diff --git a/config/names.tsv b/config/names.tsv index 3f3e863d7..7acf9e467 100644 --- a/config/names.tsv +++ b/config/names.tsv @@ -3896,7 +3896,7 @@ func_L00_002C3A78 hero_classify_input_direction descriptive config/names_local.t func_L00_002C3BB0 hero_find_swingshot_node_in_front descriptive config/names_local.tsv func_L00_002C3E18 hero_find_active_swingshot_node descriptive config/names_local.tsv func_L00_002C40C0 hero_find_blue_swingshot_target descriptive config/names_local.tsv -func_L00_002C42E0 hero_l00_set_action descriptive config/names_local.tsv +func_L00_002C42E0 hero_l00_set_move_state descriptive config/names_local.tsv hero_l00_set_action func_L00_002C8BA8 hero_start_loader_state descriptive config/names_local.tsv func_L00_002C8C00 hero_try_start_transition descriptive config/names_local.tsv func_L00_002C8CB0 hero_try_start_ledge_move descriptive config/names_local.tsv @@ -3974,12 +3974,12 @@ func_L00_002D6848 level_is_special_global_value descriptive config/names_local.t func_L00_002D6878 level_return_zero descriptive config/names_local.tsv func_L00_002D6880 level_is_special_mode_active descriptive config/names_local.tsv func_L00_002D68E8 level_get_global_word descriptive config/names_local.tsv -func_L00_002D6900 queue_copy_record_by_index descriptive config/names_local.tsv -func_L00_002D6940 slot_clear_active_bytes descriptive config/names_local.tsv -func_L00_002D6978 slot_is_entry_nonzero descriptive config/names_local.tsv -func_L00_002D6998 slot_copy_records_to_free descriptive config/names_local.tsv -func_L00_002D6B70 slot_reset_active descriptive config/names_local.tsv -func_L00_002D6FD8 math_add_wrapping_counter descriptive config/names_local.tsv +func_L00_002D6900 actuator_play_pattern descriptive config/names_local.tsv queue_copy_record_by_index +func_L00_002D6940 actuator_stop_all descriptive config/names_local.tsv slot_clear_active_bytes +func_L00_002D6978 actuator_is_channel_active descriptive config/names_local.tsv slot_is_entry_nonzero +func_L00_002D6998 actuator_play_waves descriptive config/names_local.tsv slot_copy_records_to_free +func_L00_002D6B70 actuator_end_looping_waves descriptive config/names_local.tsv slot_reset_active +func_L00_002D6FD8 actuator_update descriptive config/names_local.tsv math_add_wrapping_counter func_L00_002D7068 cam_clear_override_slots descriptive config/names_local.tsv func_L00_002D70A0 cam_alloc_override_slot descriptive config/names_local.tsv func_L00_002D7140 cam_end_override descriptive config/names_local.tsv @@ -5778,7 +5778,7 @@ func_L03_002B8708 hero_l03_apply_contact_push descriptive config/names_local.tsv func_L03_002B8D10 cam_update_hero_targets descriptive config/names_local.tsv func_L03_002BAEA0 hero_l03_push_out_of_collision descriptive config/names_local.tsv func_L03_002BF8F0 hero_l03_update_state_machine descriptive config/names_local.tsv -func_L03_002C6F08 hero_l03_enter_state descriptive config/names_local.tsv +func_L03_002C6F08 hero_l03_set_move_state descriptive config/names_local.tsv hero_l03_enter_state func_L03_002CCB70 hero_l03_decide_state descriptive config/names_local.tsv func_L03_002D3498 hero_solve_motion_collision_time descriptive config/names_local.tsv func_L03_002FDB10 sky_update_scroll descriptive config/names_local.tsv @@ -5983,7 +5983,7 @@ func_L04_002D91B8 hero_check_surface_contact descriptive config/names_local.tsv func_L04_002D9780 hero_update_turn_tilt_speeds descriptive config/names_local.tsv func_L04_002DCE78 hero_steer_airborne_by_state descriptive config/names_local.tsv func_L04_002E04A8 hero_l04_update_state_machine descriptive config/names_local.tsv -func_L04_002E7C08 hero_l04_enter_state descriptive config/names_local.tsv +func_L04_002E7C08 hero_l04_set_move_state descriptive config/names_local.tsv hero_l04_enter_state func_L04_002EDBC8 hero_l04_decide_state_transition descriptive config/names_local.tsv func_L04_002FB920 level_clear_leftover_flag descriptive config/names_local.tsv func_L04_0030C4C0 level_build_spawn_record descriptive config/names_local.tsv @@ -6538,7 +6538,7 @@ func_L06_0047C1E0 cam_exit_noop descriptive config/names_local.tsv func_L07_002AC078 hero_queue_action_from_input descriptive config/names_local.tsv func_L07_002B3580 hero_l07_update_ground_contact descriptive config/names_local.tsv func_L07_002B8618 hero_l07_update_state_machine descriptive config/names_local.tsv -func_L07_002BE770 hero_l07_enter_state descriptive config/names_local.tsv +func_L07_002BE770 hero_l07_set_move_state descriptive config/names_local.tsv hero_l07_enter_state func_L07_002C3CC0 hero_l07_decide_state_transition descriptive config/names_local.tsv func_L07_002E2090 part_spawn_between_points_depth_push descriptive config/names_local.tsv func_L07_002F2C70 moby_build_followed_points descriptive config/names_local.tsv @@ -6649,7 +6649,7 @@ func_L07_00410B48 effect_l07_spawner_update descriptive config/names_local.tsv func_L07_00410C50 siberius_debris_update descriptive config/names_local.tsv func_L08_002BE8E8 hero_refresh_action_triggers descriptive config/names_local.tsv func_L08_002CB6E8 hero_l08_update_state_machine descriptive config/names_local.tsv -func_L08_002D2ED8 hero_l08_enter_state descriptive config/names_local.tsv +func_L08_002D2ED8 hero_l08_set_move_state descriptive config/names_local.tsv hero_l08_enter_state func_L08_002D90C8 hero_l08_update_state_transitions descriptive config/names_local.tsv func_L08_002F2D10 gfx_queue_draw_callback descriptive config/names_local.tsv func_L08_00300090 hero_begin_saved_float_hold descriptive config/names_local.tsv @@ -6807,7 +6807,7 @@ func_L09_002AFC90 hero_read_button_command descriptive config/names_local.tsv func_L09_002B5CE8 hero_l09_update_blend_channels descriptive config/names_local.tsv func_L09_002B7238 hero_probe_ground descriptive config/names_local.tsv func_L09_002BC490 hero_l09_update_state_machine descriptive config/names_local.tsv -func_L09_002C3580 hero_l09_set_state descriptive config/names_local.tsv +func_L09_002C3580 hero_l09_set_move_state descriptive config/names_local.tsv hero_l09_set_state func_L09_002C9738 hero_l09_decide_state_transition descriptive config/names_local.tsv func_L09_002F89F8 glow_place_state_nine_corners descriptive config/names_local.tsv func_L09_002F8BA0 gfx_draw_state_nine_pulsing_quad descriptive config/names_local.tsv @@ -7028,7 +7028,7 @@ func_L10_00449AD0 level_get_global_pointer descriptive config/names_local.tsv func_L11_002C51D0 hero_process_input_command descriptive config/names_local.tsv func_L11_002CB130 hero_handle_contact_hit descriptive config/names_local.tsv func_L11_002D22C8 hero_l11_update_state_machine descriptive config/names_local.tsv -func_L11_002D8EF8 hero_l11_enter_state descriptive config/names_local.tsv +func_L11_002D8EF8 hero_l11_set_move_state descriptive config/names_local.tsv hero_l11_enter_state func_L11_002DE9E0 hero_decide_next_state descriptive config/names_local.tsv func_L11_0030ED58 level_start_progress_cue descriptive config/names_local.tsv func_L11_0030F060 moby_update_list_flags descriptive config/names_local.tsv @@ -7302,7 +7302,7 @@ func_L11_004885A0 overlay_set_shared_flag descriptive config/names_local.tsv func_L11_004885B8 moby_init_effect_blocks descriptive config/names_local.tsv func_L12_002B85E0 hero_l12_apply_contact_push descriptive config/names_local.tsv func_L12_002C0008 hero_l12_update_state_machine descriptive config/names_local.tsv -func_L12_002C8BD0 hero_l12_set_action descriptive config/names_local.tsv +func_L12_002C8BD0 hero_l12_set_move_state descriptive config/names_local.tsv hero_l12_set_action func_L12_002CF7B0 hero_decide_todano_state descriptive config/names_local.tsv func_L12_002FFF88 todano_build_trail_slice_meshes descriptive config/names_local.tsv func_L12_00300138 todano_refresh_scene_tuning descriptive config/names_local.tsv @@ -7421,7 +7421,7 @@ func_L12_00429868 timed_explosion_debris_update descriptive config/names_local.t func_L12_00429D60 part_spawn_two_flare_effects descriptive config/names_local.tsv func_L12_00429ED8 gfx_draw_laser_beam descriptive config/names_local.tsv func_L13_002C5760 hero_l13_update_state_machine descriptive config/names_local.tsv -func_L13_002CEF00 hero_change_action descriptive config/names_local.tsv +func_L13_002CEF00 hero_l13_set_move_state descriptive config/names_local.tsv hero_change_action func_L13_002D5ED8 hero_l13_decide_state descriptive config/names_local.tsv func_L13_00306F38 boldan_init_level_objects descriptive config/names_local.tsv func_L13_0035E890 menu_build_level_list descriptive config/names_local.tsv @@ -7650,7 +7650,7 @@ func_L16_002B3250 hero_handle_contact_reaction descriptive config/names_local.ts func_L16_002B59A0 hero_l16_push_out_of_collision descriptive config/names_local.tsv func_L16_002B5EE0 hero_apply_movement descriptive config/names_local.tsv func_L16_002B9FF0 hero_update_state_handler descriptive config/names_local.tsv -func_L16_002C0BC8 hero_l16_enter_state descriptive config/names_local.tsv +func_L16_002C0BC8 hero_l16_set_move_state descriptive config/names_local.tsv hero_l16_enter_state func_L16_002C6378 hero_decide_state_snivelak descriptive config/names_local.tsv func_L16_002D2D10 transition_arm_shared descriptive config/names_local.tsv func_L16_002F60B8 snivelak_room_scene_update descriptive config/names_local.tsv @@ -7824,7 +7824,7 @@ func_L18_002D0C00 hero_update_frame_input descriptive config/names_local.tsv func_L18_002D7650 hero_l18_update_state_machine descriptive config/names_local.tsv func_L18_002DEFF8 hero_update_timers_reach descriptive config/names_local.tsv func_L18_002E0060 hero_clear_global_flag descriptive config/names_local.tsv -func_L18_002E0070 hero_l18_set_action descriptive config/names_local.tsv +func_L18_002E0070 hero_l18_set_move_state descriptive config/names_local.tsv hero_l18_set_action func_L18_002E4090 snd_start_mode_sound descriptive config/names_local.tsv func_L18_002E42F8 hero_check_ledge_fall descriptive config/names_local.tsv func_L18_002E68B0 hero_update_state_decider descriptive config/names_local.tsv @@ -8002,7 +8002,7 @@ func_L19_002B0148 hero_process_button_command descriptive config/names_local.tsv func_L19_002B5BF0 hero_l19_apply_contact_push descriptive config/names_local.tsv func_L19_002B6278 hero_l19_update_speed_targets descriptive config/names_local.tsv func_L19_002BCA50 hero_l19_update_state_machine descriptive config/names_local.tsv -func_L19_002C44F8 hero_l19_set_state descriptive config/names_local.tsv +func_L19_002C44F8 hero_l19_set_move_state descriptive config/names_local.tsv hero_l19_set_state func_L19_002CAAB0 hero_l19_decide_state_transition descriptive config/names_local.tsv func_L19_00380918 linked_object_watcher_update descriptive config/names_local.tsv func_L19_00380A98 moby_toggle_active_by_level_mode descriptive config/names_local.tsv @@ -8048,7 +8048,7 @@ func_L20_002C5D00 hero_handle_hazard_contact descriptive config/names_local.tsv func_L20_002C7588 hero_slide_along_wall descriptive config/names_local.tsv func_L20_002CD928 hero_l20_update_state_machine descriptive config/names_local.tsv func_L20_002D6488 hero_l20_update_timers descriptive config/names_local.tsv -func_L20_002D7730 hero_l20_set_state descriptive config/names_local.tsv +func_L20_002D7730 hero_l20_set_move_state descriptive config/names_local.tsv hero_l20_set_state func_L20_002DC390 hero_load_state_by_game_mode descriptive config/names_local.tsv func_L20_002DEBE0 hero_l20_decide_state_transition descriptive config/names_local.tsv func_L20_00310E38 level_script_update descriptive config/names_local.tsv @@ -8195,7 +8195,7 @@ func_L22_002B7C70 hero_l22_update_speed_targets descriptive config/names_local.t func_L22_002B8E10 hero_slide_along_walls descriptive config/names_local.tsv func_L22_002BF1B0 hero_l22_update_state_machine descriptive config/names_local.tsv func_L22_002C8610 hero_update_timers_and_reach descriptive config/names_local.tsv -func_L22_002C9898 hero_l22_set_action descriptive config/names_local.tsv +func_L22_002C9898 hero_l22_set_move_state descriptive config/names_local.tsv hero_l22_set_action func_L22_002CE468 text_play_mode_message descriptive config/names_local.tsv func_L22_002D0C98 hero_update_actions descriptive config/names_local.tsv func_L22_00328220 math_steer_along_direction descriptive config/names_local.tsv @@ -9519,7 +9519,7 @@ D_L00_001AF690 g_blitz_cooldown_ticks_b descriptive config/names_local.tsv D_L00_001AF684 g_blitz_delay_ticks_a descriptive config/names_local.tsv D_L00_001AF688 g_blitz_delay_ticks_b descriptive config/names_local.tsv D_L00_001AF670 g_blitz_gun_euler_angles descriptive config/names_local.tsv -D_L00_00294900 g_blitz_gun_sound_records descriptive config/names_local.tsv +D_L00_00294900 g_blitz_gun_rumble_waves descriptive config/names_local.tsv g_blitz_gun_sound_records D_L00_001AF680 g_blitz_startup_ticks descriptive config/names_local.tsv D_L00_001AF6B4 g_blitz_ticks descriptive config/names_local.tsv D_L12_001B05A4 g_block_damping descriptive config/names_local.tsv @@ -9720,7 +9720,7 @@ D_L20_001AC810 g_bounce_projectile_model descriptive config/names_local.tsv D_001AA39C g_bounce_split_chance descriptive config/names_local.tsv D_L00_001B0C2C g_bouncer_l00_debris_scale descriptive config/names_local.tsv D_L00_001B0C38 g_bouncer_l00_debris_scale_2 descriptive config/names_local.tsv -D_L00_0029F210 g_bouncer_sound_record descriptive config/names_local.tsv +D_L00_0029F210 g_bouncer_rumble_waves descriptive config/names_local.tsv g_bouncer_sound_record D_L00_001B2BE4 g_bouncer_timer descriptive config/names_local.tsv D_0013958D g_bouncer_weapon_index descriptive config/names_local.tsv D_L00_001B0918 g_bouncing_explosive_bounce_damping descriptive config/names_local.tsv @@ -10326,7 +10326,7 @@ D_L00_001AF5D8 g_charge_minimum descriptive config/names_local.tsv D_L00_001AF5DC g_charge_next_step descriptive config/names_local.tsv D_L00_001B06C0 g_charge_rate_down descriptive config/names_local.tsv D_L00_001B06BC g_charge_rate_up descriptive config/names_local.tsv -D_L00_002960A0 g_charge_sound_records descriptive config/names_local.tsv +D_L00_002960A0 g_lock_on_weapon_rumble_waves descriptive config/names_local.tsv g_charge_sound_records D_L22_001AFA04 g_charge_voice_other descriptive config/names_local.tsv D_L22_001AFA00 g_charge_voice_player descriptive config/names_local.tsv D_L00_0024F7C0 g_charge_weapon_effect_table descriptive config/names_local.tsv @@ -10365,7 +10365,7 @@ D_L22_001AF9EC g_charged_shot_vec_scale descriptive config/names_local.tsv D_L23_001A8AB8 g_charged_shot_zero_words descriptive config/names_local.tsv D_00139593 g_charging_weapon_index descriptive config/names_local.tsv D_L00_001B0F90 g_charging_weapon_initial_value descriptive config/names_local.tsv -D_L00_0029FBE0 g_charging_weapon_sound_records descriptive config/names_local.tsv +D_L00_0029FBE0 g_charging_weapon_rumble_waves descriptive config/names_local.tsv g_charging_weapon_sound_records D_L05_00221D88 g_chase_target descriptive config/names_local.tsv D_001A7A44 g_cheat_flags descriptive config/names_local.tsv D_001AB938 g_cheat_id_table descriptive config/names_local.tsv @@ -11174,7 +11174,7 @@ D_L16_001B15C0 g_effect_field_b descriptive config/names_local.tsv D_L03_001AEC70 g_effect_flags descriptive config/names_local.tsv D_L16_001B15B8 g_effect_float_param descriptive config/names_local.tsv D_L06_001B1858 g_effect_group_counts descriptive config/names_local.tsv -D_L00_00296120 g_effect_handle_records descriptive config/names_local.tsv +D_L00_00296120 g_spread_weapon_rumble_waves descriptive config/names_local.tsv g_effect_handle_records D_L00_001B0AF4 g_effect_id_max descriptive config/names_local.tsv D_L00_001B0AF0 g_effect_id_min descriptive config/names_local.tsv D_001AEF60 g_effect_init_flag descriptive config/names_local.tsv @@ -11950,9 +11950,9 @@ D_L05_001B251C g_feltzin_target_mobys descriptive config/names_local.tsv D_L05_001B3550 g_feltzin_timer descriptive config/names_local.tsv D_L01_002A45D0 g_ferry_height_offsets descriptive config/names_local.tsv D_L01_002A48B0 g_ferry_height_offsets_alt descriptive config/names_local.tsv -D_L01_00297300 g_ferry_src_record_a descriptive config/names_local.tsv -D_L01_00297380 g_ferry_src_record_b descriptive config/names_local.tsv -D_L01_00297400 g_ferry_src_record_c descriptive config/names_local.tsv +D_L01_00297300 g_ferry_rumble_waves_a descriptive config/names_local.tsv g_ferry_src_record_a +D_L01_00297380 g_ferry_rumble_waves_b descriptive config/names_local.tsv g_ferry_src_record_b +D_L01_00297400 g_ferry_rumble_waves_c descriptive config/names_local.tsv g_ferry_src_record_c D_0018A0B4 g_field_mob_contact descriptive config/names_local.tsv D_L11_001B1D60 g_fighter_action_distance descriptive config/names_local.tsv D_L11_001B1DA4 g_fighter_close_distance descriptive config/names_local.tsv @@ -12304,7 +12304,7 @@ D_001B24DC g_frame_time_base descriptive config/names_local.tsv D_001BD370 g_frame_time_divisor descriptive config/names_local.tsv D_001B168C g_frame_time_scale descriptive config/names_local.tsv D_001B24E0 g_frame_time_scales descriptive config/names_local.tsv -D_L04_001B94C0 g_free_slot_records descriptive config/names_local.tsv +D_L04_001B94C0 g_wave_l04_channels descriptive config/names_local.tsv g_free_slot_records D_001A8B84 g_frontend_done_flag descriptive config/names_local.tsv D_001A742C g_fs_aa_buffer_table descriptive config/names_local.tsv D_L03_002A11E8 g_fx_color_table descriptive config/names_local.tsv @@ -12731,7 +12731,7 @@ D_L00_001B2BB0 g_gravity_bomb_fire_held descriptive config/names_local.tsv D_L00_001B080C g_gravity_bomb_launch_time descriptive config/names_local.tsv D_L00_001B082C g_gravity_bomb_query_friction descriptive config/names_local.tsv D_L00_001B0828 g_gravity_bomb_query_response descriptive config/names_local.tsv -D_L00_0029AE70 g_gravity_bomb_sound_records descriptive config/names_local.tsv +D_L00_0029AE70 g_gravity_bomb_rumble_waves descriptive config/names_local.tsv g_gravity_bomb_sound_records D_L00_001B0808 g_gravity_bomb_speed descriptive config/names_local.tsv D_00139592 g_gravity_bomb_weapon_index descriptive config/names_local.tsv D_L00_001A9000 g_gravity_center_point descriptive config/names_local.tsv @@ -14555,8 +14555,8 @@ D_L00_001AEC90 g_lamp_piece_vectors descriptive config/names_local.tsv D_L00_001B2874 g_lancer_fire_held descriptive config/names_local.tsv D_L00_001B2868 g_lancer_horizontal_arc descriptive config/names_local.tsv D_L00_001B286C g_lancer_range descriptive config/names_local.tsv -D_L00_00294980 g_lancer_sound_records_a descriptive config/names_local.tsv -D_L00_00294A00 g_lancer_sound_records_b descriptive config/names_local.tsv +D_L00_00294980 g_lancer_shot_rumble_waves descriptive config/names_local.tsv g_lancer_sound_records_a +D_L00_00294A00 g_lancer_held_rumble_waves descriptive config/names_local.tsv g_lancer_sound_records_b D_L00_001AF6C4 g_lancer_state_int descriptive config/names_local.tsv D_L00_001AF6C0 g_lancer_state_short descriptive config/names_local.tsv D_L00_001B2870 g_lancer_vertical_arc descriptive config/names_local.tsv @@ -15405,7 +15405,7 @@ D_001430C0 g_mc_rpc_result descriptive config/names_local.tsv D_00137E6C g_mc_sema descriptive config/names_local.tsv D_00141BB0 g_mc_set_file_info_request descriptive config/names_local.tsv D_L00_001B1270 g_megarocket_nozzle_offset descriptive config/names_local.tsv -D_0029FCC8 g_megarocket_sound_records descriptive config/names_local.tsv +D_0029FCC8 g_megarocket_rumble_waves descriptive config/names_local.tsv g_megarocket_sound_records D_001AEC68 g_megaturret_shot_param descriptive config/names_local.tsv D_L00_001AEFA8 g_megaturret_shot_value descriptive config/names_local.tsv D_001AEC0C g_megaturret_slot_counter descriptive config/names_local.tsv @@ -15687,7 +15687,7 @@ D_001AD908 g_meter_vtable_b descriptive config/names_local.tsv D_L00_001B05DC g_mini_nuke_blast_moby descriptive config/names_local.tsv D_L00_001B0644 g_mini_nuke_collision_friction descriptive config/names_local.tsv D_L00_001B0640 g_mini_nuke_collision_response descriptive config/names_local.tsv -D_L00_00296020 g_mini_nuke_sound_records descriptive config/names_local.tsv +D_L00_00296020 g_mini_nuke_rumble_waves descriptive config/names_local.tsv g_mini_nuke_sound_records D_L08_001B1B64 g_mining_hit_cooldown descriptive config/names_local.tsv D_L08_001B1B4C g_mining_hit_float_c descriptive config/names_local.tsv D_L08_001B1B50 g_mining_hit_float_d descriptive config/names_local.tsv @@ -15763,7 +15763,7 @@ D_L08_001B1938 g_mining_vehicle_turn_push descriptive config/names_local.tsv D_L08_001B18F8 g_mining_vehicle_turn_rate descriptive config/names_local.tsv D_L08_001B1900 g_mining_vehicle_vertical_damping descriptive config/names_local.tsv D_L00_001B2864 g_minirocket_fire_held descriptive config/names_local.tsv -D_00294880 g_minirocket_sound_records descriptive config/names_local.tsv +D_00294880 g_minirocket_rumble_waves descriptive config/names_local.tsv g_minirocket_sound_records D_L03_001AEFCC g_miniturret_counter descriptive config/names_local.tsv D_L03_001AEFB0 g_miniturret_move_speed descriptive config/names_local.tsv D_L03_001ADAAC g_miniturret_l03_owner_table descriptive config/names_local.tsv @@ -16283,7 +16283,7 @@ D_L00_001AFEC0 g_nuke_l00_launch_speed descriptive config/names_local.tsv D_L04_001B01A8 g_nuke_l04_launch_speed descriptive config/names_local.tsv D_L00_001AFEC8 g_nuke_move_speed descriptive config/names_local.tsv D_L04_001B2F38 g_nuke_pressed_flag descriptive config/names_local.tsv -D_L04_002BA6C0 g_nuke_src_records descriptive config/names_local.tsv +D_L04_002BA6C0 g_mini_nuke_l04_rumble_waves descriptive config/names_local.tsv g_nuke_src_records D_L01_001AA550 g_number_separators descriptive config/names_local.tsv D_L04_002AF630 g_object_anim_sparks_table descriptive config/names_local.tsv D_001ADA78 g_object_base_table descriptive config/names_local.tsv @@ -17195,7 +17195,7 @@ D_L01_001AEEE8 g_quad_vertex_index_c descriptive config/names_local.tsv D_L01_001AEEEC g_quad_vertex_index_d descriptive config/names_local.tsv D_L11_001B18F8 g_quad_wave_amplitude descriptive config/names_local.tsv D_001A9EA0 g_quat_next_axis_table descriptive config/names_local.tsv -D_L00_0025E120 g_queue_source_records descriptive config/names_local.tsv +D_L00_0025E120 g_actuator_patterns descriptive config/names_local.tsv g_queue_source_records D_L04_001B09F8 g_race_banner_keys_end descriptive config/names_local.tsv D_L04_001B09E0 g_race_banner_keys_start descriptive config/names_local.tsv D_L04_001B09B0 g_race_banner_keys_x descriptive config/names_local.tsv @@ -18648,7 +18648,7 @@ D_L00_001B19E8 g_slot_count descriptive config/names_local.tsv D_L23_001B3900 g_slot_effect_alpha_table descriptive config/names_local.tsv D_L02_001B0A18 g_slot_effect_rate_range descriptive config/names_local.tsv D_L23_001B38E8 g_slot_effect_scale_table descriptive config/names_local.tsv -D_L24_001B8500 g_slot_entry_table descriptive config/names_local.tsv +D_L24_001B8500 g_wave_l24_channels descriptive config/names_local.tsv g_slot_entry_table D_L04_0021DA00 g_slot_flag_view_a descriptive config/names_local.tsv D_L04_0021E670 g_slot_flag_view_b descriptive config/names_local.tsv D_0018C0E8 g_slot_index_first descriptive config/names_local.tsv @@ -18661,7 +18661,7 @@ D_L08_002603E0 g_slot_pane_matrices descriptive config/names_local.tsv D_L08_002604A0 g_slot_pane_points descriptive config/names_local.tsv D_001A73E0 g_slot_play_counters descriptive config/names_local.tsv D_L08_00260410 g_slot_positions descriptive config/names_local.tsv -D_L05_002B8770 g_slot_record_source descriptive config/names_local.tsv +D_L05_002B8770 g_ship_l05_rumble_waves descriptive config/names_local.tsv g_slot_record_source D_L02_002A53B0 g_slot_reel_symbol_table descriptive config/names_local.tsv D_L02_002A52F0 g_slot_strip_geometry descriptive config/names_local.tsv D_PAL_001B09B8 g_slot_t_increment descriptive config/names_local.tsv @@ -20298,7 +20298,7 @@ D_L03_001B2750 g_target_counters descriptive config/names_local.tsv D_001A85CC g_target_fade_speed descriptive config/names_local.tsv D_001A861C g_target_height descriptive config/names_local.tsv D_L03_001B0464 g_target_height_speed descriptive config/names_local.tsv -D_L00_00294800 g_target_hud_records descriptive config/names_local.tsv +D_L00_00294800 g_scoped_weapon_rumble_waves descriptive config/names_local.tsv g_target_hud_records D_L06_001B2970 g_target_index_list descriptive config/names_local.tsv D_001EE960 g_target_list descriptive config/names_local.tsv D_L00_001FACE0 g_target_l00_list descriptive config/names_local.tsv @@ -22075,7 +22075,7 @@ D_L00_001B09B0 g_vaporizer_ring_c_width descriptive config/names_local.tsv D_L00_001B097C g_vaporizer_ring_side_u_offset descriptive config/names_local.tsv D_L00_001B0980 g_vaporizer_ring_u_step descriptive config/names_local.tsv D_L00_001B0984 g_vaporizer_ring_vec_scale descriptive config/names_local.tsv -D_L00_00296AA0 g_vaporizer_sound_records descriptive config/names_local.tsv +D_L00_00296AA0 g_vaporizer_rumble_waves descriptive config/names_local.tsv g_vaporizer_sound_records D_L00_001B09F0 g_vaporizer_spark_alpha descriptive config/names_local.tsv D_L00_001B09F8 g_vaporizer_spark_angle_max descriptive config/names_local.tsv D_L00_001B09F4 g_vaporizer_spark_angle_min descriptive config/names_local.tsv @@ -25672,8 +25672,8 @@ func_US2_L22_002D0F48 hero_action_state_update_us2 descriptive config/names_loca func_PAL_L00_002CB6A8 hero_apply_pending_change_pal descriptive config/names_local.tsv func_PAL_L01_002B6870 hero_approach_velocity_pal descriptive config/names_local.tsv func_PAL_L18_002CFC50 hero_attach_to_object_pal descriptive config/names_local.tsv -func_US2_L00_002C4560 hero_l00_change_action_us2 descriptive config/names_local.tsv -func_US2_L13_002CF1F8 hero_l13_change_action_us2 descriptive config/names_local.tsv +func_US2_L00_002C4560 hero_l00_set_move_state_us2 descriptive config/names_local.tsv hero_l00_change_action_us2 +func_US2_L13_002CF1F8 hero_l13_set_move_state_us2 descriptive config/names_local.tsv hero_l13_change_action_us2 func_PAL_L00_002CB138 hero_check_step_ahead_pal descriptive config/names_local.tsv func_PAL_L00_002CA888 hero_choose_idle_anim_pal descriptive config/names_local.tsv func_PAL_L00_002CAEB0 hero_choose_jump_or_roll_move_pal descriptive config/names_local.tsv @@ -25688,7 +25688,7 @@ func_PAL_L01_0039A520 hero_enter_from_pad_pal descriptive config/names_local.tsv func_US2_L00_003ACCF0 hero_fire_effect_from_facing_us2 descriptive config/names_local.tsv func_PAL_L01_003BFAF4 hero_grabber_update_pal descriptive config/names_local.tsv func_PAL_L00_002CB7A0 hero_l00_decide_state_pal descriptive config/names_local.tsv -func_PAL_L00_002C4480 hero_l00_set_action_pal descriptive config/names_local.tsv +func_PAL_L00_002C4480 hero_l00_set_move_state_pal descriptive config/names_local.tsv hero_l00_set_action_pal func_US2_L00_002A6DD0 hero_l00_update_frame_2_us2 descriptive config/names_local.tsv func_US2_L00_002CB650 hero_l00_update_move_decider_us2 descriptive config/names_local.tsv func_PAL_L00_002BA750 hero_l00_update_state_machine_pal descriptive config/names_local.tsv @@ -25699,39 +25699,39 @@ func_US2_L01_002BA3C8 hero_l01_update_state_machine_us2 descriptive config/names func_PAL_L01_002C3A10 hero_l01_update_state_transitions_pal descriptive config/names_local.tsv func_PAL_L03_002CCED8 hero_l03_decide_state_pal descriptive config/names_local.tsv func_US2_L03_002CCF18 hero_l03_decide_state_us2 descriptive config/names_local.tsv -func_PAL_L03_002C7068 hero_l03_enter_state_pal descriptive config/names_local.tsv -func_US2_L03_002C7288 hero_l03_enter_state_us2 descriptive config/names_local.tsv +func_PAL_L03_002C7068 hero_l03_set_move_state_pal descriptive config/names_local.tsv hero_l03_enter_state_pal +func_US2_L03_002C7288 hero_l03_set_move_state_us2 descriptive config/names_local.tsv hero_l03_enter_state_us2 func_PAL_L03_002BF860 hero_l03_update_state_machine_pal descriptive config/names_local.tsv func_US2_L03_002BFAF8 hero_l03_update_state_machine_us2 descriptive config/names_local.tsv func_PAL_L04_002EDFB8 hero_l04_decide_state_transition_pal descriptive config/names_local.tsv -func_PAL_L04_002E7DA8 hero_l04_enter_state_pal descriptive config/names_local.tsv -func_US2_L04_002E7F28 hero_l04_enter_state_us2 descriptive config/names_local.tsv +func_PAL_L04_002E7DA8 hero_l04_set_move_state_pal descriptive config/names_local.tsv hero_l04_enter_state_pal +func_US2_L04_002E7F28 hero_l04_set_move_state_us2 descriptive config/names_local.tsv hero_l04_enter_state_us2 func_PAL_L04_002E04A0 hero_l04_update_state_machine_pal descriptive config/names_local.tsv func_US2_L04_002E06B0 hero_l04_update_state_machine_us2 descriptive config/names_local.tsv func_PAL_L07_002C4018 hero_l07_decide_state_transition_pal descriptive config/names_local.tsv -func_PAL_L07_002BE8C8 hero_l07_enter_state_pal descriptive config/names_local.tsv -func_US2_L07_002BE988 hero_l07_enter_state_us2 descriptive config/names_local.tsv +func_PAL_L07_002BE8C8 hero_l07_set_move_state_pal descriptive config/names_local.tsv hero_l07_enter_state_pal +func_US2_L07_002BE988 hero_l07_set_move_state_us2 descriptive config/names_local.tsv hero_l07_enter_state_us2 func_PAL_L07_002B8608 hero_l07_update_state_machine_pal descriptive config/names_local.tsv func_US2_L07_002B8720 hero_l07_update_state_machine_us2 descriptive config/names_local.tsv -func_PAL_L08_002D3078 hero_l08_enter_state_pal descriptive config/names_local.tsv -func_US2_L08_002D31F8 hero_l08_enter_state_us2 descriptive config/names_local.tsv +func_PAL_L08_002D3078 hero_l08_set_move_state_pal descriptive config/names_local.tsv hero_l08_enter_state_pal +func_US2_L08_002D31F8 hero_l08_set_move_state_us2 descriptive config/names_local.tsv hero_l08_enter_state_us2 func_PAL_L08_003A6850 hero_l08_lock_on_tether_update_pal descriptive config/names_local.tsv func_PAL_L08_002CB6E0 hero_l08_update_state_machine_pal descriptive config/names_local.tsv func_US2_L08_002CB8F0 hero_l08_update_state_machine_us2 descriptive config/names_local.tsv func_PAL_L08_002D94C0 hero_l08_update_state_transitions_pal descriptive config/names_local.tsv func_PAL_L09_002C9B18 hero_l09_decide_state_transition_pal descriptive config/names_local.tsv -func_PAL_L09_002C3708 hero_l09_set_state_pal descriptive config/names_local.tsv -func_US2_L09_002C3818 hero_l09_set_state_us2 descriptive config/names_local.tsv +func_PAL_L09_002C3708 hero_l09_set_move_state_pal descriptive config/names_local.tsv hero_l09_set_state_pal +func_US2_L09_002C3818 hero_l09_set_move_state_us2 descriptive config/names_local.tsv hero_l09_set_state_us2 func_PAL_L09_002B5C80 hero_l09_update_blend_channels_pal descriptive config/names_local.tsv func_PAL_L09_00394290 hero_l09_update_lock_on_tether_pal descriptive config/names_local.tsv func_PAL_L09_002BC480 hero_l09_update_state_machine_pal descriptive config/names_local.tsv func_US2_L09_002BC618 hero_l09_update_state_machine_us2 descriptive config/names_local.tsv -func_PAL_L11_002D9038 hero_l11_enter_state_pal descriptive config/names_local.tsv -func_US2_L11_002D9208 hero_l11_enter_state_us2 descriptive config/names_local.tsv +func_PAL_L11_002D9038 hero_l11_set_move_state_pal descriptive config/names_local.tsv hero_l11_enter_state_pal +func_US2_L11_002D9208 hero_l11_set_move_state_us2 descriptive config/names_local.tsv hero_l11_enter_state_us2 func_PAL_L11_002D22B8 hero_l11_update_state_machine_pal descriptive config/names_local.tsv func_US2_L11_002D24D0 hero_l11_update_state_machine_us2 descriptive config/names_local.tsv -func_PAL_L12_002C8C58 hero_l12_set_action_pal descriptive config/names_local.tsv -func_US2_L12_002C8DD8 hero_l12_set_action_us2 descriptive config/names_local.tsv +func_PAL_L12_002C8C58 hero_l12_set_move_state_pal descriptive config/names_local.tsv hero_l12_set_action_pal +func_US2_L12_002C8DD8 hero_l12_set_move_state_us2 descriptive config/names_local.tsv hero_l12_set_action_us2 func_PAL_L12_002BFF00 hero_l12_update_state_machine_pal descriptive config/names_local.tsv func_US2_L12_002C0110 hero_l12_update_state_machine_us2 descriptive config/names_local.tsv func_PAL_L13_002D62D0 hero_l13_decide_state_pal descriptive config/names_local.tsv @@ -25739,29 +25739,29 @@ func_US2_L13_002D61F8 hero_l13_decide_state_us2 descriptive config/names_local.t func_PAL_L13_002C56D8 hero_l13_update_state_machine_pal descriptive config/names_local.tsv func_US2_L13_002C58E8 hero_l13_update_state_machine_us2 descriptive config/names_local.tsv func_PAL_L15_003B2BE8 hero_l15_lock_on_tether_update_pal descriptive config/names_local.tsv -func_PAL_L16_002C0CB0 hero_l16_enter_state_pal descriptive config/names_local.tsv -func_US2_L16_002C0E50 hero_l16_enter_state_us2 descriptive config/names_local.tsv +func_PAL_L16_002C0CB0 hero_l16_set_move_state_pal descriptive config/names_local.tsv hero_l16_enter_state_pal +func_US2_L16_002C0E50 hero_l16_set_move_state_us2 descriptive config/names_local.tsv hero_l16_enter_state_us2 func_PAL_L16_00390B70 hero_l16_lock_on_tether_update_pal descriptive config/names_local.tsv -func_PAL_L18_002E01E0 hero_l18_set_action_pal descriptive config/names_local.tsv -func_US2_L18_002E02E8 hero_l18_set_action_us2 descriptive config/names_local.tsv +func_PAL_L18_002E01E0 hero_l18_set_move_state_pal descriptive config/names_local.tsv hero_l18_set_action_pal +func_US2_L18_002E02E8 hero_l18_set_move_state_us2 descriptive config/names_local.tsv hero_l18_set_action_us2 func_PAL_L18_002C4000 hero_l18_update_frame_pal descriptive config/names_local.tsv func_PAL_L18_002D0738 hero_l18_update_speed_targets_pal descriptive config/names_local.tsv func_PAL_L18_002D7598 hero_l18_update_state_machine_pal descriptive config/names_local.tsv func_US2_L18_002D7758 hero_l18_update_state_machine_us2 descriptive config/names_local.tsv func_PAL_L19_002CADE8 hero_l19_decide_state_transition_pal descriptive config/names_local.tsv -func_PAL_L19_002C45D0 hero_l19_set_state_pal descriptive config/names_local.tsv -func_US2_L19_002C4708 hero_l19_set_state_us2 descriptive config/names_local.tsv +func_PAL_L19_002C45D0 hero_l19_set_move_state_pal descriptive config/names_local.tsv hero_l19_set_state_pal +func_US2_L19_002C4708 hero_l19_set_move_state_us2 descriptive config/names_local.tsv hero_l19_set_state_us2 func_PAL_L19_002B6160 hero_l19_update_speed_targets_pal descriptive config/names_local.tsv func_PAL_L19_002BC990 hero_l19_update_state_machine_pal descriptive config/names_local.tsv func_US2_L19_002BCB58 hero_l19_update_state_machine_us2 descriptive config/names_local.tsv func_PAL_L20_002DF028 hero_l20_decide_state_transition_pal descriptive config/names_local.tsv func_US2_L20_002DEE88 hero_l20_decide_state_transition_us2 descriptive config/names_local.tsv -func_PAL_L20_002D7920 hero_l20_set_state_pal descriptive config/names_local.tsv -func_US2_L20_002D79B0 hero_l20_set_state_us2 descriptive config/names_local.tsv +func_PAL_L20_002D7920 hero_l20_set_move_state_pal descriptive config/names_local.tsv hero_l20_set_state_pal +func_US2_L20_002D79B0 hero_l20_set_move_state_us2 descriptive config/names_local.tsv hero_l20_set_state_us2 func_PAL_L20_002B9270 hero_l20_update_frame_pal descriptive config/names_local.tsv func_PAL_L20_002CD8F0 hero_l20_update_state_machine_pal descriptive config/names_local.tsv func_US2_L20_002CDA30 hero_l20_update_state_machine_us2 descriptive config/names_local.tsv -func_PAL_L22_002C99C8 hero_l22_set_action_pal descriptive config/names_local.tsv +func_PAL_L22_002C99C8 hero_l22_set_move_state_pal descriptive config/names_local.tsv hero_l22_set_action_pal func_PAL_L22_002B7B08 hero_l22_update_speed_targets_pal descriptive config/names_local.tsv func_PAL_L22_002BF0A8 hero_l22_update_state_machine_pal descriptive config/names_local.tsv func_US2_L22_002BF2B8 hero_l22_update_state_machine_us2 descriptive config/names_local.tsv @@ -25779,11 +25779,11 @@ func_US2_L00_002B22D0 hero_play_collection_voice_line_us2 descriptive config/nam func_PAL_L00_002B20F8 hero_play_voice_line_for_progress_pal descriptive config/names_local.tsv func_US2_L01_002C1D90 hero_process_item_action_input_us2 descriptive config/names_local.tsv func_US2_L00_002C96D0 hero_select_context_action_us2 descriptive config/names_local.tsv -func_PAL_L13_002CF0A0 hero_set_action_state_pal descriptive config/names_local.tsv -func_US2_L22_002C9B20 hero_set_action_us2 descriptive config/names_local.tsv +func_PAL_L13_002CF0A0 hero_l13_set_move_state_pal descriptive config/names_local.tsv hero_set_action_state_pal +func_US2_L22_002C9B20 hero_l22_set_move_state_us2 descriptive config/names_local.tsv hero_set_action_us2 func_PAL_L00_002D29D0 hero_set_anim_mode_pal descriptive config/names_local.tsv func_PAL_L00_002D1FE8 hero_set_linked_objects_anim_pal descriptive config/names_local.tsv -func_US2_L01_002BEEA8 hero_set_move_state_us2 descriptive config/names_local.tsv +func_US2_L01_002BEEA8 SetHeroMoveState_us2 descriptive config/names_local.tsv hero_set_move_state_us2 func_PAL_L00_002BA480 hero_setup_attached_object_transform_pal descriptive config/names_local.tsv func_PAL_L04_002DCE68 hero_steer_airborne_by_state_pal descriptive config/names_local.tsv func_PAL_L00_003A1688 hero_steer_along_rail_paths_pal descriptive config/names_local.tsv diff --git a/config/names_local.tsv b/config/names_local.tsv index b4913880c..e4c4408d7 100644 --- a/config/names_local.tsv +++ b/config/names_local.tsv @@ -2851,7 +2851,7 @@ func_L00_002C3A78 hero_classify_input_direction maps input angle to 0-3 (was Cla func_L00_002C3BB0 hero_find_swingshot_node_in_front scans class 0x323 nodes (was FindSwingshotNodeInFront) func_L00_002C3E18 hero_find_active_swingshot_node scans class 0x2F6 nodes (was FindActiveSwingshotNode) func_L00_002C40C0 hero_find_blue_swingshot_target scans class 0x99D targets (was FindBlueSwingshotTarget) -func_L00_002C42E0 hero_l00_set_action changes player action and animation (was SetHeroAction_L00) +func_L00_002C42E0 hero_l00_set_move_state the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l00_set_action) func_L00_002C8BA8 hero_start_loader_state picks loader variant by state (was StartHeroLoaderState) func_L00_002C8C00 hero_try_start_transition gated state change (was TryStartHeroTransition) func_L00_002C8CB0 hero_try_start_ledge_move ledge grab or climb choice (was TryStartLedgeMove) @@ -2929,12 +2929,12 @@ func_L00_002D6848 level_is_special_global_value matches 0x16/0x17/0x2CE (was IsS func_L00_002D6878 level_return_zero constant 0 (was ReturnZero_L00) func_L00_002D6880 level_is_special_mode_active state 49 and mode 4 or 11 (was IsSpecificGameModeActive) func_L00_002D68E8 level_get_global_word returns one global (was GetGlobalWord) -func_L00_002D6900 queue_copy_record_by_index index into table then copy (was QueueRecordsByIndex) -func_L00_002D6940 slot_clear_active_bytes clears 8 slot bytes (was ClearSlotActiveBytes) -func_L00_002D6978 slot_is_entry_nonzero tests indexed byte (was IsTableEntryNonzero) -func_L00_002D6998 slot_copy_records_to_free copies into free slots (was CopyRecordsToFreeSlots) -func_L00_002D6B70 slot_reset_active clears active slots (was ResetActiveSlots) -func_L00_002D6FD8 math_add_wrapping_counter wraps at 256 (was AddToWrappingCounter) +func_L00_002D6900 actuator_play_pattern plays pattern INDEX of g_actuator_patterns through actuator_play_waves (was queue_copy_record_by_index) +func_L00_002D6940 actuator_stop_all zeroes the kind byte of all 8 wave channels; hero set-action copies call it on every action change (was slot_clear_active_bytes) +func_L00_002D6978 actuator_is_channel_active tests a wave channel's kind byte (was slot_is_entry_nonzero) +func_L00_002D6998 actuator_play_waves copies a 0xFF-ended wave list into free wave channels, returns a channel or -1 (was slot_copy_records_to_free) +func_L00_002D6B70 actuator_end_looping_waves clears permanent and duration of looping wave channels so the mixer ends them (was slot_reset_active) +func_L00_002D6FD8 actuator_update runs LevelActuatorCalcPower and writes the pad's motor bytes (+0x188, +0x189 of g_pad_state) when vibration is on (was math_add_wrapping_counter) func_L00_002D7068 cam_clear_override_slots clears 32 slots, selection -1 (was ClearCameraOverrideSlots) func_L00_002D70A0 cam_alloc_override_slot finds free slot and inits (was AllocCameraOverrideSlot) func_L00_002D7140 cam_end_override clears active and eases blend (was EndCameraOverride) @@ -4733,7 +4733,7 @@ func_L03_002B8708 hero_l03_apply_contact_push pushes hero along contact directio func_L03_002B8D10 cam_update_hero_targets eases camera settings to targets (was UpdateHeroCameraTargets) func_L03_002BAEA0 hero_l03_push_out_of_collision capsule push-out loop (was PushHeroOutOfCollision) func_L03_002BF8F0 hero_l03_update_state_machine per-frame hero state switch (was UpdateHeroStateMachine_L03) -func_L03_002C6F08 hero_l03_enter_state changes hero action and picks animation (was EnterHeroState_L03) +func_L03_002C6F08 hero_l03_set_move_state the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l03_enter_state) func_L03_002CCB70 hero_l03_decide_state hero state decider (was DecideHeroStateEndako) func_L03_002D3498 hero_solve_motion_collision_time forward collision time per mode (was SolveHeroMotionCollisionTime) func_L03_002FDB10 sky_update_scroll sets up sky, scrolls offset (was UpdateEndakoSkyScroll) @@ -4938,7 +4938,7 @@ func_L04_002D91B8 hero_check_surface_contact checks standing surface, applies im func_L04_002D9780 hero_update_turn_tilt_speeds sets hero turn values per state, eases camera (was UpdateHeroTurnTiltSpeeds) func_L04_002DCE78 hero_steer_airborne_by_state per-state airborne steering (was SteerHeroAirborneByState) func_L04_002E04A8 hero_l04_update_state_machine hero per-frame state switch (was UpdateHeroStateMachine_L04) -func_L04_002E7C08 hero_l04_enter_state changes hero action and inits params (was EnterHeroState_L04) +func_L04_002E7C08 hero_l04_set_move_state the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l04_enter_state) func_L04_002EDBC8 hero_l04_decide_state_transition 141 way hero state switch (was DecideHeroStateTransition_L04) func_L04_002FB920 level_clear_leftover_flag zeroes one global (was ClearLeftoverGlobalFlag) func_L04_0030C4C0 level_build_spawn_record copies blocks into spawn objects (was BuildSpawnRecordFromBlocks) @@ -5493,7 +5493,7 @@ func_L06_0047C1E0 cam_exit_noop empty function (was CameraExitNoop) func_L07_002AC078 hero_queue_action_from_input reads command and starts hero action (was QueueHeroActionFromInput) func_L07_002B3580 hero_l07_update_ground_contact ground height slope and feet tilt (was UpdateHeroGroundContact_L07) func_L07_002B8618 hero_l07_update_state_machine per-frame hero state switch (was UpdateHeroStateMachine_L07) -func_L07_002BE770 hero_l07_enter_state changes hero state and sets animation (was EnterHeroState_L07) +func_L07_002BE770 hero_l07_set_move_state the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l07_enter_state) func_L07_002C3CC0 hero_l07_decide_state_transition hero state transition decider (was DecideHeroStateTransition_L07) func_L07_002E2090 part_spawn_between_points_depth_push spawns record with +-0.4 z velocities (was SpawnEffectBetweenPointsWithDepthPush) func_L07_002F2C70 moby_build_followed_points transforms four points by object matrix (was BuildFollowedObjectPoints) @@ -5604,7 +5604,7 @@ func_L07_00410B48 effect_l07_spawner_update class 4769 spawn then remove (was Up func_L07_00410C50 siberius_debris_update moby class 4776 handler (was UpdateSiberiusDebrisMoby) func_L08_002BE8E8 hero_refresh_action_triggers resets hero trigger flags per action (was RefreshHeroActionTriggers) func_L08_002CB6E8 hero_l08_update_state_machine hero per-frame state switch (was UpdateHeroStateMachine_L08) -func_L08_002D2ED8 hero_l08_enter_state changes hero action and inits params (was EnterHeroState_L08) +func_L08_002D2ED8 hero_l08_set_move_state the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l08_enter_state) func_L08_002D90C8 hero_l08_update_state_transitions 141-way hero state switch (was UpdateHeroStateTransitions_L08) func_L08_002F2D10 gfx_queue_draw_callback adds callback to 64 entry list (was QueueDrawCallback) func_L08_00300090 hero_begin_saved_float_hold stores global float once (was BeginSavedFloatHold) @@ -5762,7 +5762,7 @@ func_L09_002AFC90 hero_read_button_command command to action (was ReadPlayerButt func_L09_002B5CE8 hero_l09_update_blend_channels ramps channels (was UpdatePlayerBlendChannels) func_L09_002B7238 hero_probe_ground hero ground collision probes (was ProbeHeroGround) func_L09_002BC490 hero_l09_update_state_machine per-frame state switch (was UpdatePlayerStateMachine) -func_L09_002C3580 hero_l09_set_state state entry (was SetPlayerState) +func_L09_002C3580 hero_l09_set_move_state the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l09_set_state) func_L09_002C9738 hero_l09_decide_state_transition hero state switch (was DecideHeroStateTransition_L09) func_L09_002F89F8 glow_place_state_nine_corners corner quads while state 9 (was PlaceStateNineGlowCorners) func_L09_002F8BA0 gfx_draw_state_nine_pulsing_quad sine alpha quad (was DrawStateNinePulsingQuad) @@ -5983,7 +5983,7 @@ func_L10_00449AD0 level_get_global_pointer returns a global pointer (was GetLeve func_L11_002C51D0 hero_process_input_command sets input flags, starts states (was ProcessHeroInputCommand) func_L11_002CB130 hero_handle_contact_hit contact entry knockback (was HandleHeroContactHit) func_L11_002D22C8 hero_l11_update_state_machine hero per-frame state switch (was UpdateHeroStateMachine_L11) -func_L11_002D8EF8 hero_l11_enter_state changes hero action and animation (was EnterHeroState_L11) +func_L11_002D8EF8 hero_l11_set_move_state the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l11_enter_state) func_L11_002DE9E0 hero_decide_next_state hero next-state decider (was UpdateJobaHeroStateDecider) func_L11_0030ED58 level_start_progress_cue cue chosen by progress counter (was StartProgressCue) func_L11_0030F060 moby_update_list_flags walks moby list, flags types (was UpdateJobaMobyListFlags) @@ -6257,7 +6257,7 @@ func_L11_004885A0 overlay_set_shared_flag writes one flag byte (was SetSharedOve func_L11_004885B8 moby_init_effect_blocks default effect values (was InitMobyEffectBlocks) func_L12_002B85E0 hero_l12_apply_contact_push pushes hero along contact direction (was ApplyHeroContactPush_L12) func_L12_002C0008 hero_l12_update_state_machine per-frame hero state switch (was UpdateHeroStateMachine_L12) -func_L12_002C8BD0 hero_l12_set_action changes hero action and animation (was SetHeroAction_L12) +func_L12_002C8BD0 hero_l12_set_move_state the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l12_set_action) func_L12_002CF7B0 hero_decide_todano_state hero state decider (was DecideTodanoHeroState) func_L12_002FFF88 todano_build_trail_slice_meshes positions four mesh slices on object (was BuildTrailSliceMeshes) func_L12_00300138 todano_refresh_scene_tuning sets two float factors (was RefreshSceneTuningFactors) @@ -6376,7 +6376,7 @@ func_L12_00429868 timed_explosion_debris_update timer then explosion and debris func_L12_00429D60 part_spawn_two_flare_effects two flare effects (was SpawnTwoFlareEffects) func_L12_00429ED8 gfx_draw_laser_beam beam strips and glow (was DrawLaserBeamVariant) func_L13_002C5760 hero_l13_update_state_machine per-frame hero state switch (was UpdateHeroStateMachine_L13) -func_L13_002CEF00 hero_change_action hero action switch (was ChangeHeroAction) +func_L13_002CEF00 hero_l13_set_move_state the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_change_action) func_L13_002D5ED8 hero_l13_decide_state hero state decider (was DecideHeroState_L13) func_L13_00306F38 boldan_init_level_objects loops level mobs (was InitBoldanLevelObjects) func_L13_0035E890 menu_build_level_list fills menu rows (was BuildLevelMenuList) @@ -6605,7 +6605,7 @@ func_L16_002B3250 hero_handle_contact_reaction contact entry knockback and hurt func_L16_002B59A0 hero_l16_push_out_of_collision capsule push-out loop (was PushPlayerOutOfCollision) func_L16_002B5EE0 hero_apply_movement limits speed records motion (was ApplyPlayerMovement) func_L16_002B9FF0 hero_update_state_handler big per-state hero switch (was UpdatePlayerStateHandler) -func_L16_002C0BC8 hero_l16_enter_state sets new hero state and animation (was EnterPlayerState) +func_L16_002C0BC8 hero_l16_set_move_state the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l16_enter_state) func_L16_002C6378 hero_decide_state_snivelak hero state decider (was DecideHeroStateSnivelak) func_L16_002D2D10 transition_arm_shared stores reciprocal steps once (was ArmSharedTransition) func_L16_002F60B8 snivelak_room_scene_update per-frame scene object effects (was UpdateSnivelakRoomScene) @@ -6779,7 +6779,7 @@ func_L18_002D0C00 hero_update_frame_input reads input, history, calls movement ( func_L18_002D7650 hero_l18_update_state_machine per-frame hero state switch (was UpdateHeroStateMachine_L18) func_L18_002DEFF8 hero_update_timers_reach timers history reach (was UpdateHeroTimersAndReach_L18) func_L18_002E0060 hero_clear_global_flag zeroes a global returns 0 (was ClearHeroGlobalFlag) -func_L18_002E0070 hero_l18_set_action changes action and animation (was SetHeroAction_L18) +func_L18_002E0070 hero_l18_set_move_state the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l18_set_action) func_L18_002E4090 snd_start_mode_sound switch on mode byte (was StartModeSound) func_L18_002E42F8 hero_check_ledge_fall starts falling state off ledge (was CheckHeroLedgeFall) func_L18_002E68B0 hero_update_state_decider hero action chooser (was UpdateHeroStateDecider) @@ -6957,7 +6957,7 @@ func_L19_002B0148 hero_process_button_command command to jump/attack flags (was func_L19_002B5BF0 hero_l19_apply_contact_push contact response pushes hero (was ApplyHeroContactPush_L19) func_L19_002B6278 hero_l19_update_speed_targets eases speed channels toward targets (was UpdateHeroSpeedTargets_L19) func_L19_002BCA50 hero_l19_update_state_machine per-frame hero state switch (was UpdateHeroStateMachine_L19) -func_L19_002C44F8 hero_l19_set_state switches hero state and anim (was SetHeroState) +func_L19_002C44F8 hero_l19_set_move_state the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l19_set_state) func_L19_002CAAB0 hero_l19_decide_state_transition hero state switch (was DecideHeroStateTransition_L19) func_L19_00380918 linked_object_watcher_update destroys self when linked objects gone (was UpdateLinkedObjectWatcherMoby) func_L19_00380A98 moby_toggle_active_by_level_mode sets flags by mode word (was ToggleMobyActiveByLevelMode) @@ -7003,7 +7003,7 @@ func_L20_002C5D00 hero_handle_hazard_contact damage and push on contact (was Han func_L20_002C7588 hero_slide_along_wall wall probe and velocity clip (was SlideYeedilHeroAlongWall) func_L20_002CD928 hero_l20_update_state_machine big state switch (was UpdateYeedilHeroStateMachine) func_L20_002D6488 hero_l20_update_timers frame timers and reach (was UpdateYeedilHeroTimers) -func_L20_002D7730 hero_l20_set_state hero action entry jump table (was YeedilEnterHeroAction) +func_L20_002D7730 hero_l20_set_move_state the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l20_set_state) func_L20_002DC390 hero_load_state_by_game_mode wraps 002D7730 by mode (was LoadYeedilHeroStateByGameMode) func_L20_002DEBE0 hero_l20_decide_state_transition hero state decider per frame (was YeedilUpdateHeroActionDecider) func_L20_00310E38 level_script_update per frame level object and camera tweaks (was UpdateYeedilLevelScript) @@ -7150,7 +7150,7 @@ func_L22_002B7C70 hero_l22_update_speed_targets eases speeds to per-mode targets func_L22_002B8E10 hero_slide_along_walls wall probe adjusts hero velocity (was SlideHeroAlongWalls) func_L22_002BF1B0 hero_l22_update_state_machine per-frame hero state switch (was UpdateHeroStateMachine_L22) func_L22_002C8610 hero_update_timers_and_reach frame timers and reach state (was UpdateHeroTimersAndReach_L22) -func_L22_002C9898 hero_l22_set_action changes player action and sets up movement and animation (was SetHeroAction_L22) +func_L22_002C9898 hero_l22_set_move_state the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l22_set_action) func_L22_002CE468 text_play_mode_message picks one of three messages (was PlayModeMessage) func_L22_002D0C98 hero_update_actions per-frame player action decider (was UpdateHeroActions) func_L22_00328220 math_steer_along_direction adjusts position by direction and speed, bends angle (was SteerAlongDirection) @@ -8474,7 +8474,7 @@ D_L00_001AF690 g_blitz_cooldown_ticks_b short cooldown (medium) D_L00_001AF684 g_blitz_delay_ticks_a short delay (medium) D_L00_001AF688 g_blitz_delay_ticks_b short delay (medium) D_L00_001AF670 g_blitz_gun_euler_angles euler_to_matrix input (medium) -D_L00_00294900 g_blitz_gun_sound_records slot copy records (medium) +D_L00_00294900 g_blitz_gun_rumble_waves wave list passed only to actuator_play_waves, by blitz_gun_update (was g_blitz_gun_sound_records) D_L00_001AF680 g_blitz_startup_ticks unsigned short startup (medium) D_L00_001AF6B4 g_blitz_ticks int ticks (medium) D_L12_001B05A4 g_block_damping velocity multiplier (medium) @@ -8675,7 +8675,7 @@ D_L20_001AC810 g_bounce_projectile_model model pointer compare (medium) D_001AA39C g_bounce_split_chance random int below minus 1 (medium) D_L00_001B0C2C g_bouncer_l00_debris_scale object scale multiplier (medium) D_L00_001B0C38 g_bouncer_l00_debris_scale_2 debris object scale (medium) -D_L00_0029F210 g_bouncer_sound_record slot copy records (medium) +D_L00_0029F210 g_bouncer_rumble_waves wave list passed only to actuator_play_waves, by bouncer_update (was g_bouncer_sound_record) D_L00_001B2BE4 g_bouncer_timer 20 (medium) D_0013958D g_bouncer_weapon_index weapon table index (medium) D_L00_001B0918 g_bouncing_explosive_bounce_damping scales velocity on bounce (medium) @@ -9281,7 +9281,7 @@ D_L00_001AF5D8 g_charge_minimum min compare and reset (medium) D_L00_001AF5DC g_charge_next_step next = charge+x (medium) D_L00_001B06C0 g_charge_rate_down charge -= (medium) D_L00_001B06BC g_charge_rate_up charge += (medium) -D_L00_002960A0 g_charge_sound_records slot copy records (medium) +D_L00_002960A0 g_lock_on_weapon_rumble_waves wave list passed only to actuator_play_waves, by UpdateLockOnWeapon (was g_charge_sound_records) D_L22_001AFA04 g_charge_voice_other snd voice handle (medium) D_L22_001AFA00 g_charge_voice_player snd voice handle (medium) D_L00_0024F7C0 g_charge_weapon_effect_table ChargeWeaponEffect entries @@ -9320,7 +9320,7 @@ D_L22_001AF9EC g_charged_shot_vec_scale FastVecScale (medium) D_L23_001A8AB8 g_charged_shot_zero_words long long pair (medium) D_00139593 g_charging_weapon_index weapon table index (medium) D_L00_001B0F90 g_charging_weapon_initial_value vars slot init (medium) -D_L00_0029FBE0 g_charging_weapon_sound_records slot copy records (medium) +D_L00_0029FBE0 g_charging_weapon_rumble_waves wave list passed only to actuator_play_waves, by charging_weapon_update (was g_charging_weapon_sound_records) D_L05_00221D88 g_chase_target camera chase pointer (medium) D_001A7A44 g_cheat_flags invulnerable element (medium) D_001AB938 g_cheat_id_table IdTable (medium) @@ -10129,7 +10129,7 @@ D_L16_001B15C0 g_effect_field_b effect f4 (medium) D_L03_001AEC70 g_effect_flags flags (medium) D_L16_001B15B8 g_effect_float_param stored in effect table (medium) D_L06_001B1858 g_effect_group_counts indexed count table (medium) -D_L00_00296120 g_effect_handle_records slot copy records (medium) +D_L00_00296120 g_spread_weapon_rumble_waves wave list passed only to actuator_play_waves, by UpdateSpreadWeapon (was g_effect_handle_records) D_L00_001B0AF4 g_effect_id_max random int range (medium) D_L00_001B0AF0 g_effect_id_min random int range (medium) D_001AEF60 g_effect_init_flag zeroed in init (medium) @@ -10905,9 +10905,9 @@ D_L05_001B251C g_feltzin_target_mobys target pool base, 256 stride D_L05_001B3550 g_feltzin_timer split into minutes seconds (medium) D_L01_002A45D0 g_ferry_height_offsets float table indexed (medium) D_L01_002A48B0 g_ferry_height_offsets_alt float table indexed (medium) -D_L01_00297300 g_ferry_src_record_a slot_copy_records_to_free (medium) -D_L01_00297380 g_ferry_src_record_b slot_copy_records_to_free (medium) -D_L01_00297400 g_ferry_src_record_c slot_copy_records_to_free (medium) +D_L01_00297300 g_ferry_rumble_waves_a wave list passed only to actuator_play_waves, by path_ferry_update (was g_ferry_src_record_a) +D_L01_00297380 g_ferry_rumble_waves_b wave list passed only to actuator_play_waves, by path_ferry_update (was g_ferry_src_record_b) +D_L01_00297400 g_ferry_rumble_waves_c wave list passed only to actuator_play_waves, by path_ferry_update (was g_ferry_src_record_c) D_0018A0B4 g_field_mob_contact compared to self (medium) D_L11_001B1D60 g_fighter_action_distance choose action gate (medium) D_L11_001B1DA4 g_fighter_close_distance distance gate (medium) @@ -11259,7 +11259,7 @@ D_001B24DC g_frame_time_base time scales (medium) D_001BD370 g_frame_time_divisor 0.62 divided by it (medium) D_001B168C g_frame_time_scale time scaled by pal ntsc (medium) D_001B24E0 g_frame_time_scales scaled times -D_L04_001B94C0 g_free_slot_records slot_copy_records_to_free dst records +D_L04_001B94C0 g_wave_l04_channels level 04's g_wave_l00_channels: the address actuator_play_waves forms there (was g_free_slot_records) D_001A8B84 g_frontend_done_flag loader waits until set (medium) D_001A742C g_fs_aa_buffer_table FsAaBuffer pointer array D_L03_002A11E8 g_fx_color_table indexed by color @@ -11686,7 +11686,7 @@ D_L00_001B2BB0 g_gravity_bomb_fire_held pad held latch (medium) D_L00_001B080C g_gravity_bomb_launch_time scaled by 1/60 (medium) D_L00_001B082C g_gravity_bomb_query_friction work.query.friction D_L00_001B0828 g_gravity_bomb_query_response work.query.response -D_L00_0029AE70 g_gravity_bomb_sound_records slot copy records (medium) +D_L00_0029AE70 g_gravity_bomb_rumble_waves wave list passed only to actuator_play_waves, by gravity_bomb_launcher_update (was g_gravity_bomb_sound_records) D_L00_001B0808 g_gravity_bomb_speed scaled by 1/3600, velocity (medium) D_00139592 g_gravity_bomb_weapon_index weapon table index (medium) D_L00_001A9000 g_gravity_center_point position arg in gravity (medium) @@ -13510,8 +13510,8 @@ D_L00_001AEC90 g_lamp_piece_vectors Vector4 array to part explode (medium) D_L00_001B2874 g_lancer_fire_held pad held latch (medium) D_L00_001B2868 g_lancer_horizontal_arc radians (medium) D_L00_001B286C g_lancer_range 20/30 (medium) -D_L00_00294980 g_lancer_sound_records_a slot copy records (medium) -D_L00_00294A00 g_lancer_sound_records_b slot copy records (medium) +D_L00_00294980 g_lancer_shot_rumble_waves wave list passed only to actuator_play_waves, by lancer_update, a shot of MOBY_CLASS_LANCER (was g_lancer_sound_records_a) +D_L00_00294A00 g_lancer_held_rumble_waves wave list passed only to actuator_play_waves, by lancer_update for its other class, kept until the button is let go (actuator_end_looping_waves) (was g_lancer_sound_records_b) D_L00_001AF6C4 g_lancer_state_int state+0x34 for lancer (medium) D_L00_001AF6C0 g_lancer_state_short state+6 for lancer (medium) D_L00_001B2870 g_lancer_vertical_arc radians (medium) @@ -14360,7 +14360,7 @@ D_001430C0 g_mc_rpc_result rpc receive buffer (medium) D_00137E6C g_mc_sema PollSema/SignalSema D_00141BB0 g_mc_set_file_info_request request in sceMcSetFileInfo (medium) D_L00_001B1270 g_megarocket_nozzle_offset vector transformed (medium) -D_0029FCC8 g_megarocket_sound_records slot_copy_records_to_free arg (medium) +D_0029FCC8 g_megarocket_rumble_waves wave list passed only to actuator_play_waves, by megarocket_cannon_update (was g_megarocket_sound_records) D_001AEC68 g_megaturret_shot_param stored in vars (medium) D_L00_001AEFA8 g_megaturret_shot_value stored in work field (medium) D_001AEC0C g_megaturret_slot_counter mod 100 counter @@ -14642,7 +14642,7 @@ D_001AD908 g_meter_vtable_b object table pointer (medium) D_L00_001B05DC g_mini_nuke_blast_moby current blast moby D_L00_001B0644 g_mini_nuke_collision_friction query.friction D_L00_001B0640 g_mini_nuke_collision_response query.response -D_L00_00296020 g_mini_nuke_sound_records slot copy records (medium) +D_L00_00296020 g_mini_nuke_rumble_waves wave list passed only to actuator_play_waves, by mini_l00_nuke_update (was g_mini_nuke_sound_records) D_L08_001B1B64 g_mining_hit_cooldown hitCooldown assigned D_L08_001B1B4C g_mining_hit_float_c float vec arg (medium) D_L08_001B1B50 g_mining_hit_float_d float vec arg (medium) @@ -14718,7 +14718,7 @@ D_L08_001B1938 g_mining_vehicle_turn_push push from turn (medium) D_L08_001B18F8 g_mining_vehicle_turn_rate yaw rate D_L08_001B1900 g_mining_vehicle_vertical_damping vel[1] multiplier (medium) D_L00_001B2864 g_minirocket_fire_held pad held latch (medium) -D_00294880 g_minirocket_sound_records slot_copy_records_to_free arg (medium) +D_00294880 g_minirocket_rumble_waves wave list passed only to actuator_play_waves, by minirocket_tube_update (was g_minirocket_sound_records) D_L03_001AEFCC g_miniturret_counter mod 100 counter D_L03_001AEFB0 g_miniturret_move_speed speed scale (medium) D_L03_001ADAAC g_miniturret_l03_owner_table owner list (medium) @@ -15238,7 +15238,7 @@ D_L00_001AFEC0 g_nuke_l00_launch_speed launch velocity arg (medium) D_L04_001B01A8 g_nuke_l04_launch_speed scaled per tick (medium) D_L00_001AFEC8 g_nuke_move_speed scaled direction step (medium) D_L04_001B2F38 g_nuke_pressed_flag mini nuke state (medium) -D_L04_002BA6C0 g_nuke_src_records slot_copy_records_to_free +D_L04_002BA6C0 g_mini_nuke_l04_rumble_waves wave list passed only to actuator_play_waves, by mini_l04_nuke_update (was g_nuke_src_records) D_L01_001AA550 g_number_separators Sep6 in number formatting (medium) D_L04_002AF630 g_object_anim_sparks_table frame interpolation (medium) D_001ADA78 g_object_base_table object base table pointer (medium) @@ -16150,7 +16150,7 @@ D_L01_001AEEE8 g_quad_vertex_index_c index table column (medium) D_L01_001AEEEC g_quad_vertex_index_d index table column (medium) D_L11_001B18F8 g_quad_wave_amplitude sin multiplier (medium) D_001A9EA0 g_quat_next_axis_table Ord3 in mat_to_quaternion (medium) -D_L00_0025E120 g_queue_source_records record pointers by index (medium) +D_L00_0025E120 g_actuator_patterns 48 pointers to wave lists, read by actuator_play_pattern (was g_queue_source_records) D_L04_001B09F8 g_race_banner_keys_end banner end (medium) D_L04_001B09E0 g_race_banner_keys_start banner start (medium) D_L04_001B09B0 g_race_banner_keys_x banner copy x (medium) @@ -17603,7 +17603,7 @@ D_L00_001B19E8 g_slot_count loop bound over slots (medium) D_L23_001B3900 g_slot_effect_alpha_table int array set 0xFF per slot (medium) D_L02_001B0A18 g_slot_effect_rate_range use in function (medium) D_L23_001B38E8 g_slot_effect_scale_table float array indexed by state slot (medium) -D_L24_001B8500 g_slot_entry_table 16 byte entries nonzero test (medium) +D_L24_001B8500 g_wave_l24_channels level 24's g_wave_l00_channels: the address actuator_is_channel_active forms there (was g_slot_entry_table) D_L04_0021DA00 g_slot_flag_view_a active flags clear (medium) D_L04_0021E670 g_slot_flag_view_b active flags clear (medium) D_0018C0E8 g_slot_index_first request slot state 0 (medium) @@ -17616,7 +17616,7 @@ D_L08_002603E0 g_slot_pane_matrices 4x4 matrices per slot (medium) D_L08_002604A0 g_slot_pane_points point rows per slot (medium) D_001A73E0 g_slot_play_counters indexed by slot or mission (medium) D_L08_00260410 g_slot_positions position vec per index (medium) -D_L05_002B8770 g_slot_record_source slot_copy_records_to_free (medium) +D_L05_002B8770 g_ship_l05_rumble_waves wave list passed only to actuator_play_waves, by UpdateTimedTransformState, ResolveLinkedMobyMovementCollisions (was g_slot_record_source) D_L02_002A53B0 g_slot_reel_symbol_table reel symbols D_L02_002A52F0 g_slot_strip_geometry strip geometry copy (medium) D_PAL_001B09B8 g_slot_t_increment added to slot t (medium) @@ -19253,7 +19253,7 @@ D_L03_001B2750 g_target_counters TargetCounters struct D_001A85CC g_target_fade_speed ApproachValue fade D_001A861C g_target_height scaled height (medium) D_L03_001B0464 g_target_height_speed target z times 1/60 (medium) -D_L00_00294800 g_target_hud_records slot copy records (medium) +D_L00_00294800 g_scoped_weapon_rumble_waves wave list passed only to actuator_play_waves, by UpdateScopedWeapon (was g_target_hud_records) D_L06_001B2970 g_target_index_list count then moby indices (medium) D_001EE960 g_target_list candidate pointers null ended (medium) D_L00_001FACE0 g_target_l00_list null-terminated target pointers @@ -21030,7 +21030,7 @@ D_L00_001B09B0 g_vaporizer_ring_c_width side vector length (medium) D_L00_001B097C g_vaporizer_ring_side_u_offset added to phase (medium) D_L00_001B0980 g_vaporizer_ring_u_step added to u (medium) D_L00_001B0984 g_vaporizer_ring_vec_scale FastVecScale (medium) -D_L00_00296AA0 g_vaporizer_sound_records slot copy records (medium) +D_L00_00296AA0 g_vaporizer_rumble_waves wave list passed only to actuator_play_waves, by vaporizer_update (was g_vaporizer_sound_records) D_L00_001B09F0 g_vaporizer_spark_alpha alpha value (medium) D_L00_001B09F8 g_vaporizer_spark_angle_max angle range D_L00_001B09F4 g_vaporizer_spark_angle_min angle range @@ -24627,8 +24627,8 @@ func_US2_L22_002D0F48 hero_action_state_update_us2 per-frame hero action state m func_PAL_L00_002CB6A8 hero_apply_pending_change_pal v1.01 CB2D8 per file comment func_PAL_L01_002B6870 hero_approach_velocity_pal approaches requested velocity with rate (medium) func_PAL_L18_002CFC50 hero_attach_to_object_pal copy of func_L18_002CFD68 -func_US2_L00_002C4560 hero_l00_change_action_us2 changes player action; same as hero_change_action -func_US2_L13_002CF1F8 hero_l13_change_action_us2 copy of hero_change_action L13_002CEF00 +func_US2_L00_002C4560 hero_l00_set_move_state_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l00_change_action_us2) +func_US2_L13_002CF1F8 hero_l13_set_move_state_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l13_change_action_us2) func_PAL_L00_002CB138 hero_check_step_ahead_pal v1.01 CAD90-qcopy func_PAL_L00_002CA888 hero_choose_idle_anim_pal v1.01 CA4E0 same C func_PAL_L00_002CAEB0 hero_choose_jump_or_roll_move_pal v1.01 CAB08 @@ -24643,7 +24643,7 @@ func_PAL_L01_0039A520 hero_enter_from_pad_pal places hero and camera at pad, arr func_US2_L00_003ACCF0 hero_fire_effect_from_facing_us2 copy of func_L00_003AB8B8 func_PAL_L01_003BFAF4 hero_grabber_update_pal PAL copy of hero_grabber_update func_PAL_L00_002CB7A0 hero_l00_decide_state_pal v1.01 CB3A8 decider -func_PAL_L00_002C4480 hero_l00_set_action_pal v1.01 C42E0 set action +func_PAL_L00_002C4480 hero_l00_set_move_state_pal the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l00_set_action_pal) func_US2_L00_002A6DD0 hero_l00_update_frame_2_us2 same address as func_L00_002A6DD0 hero_l00_update_frame_2 func_US2_L00_002CB650 hero_l00_update_move_decider_us2 per-state input decider switching move state (medium) func_PAL_L00_002BA750 hero_l00_update_state_machine_pal v1.01 BA7D8 state machine @@ -24654,39 +24654,39 @@ func_US2_L01_002BA3C8 hero_l01_update_state_machine_us2 address next to v1.01 st func_PAL_L01_002C3A10 hero_l01_update_state_transitions_pal identical locals to v1.01 002C37C8 func_PAL_L03_002CCED8 hero_l03_decide_state_pal PAL copy of v1.01 002CCB70 func_US2_L03_002CCF18 hero_l03_decide_state_us2 counterpart func_L03_002CCB70 -func_PAL_L03_002C7068 hero_l03_enter_state_pal PAL copy of v1.01 002C6F08 -func_US2_L03_002C7288 hero_l03_enter_state_us2 counterpart func_L03_002C6F08, same comment +func_PAL_L03_002C7068 hero_l03_set_move_state_pal the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l03_enter_state_pal) +func_US2_L03_002C7288 hero_l03_set_move_state_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l03_enter_state_us2) func_PAL_L03_002BF860 hero_l03_update_state_machine_pal PAL copy of v1.01 002BF8F0 func_US2_L03_002BFAF8 hero_l03_update_state_machine_us2 counterpart func_L03_002BF8F0 func_PAL_L04_002EDFB8 hero_l04_decide_state_transition_pal counterpart func_L04_002EDBC8 -func_PAL_L04_002E7DA8 hero_l04_enter_state_pal counterpart func_L04_002E7C08 -func_US2_L04_002E7F28 hero_l04_enter_state_us2 counterpart func_L04_002E7C08 +func_PAL_L04_002E7DA8 hero_l04_set_move_state_pal the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l04_enter_state_pal) +func_US2_L04_002E7F28 hero_l04_set_move_state_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l04_enter_state_us2) func_PAL_L04_002E04A0 hero_l04_update_state_machine_pal counterpart func_L04_002E04A8 func_US2_L04_002E06B0 hero_l04_update_state_machine_us2 counterpart func_L04_002E04A8 func_PAL_L07_002C4018 hero_l07_decide_state_transition_pal same code as func_L07_002C3CC0 -func_PAL_L07_002BE8C8 hero_l07_enter_state_pal same code as func_L07_002BE770 -func_US2_L07_002BE988 hero_l07_enter_state_us2 v2.00 copy of hero_l07_enter_state +func_PAL_L07_002BE8C8 hero_l07_set_move_state_pal the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l07_enter_state_pal) +func_US2_L07_002BE988 hero_l07_set_move_state_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l07_enter_state_us2) func_PAL_L07_002B8608 hero_l07_update_state_machine_pal same code as func_L07_002B8618 func_US2_L07_002B8720 hero_l07_update_state_machine_us2 v2.00 copy of hero_l07_update_state_machine -func_PAL_L08_002D3078 hero_l08_enter_state_pal v1.01 hero_l08_enter_state -func_US2_L08_002D31F8 hero_l08_enter_state_us2 v2.00 copy of hero_l08_enter_state +func_PAL_L08_002D3078 hero_l08_set_move_state_pal the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l08_enter_state_pal) +func_US2_L08_002D31F8 hero_l08_set_move_state_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l08_enter_state_us2) func_PAL_L08_003A6850 hero_l08_lock_on_tether_update_pal tether rope targets (medium) func_PAL_L08_002CB6E0 hero_l08_update_state_machine_pal v1.01 hero_l08_update_state_machine same switch func_US2_L08_002CB8F0 hero_l08_update_state_machine_us2 v2.00 copy of hero_l08_update_state_machine func_PAL_L08_002D94C0 hero_l08_update_state_transitions_pal v1.01 hero_l08_update_state_transitions func_PAL_L09_002C9B18 hero_l09_decide_state_transition_pal file L09_002C9738 -func_PAL_L09_002C3708 hero_l09_set_state_pal same signature as v1.01 -func_US2_L09_002C3818 hero_l09_set_state_us2 changes action, sets animation; v1.01 hero_l09_set_state +func_PAL_L09_002C3708 hero_l09_set_move_state_pal the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l09_set_state_pal) +func_US2_L09_002C3818 hero_l09_set_move_state_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l09_set_state_us2) func_PAL_L09_002B5C80 hero_l09_update_blend_channels_pal counterpart func_L09_002B5CE8 func_PAL_L09_00394290 hero_l09_update_lock_on_tether_pal file L09_003910F8-tether func_PAL_L09_002BC480 hero_l09_update_state_machine_pal file L09_002BC490 func_US2_L09_002BC618 hero_l09_update_state_machine_us2 v1.01 func_L09_002BC490 counterpart -func_PAL_L11_002D9038 hero_l11_enter_state_pal counterpart func_L11_002D8EF8 -func_US2_L11_002D9208 hero_l11_enter_state_us2 copy of func_L11_002D8EF8 +func_PAL_L11_002D9038 hero_l11_set_move_state_pal the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l11_enter_state_pal) +func_US2_L11_002D9208 hero_l11_set_move_state_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l11_enter_state_us2) func_PAL_L11_002D22B8 hero_l11_update_state_machine_pal counterpart func_L11_002D22C8 func_US2_L11_002D24D0 hero_l11_update_state_machine_us2 copy of func_L11_002D22C8 -func_PAL_L12_002C8C58 hero_l12_set_action_pal PAL copy of func_L12_002C8BD0 -func_US2_L12_002C8DD8 hero_l12_set_action_us2 v2.00 copy of func_L12_002C8BD0 set action +func_PAL_L12_002C8C58 hero_l12_set_move_state_pal the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l12_set_action_pal) +func_US2_L12_002C8DD8 hero_l12_set_move_state_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l12_set_action_us2) func_PAL_L12_002BFF00 hero_l12_update_state_machine_pal PAL copy of func_L12_002C0008 func_US2_L12_002C0110 hero_l12_update_state_machine_us2 v2.00 copy of func_L12_002C0008 hero state logic func_PAL_L13_002D62D0 hero_l13_decide_state_pal PAL copy of func_L13_002D5ED8 @@ -24694,29 +24694,29 @@ func_US2_L13_002D61F8 hero_l13_decide_state_us2 copy of hero_l13_decide_state L1 func_PAL_L13_002C56D8 hero_l13_update_state_machine_pal PAL copy of func_L13_002C5760 func_US2_L13_002C58E8 hero_l13_update_state_machine_us2 copy of hero_l13_update_state_machine func_PAL_L15_003B2BE8 hero_l15_lock_on_tether_update_pal PAL copy of hero_l15_lock_on_tether_update -func_PAL_L16_002C0CB0 hero_l16_enter_state_pal PAL copy of hero_l16_enter_state -func_US2_L16_002C0E50 hero_l16_enter_state_us2 v2.00 copy of hero_l16_enter_state +func_PAL_L16_002C0CB0 hero_l16_set_move_state_pal the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l16_enter_state_pal) +func_US2_L16_002C0E50 hero_l16_set_move_state_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l16_enter_state_us2) func_PAL_L16_00390B70 hero_l16_lock_on_tether_update_pal tether chain like other levels -func_PAL_L18_002E01E0 hero_l18_set_action_pal copy of hero_l18_set_action -func_US2_L18_002E02E8 hero_l18_set_action_us2 copy of hero_l18_set_action, same comment/structure +func_PAL_L18_002E01E0 hero_l18_set_move_state_pal the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l18_set_action_pal) +func_US2_L18_002E02E8 hero_l18_set_move_state_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l18_set_action_us2) func_PAL_L18_002C4000 hero_l18_update_frame_pal copy of func_L18_002C41F0 func_PAL_L18_002D0738 hero_l18_update_speed_targets_pal header: copy of hero_l18_update_speed_targets func_PAL_L18_002D7598 hero_l18_update_state_machine_pal copy of hero_l18_update_state_machine func_US2_L18_002D7758 hero_l18_update_state_machine_us2 copy of func_L18_002D7650, same shift as contact fn func_PAL_L19_002CADE8 hero_l19_decide_state_transition_pal PAL copy of func_L19_002CAAB0 -func_PAL_L19_002C45D0 hero_l19_set_state_pal PAL copy of func_L19_002C44F8 -func_US2_L19_002C4708 hero_l19_set_state_us2 copy of func_L19_002C44F8, same comment +func_PAL_L19_002C45D0 hero_l19_set_move_state_pal the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l19_set_state_pal) +func_US2_L19_002C4708 hero_l19_set_move_state_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l19_set_state_us2) func_PAL_L19_002B6160 hero_l19_update_speed_targets_pal PAL copy of func_L19_002B6278 func_PAL_L19_002BC990 hero_l19_update_state_machine_pal PAL copy of func_L19_002BCA50 func_US2_L19_002BCB58 hero_l19_update_state_machine_us2 copy of func_L19_002BCA50 func_PAL_L20_002DF028 hero_l20_decide_state_transition_pal PAL of func_L20_002DEBE0, identical locals func_US2_L20_002DEE88 hero_l20_decide_state_transition_us2 copy of hero_l20_decide_state_transition -func_PAL_L20_002D7920 hero_l20_set_state_pal PAL of func_L20_002D7730 hero_l20_set_state -func_US2_L20_002D79B0 hero_l20_set_state_us2 copy of hero_l20_set_state +func_PAL_L20_002D7920 hero_l20_set_move_state_pal the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l20_set_state_pal) +func_US2_L20_002D79B0 hero_l20_set_move_state_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l20_set_state_us2) func_PAL_L20_002B9270 hero_l20_update_frame_pal PAL copy of func_L20_002B93E0 hero_l20_update_frame func_PAL_L20_002CD8F0 hero_l20_update_state_machine_pal PAL of func_L20_002CD928, identical locals func_US2_L20_002CDA30 hero_l20_update_state_machine_us2 copy of hero_l20_update_state_machine -func_PAL_L22_002C99C8 hero_l22_set_action_pal same code as hero_l22_set_action +func_PAL_L22_002C99C8 hero_l22_set_move_state_pal the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_l22_set_action_pal) func_PAL_L22_002B7B08 hero_l22_update_speed_targets_pal PAL copy of func_L22_002B7C70 func_PAL_L22_002BF0A8 hero_l22_update_state_machine_pal PAL copy of func_L22_002BF1B0 state switch func_US2_L22_002BF2B8 hero_l22_update_state_machine_us2 copy of hero_l22_update_state_machine @@ -24734,11 +24734,11 @@ func_US2_L00_002B22D0 hero_play_collection_voice_line_us2 voice lines at collect func_PAL_L00_002B20F8 hero_play_voice_line_for_progress_pal PAL copy of func_L00_002B2200 func_US2_L01_002C1D90 hero_process_item_action_input_us2 copy of ProcessHeroItemActionInput func_US2_L00_002C96D0 hero_select_context_action_us2 context-sensitive actions from buffered input (medium) -func_PAL_L13_002CF0A0 hero_set_action_state_pal changes hero action, sets params and animation (medium) -func_US2_L22_002C9B20 hero_set_action_us2 changes player action and animation (medium) +func_PAL_L13_002CF0A0 hero_l13_set_move_state_pal the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_set_action_state_pal) +func_US2_L22_002C9B20 hero_l22_set_move_state_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_set_action_us2) func_PAL_L00_002D29D0 hero_set_anim_mode_pal v1.01 D24D0 func_PAL_L00_002D1FE8 hero_set_linked_objects_anim_pal v1.01 same comment -func_US2_L01_002BEEA8 hero_set_move_state_us2 copy of SetHeroMoveState, same comment +func_US2_L01_002BEEA8 SetHeroMoveState_us2 the level's copy of SetHeroMoveState: the hero's action change (stops the vibration unless hero 0x1FA is set) (was hero_set_move_state_us2) func_PAL_L00_002BA480 hero_setup_attached_object_transform_pal v1.01 BA508 counterpart func_PAL_L04_002DCE68 hero_steer_airborne_by_state_pal copy of hero_steer_airborne_by_state func_PAL_L00_003A1688 hero_steer_along_rail_paths_pal v1.01 func_L00_0039E158 rail steering diff --git a/include/names/executable.h b/include/names/executable.h index ae5b8abf5..39093fa01 100644 --- a/include/names/executable.h +++ b/include/names/executable.h @@ -2812,10 +2812,10 @@ #define g_str_reward_trigger_debug D_0026E6A0 #define g_class_dispatch_table D_0026E880 #define g_object_dispatch_table D_0026E900 -#define g_minirocket_sound_records D_00294880 +#define g_minirocket_rumble_waves D_00294880 #define g_museum_exhibit_models D_00295BF0 #define g_pickup_notice_ids D_0029CAE0 -#define g_megarocket_sound_records D_0029FCC8 +#define g_megarocket_rumble_waves D_0029FCC8 #define g_bolt_amount_by_level D_002A0D50 #define g_slot_value_table D_002A1800 #define g_moby_class_dispatch_table D_002A3A00 diff --git a/include/names/level_01.h b/include/names/level_01.h index 9ae05d6b0..cc43c65a5 100644 --- a/include/names/level_01.h +++ b/include/names/level_01.h @@ -612,9 +612,9 @@ #define g_beam_corner_vertices D_L01_00290030 #define g_beam_l01_uv_table D_L01_002900C0 #define g_beam_color_table D_L01_00290108 -#define g_ferry_src_record_a D_L01_00297300 -#define g_ferry_src_record_b D_L01_00297380 -#define g_ferry_src_record_c D_L01_00297400 +#define g_ferry_rumble_waves_a D_L01_00297300 +#define g_ferry_rumble_waves_b D_L01_00297380 +#define g_ferry_rumble_waves_c D_L01_00297400 #define g_water_height_grid D_L01_00297580 #define g_water_color_grid D_L01_00297960 #define g_water_packet_header D_L01_00297B50 diff --git a/include/names/level_03.h b/include/names/level_03.h index 0da1c6895..dd0f63ec0 100644 --- a/include/names/level_03.h +++ b/include/names/level_03.h @@ -535,7 +535,7 @@ #define UpdateEndakoHeroGroundContacts func_L03_002BA278 #define hero_l03_push_out_of_collision func_L03_002BAEA0 #define hero_l03_update_state_machine func_L03_002BF8F0 -#define hero_l03_enter_state func_L03_002C6F08 +#define hero_l03_set_move_state func_L03_002C6F08 #define hero_l03_decide_state func_L03_002CCB70 #define hero_solve_motion_collision_time func_L03_002D3498 #define register_camera_update_callback func_L03_002D84F0 diff --git a/include/names/level_04.h b/include/names/level_04.h index 6a0b36b88..ebfa13ef3 100644 --- a/include/names/level_04.h +++ b/include/names/level_04.h @@ -399,7 +399,7 @@ #define g_barlow_path_total_e D_L04_001B3480 #define g_barlow_path_total_f D_L04_001B3484 #define g_barlow_path_total_g D_L04_001B3488 -#define g_free_slot_records D_L04_001B94C0 +#define g_wave_l04_channels D_L04_001B94C0 #define g_hero_l04_state D_L04_001B9540 #define g_tether_zero_vec D_L04_001B9680 #define g_hero_l04_state_extra D_L04_001B9698 @@ -486,7 +486,7 @@ #define g_object_anim_sparks_table D_L04_002AF630 #define g_water_l04_grid_data D_L04_002AF6C0 #define g_grouped_object_call_arg_d D_L04_002BA660 -#define g_nuke_src_records D_L04_002BA6C0 +#define g_mini_nuke_l04_rumble_waves D_L04_002BA6C0 #define g_exhaust_effect_params_a D_L04_002BDAC0 #define g_exhaust_effect_params_b D_L04_002BDB20 #define g_race_challenge_table D_L04_002C63C0 @@ -513,7 +513,7 @@ #define ApplyHeroVelocityAndResolveDisplacement func_L04_002DBE70 #define hero_steer_airborne_by_state func_L04_002DCE78 #define hero_l04_update_state_machine func_L04_002E04A8 -#define hero_l04_enter_state func_L04_002E7C08 +#define hero_l04_set_move_state func_L04_002E7C08 #define hero_l04_decide_state_transition func_L04_002EDBC8 #define level_clear_leftover_flag func_L04_002FB920 #define level_build_spawn_record func_L04_0030C4C0 diff --git a/include/names/level_05.h b/include/names/level_05.h index 04b1bd6c0..5f8a507e3 100644 --- a/include/names/level_05.h +++ b/include/names/level_05.h @@ -625,7 +625,7 @@ #define g_energy_blast_points D_L05_002B8330 #define g_energy_blast_glint_params D_L05_002B8550 #define g_energy_blast_outer_points D_L05_002B8670 -#define g_slot_record_source D_L05_002B8770 +#define g_ship_l05_rumble_waves D_L05_002B8770 #define g_lock_target_rules D_L05_002B87F0 #define g_aim_crosshair_vertices D_L05_002B8850 #define g_aim_crosshair_uvs D_L05_002B88E0 diff --git a/include/names/level_07.h b/include/names/level_07.h index e80bd27b0..1e5605e85 100644 --- a/include/names/level_07.h +++ b/include/names/level_07.h @@ -317,7 +317,7 @@ #define hero_l07_update_ground_contact func_L07_002B3580 #define UpdateHeroVelocityForStateWithYawSpring func_L07_002B5738 #define hero_l07_update_state_machine func_L07_002B8618 -#define hero_l07_enter_state func_L07_002BE770 +#define hero_l07_set_move_state func_L07_002BE770 #define hero_l07_decide_state_transition func_L07_002C3CC0 #define part_spawn_between_points_depth_push func_L07_002E2090 #define moby_build_followed_points func_L07_002F2C70 diff --git a/include/names/level_08.h b/include/names/level_08.h index 6e3d6e77d..2b2d92d8b 100644 --- a/include/names/level_08.h +++ b/include/names/level_08.h @@ -699,7 +699,7 @@ #define g_str_sandfly_debug D_L08_002B5600 #define hero_refresh_action_triggers func_L08_002BE8E8 #define hero_l08_update_state_machine func_L08_002CB6E8 -#define hero_l08_enter_state func_L08_002D2ED8 +#define hero_l08_set_move_state func_L08_002D2ED8 #define hero_l08_update_state_transitions func_L08_002D90C8 #define gfx_queue_draw_callback func_L08_002F2D10 #define DrawCenteredScaledText func_L08_002F5CB8 diff --git a/include/names/level_09.h b/include/names/level_09.h index 99b8ff7fd..0a439dcd1 100644 --- a/include/names/level_09.h +++ b/include/names/level_09.h @@ -302,7 +302,7 @@ #define hero_l09_update_blend_channels func_L09_002B5CE8 #define hero_probe_ground func_L09_002B7238 #define hero_l09_update_state_machine func_L09_002BC490 -#define hero_l09_set_state func_L09_002C3580 +#define hero_l09_set_move_state func_L09_002C3580 #define hero_l09_decide_state_transition func_L09_002C9738 #define glow_place_state_nine_corners func_L09_002F89F8 #define gfx_draw_state_nine_pulsing_quad func_L09_002F8BA0 diff --git a/include/names/level_11.h b/include/names/level_11.h index 53bc1c771..0a1981d4b 100644 --- a/include/names/level_11.h +++ b/include/names/level_11.h @@ -728,7 +728,7 @@ #define hero_handle_contact_hit func_L11_002CB130 #define HeroApplyMotionCollision func_L11_002CDE10 #define hero_l11_update_state_machine func_L11_002D22C8 -#define hero_l11_enter_state func_L11_002D8EF8 +#define hero_l11_set_move_state func_L11_002D8EF8 #define hero_decide_next_state func_L11_002DE9E0 #define level_start_progress_cue func_L11_0030ED58 #define moby_update_list_flags func_L11_0030F060 diff --git a/include/names/level_12.h b/include/names/level_12.h index 48c14df07..93978f504 100644 --- a/include/names/level_12.h +++ b/include/names/level_12.h @@ -420,7 +420,7 @@ #define g_sweeping_beam_draw_callback D_L12_0041BF88 #define hero_l12_apply_contact_push func_L12_002B85E0 #define hero_l12_update_state_machine func_L12_002C0008 -#define hero_l12_set_action func_L12_002C8BD0 +#define hero_l12_set_move_state func_L12_002C8BD0 #define hero_decide_todano_state func_L12_002CF7B0 #define todano_build_trail_slice_meshes func_L12_002FFF88 #define todano_refresh_scene_tuning func_L12_00300138 diff --git a/include/names/level_13.h b/include/names/level_13.h index 757e3af62..c4bbb8513 100644 --- a/include/names/level_13.h +++ b/include/names/level_13.h @@ -202,7 +202,7 @@ #define g_reward_switch_links D_L13_002AA9F0 #define g_str_l13_reward_switch_debug_2 D_L13_002ADB90 #define hero_l13_update_state_machine func_L13_002C5760 -#define hero_change_action func_L13_002CEF00 +#define hero_l13_set_move_state func_L13_002CEF00 #define hero_l13_decide_state func_L13_002D5ED8 #define boldan_init_level_objects func_L13_00306F38 #define menu_build_level_list func_L13_0035E890 diff --git a/include/names/level_16.h b/include/names/level_16.h index aa5225775..11976893b 100644 --- a/include/names/level_16.h +++ b/include/names/level_16.h @@ -348,7 +348,7 @@ #define hero_l16_push_out_of_collision func_L16_002B59A0 #define hero_apply_movement func_L16_002B5EE0 #define hero_update_state_handler func_L16_002B9FF0 -#define hero_l16_enter_state func_L16_002C0BC8 +#define hero_l16_set_move_state func_L16_002C0BC8 #define hero_decide_state_snivelak func_L16_002C6378 #define transition_arm_shared func_L16_002D2D10 #define snivelak_room_scene_update func_L16_002F60B8 diff --git a/include/names/level_18.h b/include/names/level_18.h index 882a563cb..3f95e4b6e 100644 --- a/include/names/level_18.h +++ b/include/names/level_18.h @@ -448,7 +448,7 @@ #define hero_l18_update_state_machine func_L18_002D7650 #define hero_update_timers_reach func_L18_002DEFF8 #define hero_clear_global_flag func_L18_002E0060 -#define hero_l18_set_action func_L18_002E0070 +#define hero_l18_set_move_state func_L18_002E0070 #define snd_start_mode_sound func_L18_002E4090 #define hero_check_ledge_fall func_L18_002E42F8 #define hero_update_state_decider func_L18_002E68B0 diff --git a/include/names/level_19.h b/include/names/level_19.h index 8bba648ce..be6207eeb 100644 --- a/include/names/level_19.h +++ b/include/names/level_19.h @@ -247,7 +247,7 @@ #define hero_l19_update_speed_targets func_L19_002B6278 #define UpdateGrelbinHeroGroundContacts func_L19_002B7820 #define hero_l19_update_state_machine func_L19_002BCA50 -#define hero_l19_set_state func_L19_002C44F8 +#define hero_l19_set_move_state func_L19_002C44F8 #define hero_l19_decide_state_transition func_L19_002CAAB0 #define UpdateCutsceneEffects func_L19_002FA1A8 #define linked_object_watcher_update func_L19_00380918 diff --git a/include/names/level_20.h b/include/names/level_20.h index bda54daa1..4aa750967 100644 --- a/include/names/level_20.h +++ b/include/names/level_20.h @@ -344,7 +344,7 @@ #define hero_slide_along_wall func_L20_002C7588 #define hero_l20_update_state_machine func_L20_002CD928 #define hero_l20_update_timers func_L20_002D6488 -#define hero_l20_set_state func_L20_002D7730 +#define hero_l20_set_move_state func_L20_002D7730 #define hero_load_state_by_game_mode func_L20_002DC390 #define hero_l20_decide_state_transition func_L20_002DEBE0 #define level_script_update func_L20_00310E38 diff --git a/include/names/level_22.h b/include/names/level_22.h index d222bda77..4863b0384 100644 --- a/include/names/level_22.h +++ b/include/names/level_22.h @@ -354,7 +354,7 @@ #define hero_slide_along_walls func_L22_002B8E10 #define hero_l22_update_state_machine func_L22_002BF1B0 #define hero_update_timers_and_reach func_L22_002C8610 -#define hero_l22_set_action func_L22_002C9898 +#define hero_l22_set_move_state func_L22_002C9898 #define text_play_mode_message func_L22_002CE468 #define hero_update_actions func_L22_002D0C98 #define math_steer_along_direction func_L22_00328220 diff --git a/include/names/level_24.h b/include/names/level_24.h index 22fe9eee5..9daf23234 100644 --- a/include/names/level_24.h +++ b/include/names/level_24.h @@ -41,7 +41,7 @@ #define g_tether_l24_segment_fades D_L24_001B2050 #define g_tether_l24_segment_timer_resets D_L24_001B2058 #define g_tether_l24_segment_offsets D_L24_001B2060 -#define g_slot_entry_table D_L24_001B8500 +#define g_wave_l24_channels D_L24_001B8500 #define g_hero_object_ref D_L24_001B8580 #define g_tether_l24_origin_vec D_L24_001B86C0 #define g_data_bank_context D_L24_001BC3C0 diff --git a/include/names/pal.h b/include/names/pal.h index 920734836..f6200f6fe 100644 --- a/include/names/pal.h +++ b/include/names/pal.h @@ -1063,7 +1063,7 @@ #define hero_l00_update_timers_pal func_PAL_L00_002C3250 #define hero_update_landing_slide_pal func_PAL_L00_002C39D8 #define hero_get_step_offset_from_direction_pal func_PAL_L00_002C3BE0 -#define hero_l00_set_action_pal func_PAL_L00_002C4480 +#define hero_l00_set_move_state_pal func_PAL_L00_002C4480 #define hero_try_start_transition_pal func_PAL_L00_002C8F98 #define hero_update_height_offset_pal func_PAL_L00_002C95C0 #define ProcessHeroEquippedItemInput_pal func_PAL_L00_002C97E0 @@ -2033,7 +2033,7 @@ #define hero_l03_push_out_of_collision_pal func_PAL_L03_002BADC8 #define hero_update_hop_velocity_pal func_PAL_L03_002BC3A0 #define hero_l03_update_state_machine_pal func_PAL_L03_002BF860 -#define hero_l03_enter_state_pal func_PAL_L03_002C7068 +#define hero_l03_set_move_state_pal func_PAL_L03_002C7068 #define hero_l03_decide_state_pal func_PAL_L03_002CCED8 #define part_spawn_particle_burst_l03_pal func_PAL_L03_002EE460 #define sky_update_scroll_pal func_PAL_L03_002FF6E0 @@ -2150,7 +2150,7 @@ #define ApplyHeroVelocityAndResolveDisplacement_pal func_PAL_L04_002DBE18 #define hero_steer_airborne_by_state_pal func_PAL_L04_002DCE68 #define hero_l04_update_state_machine_pal func_PAL_L04_002E04A0 -#define hero_l04_enter_state_pal func_PAL_L04_002E7DA8 +#define hero_l04_set_move_state_pal func_PAL_L04_002E7DA8 #define hero_l04_decide_state_transition_pal func_PAL_L04_002EDFB8 #define text_draw_scaled_medium_pal func_PAL_L04_0030B2C8 #define level_update_mob_list_by_type_pal func_PAL_L04_0031F198 @@ -2488,7 +2488,7 @@ #define cam_volume_update_pal func_PAL_L06_00480660 #define UpdateHeroVelocityForStateWithYawSpring_pal func_PAL_L07_002B5728 #define hero_l07_update_state_machine_pal func_PAL_L07_002B8608 -#define hero_l07_enter_state_pal func_PAL_L07_002BE8C8 +#define hero_l07_set_move_state_pal func_PAL_L07_002BE8C8 #define hero_l07_decide_state_transition_pal func_PAL_L07_002C4018 #define moby_build_followed_points_pal func_PAL_L07_002F4618 #define hero_adjust_jump_speed_to_target_pal func_PAL_L07_00324F58 @@ -2555,7 +2555,7 @@ #define siberius_debris_update_pal func_PAL_L07_00415B88 #define UpdateHeldBeamWeapon_pal func_PAL_L07_0041B7D8 #define hero_l08_update_state_machine_pal func_PAL_L08_002CB6E0 -#define hero_l08_enter_state_pal func_PAL_L08_002D3078 +#define hero_l08_set_move_state_pal func_PAL_L08_002D3078 #define hero_l08_update_state_transitions_pal func_PAL_L08_002D94C0 #define tabora_cutscene_update_effects_pal func_PAL_L08_0030A2B8 #define gfx_run_screen_update_steps_pal func_PAL_L08_0030C3A8 @@ -2632,7 +2632,7 @@ #define item_trader_npc_update_pal func_PAL_L08_0043B690 #define hero_l09_update_blend_channels_pal func_PAL_L09_002B5C80 #define hero_l09_update_state_machine_pal func_PAL_L09_002BC480 -#define hero_l09_set_state_pal func_PAL_L09_002C3708 +#define hero_l09_set_move_state_pal func_PAL_L09_002C3708 #define hero_l09_decide_state_transition_pal func_PAL_L09_002C9B18 #define gfx_draw_state_nine_pulsing_quad_pal func_PAL_L09_002FA660 #define mob_list_update_flags_pal func_PAL_L09_002FAA98 @@ -2768,7 +2768,7 @@ #define hero_handle_contact_hit_pal func_PAL_L11_002CB0C8 #define HeroApplyMotionCollision_pal func_PAL_L11_002CDDB8 #define hero_l11_update_state_machine_pal func_PAL_L11_002D22B8 -#define hero_l11_enter_state_pal func_PAL_L11_002D9038 +#define hero_l11_set_move_state_pal func_PAL_L11_002D9038 #define hero_decide_next_state_pal func_PAL_L11_002DED28 #define moby_update_list_flags_pal func_PAL_L11_00310B38 #define moby_call_helper_with_blocks_pal func_PAL_L11_00342558 @@ -2916,7 +2916,7 @@ #define moby_group_trigger_update_pal func_PAL_L11_00480AF0 #define hero_l12_apply_contact_push_pal func_PAL_L12_002B8478 #define hero_l12_update_state_machine_pal func_PAL_L12_002BFF00 -#define hero_l12_set_action_pal func_PAL_L12_002C8C58 +#define hero_l12_set_move_state_pal func_PAL_L12_002C8C58 #define hero_decide_todano_state_pal func_PAL_L12_002CFA90 #define todano_build_trail_slice_meshes_pal func_PAL_L12_00301950 #define todano_scene_update_events_pal func_PAL_L12_00301DD8 @@ -3003,7 +3003,7 @@ #define UpdateSpinningBlastProjectile_pal func_PAL_L12_0042F068 #define gfx_draw_laser_beam_pal func_PAL_L12_0042F4F0 #define hero_l13_update_state_machine_pal func_PAL_L13_002C56D8 -#define hero_set_action_state_pal func_PAL_L13_002CF0A0 +#define hero_l13_set_move_state_pal func_PAL_L13_002CF0A0 #define hero_l13_decide_state_pal func_PAL_L13_002D62D0 #define boldan_init_level_objects_pal func_PAL_L13_00308A88 #define trigger_list_check_hero_pal func_PAL_L13_0038EF88 @@ -3140,7 +3140,7 @@ #define hero_l16_push_out_of_collision_pal func_PAL_L16_002B5848 #define hero_apply_movement_pal func_PAL_L16_002B5D88 #define hero_update_state_handler_pal func_PAL_L16_002B9EE0 -#define hero_l16_enter_state_pal func_PAL_L16_002C0CB0 +#define hero_l16_set_move_state_pal func_PAL_L16_002C0CB0 #define hero_decide_state_snivelak_pal func_PAL_L16_002C6668 #define snivelak_room_scene_update_pal func_PAL_L16_002F7B18 #define menu_l00_init_entry_table_pal func_PAL_L16_0034F000 @@ -3275,7 +3275,7 @@ #define ClipHeroVelocityAtWall_pal func_PAL_L18_002D1890 #define hero_l18_update_state_machine_pal func_PAL_L18_002D7598 #define hero_update_timers_reach_pal func_PAL_L18_002DF168 -#define hero_l18_set_action_pal func_PAL_L18_002E01E0 +#define hero_l18_set_move_state_pal func_PAL_L18_002E01E0 #define hero_update_state_decider_pal func_PAL_L18_002E6C50 #define text_measure_width_scaled_l18_pal func_PAL_L18_00304BD8 #define FontPrintCenterScaled_pal func_PAL_L18_00305968 @@ -3365,7 +3365,7 @@ #define hero_l19_apply_contact_push_pal func_PAL_L19_002B5AD8 #define hero_l19_update_speed_targets_pal func_PAL_L19_002B6160 #define hero_l19_update_state_machine_pal func_PAL_L19_002BC990 -#define hero_l19_set_state_pal func_PAL_L19_002C45D0 +#define hero_l19_set_move_state_pal func_PAL_L19_002C45D0 #define hero_l19_decide_state_transition_pal func_PAL_L19_002CADE8 #define cutscene_l19_update_effects_pal func_PAL_L19_002FBA78 #define bouncing_l19_shot_update_ripple_pal func_PAL_L19_0038E3B0 @@ -3406,7 +3406,7 @@ #define hero_slide_along_wall_pal func_PAL_L20_002C7500 #define hero_l20_update_state_machine_pal func_PAL_L20_002CD8F0 #define hero_l20_update_timers_pal func_PAL_L20_002D6678 -#define hero_l20_set_state_pal func_PAL_L20_002D7920 +#define hero_l20_set_move_state_pal func_PAL_L20_002D7920 #define hero_l20_decide_state_transition_pal func_PAL_L20_002DF028 #define level_script_update_pal func_PAL_L20_00312A28 #define spark_l20_burst_update_pal func_PAL_L20_0039D9C8 @@ -3505,7 +3505,7 @@ #define hero_slide_along_walls_pal func_PAL_L22_002B8CB8 #define hero_l22_update_state_machine_pal func_PAL_L22_002BF0A8 #define hero_update_timers_and_reach_pal func_PAL_L22_002C8740 -#define hero_l22_set_action_pal func_PAL_L22_002C99C8 +#define hero_l22_set_move_state_pal func_PAL_L22_002C99C8 #define hero_update_actions_pal func_PAL_L22_002D1020 #define part_update_fade_record_pal func_PAL_L22_00337244 #define part_spawn_homing_trail_pal func_PAL_L22_0033BBB0 diff --git a/include/names/shared_levels.h b/include/names/shared_levels.h index 67cda35d9..f814a8270 100644 --- a/include/names/shared_levels.h +++ b/include/names/shared_levels.h @@ -1920,7 +1920,7 @@ #define g_hero_effect_vectors_b D_L00_0025DE00 #define g_hero_effect_vectors_c D_L00_0025DE70 #define g_hero_effect_blend_table D_L00_0025DEE0 -#define g_queue_source_records D_L00_0025E120 +#define g_actuator_patterns D_L00_0025E120 #define g_weight_tap_table D_L00_0025EDE0 #define g_glow_object_limit_pairs D_L00_00262260 #define g_weapon_l00_table D_L00_00262570 @@ -1950,10 +1950,10 @@ #define g_glow_sphere_quad_points D_L00_00293EB0 #define g_glow_sphere_quad_indices D_L00_002944B0 #define g_beam_network_attachment_points D_L00_002947B0 -#define g_target_hud_records D_L00_00294800 -#define g_blitz_gun_sound_records D_L00_00294900 -#define g_lancer_sound_records_a D_L00_00294980 -#define g_lancer_sound_records_b D_L00_00294A00 +#define g_scoped_weapon_rumble_waves D_L00_00294800 +#define g_blitz_gun_rumble_waves D_L00_00294900 +#define g_lancer_shot_rumble_waves D_L00_00294980 +#define g_lancer_held_rumble_waves D_L00_00294A00 #define g_quad_beam_directions D_L00_00294A80 #define g_quad_beam_corner_uvs D_L00_00294B10 #define g_beam_ring_vertices D_L00_00294B60 @@ -1963,12 +1963,12 @@ #define g_effect_mesh_uvs_b D_L00_00295B00 #define g_effect_mesh_colors_a D_L00_00295CE0 #define g_effect_mesh_colors_b D_L00_00295F30 -#define g_mini_nuke_sound_records D_L00_00296020 -#define g_charge_sound_records D_L00_002960A0 -#define g_effect_handle_records D_L00_00296120 +#define g_mini_nuke_rumble_waves D_L00_00296020 +#define g_lock_on_weapon_rumble_waves D_L00_002960A0 +#define g_spread_weapon_rumble_waves D_L00_00296120 #define g_wobbling_ball_vertices D_L00_002961A0 #define g_wobbling_ball_face_indices D_L00_002967A0 -#define g_vaporizer_sound_records D_L00_00296AA0 +#define g_vaporizer_rumble_waves D_L00_00296AA0 #define g_blast_ring_vertices D_L00_00296B20 #define g_blast_ring_quad_indices D_L00_00297020 #define g_blast_ring_uvs D_L00_00297420 @@ -1979,7 +1979,7 @@ #define g_blast_ripple_quad_indices D_L00_0029A090 #define g_blast_ripple_uvs D_L00_0029A990 #define g_plasma_coil_beam_points D_L00_0029AE20 -#define g_gravity_bomb_sound_records D_L00_0029AE70 +#define g_gravity_bomb_rumble_waves D_L00_0029AE70 #define g_blast_burst_light D_L00_0029AEF0 #define g_quad_sphere_vertices D_L00_0029AF40 #define g_quad_sphere_quad_indices D_L00_0029B440 @@ -1995,10 +1995,10 @@ #define g_shape_b_face_normals D_L00_0029EA90 #define g_shape_b_face_vectors D_L00_0029EDB0 #define g_vaporizer_beam_ring_vertices D_L00_0029F0D0 -#define g_bouncer_sound_record D_L00_0029F210 +#define g_bouncer_rumble_waves D_L00_0029F210 #define g_ring_effect_vertices D_L00_0029F2E0 #define g_ring_effect_face_indices D_L00_0029F8E0 -#define g_charging_weapon_sound_records D_L00_0029FBE0 +#define g_charging_weapon_rumble_waves D_L00_0029FBE0 #define g_zone_trigger_lists_by_map D_L00_0029FC60 #define g_startup_table D_L00_002A0E60 #define g_str_startup_message D_L00_002A0ED0 @@ -2182,7 +2182,7 @@ #define hero_find_swingshot_node_in_front func_L00_002C3BB0 #define hero_find_active_swingshot_node func_L00_002C3E18 #define hero_find_blue_swingshot_target func_L00_002C40C0 -#define hero_l00_set_action func_L00_002C42E0 +#define hero_l00_set_move_state func_L00_002C42E0 #define hero_start_loader_state func_L00_002C8BA8 #define hero_try_start_transition func_L00_002C8C00 #define hero_try_start_ledge_move func_L00_002C8CB0 @@ -2265,13 +2265,13 @@ #define level_return_zero func_L00_002D6878 #define level_is_special_mode_active func_L00_002D6880 #define level_get_global_word func_L00_002D68E8 -#define queue_copy_record_by_index func_L00_002D6900 -#define slot_clear_active_bytes func_L00_002D6940 -#define slot_is_entry_nonzero func_L00_002D6978 -#define slot_copy_records_to_free func_L00_002D6998 -#define slot_reset_active func_L00_002D6B70 +#define actuator_play_pattern func_L00_002D6900 +#define actuator_stop_all func_L00_002D6940 +#define actuator_is_channel_active func_L00_002D6978 +#define actuator_play_waves func_L00_002D6998 +#define actuator_end_looping_waves func_L00_002D6B70 #define LevelActuatorCalcPower func_L00_002D6BA8 -#define math_add_wrapping_counter func_L00_002D6FD8 +#define actuator_update func_L00_002D6FD8 #define cam_clear_override_slots func_L00_002D7068 #define cam_alloc_override_slot func_L00_002D70A0 #define cam_end_override func_L00_002D7140 diff --git a/include/names/us2.h b/include/names/us2.h index 9c73f1ee2..e3962af04 100644 --- a/include/names/us2.h +++ b/include/names/us2.h @@ -652,7 +652,7 @@ #define hero_update_zapper_us2 func_US2_L00_002B2408 #define hero_try_grab_object_us2 func_US2_L00_002B2DD0 #define hero_update_move_physics_us2 func_US2_L00_002BA8E0 -#define hero_l00_change_action_us2 func_US2_L00_002C4560 +#define hero_l00_set_move_state_us2 func_US2_L00_002C4560 #define hero_select_context_action_us2 func_US2_L00_002C96D0 #define hero_l00_update_move_decider_us2 func_US2_L00_002CB650 #define hero_update_collection_progress_us2 func_US2_L00_002D6258 @@ -852,7 +852,7 @@ #define game_update_frame_us2 func_US2_L01_002A8D48 #define hero_l01_apply_hazard_contact_us2 func_US2_L01_002B3990 #define hero_l01_update_state_machine_us2 func_US2_L01_002BA3C8 -#define hero_set_move_state_us2 func_US2_L01_002BEEA8 +#define SetHeroMoveState_us2 func_US2_L01_002BEEA8 #define hero_process_item_action_input_us2 func_US2_L01_002C1D90 #define hero_l01_update_state_transitions_us2 func_US2_L01_002C3B08 #define level_tick_timer_get_value_us2 func_US2_L01_002F2458 @@ -904,7 +904,7 @@ #define level_update_frame_us2 func_US2_L03_002AD640 #define hero_l03_apply_contact_push_us2 func_US2_L03_002B8910 #define hero_l03_update_state_machine_us2 func_US2_L03_002BFAF8 -#define hero_l03_enter_state_us2 func_US2_L03_002C7288 +#define hero_l03_set_move_state_us2 func_US2_L03_002C7288 #define hero_l03_decide_state_us2 func_US2_L03_002CCF18 #define level_update_objects_us2 func_US2_L03_002FEB58 #define bot_update_us2 func_US2_L03_003C31F8 @@ -923,7 +923,7 @@ #define laser_bot_init_check_hit_us2 func_US2_L03_004201B8 #define hero_check_surface_contact_us2 func_US2_L04_002D93C0 #define hero_l04_update_state_machine_us2 func_US2_L04_002E06B0 -#define hero_l04_enter_state_us2 func_US2_L04_002E7F28 +#define hero_l04_set_move_state_us2 func_US2_L04_002E7F28 #define hero_l04_decide_state_transition_us2 func_US2_L04_002EDF10 #define level_update_mob_list_by_type_us2 func_US2_L04_0031E208 #define barlow_creature_update_us2 func_US2_L04_003E38E8 @@ -973,14 +973,14 @@ #define item_l06_trigger_update_us2 func_US2_L06_004571C8 #define destructible_machine_update_us2 func_US2_L06_00458A00 #define hero_l07_update_state_machine_us2 func_US2_L07_002B8720 -#define hero_l07_enter_state_us2 func_US2_L07_002BE988 +#define hero_l07_set_move_state_us2 func_US2_L07_002BE988 #define hero_l07_decide_state_transition_us2 func_US2_L07_002C3F00 #define shooter_entity_update_us2 func_US2_L07_003EBC40 #define boss_update_us2 func_US2_L07_003F83E8 #define siberius_trigger_update_us2 func_US2_L07_00409480 #define tv_l07_screens_update_us2 func_US2_L07_0040A6A0 #define hero_l08_update_state_machine_us2 func_US2_L08_002CB8F0 -#define hero_l08_enter_state_us2 func_US2_L08_002D31F8 +#define hero_l08_set_move_state_us2 func_US2_L08_002D31F8 #define hero_l08_update_state_transitions_us2 func_US2_L08_002D9410 #define tabora_cutscene_update_effects_us2 func_US2_L08_003093B8 #define level_set_game_state_pair_us2 func_US2_L08_0031A090 @@ -999,7 +999,7 @@ #define sandfly_update_us2 func_US2_L08_00424F74 #define item_trader_npc_update_us2 func_US2_L08_004370E0 #define hero_l09_update_state_machine_us2 func_US2_L09_002BC618 -#define hero_l09_set_state_us2 func_US2_L09_002C3818 +#define hero_l09_set_move_state_us2 func_US2_L09_002C3818 #define hero_l09_decide_state_transition_us2 func_US2_L09_002C99F8 #define mob_list_update_flags_us2 func_US2_L09_002F9B28 #define region_scan_objects_us2 func_US2_L09_003E46F8 @@ -1026,7 +1026,7 @@ #define gate_course_update_us2 func_US2_L10_00426260 #define hero_handle_contact_hit_us2 func_US2_L11_002CB338 #define hero_l11_update_state_machine_us2 func_US2_L11_002D24D0 -#define hero_l11_enter_state_us2 func_US2_L11_002D9208 +#define hero_l11_set_move_state_us2 func_US2_L11_002D9208 #define hero_decide_next_state_us2 func_US2_L11_002DED18 #define moby_update_list_flags_us2 func_US2_L11_0030FC28 #define level_update_progress_flags_us2 func_US2_L11_00399764 @@ -1051,7 +1051,7 @@ #define item_l11_trigger_update_us2 func_US2_L11_0046F118 #define hero_l12_apply_contact_push_us2 func_US2_L12_002B86E8 #define hero_l12_update_state_machine_us2 func_US2_L12_002C0110 -#define hero_l12_set_action_us2 func_US2_L12_002C8DD8 +#define hero_l12_set_move_state_us2 func_US2_L12_002C8DD8 #define hero_decide_todano_state_us2 func_US2_L12_002CF9E0 #define todano_scene_update_events_us2 func_US2_L12_00300ED0 #define UpdateTodanoItemTradeNpc_us2 func_US2_L12_003B6518 @@ -1066,7 +1066,7 @@ #define flying_boss_update_us2 func_US2_L12_00429A10 #define gfx_draw_laser_beam_us2 func_US2_L12_0042B340 #define hero_l13_update_state_machine_us2 func_US2_L13_002C58E8 -#define hero_l13_change_action_us2 func_US2_L13_002CF1F8 +#define hero_l13_set_move_state_us2 func_US2_L13_002CF1F8 #define hero_l13_decide_state_us2 func_US2_L13_002D61F8 #define boldan_init_level_objects_us2 func_US2_L13_00307BE0 #define l13_pulse_trigger_update_us2 func_US2_L13_003C6DC0 @@ -1100,7 +1100,7 @@ #define gorn_path_course_update_us2 func_US2_L15_00432BA8 #define hero_handle_contact_reaction_us2 func_US2_L16_002B3358 #define hero_update_state_handler_us2 func_US2_L16_002BA0F8 -#define hero_l16_enter_state_us2 func_US2_L16_002C0E50 +#define hero_l16_set_move_state_us2 func_US2_L16_002C0E50 #define hero_decide_state_snivelak_us2 func_US2_L16_002C6628 #define snivelak_room_scene_update_us2 func_US2_L16_002F6CE0 #define menu_l16_fill_entries_from_item_list_us2 func_US2_L16_0034DE08 @@ -1122,7 +1122,7 @@ #define hero_detach_from_object_us2 func_US2_L18_002D0050 #define hero_handle_hit_object_contact_us2 func_US2_L18_002D02B8 #define hero_l18_update_state_machine_us2 func_US2_L18_002D7758 -#define hero_l18_set_action_us2 func_US2_L18_002E02E8 +#define hero_l18_set_move_state_us2 func_US2_L18_002E02E8 #define hero_update_state_decider_us2 func_US2_L18_002E6B50 #define text_measure_font_texture_us2 func_US2_L18_00304470 #define UpdateDamoselTimedExplosions_us2 func_US2_L18_00317D10 @@ -1137,7 +1137,7 @@ #define UpdatePartsPurchaseNpc_us2 func_US2_L18_00441C08 #define hero_l19_apply_contact_push_us2 func_US2_L19_002B5CF8 #define hero_l19_update_state_machine_us2 func_US2_L19_002BCB58 -#define hero_l19_set_state_us2 func_US2_L19_002C4708 +#define hero_l19_set_move_state_us2 func_US2_L19_002C4708 #define hero_l19_decide_state_transition_us2 func_US2_L19_002CACE8 #define UpdateCutsceneEffects_us2 func_US2_L19_002FABB0 #define menu_l19_fill_entries_from_item_list_us2 func_US2_L19_00353D38 @@ -1156,7 +1156,7 @@ #define hero_exit_vehicle_mode_us2 func_US2_L20_002C5B50 #define hero_handle_hazard_contact_us2 func_US2_L20_002C5E08 #define hero_l20_update_state_machine_us2 func_US2_L20_002CDA30 -#define hero_l20_set_state_us2 func_US2_L20_002D79B0 +#define hero_l20_set_move_state_us2 func_US2_L20_002D79B0 #define hero_l20_decide_state_transition_us2 func_US2_L20_002DEE88 #define level_script_update_us2 func_US2_L20_00311A60 #define scripted_pickup_update_us2 func_US2_L20_003C1450 @@ -1170,7 +1170,7 @@ #define eased_platform_update_us2 func_US2_L20_00448E78 #define hero_l22_apply_hazard_contact_us2 func_US2_L22_002B7658 #define hero_l22_update_state_machine_us2 func_US2_L22_002BF2B8 -#define hero_set_action_us2 func_US2_L22_002C9B20 +#define hero_l22_set_move_state_us2 func_US2_L22_002C9B20 #define hero_action_state_update_us2 func_US2_L22_002D0F48 #define moby_wait_no_active_trigger_event_us2 func_US2_L22_00387310 #define space_ship_update_us2 func_US2_L22_0039EB38 diff --git a/src/levels/00_aranos_tutorial/L00_002C42E0-state-g8.c b/src/levels/00_aranos_tutorial/L00_002C42E0-state-g8.c index 204247c71..7de34afce 100644 --- a/src/levels/00_aranos_tutorial/L00_002C42E0-state-g8.c +++ b/src/levels/00_aranos_tutorial/L00_002C42E0-state-g8.c @@ -81,8 +81,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -147,7 +147,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l00_set_action(s32 action, s32 animate) { +s32 hero_l00_set_move_state(s32 action, s32 animate) { f32 dir[4]; f32 pos[4]; u8 *objectSnapshot; @@ -196,7 +196,9 @@ s32 hero_l00_set_action(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -209,8 +211,8 @@ s32 hero_l00_set_action(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l00_set_action(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_action(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l00_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_or_form_id(0) == 0x51) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_or_form_id(0), 0, -1.0f); @@ -357,7 +359,7 @@ s32 hero_l00_set_action(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l00_set_action(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l00_set_move_state(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -403,12 +405,12 @@ s32 hero_l00_set_action(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l00_set_action(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_action(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l00_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_or_form_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l00_set_action(0, 0)) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); + if (hero_l00_set_move_state(0, 0)) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -433,7 +435,7 @@ s32 hero_l00_set_action(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_action(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -612,13 +614,13 @@ s32 hero_l00_set_action(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l00_set_action(0x81, 1); return 0; + hero_l00_set_move_state(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_action_blocked_flag) { hero_l00_set_action(0x6E, 1); return 0; } + action != 0x38 && !g_hero_action_blocked_flag) { hero_l00_set_move_state(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l00_set_action(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l00_set_move_state(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -693,9 +695,9 @@ s32 hero_l00_set_action(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_map_event_flag) hero_l00_set_action(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l00_set_action(0x79, 1); - else hero_l00_set_action(0x39, 1); + if (g_current_map_index == 2 && g_map_event_flag) hero_l00_set_move_state(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l00_set_move_state(0x79, 1); + else hero_l00_set_move_state(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -746,7 +748,7 @@ s32 hero_l00_set_action(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -775,7 +777,7 @@ s32 hero_l00_set_action(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -784,7 +786,7 @@ s32 hero_l00_set_action(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -926,7 +928,7 @@ s32 hero_l00_set_action(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -1017,7 +1019,7 @@ s32 hero_l00_set_action(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -1029,7 +1031,7 @@ s32 hero_l00_set_action(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth(1); @@ -1064,7 +1066,7 @@ s32 hero_l00_set_action(s32 action, s32 animate) { set_hero_animation(0x11, 0, 8.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_action(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation(0, 0, 9.0f); goto finish; case 0x4B: @@ -1098,7 +1100,7 @@ s32 hero_l00_set_action(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_action_curve_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_action(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1142,7 +1144,7 @@ s32 hero_l00_set_action(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l00_set_action(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l00_set_move_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/levels/01_oozla/L01_002ADDC8.c b/src/levels/01_oozla/L01_002ADDC8.c index ee92696d2..465d3c4b3 100644 --- a/src/levels/01_oozla/L01_002ADDC8.c +++ b/src/levels/01_oozla/L01_002ADDC8.c @@ -169,7 +169,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -188,7 +188,7 @@ extern s32 shooter_update_ranged_attack(s32); extern s32 hero_get_weapon_anim_id(s32); extern void hero_exit_vehicle_mode(s32); extern void ClipHeroVelocityAgainstWall(s32); -extern s32 hero_l20_set_state(s32, s32); +extern s32 hero_l20_set_move_state(s32, s32); /* Runs the hero's per-frame logic for whichever action the hero is in (idle, run, jump, swing and so on). */ void hero_l01_update_state_machine(void) { f32 speed62; @@ -759,7 +759,7 @@ void hero_l01_update_state_machine(void) { coll_process_hit(0.4f, (s32)((TI128*)work_vec0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)work_vec2)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_drive_settings)->f[0x180/4] = 0.1f; diff --git a/src/levels/01_oozla/L01_002BEB90-state-g8.c b/src/levels/01_oozla/L01_002BEB90-state-g8.c index 1c56fa2bb..f5159c42f 100644 --- a/src/levels/01_oozla/L01_002BEB90-state-g8.c +++ b/src/levels/01_oozla/L01_002BEB90-state-g8.c @@ -63,8 +63,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -179,7 +179,9 @@ s32 SetHeroMoveState(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -473,7 +475,7 @@ s32 SetHeroMoveState(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -499,7 +501,7 @@ s32 SetHeroMoveState(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -508,7 +510,7 @@ s32 SetHeroMoveState(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -640,7 +642,7 @@ s32 SetHeroMoveState(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -710,7 +712,7 @@ s32 SetHeroMoveState(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -722,7 +724,7 @@ s32 SetHeroMoveState(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth(1); diff --git a/src/levels/01_oozla/L01_003B9F30-g16.c b/src/levels/01_oozla/L01_003B9F30-g16.c index c11a13040..418818f6b 100644 --- a/src/levels/01_oozla/L01_003B9F30-g16.c +++ b/src/levels/01_oozla/L01_003B9F30-g16.c @@ -40,9 +40,9 @@ extern char *g_path_l01_table[]; extern char *g_moby_l01_table __attribute__((sda)); extern float g_water_l01_height[] __attribute__((sda)); extern float g_ferry_height_offsets_alt[], g_ferry_height_offsets[]; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_ferry_src_record_a; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_ferry_src_record_b; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_ferry_src_record_c; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_ferry_rumble_waves_a; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_ferry_rumble_waves_b; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_ferry_rumble_waves_c; extern float level_get_water_height(void); extern int func_001163B0(void); extern void anim_start_blended(unsigned char *, int, int, int); @@ -74,8 +74,8 @@ extern void moby_scale_owner_words_by_angles(float *, float *, float *, float, f extern void value_set_and_smooth(void *, float *, float, int, int); extern char *part_spawn_drifting(void *, float, float, void *, int); extern void path_sample_position(void *, int, void *, void *, int, float); -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); -extern void slot_reset_active(int); +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern void actuator_end_looping_waves(int); extern PoolRecord64 *cam_alloc_override_slot(int); extern void cam_end_override(unsigned char *); #define I(p,o) (*(int *)((char *)(p)+(o))) @@ -159,7 +159,7 @@ void path_ferry_update(unsigned char *object) int i; hit = part_find_owned_effect_slot(object, 0x10000, 0); if (hit && (!P(hit, 0x20) || H(P(hit, 0x20), 0xAA) != 0xCE7 /* moby class 3303 */)) { - if (g_hero_state.interaction == (char *)object && g_hero_state.active) slot_copy_records_to_free(&g_ferry_src_record_a); + if (g_hero_state.interaction == (char *)object && g_hero_state.active) actuator_play_waves(&g_ferry_rumble_waves_a); if (object[0x43] != 2) anim_start_blended(object, 2, 5, 3); moby_set_state(object, 3, -1); } else { @@ -186,7 +186,7 @@ void path_ferry_update(unsigned char *object) F(object, 0x48) = math_random_float_range(0.8f, 1.2f); } if (g_hero_state.interaction == (char *)object && g_hero_state.active) { - slot_copy_records_to_free(&g_ferry_src_record_a); + actuator_play_waves(&g_ferry_rumble_waves_a); if (object[0x43] != 2) anim_start_blended(object, 2, 5, 3); moby_set_state(object, 3, -1); } @@ -196,7 +196,7 @@ void path_ferry_update(unsigned char *object) } case 3: if (object[0x60] & 2) { - if (g_hero_state.interaction == (char *)object && g_hero_state.active) I(context, 0x2F0) = slot_copy_records_to_free(&g_ferry_src_record_b); + if (g_hero_state.interaction == (char *)object && g_hero_state.active) I(context, 0x2F0) = actuator_play_waves(&g_ferry_rumble_waves_b); if (object[0x43] != 3) anim_start_blended(object, 3, 0, 6); F(context, 0x2CC) = F(context, 0x2D0) = 10.0f; moby_set_state(object, 4, -1); @@ -251,9 +251,9 @@ void path_ferry_update(unsigned char *object) if (child) child[9] = FloatToInt(16.0f)+32; } if ((float)(I(outbound, 0)-1) <= F(context, 0x2B0)) { - slot_reset_active(I(context, 0x2F0)); + actuator_end_looping_waves(I(context, 0x2F0)); I(context, 0x2F0) = -1; - if (g_hero_state.interaction == (char *)object && g_hero_state.active) slot_copy_records_to_free(&g_ferry_src_record_c); + if (g_hero_state.interaction == (char *)object && g_hero_state.active) actuator_play_waves(&g_ferry_rumble_waves_c); if (object[0x43] != 6) anim_start_blended(object, 6, 0, 10); U(object, 0x96) = 0; object[0x20] = 5; diff --git a/src/levels/01_oozla/L01_003BBF68-g8.c b/src/levels/01_oozla/L01_003BBF68-g8.c index 2e2eee395..98a4ce938 100644 --- a/src/levels/01_oozla/L01_003BBF68-g8.c +++ b/src/levels/01_oozla/L01_003BBF68-g8.c @@ -28,8 +28,8 @@ extern float moby_get_anim_value(void *); extern void moby_set_state(void *, int, int); extern void anim_start_blended(void *, int, int, int); extern int FloatToInt(float); -extern int queue_copy_record_by_index(int); -extern void slot_reset_active(int); +extern int actuator_play_pattern(int); +extern void actuator_end_looping_waves(int); extern int math_fast_float_d(void *); extern int PlayMobySound(int, int, void *); extern int math_random_int_below(int); @@ -65,27 +65,27 @@ void hero_grabber_update(char *moby) if (g_hero_state.obj == moby && g_hero_state.active) { moby_set_state(moby, 2, -1); *(int *)(vars + 0x60) = FloatToInt(*(float *)(vars + 0x50) * 60.0f); - *(int *)(vars + 0x78) = queue_copy_record_by_index(7); + *(int *)(vars + 0x78) = actuator_play_pattern(7); if (*(unsigned char *)(moby + 0x43) != 1) anim_start_blended(moby, 1, 0, 10); } break; case 2: if (g_hero_state.obj == moby && g_hero_state.active) { - *(int *)(vars + 0x78) = queue_copy_record_by_index(4); + *(int *)(vars + 0x78) = actuator_play_pattern(4); } else if (*(int *)(vars + 0x78) != -1) { - slot_reset_active(*(int *)(vars + 0x78)); + actuator_end_looping_waves(*(int *)(vars + 0x78)); *(int *)(vars + 0x78) = -1; } if (math_fast_float_d(vars + 0x70) && math_fast_float_d(vars + 0x60)) { if (*(int *)(vars + 0x78) != -1) { - slot_reset_active(*(int *)(vars + 0x78)); + actuator_end_looping_waves(*(int *)(vars + 0x78)); *(int *)(vars + 0x78) = -1; } moby_set_state(moby, 3, -1); PlayMobySound(0, 0, moby); if (*(unsigned char *)(moby + 0x43) != 2) anim_start_blended(moby, 2, 0, 6); if (g_hero_state.obj == moby && g_hero_state.active) - *(int *)(vars + 0x78) = queue_copy_record_by_index(5); + *(int *)(vars + 0x78) = actuator_play_pattern(5); *(float *)(moby + 0x48) = g_grabber_field_value; } break; @@ -94,12 +94,12 @@ void hero_grabber_update(char *moby) *(unsigned short *)(moby + 0x34) |= 0x1000; *(int *)(vars + 0x64) = 600; if (g_hero_state.obj == moby && g_hero_state.f31C < 0.5f) { - *(int *)(vars + 0x78) = queue_copy_record_by_index(5); + *(int *)(vars + 0x78) = actuator_play_pattern(5); *(int *)(vars + 0x68) = 1; *(int *)(moby + 0x9C) = -1; } else { if (*(int *)(vars + 0x78) != -1) { - slot_reset_active(*(int *)(vars + 0x78)); + actuator_end_looping_waves(*(int *)(vars + 0x78)); *(int *)(vars + 0x78) = -1; } *(int *)(moby + 0x9C) = 0x80000000; @@ -108,7 +108,7 @@ void hero_grabber_update(char *moby) } break; case 4: - if (*(int *)(vars + 0x68) && !math_random_int_below(11)) *(int *)(vars + 0x78) = queue_copy_record_by_index(5); + if (*(int *)(vars + 0x68) && !math_random_int_below(11)) *(int *)(vars + 0x78) = actuator_play_pattern(5); if (*(float *)(vars + 0x74) < 46.0f && frame > 46.0f) { if (*(int *)(vars + 0x68)) { if (g_hero_state.f24CC < 2) hero_record_play_counters(); @@ -126,7 +126,7 @@ void hero_grabber_update(char *moby) } if (*(unsigned char *)(moby + 0x60) & 2) { if (*(int *)(vars + 0x78) != -1) { - slot_reset_active(*(int *)(vars + 0x78)); + actuator_end_looping_waves(*(int *)(vars + 0x78)); *(int *)(vars + 0x78) = -1; } moby_set_state(moby, 1, -1); diff --git a/src/levels/02_maktar_nebula/L02_003F5430-g8.c b/src/levels/02_maktar_nebula/L02_003F5430-g8.c index 8a6168e58..af0b0f0d0 100644 --- a/src/levels/02_maktar_nebula/L02_003F5430-g8.c +++ b/src/levels/02_maktar_nebula/L02_003F5430-g8.c @@ -479,7 +479,7 @@ typedef struct { extern L02_003FF9A0_Rec g_material_l02_table[]; -extern s32 hero_l00_set_action(s32, s32); +extern s32 hero_l00_set_move_state(s32, s32); extern s32 PadPressedWithin(s32, s32, s32 *); extern s32 arena_get_challenge_save_index(s32); extern s32 flag_is_byte_set(void); @@ -502,7 +502,7 @@ void menu_select_next_usable(char *moby) { L02_003FF9A0_Rec *record; if (g_game_mode != 0x6F) - hero_l00_set_action(0x6F, 1); + hero_l00_set_move_state(0x6F, 1); if (PadPressedWithin(0x40, 0x3C, 0) != 0) { moby_set_state(moby, 7, -1); for (i = *(s16 *)(state + 0x118) + 1; i < 0xE; i++) { diff --git a/src/levels/02_maktar_nebula/L02_003FD8B8-g8.c b/src/levels/02_maktar_nebula/L02_003FD8B8-g8.c index 029ba7bce..4dbf570a1 100644 --- a/src/levels/02_maktar_nebula/L02_003FD8B8-g8.c +++ b/src/levels/02_maktar_nebula/L02_003FD8B8-g8.c @@ -5,7 +5,7 @@ extern int mode_get_stack_top(void); extern int flag_is_byte_set(void); extern int arena_get_challenge_save_index(unsigned int); -extern int hero_l00_set_action(int, int); +extern int hero_l00_set_move_state(int, int); extern int snd_play_from_global_bank(int, int, void *); extern int FastDecTimer(short *); extern void moby_set_state(u8 *, int, int); @@ -46,7 +46,7 @@ void arena_update_challenge_menu(u8 *object) int i, found; InputView *input; if (mode_get_stack_top()==5) return; - if (g_game_mode[0]!=0x6f) hero_l00_set_action(0x6f,1); + if (g_game_mode[0]!=0x6f) hero_l00_set_move_state(0x6f,1); if (H(0x11a)==0) { if ((((InputView *)g_pad_state)->field1c4&0x2000) && H(0x118)<13) { for (i=H(0x118)+1;i<14;i++) { diff --git a/src/levels/02_maktar_nebula/L02_00412D50-g16.c b/src/levels/02_maktar_nebula/L02_00412D50-g16.c index b0e10b4ad..c60219125 100644 --- a/src/levels/02_maktar_nebula/L02_00412D50-g16.c +++ b/src/levels/02_maktar_nebula/L02_00412D50-g16.c @@ -61,7 +61,7 @@ extern float vec_length_xy(void *); extern void vec_transform_by_object_or_given(char *, char *, char *, char *); extern double __extendsfdf2(float); extern void STUB_printf(const char *, ...); -extern int hero_l00_set_action(s32, s32); +extern int hero_l00_set_move_state(s32, s32); extern float vec_distance_xy(void *, void *); extern void cam_set_mode_state(s32); extern s32 flag_set_first_pending(u8 *); @@ -170,7 +170,7 @@ void lift_l02_update(u8 *object) vec_transform_by_object_or_given((char *)object, (char *)&delta, (char *)&delta, 0); if (delta.f[2] < -0.6f) { STUB_printf(g_str_lift_distance, __extendsfdf2(distance)); - hero_l00_set_action(0x6F, 1); + hero_l00_set_move_state(0x6F, 1); moby_set_state(object, 2, -1); } } else if ((g_frame_l02_counter[0] & 0x3F) == 0) { @@ -251,7 +251,7 @@ void lift_l02_update(u8 *object) s32 slot; u8 *sound_record; if ((u16)ticks == 45) - hero_l00_set_action(0x6F, 1); + hero_l00_set_move_state(0x6F, 1); slot = state->sound; sound_record = (u8 *)&g_sound_state[slot]; if (*(u8 **)(sound_record + 0x88) != object || !sound_record[0x74]) @@ -260,7 +260,7 @@ void lift_l02_update(u8 *object) } if (g_grab_highlight_level[0] >= 1.0f) { s32 slot; - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); slot = state->sound; if (slot != -1) { u8 *sound_record = (u8 *)&g_sound_state[slot]; diff --git a/src/levels/03_endako/L03_002B2798-input.c b/src/levels/03_endako/L03_002B2798-input.c index 487c5f9c3..13f2e6776 100644 --- a/src/levels/03_endako/L03_002B2798-input.c +++ b/src/levels/03_endako/L03_002B2798-input.c @@ -42,7 +42,7 @@ extern unsigned char g_hero_input_enabled __attribute__((sda)); extern int g_current_map_index __attribute__((sda)); extern int g_hero_special_flag __attribute__((sda)); extern void mem_fast_helper_b(void *, int); -extern int hero_l03_enter_state(int, int); +extern int hero_l03_set_move_state(int, int); /* Reads the hero's button action this frame and switches the hero to the matching state (jump, glide, swing and so on). */ void hero_handle_action_input(void) @@ -73,14 +73,14 @@ void hero_handle_action_input(void) if (action == 12) PLAYER->tertiary = 1; if (PLAYER->primary) { if (active && PLAYER->state == 1 && PLAYER->mode != 0x7a) { - hero_l03_enter_state(0x7a, 1); + hero_l03_set_move_state(0x7a, 1); } else if (PLAYER->primary && active) { if (PLAYER->mode == 0x38 && !PLAYER->enabled) return; - if (PLAYER->busy) hero_l03_enter_state(0x38, 1); - else if (g_current_map_index == 2 && g_hero_special_flag) hero_l03_enter_state(0x7d, 1); + if (PLAYER->busy) hero_l03_set_move_state(0x38, 1); + else if (g_current_map_index == 2 && g_hero_special_flag) hero_l03_set_move_state(0x7d, 1); else if (*(int *)(*(char **)(PLAYER->object + 0x24) + 0x1f0)) - hero_l03_enter_state(0x79, 1); - else hero_l03_enter_state(0x39, 1); + hero_l03_set_move_state(0x79, 1); + else hero_l03_set_move_state(0x39, 1); } } } diff --git a/src/levels/03_endako/L03_002B8708-contact.c b/src/levels/03_endako/L03_002B8708-contact.c index ca86559e2..75f693eb9 100644 --- a/src/levels/03_endako/L03_002B8708-contact.c +++ b/src/levels/03_endako/L03_002B8708-contact.c @@ -67,7 +67,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l03_enter_state(s32, s32); +extern s32 hero_l03_set_move_state(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth(s32); extern int hero_play_sound(s32, s32); @@ -143,7 +143,7 @@ s32 hero_l03_apply_contact_push(s32 apply_push) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB /* moby class 1259 */ || *(s16 *)(other + 0xAA) == 0x558 /* moby class 1368 */)) { - hero_l03_enter_state(0x7D, 1); + hero_l03_set_move_state(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -154,7 +154,7 @@ s32 hero_l03_apply_contact_push(s32 apply_push) { AdjustPlayerHealth(FloatToInt(*(float *)(anim_record + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l03_enter_state(0x16, 1); + hero_l03_set_move_state(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -164,9 +164,9 @@ s32 hero_l03_apply_contact_push(s32 apply_push) { return 0; } if (entry->f24 & 8) { - hero_l03_enter_state(0x8C, 1); + hero_l03_set_move_state(0x8C, 1); } else { - hero_l03_enter_state(0x16, 1); + hero_l03_set_move_state(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&vec); @@ -178,7 +178,7 @@ s32 hero_l03_apply_contact_push(s32 apply_push) { } break; case 1: - hero_l03_enter_state(0x42, 1); + hero_l03_set_move_state(0x42, 1); hero_flatten_push_vector(&vec, flag, 0.083333336f, 0.050000004f); break; } diff --git a/src/levels/03_endako/L03_002BF8F0.c b/src/levels/03_endako/L03_002BF8F0.c index a407145b2..6ce330462 100644 --- a/src/levels/03_endako/L03_002BF8F0.c +++ b/src/levels/03_endako/L03_002BF8F0.c @@ -165,7 +165,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -184,7 +184,7 @@ extern s32 shooter_update_ranged_attack(s32); extern s32 hero_get_gadget_value(s32); extern void hero_exit_vehicle_mode(s32); extern void DeflectHeroOffSteepSurface(s32); -extern s32 hero_l20_set_state(s32, s32); +extern s32 hero_l20_set_move_state(s32, s32); void hero_l03_update_state_machine(void) { f32 speed62; s32 lim67; @@ -1002,7 +1002,7 @@ void hero_l03_update_state_machine(void) { coll_process_hit(0.4f, (s32)((TI128*)vec0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l03_state_alias)->f[0x180/4] = 0.1f; diff --git a/src/levels/03_endako/L03_002C6F08-state-g8.c b/src/levels/03_endako/L03_002C6F08-state-g8.c index 5821bec45..0d8c053aa 100644 --- a/src/levels/03_endako/L03_002C6F08-state-g8.c +++ b/src/levels/03_endako/L03_002C6F08-state-g8.c @@ -73,8 +73,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -143,7 +143,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l03_enter_state(s32 action, s32 animate) { +s32 hero_l03_set_move_state(s32 action, s32 animate) { f32 dir[4]; u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -191,7 +191,9 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -204,7 +206,7 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_gadget_value(0) == 0x51) set_hero_animation(hero_get_gadget_value(0), 0, 18.0f); else set_hero_animation(hero_get_gadget_value(0), 0, -1.0f); @@ -255,7 +257,7 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l03_enter_state(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l03_set_move_state(0x76, 1); return 0; } } WORD(0x2298) = 0; BYTE(0x40C) = 0; BYTE(0x40E) = 0; @@ -285,11 +287,11 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_gadget_value(0) == 0x51) { if (!animate) goto finish; - if (hero_l03_enter_state(0, 0)) set_hero_animation(hero_get_gadget_value(0), 0, 18.0f); + if (hero_l03_set_move_state(0, 0)) set_hero_animation(hero_get_gadget_value(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -314,7 +316,7 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -479,13 +481,13 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 /* moby class 2489 */ || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05 /* moby class 3845 */)) { - hero_l03_enter_state(0x81, 1); return 0; + hero_l03_set_move_state(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l03_lock_flag) { hero_l03_enter_state(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l03_lock_flag) { hero_l03_set_move_state(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l03_enter_state(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l03_set_move_state(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -544,9 +546,9 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_special_flag) hero_l03_enter_state(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l03_enter_state(0x79, 1); - else hero_l03_enter_state(0x39, 1); + if (g_current_map_index == 2 && g_hero_special_flag) hero_l03_set_move_state(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l03_set_move_state(0x79, 1); + else hero_l03_set_move_state(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -591,7 +593,7 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -620,7 +622,7 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -629,7 +631,7 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -769,7 +771,7 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -845,7 +847,7 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -857,7 +859,7 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth(1); @@ -880,7 +882,7 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { set_hero_animation(0x11, 0, 8.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation(0, 0, 9.0f); goto finish; case 0x4B: @@ -914,7 +916,7 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l03_float_sequences[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -958,7 +960,7 @@ s32 hero_l03_enter_state(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l03_enter_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l03_set_move_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/levels/03_endako/L03_002CCB70-decider.c b/src/levels/03_endako/L03_002CCB70-decider.c index 1bccde184..fbe03902f 100644 --- a/src/levels/03_endako/L03_002CCB70-decider.c +++ b/src/levels/03_endako/L03_002CCB70-decider.c @@ -87,7 +87,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_refresh_speed_from_timer(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l03_enter_state(s32, s32); +s32 hero_l03_set_move_state(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -164,7 +164,7 @@ void hero_l03_decide_state(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l03_enter_state(0x39, 1); + hero_l03_set_move_state(0x39, 1); goto end; } } @@ -199,7 +199,7 @@ void hero_l03_decide_state(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l03_decide_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l03_enter_state(0x74, 1); + hero_l03_set_move_state(0x74, 1); goto end; } } @@ -209,16 +209,16 @@ void hero_l03_decide_state(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state(1, 1); + hero_l03_set_move_state(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l03_enter_state(0x82, 1); + hero_l03_set_move_state(0x82, 1); break; } if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l03_enter_state(0x82, 1); + hero_l03_set_move_state(0x82, 1); break; } { @@ -254,7 +254,7 @@ void hero_l03_decide_state(void) { rec = g_hero_decide_records + selected_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l03_enter_state(0x3C, 1); + hero_l03_set_move_state(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -297,12 +297,12 @@ void hero_l03_decide_state(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l03_enter_state(0x76, 1); + hero_l03_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); } break; } @@ -323,17 +323,17 @@ void hero_l03_decide_state(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l03_lock_flag == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l03_enter_state(0x6E, 1); + hero_l03_set_move_state(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l03_enter_state(4, 1); + hero_l03_set_move_state(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state(0x27, 1); + hero_l03_set_move_state(0x27, 1); break; } { @@ -353,28 +353,28 @@ void hero_l03_decide_state(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l03_enter_state(2, 1); + hero_l03_set_move_state(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state(1, 1); + hero_l03_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_buttons = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_buttons & 8)) { - hero_l03_enter_state(0x3D, 1); + hero_l03_set_move_state(0x3D, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l03_enter_state(0x3D, 1); + hero_l03_set_move_state(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l03_enter_state(0, 1); + hero_l03_set_move_state(0, 1); } break; case 0x3D: @@ -383,22 +383,22 @@ void hero_l03_decide_state(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state(4, 1); + hero_l03_set_move_state(4, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l03_enter_state(2, 1); + hero_l03_set_move_state(2, 1); break; } - hero_l03_enter_state(0, 1); + hero_l03_set_move_state(0, 1); break; case 0x39: case 0x43: @@ -448,9 +448,9 @@ void hero_l03_decide_state(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state(4, 1); + hero_l03_set_move_state(4, 1); } else { - hero_l03_enter_state(0, 0); + hero_l03_set_move_state(0, 0); anim = hero_get_gadget_value(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -462,9 +462,9 @@ void hero_l03_decide_state(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l03_enter_state(0, 0); + hero_l03_set_move_state(0, 0); } else { - hero_l03_enter_state(0, 1); + hero_l03_set_move_state(0, 1); } } break; @@ -497,7 +497,7 @@ void hero_l03_decide_state(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state(7, 1); + hero_l03_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -506,7 +506,7 @@ void hero_l03_decide_state(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l03_enter_state(0, 0); + hero_l03_set_move_state(0, 0); } break; } @@ -528,7 +528,7 @@ void hero_l03_decide_state(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state(7, 1); + hero_l03_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -541,7 +541,7 @@ void hero_l03_decide_state(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l03_enter_state(2, 0); + hero_l03_set_move_state(2, 0); set_hero_animation(3, g_hero_l03_animation_table[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -552,22 +552,22 @@ void hero_l03_decide_state(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l03_enter_state(2, 1); + hero_l03_set_move_state(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l03_enter_state(0, 0); + hero_l03_set_move_state(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state(0, 0); + hero_l03_set_move_state(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l03_enter_state(0, 1); + hero_l03_set_move_state(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -584,7 +584,7 @@ void hero_l03_decide_state(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state(7, 1); + hero_l03_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -593,7 +593,7 @@ void hero_l03_decide_state(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l03_enter_state(0, 0); + hero_l03_set_move_state(0, 0); set_hero_animation(hero_get_gadget_value(0), 0, 15.0f); break; } @@ -605,7 +605,7 @@ void hero_l03_decide_state(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state(0, 1); + hero_l03_set_move_state(0, 1); } break; case 0x2: @@ -619,11 +619,11 @@ void hero_l03_decide_state(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l03_enter_state(0x76, 1); + hero_l03_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); break; } n = 9; @@ -637,12 +637,12 @@ void hero_l03_decide_state(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l03_enter_state(9, 1); + hero_l03_set_move_state(9, 1); } else { - hero_l03_enter_state(7, 1); + hero_l03_set_move_state(7, 1); } } else { - hero_l03_enter_state(7, 1); + hero_l03_set_move_state(7, 1); } break; } @@ -650,15 +650,15 @@ void hero_l03_decide_state(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state(1, 1); + hero_l03_set_move_state(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state(4, 1); + hero_l03_set_move_state(4, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state(0x27, 1); + hero_l03_set_move_state(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -669,7 +669,7 @@ void hero_l03_decide_state(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l03_enter_state(0, 0) == 0) { + if (hero_l03_set_move_state(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -709,17 +709,17 @@ void hero_l03_decide_state(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l03_enter_state(3, 0); + hero_l03_set_move_state(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l03_enter_state(0x77, 1); + hero_l03_set_move_state(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l03_enter_state(0x77, 1); + hero_l03_set_move_state(0x77, 1); break; } } @@ -737,11 +737,11 @@ void hero_l03_decide_state(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l03_enter_state(0x64, 1); + hero_l03_set_move_state(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l03_enter_state(0x63, 1); + hero_l03_set_move_state(0x63, 1); } } else { hero_update_anim_scale(); @@ -749,15 +749,15 @@ void hero_l03_decide_state(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state(0x62, 1); + hero_l03_set_move_state(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l03_enter_state(0, 1); + hero_l03_set_move_state(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l03_enter_state(0x62, 1); + hero_l03_set_move_state(0x62, 1); } break; case 0x79: /* switch 2 */ @@ -782,29 +782,29 @@ void hero_l03_decide_state(void) { return; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state(1, 1); + hero_l03_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l03_enter_state(7, 1); + hero_l03_set_move_state(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state(4, 1); + hero_l03_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state(0, 1); + hero_l03_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state(0x27, 1); + hero_l03_set_move_state(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -812,45 +812,45 @@ void hero_l03_decide_state(void) { } if (hero_get_gadget_value(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l03_enter_state(0, 0); + hero_l03_set_move_state(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l03_enter_state(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l03_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_gadget_value(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l03_enter_state(2, 1); + hero_l03_set_move_state(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state(1, 1); + hero_l03_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state(0, 0); + hero_l03_set_move_state(0, 0); set_hero_animation(hero_get_gadget_value(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l03_enter_state(0x76, 1); + hero_l03_set_move_state(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l03_enter_state(0x15, 1); + hero_l03_set_move_state(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l03_enter_state(0, 1); + hero_l03_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -858,17 +858,17 @@ void hero_l03_decide_state(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l03_enter_state(0x8B, 1); + hero_l03_set_move_state(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l03_enter_state(0, 1); + hero_l03_set_move_state(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l03_enter_state(0, 1); + hero_l03_set_move_state(0, 1); } break; case 0x24: @@ -894,14 +894,14 @@ void hero_l03_decide_state(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l03_enter_state(0, 0); + hero_l03_set_move_state(0, 0); set_hero_animation(hero_get_gadget_value(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l03_enter_state(6, 0); + hero_l03_set_move_state(6, 0); } else { - hero_l03_enter_state(6, 0); + hero_l03_set_move_state(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -917,9 +917,9 @@ void hero_l03_decide_state(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l03_enter_state(0, 1); + hero_l03_set_move_state(0, 1); } else { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -931,7 +931,7 @@ void hero_l03_decide_state(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l03_enter_state(0x2C, 1); + hero_l03_set_move_state(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -980,11 +980,11 @@ void hero_l03_decide_state(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.21666668f); FLD(g_hero_state, f32, 0x128) = 0.16666667f; - hero_l03_enter_state(0x16, 1); + hero_l03_set_move_state(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x46; FLD(g_hero_state, s16, 0x1D0) = 0x46; } else { - hero_l03_enter_state(0x3E, 1); + hero_l03_set_move_state(0x3E, 1); } break; } @@ -997,7 +997,7 @@ void hero_l03_decide_state(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l03_enter_state(0x28, 1); + hero_l03_set_move_state(0x28, 1); } break; } @@ -1008,16 +1008,16 @@ void hero_l03_decide_state(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x46; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l03_enter_state(0x74, 1); + hero_l03_set_move_state(0x74, 1); } else { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { - hero_l03_enter_state(0x2A, 1); + hero_l03_set_move_state(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1034,7 +1034,7 @@ void hero_l03_decide_state(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l03_enter_state(0x28, 1); + hero_l03_set_move_state(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)point_b = 0; @@ -1051,7 +1051,7 @@ void hero_l03_decide_state(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 5, NULL) != 0) && ((f32)g_hero_state_params[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l03_enter_state(0x28, 1); + hero_l03_set_move_state(0x28, 1); break; } top = 0xE; @@ -1060,19 +1060,19 @@ void hero_l03_decide_state(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l03_enter_state(0x2A, 1); + hero_l03_set_move_state(0x2A, 1); } break; } if ((f32)g_hero_state_params[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l03_enter_state(0x27, 1); + hero_l03_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x6C8) >= 6)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l03_enter_state(0x74, 1); + hero_l03_set_move_state(0x74, 1); } else { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1081,7 +1081,7 @@ void hero_l03_decide_state(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l03_enter_state(0x27, 1); + hero_l03_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0xA) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1117,7 +1117,7 @@ void hero_l03_decide_state(void) { find_nearest_path_point(new_path, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), new_path_count, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l03_enter_state(0x29, 1); + hero_l03_set_move_state(0x29, 1); break; } } @@ -1165,7 +1165,7 @@ void hero_l03_decide_state(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x46; FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1173,7 +1173,7 @@ void hero_l03_decide_state(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l03_enter_state(0x71, 1); + hero_l03_set_move_state(0x71, 1); break; } { @@ -1185,7 +1185,7 @@ void hero_l03_decide_state(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l03_enter_state(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l03_set_move_state(0, 0) != 0)) { set_hero_animation(0xC, 4, 6.0f); } } else if (st == 0x3E) { @@ -1194,18 +1194,18 @@ void hero_l03_decide_state(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)dust_kind_b, 0.5f, -1.0f); } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state(0x27, 1); + hero_l03_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l03_enter_state(0x27, 1); + hero_l03_set_move_state(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l03_enter_state(0x18, 0); + hero_l03_set_move_state(0x18, 0); } break; case 0x18: @@ -1214,18 +1214,18 @@ void hero_l03_decide_state(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l03_enter_state(0x1B, 1); + hero_l03_set_move_state(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1234,7 +1234,7 @@ void hero_l03_decide_state(void) { point_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; point_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l03_enter_state(0x19, 1); + hero_l03_set_move_state(0x19, 1); } break; } @@ -1245,7 +1245,7 @@ void hero_l03_decide_state(void) { point_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; point_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l03_enter_state(0x1A, 1); + hero_l03_set_move_state(0x1A, 1); } } } @@ -1264,18 +1264,18 @@ void hero_l03_decide_state(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state(0x18, 1); + hero_l03_set_move_state(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l03_enter_state(0x1B, 1); + hero_l03_set_move_state(0x1B, 1); } break; } @@ -1285,9 +1285,9 @@ void hero_l03_decide_state(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); } else { - hero_l03_enter_state(0, 1); + hero_l03_set_move_state(0, 1); } } break; @@ -1311,12 +1311,12 @@ void hero_l03_decide_state(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l03_enter_state(0x39, 1); + hero_l03_set_move_state(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l03_enter_state(0, 0) != 0) { + if (hero_l03_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1324,7 +1324,7 @@ void hero_l03_decide_state(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l03_enter_state(0, 0) != 0) { + if (hero_l03_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1338,32 +1338,32 @@ void hero_l03_decide_state(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l03_enter_state(2, 1); + hero_l03_set_move_state(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l03_enter_state(3, 0) != 0) { + if (hero_l03_set_move_state(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l03_enter_state(0, 1); + hero_l03_set_move_state(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l03_enter_state(8, 1); + hero_l03_set_move_state(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state(0x17, 1); + hero_l03_set_move_state(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state(0x27, 1); + hero_l03_set_move_state(0x27, 1); break; } } @@ -1395,7 +1395,7 @@ void hero_l03_decide_state(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == MOBY_CLASS_LEVITATOR_PAD)) { - if (hero_l03_enter_state(0, 0) != 0) { + if (hero_l03_set_move_state(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1405,9 +1405,9 @@ void hero_l03_decide_state(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l03_enter_state(0x74, 1); + hero_l03_set_move_state(0x74, 1); } else { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); } } break; @@ -1420,16 +1420,16 @@ void hero_l03_decide_state(void) { ok = 1; } if (ok != 0) { - hero_l03_enter_state(0x11, 1); + hero_l03_set_move_state(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state(0x17, 1); + hero_l03_set_move_state(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1440,23 +1440,23 @@ void hero_l03_decide_state(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l03_enter_state(3, 0) != 0) { + if (hero_l03_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state(4, 1); + hero_l03_set_move_state(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_l03_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l03_enter_state(2, 1); + hero_l03_set_move_state(2, 1); break; } - hero_l03_enter_state(2, 0); + hero_l03_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1465,21 +1465,21 @@ void hero_l03_decide_state(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_l03_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l03_enter_state(2, 1); + hero_l03_set_move_state(2, 1); break; } - hero_l03_enter_state(2, 0); + hero_l03_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l03_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l03_enter_state(0, 0) != 0) { + if (hero_l03_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_gadget_value(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l03_enter_state(0, 0) != 0) { + } else if (hero_l03_set_move_state(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1526,14 +1526,14 @@ void hero_l03_decide_state(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state(0xB, 1); + hero_l03_set_move_state(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l03_enter_state(0x82, 1); + hero_l03_set_move_state(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1542,25 +1542,25 @@ void hero_l03_decide_state(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l03_enter_state(0xA, 1); + hero_l03_set_move_state(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l03_enter_state(0x10, 1); + hero_l03_set_move_state(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state(0x27, 1); + hero_l03_set_move_state(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l03_enter_state(0x77, 1); + hero_l03_set_move_state(0x77, 1); break; } } @@ -1664,7 +1664,7 @@ void hero_l03_decide_state(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l03_enter_state(3, 0) != 0) { + if (hero_l03_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1672,13 +1672,13 @@ void hero_l03_decide_state(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l03_speed_params[0][2])) { - hero_l03_enter_state(7, 1); + hero_l03_set_move_state(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l03_enter_state(7, 1); + hero_l03_set_move_state(7, 1); } else if (g_hero_l03_speed_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l03_enter_state(9, 1); + hero_l03_set_move_state(9, 1); } else { - hero_l03_enter_state(7, 1); + hero_l03_set_move_state(7, 1); } break; } @@ -1686,10 +1686,10 @@ void hero_l03_decide_state(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_action(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); break; } { @@ -1699,7 +1699,7 @@ void hero_l03_decide_state(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &unused_slot6_c) != 0) && (unused_slot6_c < FLD(g_hero_state, s32, 0x1B8))) { - hero_l03_enter_state(0x11, 1); + hero_l03_set_move_state(0x11, 1); break; } } @@ -1728,7 +1728,7 @@ void hero_l03_decide_state(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l03_enter_state(0xE, 1); + hero_l03_set_move_state(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1738,32 +1738,32 @@ void hero_l03_decide_state(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l03_enter_state(8, 1); + hero_l03_set_move_state(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l03_enter_state(0x17, 1); + hero_l03_set_move_state(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l03_enter_state(6, 1); + hero_l03_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l03_enter_state(0x79, 1); + hero_l03_set_move_state(0x79, 1); } else { - hero_l03_enter_state(0x39, 1); + hero_l03_set_move_state(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l03_enter_state(0x82, 1); + hero_l03_set_move_state(0x82, 1); } else { - hero_l03_enter_state(0, 0); + hero_l03_set_move_state(0, 0); } } break; @@ -1773,8 +1773,8 @@ void hero_l03_decide_state(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l03_enter_state(0x39, 1); - } else if (hero_l03_enter_state(0, 0) != 0) { + hero_l03_set_move_state(0x39, 1); + } else if (hero_l03_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_gadget_value(0), 0, 13.0f); } } @@ -1799,28 +1799,28 @@ void hero_l03_decide_state(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l03_enter_state(0x4E, 1); + hero_l03_set_move_state(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state(1, 1); + hero_l03_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l03_enter_state(0x41, 1); + hero_l03_set_move_state(0x41, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l03_enter_state(0x45, 1); + hero_l03_set_move_state(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l03_enter_state(0x4D, 1); + hero_l03_set_move_state(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l03_enter_state(0x40, 1); + hero_l03_set_move_state(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -1833,14 +1833,14 @@ void hero_l03_decide_state(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l03_enter_state(0x4E, 1); + hero_l03_set_move_state(0x4E, 1); break; } rec = (u8 *)&g_hero_state_params[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l03_enter_state(0x3F, 0); + hero_l03_set_move_state(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -1849,13 +1849,13 @@ void hero_l03_decide_state(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0x10) ? n : 0xF, NULL) != 0) { - hero_l03_enter_state(0x4D, 1); + hero_l03_set_move_state(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l03_enter_state(0x45, 1); + hero_l03_set_move_state(0x45, 1); } break; } @@ -1918,42 +1918,42 @@ void hero_l03_decide_state(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l03_enter_state(0x45, 1); + hero_l03_set_move_state(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l03_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l03_enter_state(0x40, 1); + hero_l03_set_move_state(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l03_enter_state(0x3F, 1); + hero_l03_set_move_state(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l03_enter_state(0x41, 1); + hero_l03_set_move_state(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 5, NULL) != 0)) { - hero_l03_enter_state(0x4D, 1); + hero_l03_set_move_state(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state(0x46, 1); + hero_l03_set_move_state(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l03_enter_state(0x4B, 1); + hero_l03_set_move_state(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l03_enter_state(0x41, 1); + hero_l03_set_move_state(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state(0x46, 1); + hero_l03_set_move_state(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -1963,11 +1963,11 @@ void hero_l03_decide_state(void) { FLD(g_hero_state, s16, 0x1EE) = 0xC - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l03_enter_state(0x40, 1); + hero_l03_set_move_state(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l03_enter_state(0x3F, 1); + hero_l03_set_move_state(0x3F, 1); } break; case 0x41: @@ -1979,29 +1979,29 @@ void hero_l03_decide_state(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l03_enter_state(0x43, 1); + hero_l03_set_move_state(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l03_enter_state(0x40, 1); + hero_l03_set_move_state(0x40, 1); } else { - hero_l03_enter_state(0x3F, 1); + hero_l03_set_move_state(0x3F, 1); } } else { - hero_l03_enter_state(0x3F, 1); + hero_l03_set_move_state(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state(0x46, 1); + hero_l03_set_move_state(0x46, 1); break; } if ((PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l03_enter_state(0x4B, 1); + hero_l03_set_move_state(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l03_enter_state(0x3F, 1); + hero_l03_set_move_state(0x3F, 1); } break; case 0x4E: @@ -2010,9 +2010,9 @@ void hero_l03_decide_state(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l03_enter_state(0x41, 1); + hero_l03_set_move_state(0x41, 1); } else { - hero_l03_enter_state(0x3F, 1); + hero_l03_set_move_state(0x3F, 1); } } break; @@ -2022,7 +2022,7 @@ void hero_l03_decide_state(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l03_enter_state(0x4E, 1); + hero_l03_set_move_state(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.025000002f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2048,55 +2048,55 @@ void hero_l03_decide_state(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l03_enter_state(0x45, 1); + hero_l03_set_move_state(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l03_enter_state(0x4D, 1); + hero_l03_set_move_state(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l03_enter_state(0x41, 1); + hero_l03_set_move_state(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l03_enter_state(0x3F, 1); + hero_l03_set_move_state(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l03_enter_state(0x41, 1); + hero_l03_set_move_state(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x24) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l03_enter_state(0x43, 1); + hero_l03_set_move_state(0x43, 1); } else { - hero_l03_enter_state(0x3F, 0); + hero_l03_set_move_state(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state(0x47, 1); + hero_l03_set_move_state(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)point_a = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l03_enter_state(0x41, 1); + hero_l03_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state(0x41, 1); + hero_l03_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l03_enter_state(0x48, 1); + hero_l03_set_move_state(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2105,7 +2105,7 @@ void hero_l03_decide_state(void) { point_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; point_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)point_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l03_enter_state(0x49, 1); + hero_l03_set_move_state(0x49, 1); } break; } @@ -2116,7 +2116,7 @@ void hero_l03_decide_state(void) { point_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; point_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)point_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l03_enter_state(0x4A, 1); + hero_l03_set_move_state(0x4A, 1); } } } @@ -2135,17 +2135,17 @@ void hero_l03_decide_state(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state(0x47, 1); + hero_l03_set_move_state(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l03_enter_state(0x41, 1); + hero_l03_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l03_enter_state(0x48, 1); + hero_l03_set_move_state(0x48, 1); } break; } @@ -2160,7 +2160,7 @@ void hero_l03_decide_state(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l03_enter_state(0, 0); + hero_l03_set_move_state(0, 0); anim = hero_get_gadget_value(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -2171,7 +2171,7 @@ void hero_l03_decide_state(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l03_enter_state(0, 0); + hero_l03_set_move_state(0, 0); } break; case 0x22: @@ -2181,12 +2181,12 @@ void hero_l03_decide_state(void) { hero_choose_jump_or_roll_move(); break; } - hero_l03_enter_state(7, 1); + hero_l03_set_move_state(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l03_enter_state(0, 0); + hero_l03_set_move_state(0, 0); } break; default: diff --git a/src/levels/03_endako/L03_003CB398-g8.c b/src/levels/03_endako/L03_003CB398-g8.c index 3c22d0cb1..63f835462 100644 --- a/src/levels/03_endako/L03_003CB398-g8.c +++ b/src/levels/03_endako/L03_003CB398-g8.c @@ -11,7 +11,7 @@ extern void hero_start_target_state(void *, int, float); extern int coll_sweep_from_object(void *, void *, int, int, int, int, float, float, float); extern int flag_is_third_pending_set(void *); extern int hero_get_target_state_kind(void); -extern s32 hero_l03_enter_state(int, int); +extern s32 hero_l03_set_move_state(int, int); extern void FastVecSub(void *, void *, void *); extern float FastVecDot(void *, void *); extern void hero_start_loader_state(int); @@ -119,7 +119,7 @@ void tube_start_update(char *actor) g_hero_state.interactionLock=1; if (hero_get_target_state_kind()==2) { moby_set_state(actor,3,-1); - hero_l03_enter_state(0x6F,1); + hero_l03_set_move_state(0x6F,1); } else { timer = H(actor,0x96); oldTimer = timer++; diff --git a/src/levels/04_barlow/L04_002D38E8.c b/src/levels/04_barlow/L04_002D38E8.c index 3efc285eb..0648665bd 100644 --- a/src/levels/04_barlow/L04_002D38E8.c +++ b/src/levels/04_barlow/L04_002D38E8.c @@ -47,7 +47,7 @@ extern HeroGroundFlags g_hero_state; extern unsigned char g_hero_input_enabled __attribute__((sda)); extern void mem_fast_helper_b(void *, int); extern float math_fabs(float); -extern s32 hero_l04_enter_state(int, int); +extern s32 hero_l04_set_move_state(int, int); /* Checks what kind of ground the hero stands on (ice, water, slippery) and sets the matching flags. */ void UpdateHeroGroundMaterialFlags(void) @@ -96,6 +96,6 @@ void UpdateHeroGroundMaterialFlags(void) math_fabs(g_hero_state.waterSurfaceZ - (g_hero_state.positionZ + 0.25f)) < 1.0f && g_hero_state.waterSurfaceZ - g_hero_state.positionZ > 0.0f && (g_hero_state.displacementZ < 0.0f || g_hero_state.moveState == 123)) - hero_l04_enter_state(124, 1); + hero_l04_set_move_state(124, 1); } diff --git a/src/levels/04_barlow/L04_002E04A8.c b/src/levels/04_barlow/L04_002E04A8.c index cfd8ffd5b..fb58acba2 100644 --- a/src/levels/04_barlow/L04_002E04A8.c +++ b/src/levels/04_barlow/L04_002E04A8.c @@ -164,7 +164,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -716,7 +716,7 @@ void hero_l04_update_state_machine(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { temp_a2 = ((Hero *)g_hero_state)->i[0x2440/4]; if (temp_a2 != -1) { @@ -1440,7 +1440,7 @@ void hero_l04_update_state_machine(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l04_state)->f[0x180/4] = 0.1f; diff --git a/src/levels/04_barlow/L04_002E7C08-state-g8.c b/src/levels/04_barlow/L04_002E7C08-state-g8.c index 957a6f50a..01f29acdf 100644 --- a/src/levels/04_barlow/L04_002E7C08-state-g8.c +++ b/src/levels/04_barlow/L04_002E7C08-state-g8.c @@ -62,8 +62,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -134,7 +134,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l04_enter_state(s32 action, s32 animate) { +s32 hero_l04_set_move_state(s32 action, s32 animate) { u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 oldStep; @@ -181,7 +181,9 @@ s32 hero_l04_enter_state(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -194,8 +196,8 @@ s32 hero_l04_enter_state(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l04_enter_state(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_enter_state(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l04_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_animation_id(0) == 0x51) set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_animation_id(0), 0, -1.0f); @@ -333,7 +335,7 @@ s32 hero_l04_enter_state(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l04_enter_state(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l04_set_move_state(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -373,12 +375,12 @@ s32 hero_l04_enter_state(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l04_enter_state(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_enter_state(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l04_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_set_move_state(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_animation_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l04_enter_state(0, 0)) set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); + if (hero_l04_set_move_state(0, 0)) set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -403,7 +405,7 @@ s32 hero_l04_enter_state(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_enter_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -545,13 +547,13 @@ s32 hero_l04_enter_state(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l04_enter_state(0x81, 1); return 0; + hero_l04_set_move_state(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l04_lock_flag_b) { hero_l04_enter_state(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l04_lock_flag_b) { hero_l04_set_move_state(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l04_enter_state(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l04_set_move_state(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -636,7 +638,7 @@ s32 hero_l04_enter_state(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -662,7 +664,7 @@ s32 hero_l04_enter_state(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -671,7 +673,7 @@ s32 hero_l04_enter_state(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -803,7 +805,7 @@ s32 hero_l04_enter_state(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -858,7 +860,7 @@ s32 hero_l04_enter_state(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -870,7 +872,7 @@ s32 hero_l04_enter_state(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth(1); @@ -892,7 +894,7 @@ s32 hero_l04_enter_state(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l04_enter_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l04_set_move_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/levels/04_barlow/L04_002EDBC8.c b/src/levels/04_barlow/L04_002EDBC8.c index 453cb54f6..7638e95de 100644 --- a/src/levels/04_barlow/L04_002EDBC8.c +++ b/src/levels/04_barlow/L04_002EDBC8.c @@ -96,7 +96,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l04_enter_state(s32, s32); +s32 hero_l04_set_move_state(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -174,7 +174,7 @@ void hero_l04_decide_state_transition(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l04_enter_state(0x39, 1); + hero_l04_set_move_state(0x39, 1); goto end; } } @@ -203,7 +203,7 @@ void hero_l04_decide_state_transition(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l04_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l04_enter_state(0x74, 1); + hero_l04_set_move_state(0x74, 1); goto end; } } @@ -214,12 +214,12 @@ void hero_l04_decide_state_transition(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state(1, 1); + hero_l04_set_move_state(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l04_enter_state(0x82, 1); + hero_l04_set_move_state(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -256,7 +256,7 @@ void hero_l04_decide_state_transition(void) { rec = g_hero_transition_records + sp40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l04_enter_state(0x3C, 1); + hero_l04_set_move_state(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -299,12 +299,12 @@ void hero_l04_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l04_enter_state(0x76, 1); + hero_l04_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); } break; } @@ -325,17 +325,17 @@ void hero_l04_decide_state_transition(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l04_lock_flag_b == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l04_enter_state(0x6E, 1); + hero_l04_set_move_state(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l04_enter_state(4, 1); + hero_l04_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l04_enter_state(0x2E, 1); + hero_l04_set_move_state(0x2E, 1); break; } { @@ -355,28 +355,28 @@ void hero_l04_decide_state_transition(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l04_enter_state(2, 1); + hero_l04_set_move_state(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state(1, 1); + hero_l04_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l04_enter_state(0x3D, 1); + hero_l04_set_move_state(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l04_enter_state(0x3D, 1); + hero_l04_set_move_state(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l04_enter_state(0, 1); + hero_l04_set_move_state(0, 1); } break; case 0x3D: @@ -385,22 +385,22 @@ void hero_l04_decide_state_transition(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state(4, 1); + hero_l04_set_move_state(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l04_enter_state(2, 1); + hero_l04_set_move_state(2, 1); break; } - hero_l04_enter_state(0, 1); + hero_l04_set_move_state(0, 1); break; case 0x39: case 0x43: @@ -439,25 +439,25 @@ void hero_l04_decide_state_transition(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l04_enter_state(0x33, 1); + hero_l04_set_move_state(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l04_enter_state(0x34, 1); + hero_l04_set_move_state(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l04_enter_state(0x32, 1); + hero_l04_set_move_state(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l04_enter_state(0x33, 1); + hero_l04_set_move_state(0x33, 1); } } break; @@ -470,81 +470,81 @@ void hero_l04_decide_state_transition(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l04_enter_state(0x32, 1); + hero_l04_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l04_enter_state(0x34, 1); + hero_l04_set_move_state(0x34, 1); } else { - hero_l04_enter_state(0x32, 1); + hero_l04_set_move_state(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l04_enter_state(0x12, 1); + hero_l04_set_move_state(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l04_enter_state(0x32, 1); + hero_l04_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l04_enter_state(0x34, 1); + hero_l04_set_move_state(0x34, 1); } else { - hero_l04_enter_state(0x32, 1); + hero_l04_set_move_state(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l04_enter_state(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l04_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l04_enter_state(0x35, 1); + hero_l04_set_move_state(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l04_enter_state(0x12, 1); + hero_l04_set_move_state(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l04_enter_state(0x32, 1); + hero_l04_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l04_enter_state(0x34, 1); + hero_l04_set_move_state(0x34, 1); } else { - hero_l04_enter_state(0x32, 1); + hero_l04_set_move_state(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l04_enter_state(0x70, 0); + hero_l04_set_move_state(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l04_enter_state(0x36, 1); + hero_l04_set_move_state(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state(0x67, 1); + hero_l04_set_move_state(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state(0x33, 1); + hero_l04_set_move_state(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l04_enter_state(0x33, 0); + hero_l04_set_move_state(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state(0x67, 1); + hero_l04_set_move_state(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l04_enter_state(0x36, 0); + hero_l04_set_move_state(0x36, 0); } break; case 0x1: @@ -578,9 +578,9 @@ void hero_l04_decide_state_transition(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state(4, 1); + hero_l04_set_move_state(4, 1); } else { - hero_l04_enter_state(0, 0); + hero_l04_set_move_state(0, 0); anim = hero_get_weapon_animation_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -592,9 +592,9 @@ void hero_l04_decide_state_transition(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l04_enter_state(0, 0); + hero_l04_set_move_state(0, 0); } else { - hero_l04_enter_state(0, 1); + hero_l04_set_move_state(0, 1); } } break; @@ -627,7 +627,7 @@ void hero_l04_decide_state_transition(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state(7, 1); + hero_l04_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -636,7 +636,7 @@ void hero_l04_decide_state_transition(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l04_enter_state(0, 0); + hero_l04_set_move_state(0, 0); } break; } @@ -658,7 +658,7 @@ void hero_l04_decide_state_transition(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state(7, 1); + hero_l04_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -671,7 +671,7 @@ void hero_l04_decide_state_transition(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l04_enter_state(2, 0); + hero_l04_set_move_state(2, 0); set_hero_animation(3, g_hero_l04_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -682,22 +682,22 @@ void hero_l04_decide_state_transition(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l04_enter_state(2, 1); + hero_l04_set_move_state(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l04_enter_state(0, 0); + hero_l04_set_move_state(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state(0, 0); + hero_l04_set_move_state(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l04_enter_state(0, 1); + hero_l04_set_move_state(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -714,7 +714,7 @@ void hero_l04_decide_state_transition(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state(7, 1); + hero_l04_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -723,7 +723,7 @@ void hero_l04_decide_state_transition(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l04_enter_state(0, 0); + hero_l04_set_move_state(0, 0); set_hero_animation(hero_get_weapon_animation_id(0), 0, 15.0f); break; } @@ -735,7 +735,7 @@ void hero_l04_decide_state_transition(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state(0, 1); + hero_l04_set_move_state(0, 1); } break; case 0x2: @@ -749,11 +749,11 @@ void hero_l04_decide_state_transition(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l04_enter_state(0x76, 1); + hero_l04_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); break; } n = 9; @@ -767,12 +767,12 @@ void hero_l04_decide_state_transition(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l04_enter_state(9, 1); + hero_l04_set_move_state(9, 1); } else { - hero_l04_enter_state(7, 1); + hero_l04_set_move_state(7, 1); } } else { - hero_l04_enter_state(7, 1); + hero_l04_set_move_state(7, 1); } break; } @@ -780,11 +780,11 @@ void hero_l04_decide_state_transition(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state(1, 1); + hero_l04_set_move_state(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state(4, 1); + hero_l04_set_move_state(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -801,21 +801,21 @@ void hero_l04_decide_state_transition(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l04_enter_state(0x2E, 1); + hero_l04_set_move_state(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l04_enter_state(2, 1); + hero_l04_set_move_state(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l04_enter_state(0x70, 1); + hero_l04_set_move_state(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l04_enter_state(2, 1); + hero_l04_set_move_state(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -826,7 +826,7 @@ void hero_l04_decide_state_transition(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l04_enter_state(0, 0) == 0) { + if (hero_l04_set_move_state(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -843,7 +843,7 @@ void hero_l04_decide_state_transition(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l04_enter_state(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l04_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 17.0f); } if (FLD(hero_moby, u8, 0x43) == 0x37) { @@ -864,7 +864,7 @@ void hero_l04_decide_state_transition(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l04_enter_state(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l04_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -898,17 +898,17 @@ void hero_l04_decide_state_transition(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l04_enter_state(3, 0); + hero_l04_set_move_state(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l04_enter_state(0x77, 1); + hero_l04_set_move_state(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l04_enter_state(0x77, 1); + hero_l04_set_move_state(0x77, 1); break; } } @@ -926,11 +926,11 @@ void hero_l04_decide_state_transition(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l04_enter_state(0x64, 1); + hero_l04_set_move_state(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l04_enter_state(0x63, 1); + hero_l04_set_move_state(0x63, 1); } } else { hero_update_anim_scale(); @@ -938,38 +938,38 @@ void hero_l04_decide_state_transition(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state(0x62, 1); + hero_l04_set_move_state(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l04_enter_state(0, 1); + hero_l04_set_move_state(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l04_enter_state(0x62, 1); + hero_l04_set_move_state(0x62, 1); } break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state(1, 1); + hero_l04_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l04_enter_state(7, 1); + hero_l04_set_move_state(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state(4, 1); + hero_l04_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state(0, 1); + hero_l04_set_move_state(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -977,45 +977,45 @@ void hero_l04_decide_state_transition(void) { } if (hero_get_weapon_animation_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l04_enter_state(0, 0); + hero_l04_set_move_state(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l04_enter_state(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l04_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l04_enter_state(2, 1); + hero_l04_set_move_state(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state(1, 1); + hero_l04_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state(0, 0); + hero_l04_set_move_state(0, 0); set_hero_animation(hero_get_weapon_animation_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l04_enter_state(0x76, 1); + hero_l04_set_move_state(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l04_enter_state(0x15, 1); + hero_l04_set_move_state(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l04_enter_state(0, 1); + hero_l04_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1023,17 +1023,17 @@ void hero_l04_decide_state_transition(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l04_enter_state(0x8B, 1); + hero_l04_set_move_state(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l04_enter_state(0, 1); + hero_l04_set_move_state(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l04_enter_state(0, 1); + hero_l04_set_move_state(0, 1); } break; case 0x24: @@ -1059,14 +1059,14 @@ void hero_l04_decide_state_transition(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l04_enter_state(0, 0); + hero_l04_set_move_state(0, 0); set_hero_animation(hero_get_weapon_animation_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l04_enter_state(6, 0); + hero_l04_set_move_state(6, 0); } else { - hero_l04_enter_state(6, 0); + hero_l04_set_move_state(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1082,9 +1082,9 @@ void hero_l04_decide_state_transition(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l04_enter_state(0, 1); + hero_l04_set_move_state(0, 1); } else { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1096,7 +1096,7 @@ void hero_l04_decide_state_transition(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l04_enter_state(0x2C, 1); + hero_l04_set_move_state(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1104,7 +1104,7 @@ void hero_l04_decide_state_transition(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l04_enter_state(0x18, 0); + hero_l04_set_move_state(0x18, 0); } break; case 0x18: @@ -1113,18 +1113,18 @@ void hero_l04_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l04_enter_state(0x1B, 1); + hero_l04_set_move_state(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1133,7 +1133,7 @@ void hero_l04_decide_state_transition(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l04_enter_state(0x19, 1); + hero_l04_set_move_state(0x19, 1); } break; } @@ -1144,7 +1144,7 @@ void hero_l04_decide_state_transition(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l04_enter_state(0x1A, 1); + hero_l04_set_move_state(0x1A, 1); } } } @@ -1163,18 +1163,18 @@ void hero_l04_decide_state_transition(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state(0x18, 1); + hero_l04_set_move_state(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l04_enter_state(0x1B, 1); + hero_l04_set_move_state(0x1B, 1); } break; } @@ -1184,9 +1184,9 @@ void hero_l04_decide_state_transition(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); } else { - hero_l04_enter_state(0, 1); + hero_l04_set_move_state(0, 1); } } break; @@ -1210,12 +1210,12 @@ void hero_l04_decide_state_transition(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state(0x39, 1); + hero_l04_set_move_state(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l04_enter_state(0, 0) != 0) { + if (hero_l04_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1223,7 +1223,7 @@ void hero_l04_decide_state_transition(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l04_enter_state(0, 0) != 0) { + if (hero_l04_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1237,28 +1237,28 @@ void hero_l04_decide_state_transition(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l04_enter_state(2, 1); + hero_l04_set_move_state(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l04_enter_state(3, 0) != 0) { + if (hero_l04_set_move_state(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l04_enter_state(0, 1); + hero_l04_set_move_state(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l04_enter_state(8, 1); + hero_l04_set_move_state(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l04_enter_state(0x17, 1); + hero_l04_set_move_state(0x17, 1); break; } } @@ -1290,7 +1290,7 @@ void hero_l04_decide_state_transition(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l04_enter_state(0, 0) != 0) { + if (hero_l04_set_move_state(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1301,12 +1301,12 @@ void hero_l04_decide_state_transition(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l04_enter_state(0x74, 1); + hero_l04_set_move_state(0x74, 1); } else { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); } } else { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); } } break; @@ -1319,16 +1319,16 @@ void hero_l04_decide_state_transition(void) { ok = 1; } if (ok != 0) { - hero_l04_enter_state(0x11, 1); + hero_l04_set_move_state(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l04_enter_state(0x17, 1); + hero_l04_set_move_state(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1339,23 +1339,23 @@ void hero_l04_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l04_enter_state(3, 0) != 0) { + if (hero_l04_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state(4, 1); + hero_l04_set_move_state(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l04_speed_params[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l04_enter_state(2, 1); + hero_l04_set_move_state(2, 1); break; } - hero_l04_enter_state(2, 0); + hero_l04_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1364,21 +1364,21 @@ void hero_l04_decide_state_transition(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l04_speed_params[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l04_enter_state(2, 1); + hero_l04_set_move_state(2, 1); break; } - hero_l04_enter_state(2, 0); + hero_l04_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l04_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l04_enter_state(0, 0) != 0) { + if (hero_l04_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_animation_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l04_enter_state(0, 0) != 0) { + } else if (hero_l04_set_move_state(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1424,14 +1424,14 @@ void hero_l04_decide_state_transition(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state(0xB, 1); + hero_l04_set_move_state(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l04_enter_state(0x82, 1); + hero_l04_set_move_state(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1440,21 +1440,21 @@ void hero_l04_decide_state_transition(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l04_enter_state(0xA, 1); + hero_l04_set_move_state(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l04_enter_state(0x10, 1); + hero_l04_set_move_state(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l04_enter_state(0x77, 1); + hero_l04_set_move_state(0x77, 1); break; } } @@ -1558,7 +1558,7 @@ void hero_l04_decide_state_transition(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l04_enter_state(3, 0) != 0) { + if (hero_l04_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1566,13 +1566,13 @@ void hero_l04_decide_state_transition(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l04_speed_params[0][2])) { - hero_l04_enter_state(7, 1); + hero_l04_set_move_state(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l04_enter_state(7, 1); + hero_l04_set_move_state(7, 1); } else if (g_hero_l04_speed_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l04_enter_state(9, 1); + hero_l04_set_move_state(9, 1); } else { - hero_l04_enter_state(7, 1); + hero_l04_set_move_state(7, 1); } break; } @@ -1580,10 +1580,10 @@ void hero_l04_decide_state_transition(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); break; } { @@ -1593,7 +1593,7 @@ void hero_l04_decide_state_transition(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l04_enter_state(0x11, 1); + hero_l04_set_move_state(0x11, 1); break; } } @@ -1622,7 +1622,7 @@ void hero_l04_decide_state_transition(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l04_enter_state(0xE, 1); + hero_l04_set_move_state(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1632,28 +1632,28 @@ void hero_l04_decide_state_transition(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l04_enter_state(8, 1); + hero_l04_set_move_state(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l04_enter_state(0x17, 1); + hero_l04_set_move_state(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l04_enter_state(6, 1); + hero_l04_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state(0x39, 1); + hero_l04_set_move_state(0x39, 1); } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l04_enter_state(0x82, 1); + hero_l04_set_move_state(0x82, 1); } else { - hero_l04_enter_state(0, 0); + hero_l04_set_move_state(0, 0); } } break; @@ -1663,8 +1663,8 @@ void hero_l04_decide_state_transition(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state(0x39, 1); - } else if (hero_l04_enter_state(0, 0) != 0) { + hero_l04_set_move_state(0x39, 1); + } else if (hero_l04_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 13.0f); } } @@ -1685,7 +1685,7 @@ void hero_l04_decide_state_transition(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l04_enter_state(0, 0); + hero_l04_set_move_state(0, 0); anim = hero_get_weapon_animation_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1696,7 +1696,7 @@ void hero_l04_decide_state_transition(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l04_enter_state(0, 0); + hero_l04_set_move_state(0, 0); } break; case 0x22: @@ -1706,12 +1706,12 @@ void hero_l04_decide_state_transition(void) { hero_choose_jump_or_roll_move(); break; } - hero_l04_enter_state(7, 1); + hero_l04_set_move_state(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l04_enter_state(0, 0); + hero_l04_set_move_state(0, 0); } break; default: diff --git a/src/levels/05_feltzin_system/L05_0041DA20-g8.c b/src/levels/05_feltzin_system/L05_0041DA20-g8.c index 15b8ae0e1..69f62b046 100644 --- a/src/levels/05_feltzin_system/L05_0041DA20-g8.c +++ b/src/levels/05_feltzin_system/L05_0041DA20-g8.c @@ -32,7 +32,7 @@ extern char *g_feltzin_target_mobys[] __attribute__((sda)); extern int slot_find_active_in_chain(int); extern void hero_set_state_value_a(int), hero_set_state_value_b(int), level_select_random_object(void); extern void level_store_pair_with_increment(int, int), moby_set_flag_bit(void *, int); -extern int hero_l00_set_action(int, int); +extern int hero_l00_set_move_state(int, int); extern void hero_set_state_value_c(int); extern int LockedEntryMenuInput(void); extern void ship_save_transform_state(void); @@ -152,7 +152,7 @@ void feltzin_challenge_controller_update(char *object) g_feltzin_frame_counter = 0; } if (g_feltzin_frame_counter++ < 5 || g_game_mode_a[0] == 2) break; - hero_l00_set_action(0x31,0); + hero_l00_set_move_state(0x31,0); if (g_feltzin_needs_reset) { hero_set_state_value_c(1); g_feltzin_menu_mode = LockedEntryMenuInput(); diff --git a/src/levels/06_notak/L06_00419CA8-g8.c b/src/levels/06_notak/L06_00419CA8-g8.c index bddb6094f..7fd293085 100644 --- a/src/levels/06_notak/L06_00419CA8-g8.c +++ b/src/levels/06_notak/L06_00419CA8-g8.c @@ -56,7 +56,7 @@ extern float mat_fast_helper_a(float,float); extern float math_fabs(float); extern int PadPressedWithin(int,int,int); extern float fast_vec_dist(void *,void *); -extern int hero_l00_set_action(int,int); +extern int hero_l00_set_move_state(int,int); extern void SetCamera5Pose(void *,void *,int,int,int); extern void cam_set_state_rotation(void *); extern void object_copy_vector_to_selected(void *); @@ -124,7 +124,7 @@ void UpdateBoltCrank(char *obj) if(fast_vec_dist(obj+0x10,nearby+0x10)<3.25f) {clear=0;break;} } if(clear) { - hero_l00_set_action(0x37,1); + hero_l00_set_move_state(0x37,1); SetCamera5Pose(g_hero_l06_position.position,g_hero_l06_position.rotation,3,0xB4,0); cam_set_state_rotation(g_region_table+(I(ctx,0x20)<<7)+0x70); object_copy_vector_to_selected(g_region_table+(I(ctx,0x20)<<7)+0x30); @@ -152,7 +152,7 @@ void UpdateBoltCrank(char *obj) temp.q=0; temp.f[2]=g_hero_l06_position.rotation[2]; axis.q=temp.q; angle=mat_fast_helper_a(g_hero_state.position[0]-F(obj,0x10),g_hero_state.position[1]-F(obj,0x14)); if((PadPressedWithin(0x80,7,0) && g_hero_state.modeTimer>=61) || F(ctx,0)==1.0f) { - hero_l00_set_action(0,1); + hero_l00_set_move_state(0,1); if(I(ctx,0x38)) {U(obj,0x20)=1;} else if(F(ctx,0)==1.0f) { diff --git a/src/levels/06_notak/L06_0045A5B0-g16.c b/src/levels/06_notak/L06_0045A5B0-g16.c index 2ec10da41..ffdf72e8d 100644 --- a/src/levels/06_notak/L06_0045A5B0-g16.c +++ b/src/levels/06_notak/L06_0045A5B0-g16.c @@ -46,7 +46,7 @@ extern int IsPointInCuboid(void *, int); extern void *part_spawn_drifting(void *, void *, int, float, float); extern int PlayMobySound(int, int, void *); extern void RippleDisturb(int, int, int, float, float, float, float); -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern void moby_update_empty_alt(void *, void *, void *); extern float math_turn_angle_toward_target(void *, float, float, float, float, float); extern int math_blend_scaled_count(void *, void *, int, int, float, float); @@ -334,7 +334,7 @@ void UpdateMoby4070(u8 *self) { FastVecSub(vars + 0xC0, self_pos_c, &vec_prev_pos); if (F(vars, 0x13C) >= 1.0f) { ((Hero *)g_hero_state)->i[0x24CC / 4] = 0; - hero_l00_set_action(0x39, 1); + hero_l00_set_move_state(0x39, 1); W(((Hero *)g_hero_state)->ptr[0x2290 / 4], 0x9C) = -1; ((Hero *)g_hero_state)->b[0x22B5] = 1; B(self, 0x20) = 6; diff --git a/src/levels/07_siberius/L07_002AC078-flags.c b/src/levels/07_siberius/L07_002AC078-flags.c index 74559410e..62d4885ec 100644 --- a/src/levels/07_siberius/L07_002AC078-flags.c +++ b/src/levels/07_siberius/L07_002AC078-flags.c @@ -7,7 +7,7 @@ extern int g_current_map_index __attribute__((sda)); extern u8 g_hero_input_enabled __attribute__((sda)); extern void mem_fast_helper_b(void *, int); extern float math_fabs(float); -extern int hero_l07_enter_state(int, int); +extern int hero_l07_set_move_state(int, int); typedef int Quadword __attribute__((mode(TI))); typedef union { Quadword word; float f[4]; } Vector; typedef struct { @@ -82,30 +82,30 @@ void hero_queue_action_from_input(void) if (command == 12) g_hero_state.hover = 1; if (g_hero_state.attack && active && g_hero_state.movement != 16 && g_hero_state.movement != 20 && g_hero_state.movement != 7) { - hero_l07_enter_state(0x30, 1); + hero_l07_set_move_state(0x30, 1); return; } if (g_hero_state.flag149c && g_hero_state.state != 0x7c && math_fabs(g_hero_state.jumpTime2-(g_hero_state.position.f[2]+0.25f)) < 1.0f && g_hero_state.jumpTime2-g_hero_state.position.f[2] > 0.0f && (g_hero_state.motion.f[2] < 0.0f || g_hero_state.state == 0x7b)) { - hero_l07_enter_state(0x7c,1); return; + hero_l07_set_move_state(0x7c,1); return; } if (g_hero_state.jump && g_hero_state.state != 0x65 && g_hero_state.state != 0x78 && math_fabs(g_hero_state.jumpTime-(g_hero_state.position.f[2]+0.25f)) < 1.0f && g_hero_state.jumpTime-g_hero_state.position.f[2] > 0.0f && (g_hero_state.state != 0x66 || g_hero_state.animationDone) && (g_hero_state.motion.f[2] < 0.0f || g_hero_state.state == 0x7b)) { - if (!g_hero_state.health) { hero_l07_enter_state(0x78,1); return; } - hero_l07_enter_state(0x65,1); return; + if (!g_hero_state.health) { hero_l07_set_move_state(0x78,1); return; } + hero_l07_set_move_state(0x65,1); return; } if (!g_hero_state.cancel || g_hero_state.state == 0x78 || g_hero_state.state == 0x74) return; if (!(math_fabs(g_hero_state.jumpTime-(g_hero_state.position.f[2]+0.25f)) < 1.0f)) return; if (!(g_hero_state.jumpTime-g_hero_state.position.f[2] > 0.0f)) return; if (!(g_hero_state.motion.f[2] < 0.0f) && g_hero_state.state != 0x7b) return; if (g_current_map_index == 13) { - hero_l07_enter_state(0x74, 1); + hero_l07_set_move_state(0x74, 1); return; } - hero_l07_enter_state(0x78, 1); + hero_l07_set_move_state(0x78, 1); } diff --git a/src/levels/07_siberius/L07_002B8618.c b/src/levels/07_siberius/L07_002B8618.c index c22e70793..2a901a2d2 100644 --- a/src/levels/07_siberius/L07_002B8618.c +++ b/src/levels/07_siberius/L07_002B8618.c @@ -161,7 +161,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -180,7 +180,7 @@ extern s32 shooter_update_ranged_attack(s32); extern s32 hero_get_weapon_anim_id(s32); extern void hero_exit_vehicle_mode(s32); extern void ClipHeroVelocityAgainstWall(s32); -extern s32 hero_l20_set_state(s32, s32); +extern s32 hero_l20_set_move_state(s32, s32); /* Runs the hero's behaviour every frame for the current state, such as walking, jumping, swimming or falling. */ void hero_l07_update_state_machine(void) { f32 speed62; @@ -1033,7 +1033,7 @@ void hero_l07_update_state_machine(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l07_state_block)->f[0x180/4] = 0.1f; diff --git a/src/levels/07_siberius/L07_002BE770-state-g8.c b/src/levels/07_siberius/L07_002BE770-state-g8.c index 9029b6e1d..a141ef818 100644 --- a/src/levels/07_siberius/L07_002BE770-state-g8.c +++ b/src/levels/07_siberius/L07_002BE770-state-g8.c @@ -63,8 +63,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -132,7 +132,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l07_enter_state(s32 action, s32 animate) { +s32 hero_l07_set_move_state(s32 action, s32 animate) { u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 oldStep; @@ -179,7 +179,9 @@ s32 hero_l07_enter_state(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -192,7 +194,7 @@ s32 hero_l07_enter_state(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_enter_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_anim_id(0) == 0x51) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_anim_id(0), 0, -1.0f); @@ -251,7 +253,7 @@ s32 hero_l07_enter_state(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l07_enter_state(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l07_set_move_state(0x76, 1); return 0; } } WORD(0x2298) = 0; BYTE(0x40C) = 0; BYTE(0x40E) = 0; @@ -287,11 +289,11 @@ s32 hero_l07_enter_state(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_enter_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_set_move_state(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_anim_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l07_enter_state(0, 0)) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); + if (hero_l07_set_move_state(0, 0)) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -316,7 +318,7 @@ s32 hero_l07_enter_state(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_enter_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -458,13 +460,13 @@ s32 hero_l07_enter_state(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l07_enter_state(0x81, 1); return 0; + hero_l07_set_move_state(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l07_busy_flag) { hero_l07_enter_state(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l07_busy_flag) { hero_l07_set_move_state(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l07_enter_state(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l07_set_move_state(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -541,7 +543,7 @@ s32 hero_l07_enter_state(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -567,7 +569,7 @@ s32 hero_l07_enter_state(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -576,7 +578,7 @@ s32 hero_l07_enter_state(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -708,7 +710,7 @@ s32 hero_l07_enter_state(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -778,7 +780,7 @@ s32 hero_l07_enter_state(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -790,7 +792,7 @@ s32 hero_l07_enter_state(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth(1); @@ -824,7 +826,7 @@ s32 hero_l07_enter_state(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l07_enter_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l07_set_move_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/levels/07_siberius/L07_002C3CC0.c b/src/levels/07_siberius/L07_002C3CC0.c index 170847deb..1b01c1540 100644 --- a/src/levels/07_siberius/L07_002C3CC0.c +++ b/src/levels/07_siberius/L07_002C3CC0.c @@ -95,7 +95,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_refresh_speed_from_timer(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l07_enter_state(s32, s32); +s32 hero_l07_set_move_state(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -173,7 +173,7 @@ void hero_l07_decide_state_transition(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l07_enter_state(0x39, 1); + hero_l07_set_move_state(0x39, 1); goto end; } } @@ -202,7 +202,7 @@ void hero_l07_decide_state_transition(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l07_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l07_enter_state(0x74, 1); + hero_l07_set_move_state(0x74, 1); goto end; } } @@ -212,12 +212,12 @@ void hero_l07_decide_state_transition(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state(1, 1); + hero_l07_set_move_state(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l07_enter_state(0x82, 1); + hero_l07_set_move_state(0x82, 1); break; } { @@ -253,7 +253,7 @@ void hero_l07_decide_state_transition(void) { rec = g_hero_move_table + selected_move * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l07_enter_state(0x3C, 1); + hero_l07_set_move_state(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -296,12 +296,12 @@ void hero_l07_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l07_enter_state(0x76, 1); + hero_l07_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); } break; } @@ -322,12 +322,12 @@ void hero_l07_decide_state_transition(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l07_busy_flag == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l07_enter_state(0x6E, 1); + hero_l07_set_move_state(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l07_enter_state(4, 1); + hero_l07_set_move_state(4, 1); break; } } @@ -348,28 +348,28 @@ void hero_l07_decide_state_transition(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l07_enter_state(2, 1); + hero_l07_set_move_state(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state(1, 1); + hero_l07_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_buttons = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_buttons & 8)) { - hero_l07_enter_state(0x3D, 1); + hero_l07_set_move_state(0x3D, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l07_enter_state(0x3D, 1); + hero_l07_set_move_state(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l07_enter_state(0, 1); + hero_l07_set_move_state(0, 1); } break; case 0x3D: @@ -378,22 +378,22 @@ void hero_l07_decide_state_transition(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state(4, 1); + hero_l07_set_move_state(4, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l07_enter_state(2, 1); + hero_l07_set_move_state(2, 1); break; } - hero_l07_enter_state(0, 1); + hero_l07_set_move_state(0, 1); break; case 0x39: case 0x43: @@ -449,9 +449,9 @@ void hero_l07_decide_state_transition(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state(4, 1); + hero_l07_set_move_state(4, 1); } else { - hero_l07_enter_state(0, 0); + hero_l07_set_move_state(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -463,9 +463,9 @@ void hero_l07_decide_state_transition(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l07_enter_state(0, 0); + hero_l07_set_move_state(0, 0); } else { - hero_l07_enter_state(0, 1); + hero_l07_set_move_state(0, 1); } } break; @@ -498,7 +498,7 @@ void hero_l07_decide_state_transition(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state(7, 1); + hero_l07_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -507,7 +507,7 @@ void hero_l07_decide_state_transition(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l07_enter_state(0, 0); + hero_l07_set_move_state(0, 0); } break; } @@ -529,7 +529,7 @@ void hero_l07_decide_state_transition(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state(7, 1); + hero_l07_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -542,7 +542,7 @@ void hero_l07_decide_state_transition(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l07_enter_state(2, 0); + hero_l07_set_move_state(2, 0); set_hero_animation(3, g_hero_l07_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -553,22 +553,22 @@ void hero_l07_decide_state_transition(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l07_enter_state(2, 1); + hero_l07_set_move_state(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l07_enter_state(0, 0); + hero_l07_set_move_state(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state(0, 0); + hero_l07_set_move_state(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l07_enter_state(0, 1); + hero_l07_set_move_state(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -585,7 +585,7 @@ void hero_l07_decide_state_transition(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state(7, 1); + hero_l07_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -594,7 +594,7 @@ void hero_l07_decide_state_transition(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l07_enter_state(0, 0); + hero_l07_set_move_state(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, 15.0f); break; } @@ -606,7 +606,7 @@ void hero_l07_decide_state_transition(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state(0, 1); + hero_l07_set_move_state(0, 1); } break; case 0x2: @@ -620,11 +620,11 @@ void hero_l07_decide_state_transition(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l07_enter_state(0x76, 1); + hero_l07_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); break; } n = 9; @@ -638,12 +638,12 @@ void hero_l07_decide_state_transition(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l07_enter_state(9, 1); + hero_l07_set_move_state(9, 1); } else { - hero_l07_enter_state(7, 1); + hero_l07_set_move_state(7, 1); } } else { - hero_l07_enter_state(7, 1); + hero_l07_set_move_state(7, 1); } break; } @@ -651,11 +651,11 @@ void hero_l07_decide_state_transition(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state(1, 1); + hero_l07_set_move_state(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state(4, 1); + hero_l07_set_move_state(4, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -666,7 +666,7 @@ void hero_l07_decide_state_transition(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l07_enter_state(0, 0) == 0) { + if (hero_l07_set_move_state(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -706,17 +706,17 @@ void hero_l07_decide_state_transition(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l07_enter_state(3, 0); + hero_l07_set_move_state(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l07_enter_state(0x77, 1); + hero_l07_set_move_state(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l07_enter_state(0x77, 1); + hero_l07_set_move_state(0x77, 1); break; } } @@ -734,11 +734,11 @@ void hero_l07_decide_state_transition(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l07_enter_state(0x64, 1); + hero_l07_set_move_state(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l07_enter_state(0x63, 1); + hero_l07_set_move_state(0x63, 1); } } else { hero_update_anim_scale(); @@ -746,22 +746,22 @@ void hero_l07_decide_state_transition(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state(0x62, 1); + hero_l07_set_move_state(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l07_enter_state(0, 1); + hero_l07_set_move_state(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l07_enter_state(0x62, 1); + hero_l07_set_move_state(0x62, 1); } break; case 0x65: { s32 n = FLD(g_hero_state, s32, 0x18C0); if ((n < 3) && (((n * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40, 7, &special_cost) != 0)) { - hero_l07_enter_state(0x66, 1); + hero_l07_set_move_state(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -789,7 +789,7 @@ void hero_l07_decide_state_transition(void) { s32 off = FLD(g_hero_state, s16, 0xBFC) * 0x2C; rec -= -off; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l07_enter_state(0, 1); + hero_l07_set_move_state(0, 1); } break; } @@ -803,7 +803,7 @@ void hero_l07_decide_state_transition(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l07_enter_state(0, 0) != 0) { + if (hero_l07_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 17.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -811,25 +811,25 @@ void hero_l07_decide_state_transition(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state(1, 1); + hero_l07_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l07_enter_state(7, 1); + hero_l07_set_move_state(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state(4, 1); + hero_l07_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state(0, 1); + hero_l07_set_move_state(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -837,45 +837,45 @@ void hero_l07_decide_state_transition(void) { } if (hero_get_weapon_anim_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l07_enter_state(0, 0); + hero_l07_set_move_state(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l07_enter_state(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l07_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l07_enter_state(2, 1); + hero_l07_set_move_state(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state(1, 1); + hero_l07_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state(0, 0); + hero_l07_set_move_state(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l07_enter_state(0x76, 1); + hero_l07_set_move_state(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l07_enter_state(0x15, 1); + hero_l07_set_move_state(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l07_enter_state(0, 1); + hero_l07_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -883,17 +883,17 @@ void hero_l07_decide_state_transition(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l07_enter_state(0x8B, 1); + hero_l07_set_move_state(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l07_enter_state(0, 1); + hero_l07_set_move_state(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l07_enter_state(0, 1); + hero_l07_set_move_state(0, 1); } break; case 0x24: @@ -919,14 +919,14 @@ void hero_l07_decide_state_transition(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l07_enter_state(0, 0); + hero_l07_set_move_state(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l07_enter_state(6, 0); + hero_l07_set_move_state(6, 0); } else { - hero_l07_enter_state(6, 0); + hero_l07_set_move_state(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -942,9 +942,9 @@ void hero_l07_decide_state_transition(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l07_enter_state(0, 1); + hero_l07_set_move_state(0, 1); } else { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -956,7 +956,7 @@ void hero_l07_decide_state_transition(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l07_enter_state(0x2C, 1); + hero_l07_set_move_state(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -964,7 +964,7 @@ void hero_l07_decide_state_transition(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l07_enter_state(0x18, 0); + hero_l07_set_move_state(0x18, 0); } break; case 0x18: @@ -973,18 +973,18 @@ void hero_l07_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l07_enter_state(0x1B, 1); + hero_l07_set_move_state(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -993,7 +993,7 @@ void hero_l07_decide_state_transition(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l07_enter_state(0x19, 1); + hero_l07_set_move_state(0x19, 1); } break; } @@ -1004,7 +1004,7 @@ void hero_l07_decide_state_transition(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l07_enter_state(0x1A, 1); + hero_l07_set_move_state(0x1A, 1); } } } @@ -1023,18 +1023,18 @@ void hero_l07_decide_state_transition(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state(0x18, 1); + hero_l07_set_move_state(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l07_enter_state(0x1B, 1); + hero_l07_set_move_state(0x1B, 1); } break; } @@ -1044,9 +1044,9 @@ void hero_l07_decide_state_transition(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); } else { - hero_l07_enter_state(0, 1); + hero_l07_set_move_state(0, 1); } } break; @@ -1070,12 +1070,12 @@ void hero_l07_decide_state_transition(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l07_enter_state(0x39, 1); + hero_l07_set_move_state(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l07_enter_state(0, 0) != 0) { + if (hero_l07_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1083,7 +1083,7 @@ void hero_l07_decide_state_transition(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l07_enter_state(0, 0) != 0) { + if (hero_l07_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1097,28 +1097,28 @@ void hero_l07_decide_state_transition(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l07_enter_state(2, 1); + hero_l07_set_move_state(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l07_enter_state(3, 0) != 0) { + if (hero_l07_set_move_state(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l07_enter_state(0, 1); + hero_l07_set_move_state(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l07_enter_state(8, 1); + hero_l07_set_move_state(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l07_enter_state(0x17, 1); + hero_l07_set_move_state(0x17, 1); break; } } @@ -1150,7 +1150,7 @@ void hero_l07_decide_state_transition(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l07_enter_state(0, 0) != 0) { + if (hero_l07_set_move_state(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1161,12 +1161,12 @@ void hero_l07_decide_state_transition(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l07_enter_state(0x74, 1); + hero_l07_set_move_state(0x74, 1); } else { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); } } else { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); } } break; @@ -1179,16 +1179,16 @@ void hero_l07_decide_state_transition(void) { ok = 1; } if (ok != 0) { - hero_l07_enter_state(0x11, 1); + hero_l07_set_move_state(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l07_enter_state(0x17, 1); + hero_l07_set_move_state(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1199,23 +1199,23 @@ void hero_l07_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l07_enter_state(3, 0) != 0) { + if (hero_l07_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state(4, 1); + hero_l07_set_move_state(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l07_speed_thresholds[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l07_enter_state(2, 1); + hero_l07_set_move_state(2, 1); break; } - hero_l07_enter_state(2, 0); + hero_l07_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1224,21 +1224,21 @@ void hero_l07_decide_state_transition(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l07_speed_thresholds[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l07_enter_state(2, 1); + hero_l07_set_move_state(2, 1); break; } - hero_l07_enter_state(2, 0); + hero_l07_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l07_extra_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l07_enter_state(0, 0) != 0) { + if (hero_l07_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l07_enter_state(0, 0) != 0) { + } else if (hero_l07_set_move_state(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1284,14 +1284,14 @@ void hero_l07_decide_state_transition(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state(0xB, 1); + hero_l07_set_move_state(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l07_enter_state(0x82, 1); + hero_l07_set_move_state(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1300,21 +1300,21 @@ void hero_l07_decide_state_transition(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l07_enter_state(0xA, 1); + hero_l07_set_move_state(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l07_enter_state(0x10, 1); + hero_l07_set_move_state(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l07_enter_state(0x77, 1); + hero_l07_set_move_state(0x77, 1); break; } } @@ -1418,7 +1418,7 @@ void hero_l07_decide_state_transition(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l07_enter_state(3, 0) != 0) { + if (hero_l07_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1426,13 +1426,13 @@ void hero_l07_decide_state_transition(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l07_speed_thresholds[0][2])) { - hero_l07_enter_state(7, 1); + hero_l07_set_move_state(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l07_enter_state(7, 1); + hero_l07_set_move_state(7, 1); } else if (g_hero_l07_speed_thresholds[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l07_enter_state(9, 1); + hero_l07_set_move_state(9, 1); } else { - hero_l07_enter_state(7, 1); + hero_l07_set_move_state(7, 1); } break; } @@ -1440,10 +1440,10 @@ void hero_l07_decide_state_transition(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_action(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); break; } { @@ -1453,7 +1453,7 @@ void hero_l07_decide_state_transition(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &special_cost_limit) != 0) && (special_cost_limit < FLD(g_hero_state, s32, 0x1B8))) { - hero_l07_enter_state(0x11, 1); + hero_l07_set_move_state(0x11, 1); break; } } @@ -1482,7 +1482,7 @@ void hero_l07_decide_state_transition(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l07_enter_state(0xE, 1); + hero_l07_set_move_state(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1492,28 +1492,28 @@ void hero_l07_decide_state_transition(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l07_enter_state(8, 1); + hero_l07_set_move_state(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l07_enter_state(0x17, 1); + hero_l07_set_move_state(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l07_enter_state(6, 1); + hero_l07_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l07_enter_state(0x39, 1); + hero_l07_set_move_state(0x39, 1); } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l07_enter_state(0x82, 1); + hero_l07_set_move_state(0x82, 1); } else { - hero_l07_enter_state(0, 0); + hero_l07_set_move_state(0, 0); } } break; @@ -1523,8 +1523,8 @@ void hero_l07_decide_state_transition(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l07_enter_state(0x39, 1); - } else if (hero_l07_enter_state(0, 0) != 0) { + hero_l07_set_move_state(0x39, 1); + } else if (hero_l07_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 13.0f); } } @@ -1545,7 +1545,7 @@ void hero_l07_decide_state_transition(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l07_enter_state(0, 0); + hero_l07_set_move_state(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1556,7 +1556,7 @@ void hero_l07_decide_state_transition(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l07_enter_state(0, 0); + hero_l07_set_move_state(0, 0); } break; case 0x22: @@ -1566,12 +1566,12 @@ void hero_l07_decide_state_transition(void) { hero_choose_jump_or_roll_move(); break; } - hero_l07_enter_state(7, 1); + hero_l07_set_move_state(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l07_enter_state(0, 0); + hero_l07_set_move_state(0, 0); } break; default: diff --git a/src/levels/08_tabora/L08_002BE8E8.c b/src/levels/08_tabora/L08_002BE8E8.c index 36dd1df7d..ff8281091 100644 --- a/src/levels/08_tabora/L08_002BE8E8.c +++ b/src/levels/08_tabora/L08_002BE8E8.c @@ -13,7 +13,7 @@ extern u8 g_hero_input_enabled __attribute__((sda)); extern s32 g_current_map_index __attribute__((sda)); extern void mem_fast_helper_b(void *, s32); extern float math_fabs(float); -extern s32 hero_l08_enter_state(s32, s32); +extern s32 hero_l08_set_move_state(s32, s32); /* Preserve the selected action while refreshing its transient trigger flags. */ void hero_refresh_action_triggers(void) @@ -91,7 +91,7 @@ void hero_refresh_action_triggers(void) math_fabs(*(float *)(g_hero_state + 0x330) - (*(float *)(g_hero_state + 0x88) + 0.25f)) < 1.0f && *(float *)(g_hero_state + 0x330) - *(float *)(g_hero_state + 0x88) > 0.0f && (*(float *)(g_hero_state + 0x118) < 0.0f || *(s32 *)(g_hero_state + 0x2294) == 0x7B)) { - hero_l08_enter_state(0x7C, 1); + hero_l08_set_move_state(0x7C, 1); } else if (g_hero_state[0x1496] && *(s32 *)(g_hero_state + 0x2294) != 0x65 && *(s32 *)(g_hero_state + 0x2294) != 0x78 && math_fabs(*(float *)(g_hero_state + 0x334) - (*(float *)(g_hero_state + 0x88) + 0.25f)) < 1.0f && @@ -99,17 +99,17 @@ void hero_refresh_action_triggers(void) (*(s32 *)(g_hero_state + 0x2294) != 0x66 || g_hero_state[0x49E]) && (*(float *)(g_hero_state + 0x118) < 0.0f || *(s32 *)(g_hero_state + 0x2294) == 0x7B)) { if (!*(s32 *)(g_hero_state + 0x24CC)) - hero_l08_enter_state(0x78, 1); + hero_l08_set_move_state(0x78, 1); else - hero_l08_enter_state(0x65, 1); + hero_l08_set_move_state(0x65, 1); } else if (g_hero_state[0x149B] && *(s32 *)(g_hero_state + 0x2294) != 0x78 && *(s32 *)(g_hero_state + 0x2294) != 0x74 && math_fabs(*(float *)(g_hero_state + 0x334) - (*(float *)(g_hero_state + 0x88) + 0.25f)) < 1.0f && *(float *)(g_hero_state + 0x334) - *(float *)(g_hero_state + 0x88) > 0.0f && (*(float *)(g_hero_state + 0x118) < 0.0f || *(s32 *)(g_hero_state + 0x2294) == 0x7B)) { if (g_current_map_index == 13) - hero_l08_enter_state(0x74, 1); + hero_l08_set_move_state(0x74, 1); else - hero_l08_enter_state(0x78, 1); + hero_l08_set_move_state(0x78, 1); } } diff --git a/src/levels/08_tabora/L08_002CB6E8.c b/src/levels/08_tabora/L08_002CB6E8.c index 13e7b6c51..20d3e4469 100644 --- a/src/levels/08_tabora/L08_002CB6E8.c +++ b/src/levels/08_tabora/L08_002CB6E8.c @@ -164,7 +164,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -717,7 +717,7 @@ void hero_l08_update_state_machine(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { tmp_a2 = ((Hero *)g_hero_state)->i[0x2440/4]; if (tmp_a2 != -1) { @@ -1441,7 +1441,7 @@ void hero_l08_update_state_machine(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l08_extra_state)->f[0x180/4] = 0.1f; diff --git a/src/levels/08_tabora/L08_002D2ED8-state-g8.c b/src/levels/08_tabora/L08_002D2ED8-state-g8.c index 12b5dc7cd..ab7a80241 100644 --- a/src/levels/08_tabora/L08_002D2ED8-state-g8.c +++ b/src/levels/08_tabora/L08_002D2ED8-state-g8.c @@ -62,8 +62,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -134,7 +134,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l08_enter_state(s32 action, s32 animate) { +s32 hero_l08_set_move_state(s32 action, s32 animate) { u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 oldStep; @@ -181,7 +181,9 @@ s32 hero_l08_enter_state(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -194,8 +196,8 @@ s32 hero_l08_enter_state(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l08_enter_state(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_enter_state(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l08_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_animation_id(0) == 0x51) set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_animation_id(0), 0, -1.0f); @@ -333,7 +335,7 @@ s32 hero_l08_enter_state(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l08_enter_state(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l08_set_move_state(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -373,12 +375,12 @@ s32 hero_l08_enter_state(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l08_enter_state(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_enter_state(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l08_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_set_move_state(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_animation_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l08_enter_state(0, 0)) set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); + if (hero_l08_set_move_state(0, 0)) set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -403,7 +405,7 @@ s32 hero_l08_enter_state(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_enter_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -545,13 +547,13 @@ s32 hero_l08_enter_state(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l08_enter_state(0x81, 1); return 0; + hero_l08_set_move_state(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_action_blocked) { hero_l08_enter_state(0x6E, 1); return 0; } + action != 0x38 && !g_hero_action_blocked) { hero_l08_set_move_state(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l08_enter_state(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l08_set_move_state(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -643,7 +645,7 @@ s32 hero_l08_enter_state(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -669,7 +671,7 @@ s32 hero_l08_enter_state(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -678,7 +680,7 @@ s32 hero_l08_enter_state(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -811,7 +813,7 @@ s32 hero_l08_enter_state(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -881,7 +883,7 @@ s32 hero_l08_enter_state(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -893,7 +895,7 @@ s32 hero_l08_enter_state(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth(1); @@ -927,7 +929,7 @@ s32 hero_l08_enter_state(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l08_enter_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l08_set_move_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/levels/08_tabora/L08_002D90C8-fn.c b/src/levels/08_tabora/L08_002D90C8-fn.c index 0b734c524..e46cdde6b 100644 --- a/src/levels/08_tabora/L08_002D90C8-fn.c +++ b/src/levels/08_tabora/L08_002D90C8-fn.c @@ -95,7 +95,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l08_enter_state(s32, s32); +s32 hero_l08_set_move_state(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -173,7 +173,7 @@ void hero_l08_update_state_transitions(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l08_enter_state(0x39, 1); + hero_l08_set_move_state(0x39, 1); goto end; } } @@ -202,7 +202,7 @@ void hero_l08_update_state_transitions(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l08_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l08_enter_state(0x74, 1); + hero_l08_set_move_state(0x74, 1); goto end; } } @@ -213,12 +213,12 @@ void hero_l08_update_state_transitions(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state(1, 1); + hero_l08_set_move_state(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l08_enter_state(0x82, 1); + hero_l08_set_move_state(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -255,7 +255,7 @@ void hero_l08_update_state_transitions(void) { rec = g_hero_item_records + selected_slot * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l08_enter_state(0x3C, 1); + hero_l08_set_move_state(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -298,12 +298,12 @@ void hero_l08_update_state_transitions(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l08_enter_state(0x76, 1); + hero_l08_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); } break; } @@ -324,17 +324,17 @@ void hero_l08_update_state_transitions(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_action_blocked == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l08_enter_state(0x6E, 1); + hero_l08_set_move_state(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l08_enter_state(4, 1); + hero_l08_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l08_enter_state(0x2E, 1); + hero_l08_set_move_state(0x2E, 1); break; } { @@ -354,28 +354,28 @@ void hero_l08_update_state_transitions(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l08_enter_state(2, 1); + hero_l08_set_move_state(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state(1, 1); + hero_l08_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_flags = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_flags & 8)) { - hero_l08_enter_state(0x3D, 1); + hero_l08_set_move_state(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l08_enter_state(0x3D, 1); + hero_l08_set_move_state(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); } break; case 0x3D: @@ -384,22 +384,22 @@ void hero_l08_update_state_transitions(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state(4, 1); + hero_l08_set_move_state(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l08_enter_state(2, 1); + hero_l08_set_move_state(2, 1); break; } - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); break; case 0x39: case 0x43: @@ -438,25 +438,25 @@ void hero_l08_update_state_transitions(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l08_enter_state(0x33, 1); + hero_l08_set_move_state(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l08_enter_state(0x34, 1); + hero_l08_set_move_state(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l08_enter_state(0x32, 1); + hero_l08_set_move_state(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l08_enter_state(0x33, 1); + hero_l08_set_move_state(0x33, 1); } } break; @@ -469,81 +469,81 @@ void hero_l08_update_state_transitions(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l08_enter_state(0x32, 1); + hero_l08_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l08_enter_state(0x34, 1); + hero_l08_set_move_state(0x34, 1); } else { - hero_l08_enter_state(0x32, 1); + hero_l08_set_move_state(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l08_enter_state(0x12, 1); + hero_l08_set_move_state(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l08_enter_state(0x32, 1); + hero_l08_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l08_enter_state(0x34, 1); + hero_l08_set_move_state(0x34, 1); } else { - hero_l08_enter_state(0x32, 1); + hero_l08_set_move_state(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l08_enter_state(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l08_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l08_enter_state(0x35, 1); + hero_l08_set_move_state(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l08_enter_state(0x12, 1); + hero_l08_set_move_state(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l08_enter_state(0x32, 1); + hero_l08_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l08_enter_state(0x34, 1); + hero_l08_set_move_state(0x34, 1); } else { - hero_l08_enter_state(0x32, 1); + hero_l08_set_move_state(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l08_enter_state(0x70, 0); + hero_l08_set_move_state(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l08_enter_state(0x36, 1); + hero_l08_set_move_state(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state(0x67, 1); + hero_l08_set_move_state(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state(0x33, 1); + hero_l08_set_move_state(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l08_enter_state(0x33, 0); + hero_l08_set_move_state(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state(0x67, 1); + hero_l08_set_move_state(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l08_enter_state(0x36, 0); + hero_l08_set_move_state(0x36, 0); } break; case 0x1: @@ -577,9 +577,9 @@ void hero_l08_update_state_transitions(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state(4, 1); + hero_l08_set_move_state(4, 1); } else { - hero_l08_enter_state(0, 0); + hero_l08_set_move_state(0, 0); anim = hero_get_weapon_animation_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -591,9 +591,9 @@ void hero_l08_update_state_transitions(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l08_enter_state(0, 0); + hero_l08_set_move_state(0, 0); } else { - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); } } break; @@ -626,7 +626,7 @@ void hero_l08_update_state_transitions(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state(7, 1); + hero_l08_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -635,7 +635,7 @@ void hero_l08_update_state_transitions(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l08_enter_state(0, 0); + hero_l08_set_move_state(0, 0); } break; } @@ -657,7 +657,7 @@ void hero_l08_update_state_transitions(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state(7, 1); + hero_l08_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -670,7 +670,7 @@ void hero_l08_update_state_transitions(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l08_enter_state(2, 0); + hero_l08_set_move_state(2, 0); set_hero_animation(3, g_hero_l08_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -681,22 +681,22 @@ void hero_l08_update_state_transitions(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l08_enter_state(2, 1); + hero_l08_set_move_state(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l08_enter_state(0, 0); + hero_l08_set_move_state(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state(0, 0); + hero_l08_set_move_state(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -713,7 +713,7 @@ void hero_l08_update_state_transitions(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state(7, 1); + hero_l08_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -722,7 +722,7 @@ void hero_l08_update_state_transitions(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l08_enter_state(0, 0); + hero_l08_set_move_state(0, 0); set_hero_animation(hero_get_weapon_animation_id(0), 0, 15.0f); break; } @@ -734,7 +734,7 @@ void hero_l08_update_state_transitions(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); } break; case 0x2: @@ -748,11 +748,11 @@ void hero_l08_update_state_transitions(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l08_enter_state(0x76, 1); + hero_l08_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); break; } n = 9; @@ -766,12 +766,12 @@ void hero_l08_update_state_transitions(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l08_enter_state(9, 1); + hero_l08_set_move_state(9, 1); } else { - hero_l08_enter_state(7, 1); + hero_l08_set_move_state(7, 1); } } else { - hero_l08_enter_state(7, 1); + hero_l08_set_move_state(7, 1); } break; } @@ -779,11 +779,11 @@ void hero_l08_update_state_transitions(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state(1, 1); + hero_l08_set_move_state(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state(4, 1); + hero_l08_set_move_state(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -800,21 +800,21 @@ void hero_l08_update_state_transitions(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l08_enter_state(0x2E, 1); + hero_l08_set_move_state(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l08_enter_state(2, 1); + hero_l08_set_move_state(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l08_enter_state(0x70, 1); + hero_l08_set_move_state(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l08_enter_state(2, 1); + hero_l08_set_move_state(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -825,7 +825,7 @@ void hero_l08_update_state_transitions(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l08_enter_state(0, 0) == 0) { + if (hero_l08_set_move_state(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -842,7 +842,7 @@ void hero_l08_update_state_transitions(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l08_enter_state(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l08_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 17.0f); } if (FLD(target, u8, 0x43) == 0x37) { @@ -863,7 +863,7 @@ void hero_l08_update_state_transitions(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l08_enter_state(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l08_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -897,17 +897,17 @@ void hero_l08_update_state_transitions(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l08_enter_state(3, 0); + hero_l08_set_move_state(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l08_enter_state(0x77, 1); + hero_l08_set_move_state(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l08_enter_state(0x77, 1); + hero_l08_set_move_state(0x77, 1); break; } } @@ -925,11 +925,11 @@ void hero_l08_update_state_transitions(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l08_enter_state(0x64, 1); + hero_l08_set_move_state(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l08_enter_state(0x63, 1); + hero_l08_set_move_state(0x63, 1); } } else { hero_update_anim_scale(); @@ -937,22 +937,22 @@ void hero_l08_update_state_transitions(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state(0x62, 1); + hero_l08_set_move_state(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l08_enter_state(0x62, 1); + hero_l08_set_move_state(0x62, 1); } break; case 0x65: { s32 n = FLD(g_hero_state, s32, 0x18C0); if ((n < 3) && (((n * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40, 7, &found_value) != 0)) { - hero_l08_enter_state(0x66, 1); + hero_l08_set_move_state(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -980,31 +980,31 @@ void hero_l08_update_state_transitions(void) { s32 off = FLD(g_hero_state, s16, 0xBFC) * 0x2C; rec -= -off; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); } break; } case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state(1, 1); + hero_l08_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l08_enter_state(7, 1); + hero_l08_set_move_state(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state(4, 1); + hero_l08_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1012,45 +1012,45 @@ void hero_l08_update_state_transitions(void) { } if (hero_get_weapon_animation_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l08_enter_state(0, 0); + hero_l08_set_move_state(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l08_enter_state(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l08_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l08_enter_state(2, 1); + hero_l08_set_move_state(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state(1, 1); + hero_l08_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state(0, 0); + hero_l08_set_move_state(0, 0); set_hero_animation(hero_get_weapon_animation_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l08_enter_state(0x76, 1); + hero_l08_set_move_state(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l08_enter_state(0x15, 1); + hero_l08_set_move_state(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1058,17 +1058,17 @@ void hero_l08_update_state_transitions(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l08_enter_state(0x8B, 1); + hero_l08_set_move_state(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); } break; case 0x24: @@ -1094,14 +1094,14 @@ void hero_l08_update_state_transitions(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l08_enter_state(0, 0); + hero_l08_set_move_state(0, 0); set_hero_animation(hero_get_weapon_animation_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l08_enter_state(6, 0); + hero_l08_set_move_state(6, 0); } else { - hero_l08_enter_state(6, 0); + hero_l08_set_move_state(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1117,9 +1117,9 @@ void hero_l08_update_state_transitions(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); } else { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1131,7 +1131,7 @@ void hero_l08_update_state_transitions(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l08_enter_state(0x2C, 1); + hero_l08_set_move_state(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1139,7 +1139,7 @@ void hero_l08_update_state_transitions(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l08_enter_state(0x18, 0); + hero_l08_set_move_state(0x18, 0); } break; case 0x18: @@ -1148,18 +1148,18 @@ void hero_l08_update_state_transitions(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l08_enter_state(0x1B, 1); + hero_l08_set_move_state(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1168,7 +1168,7 @@ void hero_l08_update_state_transitions(void) { joint_pos_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; joint_pos_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)joint_pos_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l08_enter_state(0x19, 1); + hero_l08_set_move_state(0x19, 1); } break; } @@ -1179,7 +1179,7 @@ void hero_l08_update_state_transitions(void) { joint_pos_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; joint_pos_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)joint_pos_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l08_enter_state(0x1A, 1); + hero_l08_set_move_state(0x1A, 1); } } } @@ -1198,18 +1198,18 @@ void hero_l08_update_state_transitions(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)joint_pos_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state(0x18, 1); + hero_l08_set_move_state(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l08_enter_state(0x1B, 1); + hero_l08_set_move_state(0x1B, 1); } break; } @@ -1219,9 +1219,9 @@ void hero_l08_update_state_transitions(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); } else { - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); } } break; @@ -1245,12 +1245,12 @@ void hero_l08_update_state_transitions(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state(0x39, 1); + hero_l08_set_move_state(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l08_enter_state(0, 0) != 0) { + if (hero_l08_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1258,7 +1258,7 @@ void hero_l08_update_state_transitions(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l08_enter_state(0, 0) != 0) { + if (hero_l08_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1272,28 +1272,28 @@ void hero_l08_update_state_transitions(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l08_enter_state(2, 1); + hero_l08_set_move_state(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l08_enter_state(3, 0) != 0) { + if (hero_l08_set_move_state(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l08_enter_state(8, 1); + hero_l08_set_move_state(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l08_enter_state(0x17, 1); + hero_l08_set_move_state(0x17, 1); break; } } @@ -1325,7 +1325,7 @@ void hero_l08_update_state_transitions(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l08_enter_state(0, 0) != 0) { + if (hero_l08_set_move_state(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1336,12 +1336,12 @@ void hero_l08_update_state_transitions(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l08_enter_state(0x74, 1); + hero_l08_set_move_state(0x74, 1); } else { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); } } else { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); } } break; @@ -1354,16 +1354,16 @@ void hero_l08_update_state_transitions(void) { ok = 1; } if (ok != 0) { - hero_l08_enter_state(0x11, 1); + hero_l08_set_move_state(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l08_enter_state(0x17, 1); + hero_l08_set_move_state(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1374,23 +1374,23 @@ void hero_l08_update_state_transitions(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l08_enter_state(3, 0) != 0) { + if (hero_l08_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state(4, 1); + hero_l08_set_move_state(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l08_speed_params[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l08_enter_state(2, 1); + hero_l08_set_move_state(2, 1); break; } - hero_l08_enter_state(2, 0); + hero_l08_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1399,21 +1399,21 @@ void hero_l08_update_state_transitions(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l08_speed_params[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l08_enter_state(2, 1); + hero_l08_set_move_state(2, 1); break; } - hero_l08_enter_state(2, 0); + hero_l08_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l08_animation_id_extra, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l08_enter_state(0, 0) != 0) { + if (hero_l08_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_animation_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l08_enter_state(0, 0) != 0) { + } else if (hero_l08_set_move_state(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1459,14 +1459,14 @@ void hero_l08_update_state_transitions(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state(0xB, 1); + hero_l08_set_move_state(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l08_enter_state(0x82, 1); + hero_l08_set_move_state(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1475,21 +1475,21 @@ void hero_l08_update_state_transitions(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l08_enter_state(0xA, 1); + hero_l08_set_move_state(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l08_enter_state(0x10, 1); + hero_l08_set_move_state(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l08_enter_state(0x77, 1); + hero_l08_set_move_state(0x77, 1); break; } } @@ -1593,7 +1593,7 @@ void hero_l08_update_state_transitions(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l08_enter_state(3, 0) != 0) { + if (hero_l08_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1601,13 +1601,13 @@ void hero_l08_update_state_transitions(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l08_speed_params[0][2])) { - hero_l08_enter_state(7, 1); + hero_l08_set_move_state(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l08_enter_state(7, 1); + hero_l08_set_move_state(7, 1); } else if (g_hero_l08_speed_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l08_enter_state(9, 1); + hero_l08_set_move_state(9, 1); } else { - hero_l08_enter_state(7, 1); + hero_l08_set_move_state(7, 1); } break; } @@ -1615,10 +1615,10 @@ void hero_l08_update_state_transitions(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); break; } { @@ -1628,7 +1628,7 @@ void hero_l08_update_state_transitions(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l08_enter_state(0x11, 1); + hero_l08_set_move_state(0x11, 1); break; } } @@ -1657,7 +1657,7 @@ void hero_l08_update_state_transitions(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l08_enter_state(0xE, 1); + hero_l08_set_move_state(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1667,28 +1667,28 @@ void hero_l08_update_state_transitions(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l08_enter_state(8, 1); + hero_l08_set_move_state(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l08_enter_state(0x17, 1); + hero_l08_set_move_state(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l08_enter_state(6, 1); + hero_l08_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state(0x39, 1); + hero_l08_set_move_state(0x39, 1); } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l08_enter_state(0x82, 1); + hero_l08_set_move_state(0x82, 1); } else { - hero_l08_enter_state(0, 0); + hero_l08_set_move_state(0, 0); } } break; @@ -1698,8 +1698,8 @@ void hero_l08_update_state_transitions(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state(0x39, 1); - } else if (hero_l08_enter_state(0, 0) != 0) { + hero_l08_set_move_state(0x39, 1); + } else if (hero_l08_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 13.0f); } } @@ -1720,7 +1720,7 @@ void hero_l08_update_state_transitions(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l08_enter_state(0, 0); + hero_l08_set_move_state(0, 0); anim = hero_get_weapon_animation_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1731,7 +1731,7 @@ void hero_l08_update_state_transitions(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l08_enter_state(0, 0); + hero_l08_set_move_state(0, 0); } break; case 0x22: @@ -1741,12 +1741,12 @@ void hero_l08_update_state_transitions(void) { hero_choose_jump_or_roll_move(); break; } - hero_l08_enter_state(7, 1); + hero_l08_set_move_state(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l08_enter_state(0, 0); + hero_l08_set_move_state(0, 0); } break; default: diff --git a/src/levels/09_dobbo/L09_002AFC90-flags.c b/src/levels/09_dobbo/L09_002AFC90-flags.c index 383061df1..b5efd209b 100644 --- a/src/levels/09_dobbo/L09_002AFC90-flags.c +++ b/src/levels/09_dobbo/L09_002AFC90-flags.c @@ -8,7 +8,7 @@ extern int g_hero_l09_special_state_flag __attribute__((sda)); extern u8 g_hero_input_enabled __attribute__((sda)); extern void mem_fast_helper_b(void *, int); extern float math_fabs(float); -extern int hero_l09_set_state(int, int); +extern int hero_l09_set_move_state(int, int); typedef int Quadword __attribute__((mode(TI))); typedef union { Quadword word; float f[4]; } Vector; typedef struct { @@ -99,10 +99,10 @@ void hero_read_button_command(void) if (g_hero_state.attack) { if (g_hero_state.attack && active && (g_hero_state.state != 0x38 || g_hero_state.animationDone)) { - if (g_hero_state.health) { hero_l09_set_state(0x38,1); return; } - if (g_current_map_index == 2 && g_hero_l09_special_state_flag) { hero_l09_set_state(0x7d,1); return; } - if (*(int *)(*(u8 **)(g_hero_state.object + 0x24) + 0x1f0)) { hero_l09_set_state(0x79,1); return; } - hero_l09_set_state(0x39,1); return; + if (g_hero_state.health) { hero_l09_set_move_state(0x38,1); return; } + if (g_current_map_index == 2 && g_hero_l09_special_state_flag) { hero_l09_set_move_state(0x7d,1); return; } + if (*(int *)(*(u8 **)(g_hero_state.object + 0x24) + 0x1f0)) { hero_l09_set_move_state(0x79,1); return; } + hero_l09_set_move_state(0x39,1); return; } } if (g_hero_state.jump && g_hero_state.state != 0x65 && g_hero_state.state != 0x78 && @@ -110,16 +110,16 @@ void hero_read_button_command(void) g_hero_state.jumpTime-g_hero_state.position.f[2] > 0.0f && (g_hero_state.state != 0x66 || g_hero_state.animationDone) && (g_hero_state.motion.f[2] < 0.0f || g_hero_state.state == 0x7b)) { - if (!g_hero_state.health) { hero_l09_set_state(0x78,1); return; } - hero_l09_set_state(0x65,1); return; + if (!g_hero_state.health) { hero_l09_set_move_state(0x78,1); return; } + hero_l09_set_move_state(0x65,1); return; } if (!g_hero_state.cancel || g_hero_state.state == 0x78 || g_hero_state.state == 0x74) return; if (!(math_fabs(g_hero_state.jumpTime-(g_hero_state.position.f[2]+0.25f)) < 1.0f)) return; if (!(g_hero_state.jumpTime-g_hero_state.position.f[2] > 0.0f)) return; if (!(g_hero_state.motion.f[2] < 0.0f) && g_hero_state.state != 0x7b) return; if (g_current_map_index == 13) { - hero_l09_set_state(0x74, 1); + hero_l09_set_move_state(0x74, 1); return; } - hero_l09_set_state(0x78, 1); + hero_l09_set_move_state(0x78, 1); } diff --git a/src/levels/09_dobbo/L09_002BC490.c b/src/levels/09_dobbo/L09_002BC490.c index 0e05ddf58..986ac49e0 100644 --- a/src/levels/09_dobbo/L09_002BC490.c +++ b/src/levels/09_dobbo/L09_002BC490.c @@ -162,7 +162,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -674,7 +674,7 @@ void hero_l09_update_state_machine(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { value21 = ((Hero *)g_hero_state)->i[0x2440/4]; if (value21 != -1) { @@ -1377,7 +1377,7 @@ void hero_l09_update_state_machine(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l09_aux_state)->f[0x180/4] = 0.1f; diff --git a/src/levels/09_dobbo/L09_002C3580-state-g8.c b/src/levels/09_dobbo/L09_002C3580-state-g8.c index 92fa5160f..424d2a648 100644 --- a/src/levels/09_dobbo/L09_002C3580-state-g8.c +++ b/src/levels/09_dobbo/L09_002C3580-state-g8.c @@ -62,8 +62,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -136,7 +136,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u /* Changes the player's action, initializes its movement parameters and selects animation. */ /* Switches the player into a new action, such as jumping or gliding, and starts the matching animation. */ -s32 hero_l09_set_state(s32 action, s32 animate) { +s32 hero_l09_set_move_state(s32 action, s32 animate) { u8 *objectSnapshot; u8 *hit_a, *hit_b, *hit_c, *hit_d, *hit_e; s32 oldStep; @@ -183,7 +183,9 @@ s32 hero_l09_set_state(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -196,7 +198,7 @@ s32 hero_l09_set_state(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_anim_id(0) == 0x51) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_anim_id(0), 0, -1.0f); @@ -331,7 +333,7 @@ s32 hero_l09_set_state(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l09_set_state(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l09_set_move_state(0x76, 1); return 0; } } if (BYTE(0x22B9) || WORD(0x2294) == 0x70) { WORD(0x2294) = 0x70; set_hero_animation(0x59, 0, 8.0f); goto finish; @@ -364,11 +366,11 @@ s32 hero_l09_set_state(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_move_state(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_anim_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l09_set_state(0, 0)) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); + if (hero_l09_set_move_state(0, 0)) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -393,7 +395,7 @@ s32 hero_l09_set_state(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -535,13 +537,13 @@ s32 hero_l09_set_state(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l09_set_state(0x81, 1); return 0; + hero_l09_set_move_state(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l09_lock_flag_b) { hero_l09_set_state(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l09_lock_flag_b) { hero_l09_set_move_state(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l09_set_state(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l09_set_move_state(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -616,9 +618,9 @@ s32 hero_l09_set_state(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_l09_special_state_flag) hero_l09_set_state(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l09_set_state(0x79, 1); - else hero_l09_set_state(0x39, 1); + if (g_current_map_index == 2 && g_hero_l09_special_state_flag) hero_l09_set_move_state(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l09_set_move_state(0x79, 1); + else hero_l09_set_move_state(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -652,7 +654,7 @@ s32 hero_l09_set_state(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -678,7 +680,7 @@ s32 hero_l09_set_state(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -687,7 +689,7 @@ s32 hero_l09_set_state(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -821,7 +823,7 @@ s32 hero_l09_set_state(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -876,7 +878,7 @@ s32 hero_l09_set_state(s32 action, s32 animate) { frames = 8.0f; animation43 = 0x29; { set_hero_animation(animation43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_c = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_c) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_c + 0x2C))); @@ -888,7 +890,7 @@ s32 hero_l09_set_state(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_d = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_d) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_d + 0x2C))); else AdjustPlayerHealth(1); @@ -927,7 +929,7 @@ s32 hero_l09_set_state(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l09_set_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l09_set_move_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/levels/09_dobbo/L09_002C9738.c b/src/levels/09_dobbo/L09_002C9738.c index 8fef1653b..aca1cb956 100644 --- a/src/levels/09_dobbo/L09_002C9738.c +++ b/src/levels/09_dobbo/L09_002C9738.c @@ -94,7 +94,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l09_set_state(s32, s32); +s32 hero_l09_set_move_state(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -172,7 +172,7 @@ void hero_l09_decide_state_transition(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l09_set_state(0x39, 1); + hero_l09_set_move_state(0x39, 1); goto end; } } @@ -201,7 +201,7 @@ void hero_l09_decide_state_transition(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_height_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l09_set_state(0x74, 1); + hero_l09_set_move_state(0x74, 1); goto end; } } @@ -211,12 +211,12 @@ void hero_l09_decide_state_transition(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state(1, 1); + hero_l09_set_move_state(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l09_set_state(0x82, 1); + hero_l09_set_move_state(0x82, 1); break; } { @@ -252,7 +252,7 @@ void hero_l09_decide_state_transition(void) { rec = g_hero_l09_state_records + slot_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l09_set_state(0x3C, 1); + hero_l09_set_move_state(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -295,12 +295,12 @@ void hero_l09_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l09_set_state(0x76, 1); + hero_l09_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); } break; } @@ -321,12 +321,12 @@ void hero_l09_decide_state_transition(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l09_lock_flag_b == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l09_set_state(0x6E, 1); + hero_l09_set_move_state(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l09_set_state(4, 1); + hero_l09_set_move_state(4, 1); break; } } @@ -347,28 +347,28 @@ void hero_l09_decide_state_transition(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l09_set_state(2, 1); + hero_l09_set_move_state(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state(1, 1); + hero_l09_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l09_set_state(0x3D, 1); + hero_l09_set_move_state(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l09_set_state(0x3D, 1); + hero_l09_set_move_state(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l09_set_state(0, 1); + hero_l09_set_move_state(0, 1); } break; case 0x3D: @@ -377,22 +377,22 @@ void hero_l09_decide_state_transition(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state(4, 1); + hero_l09_set_move_state(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l09_set_state(2, 1); + hero_l09_set_move_state(2, 1); break; } - hero_l09_set_state(0, 1); + hero_l09_set_move_state(0, 1); break; case 0x39: case 0x43: @@ -425,25 +425,25 @@ void hero_l09_decide_state_transition(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l09_set_state(0x33, 1); + hero_l09_set_move_state(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l09_set_state(0x34, 1); + hero_l09_set_move_state(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l09_set_state(0x32, 1); + hero_l09_set_move_state(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l09_set_state(0x33, 1); + hero_l09_set_move_state(0x33, 1); } } break; @@ -456,81 +456,81 @@ void hero_l09_decide_state_transition(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l09_set_state(0x32, 1); + hero_l09_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l09_set_state(0x34, 1); + hero_l09_set_move_state(0x34, 1); } else { - hero_l09_set_state(0x32, 1); + hero_l09_set_move_state(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l09_set_state(0x12, 1); + hero_l09_set_move_state(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l09_set_state(0x32, 1); + hero_l09_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l09_set_state(0x34, 1); + hero_l09_set_move_state(0x34, 1); } else { - hero_l09_set_state(0x32, 1); + hero_l09_set_move_state(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l09_set_state(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l09_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l09_set_state(0x35, 1); + hero_l09_set_move_state(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l09_set_state(0x12, 1); + hero_l09_set_move_state(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l09_set_state(0x32, 1); + hero_l09_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l09_set_state(0x34, 1); + hero_l09_set_move_state(0x34, 1); } else { - hero_l09_set_state(0x32, 1); + hero_l09_set_move_state(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l09_set_state(0x70, 0); + hero_l09_set_move_state(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l09_set_state(0x36, 1); + hero_l09_set_move_state(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l09_set_state(0x67, 1); + hero_l09_set_move_state(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state(0x33, 1); + hero_l09_set_move_state(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l09_set_state(0x33, 0); + hero_l09_set_move_state(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l09_set_state(0x67, 1); + hero_l09_set_move_state(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l09_set_state(0x36, 0); + hero_l09_set_move_state(0x36, 0); } break; case 0x1: @@ -564,9 +564,9 @@ void hero_l09_decide_state_transition(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state(4, 1); + hero_l09_set_move_state(4, 1); } else { - hero_l09_set_state(0, 0); + hero_l09_set_move_state(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -578,9 +578,9 @@ void hero_l09_decide_state_transition(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l09_set_state(0, 0); + hero_l09_set_move_state(0, 0); } else { - hero_l09_set_state(0, 1); + hero_l09_set_move_state(0, 1); } } break; @@ -613,7 +613,7 @@ void hero_l09_decide_state_transition(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state(7, 1); + hero_l09_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -622,7 +622,7 @@ void hero_l09_decide_state_transition(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l09_set_state(0, 0); + hero_l09_set_move_state(0, 0); } break; } @@ -644,7 +644,7 @@ void hero_l09_decide_state_transition(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state(7, 1); + hero_l09_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -657,7 +657,7 @@ void hero_l09_decide_state_transition(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l09_set_state(2, 0); + hero_l09_set_move_state(2, 0); set_hero_animation(3, g_hero_l09_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -668,22 +668,22 @@ void hero_l09_decide_state_transition(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l09_set_state(2, 1); + hero_l09_set_move_state(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l09_set_state(0, 0); + hero_l09_set_move_state(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state(0, 0); + hero_l09_set_move_state(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l09_set_state(0, 1); + hero_l09_set_move_state(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -700,7 +700,7 @@ void hero_l09_decide_state_transition(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state(7, 1); + hero_l09_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -709,7 +709,7 @@ void hero_l09_decide_state_transition(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l09_set_state(0, 0); + hero_l09_set_move_state(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, 15.0f); break; } @@ -721,7 +721,7 @@ void hero_l09_decide_state_transition(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state(0, 1); + hero_l09_set_move_state(0, 1); } break; case 0x2: @@ -735,11 +735,11 @@ void hero_l09_decide_state_transition(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l09_set_state(0x76, 1); + hero_l09_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); break; } n = 9; @@ -753,12 +753,12 @@ void hero_l09_decide_state_transition(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l09_set_state(9, 1); + hero_l09_set_move_state(9, 1); } else { - hero_l09_set_state(7, 1); + hero_l09_set_move_state(7, 1); } } else { - hero_l09_set_state(7, 1); + hero_l09_set_move_state(7, 1); } break; } @@ -766,21 +766,21 @@ void hero_l09_decide_state_transition(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state(1, 1); + hero_l09_set_move_state(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state(4, 1); + hero_l09_set_move_state(4, 1); break; } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l09_set_state(0x70, 1); + hero_l09_set_move_state(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l09_set_state(2, 1); + hero_l09_set_move_state(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -791,7 +791,7 @@ void hero_l09_decide_state_transition(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l09_set_state(0, 0) == 0) { + if (hero_l09_set_move_state(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -808,7 +808,7 @@ void hero_l09_decide_state_transition(void) { hero_update_anim_scale(); } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l09_set_state(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l09_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -842,17 +842,17 @@ void hero_l09_decide_state_transition(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l09_set_state(3, 0); + hero_l09_set_move_state(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l09_set_state(0x77, 1); + hero_l09_set_move_state(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l09_set_state(0x77, 1); + hero_l09_set_move_state(0x77, 1); break; } } @@ -870,11 +870,11 @@ void hero_l09_decide_state_transition(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l09_set_state(0x64, 1); + hero_l09_set_move_state(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l09_set_state(0x63, 1); + hero_l09_set_move_state(0x63, 1); } } else { hero_update_anim_scale(); @@ -882,22 +882,22 @@ void hero_l09_decide_state_transition(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state(0x62, 1); + hero_l09_set_move_state(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l09_set_state(0, 1); + hero_l09_set_move_state(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l09_set_state(0x62, 1); + hero_l09_set_move_state(0x62, 1); } break; case 0x65: { s32 n = FLD(g_hero_state, s32, 0x18C0); if ((n < 3) && (((n * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40, 7, &query_result) != 0)) { - hero_l09_set_state(0x66, 1); + hero_l09_set_move_state(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -931,25 +931,25 @@ void hero_l09_decide_state_transition(void) { return; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state(1, 1); + hero_l09_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l09_set_state(7, 1); + hero_l09_set_move_state(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state(4, 1); + hero_l09_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state(0, 1); + hero_l09_set_move_state(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -957,45 +957,45 @@ void hero_l09_decide_state_transition(void) { } if (hero_get_weapon_anim_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l09_set_state(0, 0); + hero_l09_set_move_state(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l09_set_state(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l09_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l09_set_state(2, 1); + hero_l09_set_move_state(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state(1, 1); + hero_l09_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state(0, 0); + hero_l09_set_move_state(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l09_set_state(0x76, 1); + hero_l09_set_move_state(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l09_set_state(0x15, 1); + hero_l09_set_move_state(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l09_set_state(0, 1); + hero_l09_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1003,17 +1003,17 @@ void hero_l09_decide_state_transition(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l09_set_state(0x8B, 1); + hero_l09_set_move_state(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l09_set_state(0, 1); + hero_l09_set_move_state(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l09_set_state(0, 1); + hero_l09_set_move_state(0, 1); } break; case 0x24: @@ -1039,14 +1039,14 @@ void hero_l09_decide_state_transition(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l09_set_state(0, 0); + hero_l09_set_move_state(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l09_set_state(6, 0); + hero_l09_set_move_state(6, 0); } else { - hero_l09_set_state(6, 0); + hero_l09_set_move_state(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1062,9 +1062,9 @@ void hero_l09_decide_state_transition(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l09_set_state(0, 1); + hero_l09_set_move_state(0, 1); } else { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1076,7 +1076,7 @@ void hero_l09_decide_state_transition(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l09_set_state(0x2C, 1); + hero_l09_set_move_state(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1084,7 +1084,7 @@ void hero_l09_decide_state_transition(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l09_set_state(0x18, 0); + hero_l09_set_move_state(0x18, 0); } break; case 0x18: @@ -1093,18 +1093,18 @@ void hero_l09_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l09_set_state(0x1B, 1); + hero_l09_set_move_state(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1113,7 +1113,7 @@ void hero_l09_decide_state_transition(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l09_set_state(0x19, 1); + hero_l09_set_move_state(0x19, 1); } break; } @@ -1124,7 +1124,7 @@ void hero_l09_decide_state_transition(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l09_set_state(0x1A, 1); + hero_l09_set_move_state(0x1A, 1); } } } @@ -1143,18 +1143,18 @@ void hero_l09_decide_state_transition(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state(0x18, 1); + hero_l09_set_move_state(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l09_set_state(0x1B, 1); + hero_l09_set_move_state(0x1B, 1); } break; } @@ -1164,9 +1164,9 @@ void hero_l09_decide_state_transition(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); } else { - hero_l09_set_state(0, 1); + hero_l09_set_move_state(0, 1); } } break; @@ -1190,12 +1190,12 @@ void hero_l09_decide_state_transition(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l09_set_state(0x39, 1); + hero_l09_set_move_state(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l09_set_state(0, 0) != 0) { + if (hero_l09_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1203,7 +1203,7 @@ void hero_l09_decide_state_transition(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l09_set_state(0, 0) != 0) { + if (hero_l09_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1217,28 +1217,28 @@ void hero_l09_decide_state_transition(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l09_set_state(2, 1); + hero_l09_set_move_state(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l09_set_state(3, 0) != 0) { + if (hero_l09_set_move_state(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l09_set_state(0, 1); + hero_l09_set_move_state(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l09_set_state(8, 1); + hero_l09_set_move_state(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l09_set_state(0x17, 1); + hero_l09_set_move_state(0x17, 1); break; } } @@ -1270,7 +1270,7 @@ void hero_l09_decide_state_transition(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l09_set_state(0, 0) != 0) { + if (hero_l09_set_move_state(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1281,12 +1281,12 @@ void hero_l09_decide_state_transition(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l09_set_state(0x74, 1); + hero_l09_set_move_state(0x74, 1); } else { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); } } else { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); } } break; @@ -1299,16 +1299,16 @@ void hero_l09_decide_state_transition(void) { ok = 1; } if (ok != 0) { - hero_l09_set_state(0x11, 1); + hero_l09_set_move_state(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l09_set_state(0x17, 1); + hero_l09_set_move_state(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1319,23 +1319,23 @@ void hero_l09_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l09_set_state(3, 0) != 0) { + if (hero_l09_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state(4, 1); + hero_l09_set_move_state(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l09_speed_thresholds[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l09_set_state(2, 1); + hero_l09_set_move_state(2, 1); break; } - hero_l09_set_state(2, 0); + hero_l09_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1344,21 +1344,21 @@ void hero_l09_decide_state_transition(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l09_speed_thresholds[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l09_set_state(2, 1); + hero_l09_set_move_state(2, 1); break; } - hero_l09_set_state(2, 0); + hero_l09_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l09_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l09_set_state(0, 0) != 0) { + if (hero_l09_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l09_set_state(0, 0) != 0) { + } else if (hero_l09_set_move_state(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1404,14 +1404,14 @@ void hero_l09_decide_state_transition(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state(0xB, 1); + hero_l09_set_move_state(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l09_set_state(0x82, 1); + hero_l09_set_move_state(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1420,21 +1420,21 @@ void hero_l09_decide_state_transition(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l09_set_state(0xA, 1); + hero_l09_set_move_state(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l09_set_state(0x10, 1); + hero_l09_set_move_state(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l09_set_state(0x77, 1); + hero_l09_set_move_state(0x77, 1); break; } } @@ -1538,7 +1538,7 @@ void hero_l09_decide_state_transition(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l09_set_state(3, 0) != 0) { + if (hero_l09_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1546,13 +1546,13 @@ void hero_l09_decide_state_transition(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l09_speed_thresholds[0][2])) { - hero_l09_set_state(7, 1); + hero_l09_set_move_state(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l09_set_state(7, 1); + hero_l09_set_move_state(7, 1); } else if (g_hero_l09_speed_thresholds[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l09_set_state(9, 1); + hero_l09_set_move_state(9, 1); } else { - hero_l09_set_state(7, 1); + hero_l09_set_move_state(7, 1); } break; } @@ -1560,10 +1560,10 @@ void hero_l09_decide_state_transition(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_action(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); break; } { @@ -1573,7 +1573,7 @@ void hero_l09_decide_state_transition(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l09_set_state(0x11, 1); + hero_l09_set_move_state(0x11, 1); break; } } @@ -1602,7 +1602,7 @@ void hero_l09_decide_state_transition(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l09_set_state(0xE, 1); + hero_l09_set_move_state(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1612,32 +1612,32 @@ void hero_l09_decide_state_transition(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l09_set_state(8, 1); + hero_l09_set_move_state(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l09_set_state(0x17, 1); + hero_l09_set_move_state(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l09_set_state(6, 1); + hero_l09_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l09_set_state(0x79, 1); + hero_l09_set_move_state(0x79, 1); } else { - hero_l09_set_state(0x39, 1); + hero_l09_set_move_state(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l09_set_state(0x82, 1); + hero_l09_set_move_state(0x82, 1); } else { - hero_l09_set_state(0, 0); + hero_l09_set_move_state(0, 0); } } break; @@ -1647,8 +1647,8 @@ void hero_l09_decide_state_transition(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l09_set_state(0x39, 1); - } else if (hero_l09_set_state(0, 0) != 0) { + hero_l09_set_move_state(0x39, 1); + } else if (hero_l09_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 13.0f); } } @@ -1669,7 +1669,7 @@ void hero_l09_decide_state_transition(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l09_set_state(0, 0); + hero_l09_set_move_state(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1680,7 +1680,7 @@ void hero_l09_decide_state_transition(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l09_set_state(0, 0); + hero_l09_set_move_state(0, 0); } break; case 0x22: @@ -1690,12 +1690,12 @@ void hero_l09_decide_state_transition(void) { hero_choose_jump_or_roll_move(); break; } - hero_l09_set_state(7, 1); + hero_l09_set_move_state(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l09_set_state(0, 0); + hero_l09_set_move_state(0, 0); } break; default: diff --git a/src/levels/10_hrugis_cloud/L10_003170D0-state-g8.c b/src/levels/10_hrugis_cloud/L10_003170D0-state-g8.c index 0f65b5f01..10f7cdfde 100644 --- a/src/levels/10_hrugis_cloud/L10_003170D0-state-g8.c +++ b/src/levels/10_hrugis_cloud/L10_003170D0-state-g8.c @@ -117,7 +117,7 @@ extern s32 slot_find_active_in_chain(s32 index); extern void level_select_random_object(void); extern void level_store_pair_with_increment(s32 a0, s32 a1); extern void moby_set_flag_bit(Moby *moby, s32 enabled); -extern s32 hero_l00_set_action(s32 action, s32 animate); +extern s32 hero_l00_set_move_state(s32 action, s32 animate); extern void hero_set_state_value_c(s32 value); extern s32 LockedEntryMenuInput(void); extern void ship_save_transform_state(void); @@ -227,7 +227,7 @@ void UpdateHrugisController(Moby *moby) if (g_state_frame_count++ < 5 || g_mission_reward_state == 2) break; - hero_l00_set_action(0x31, 0); + hero_l00_set_move_state(0x31, 0); if (g_kind_choosing_flag) { hero_set_state_value_c(on); g_selected_mission_kind = LockedEntryMenuInput(); diff --git a/src/levels/11_joba/L11_002C51D0.c b/src/levels/11_joba/L11_002C51D0.c index c0752bc2b..805c0b946 100644 --- a/src/levels/11_joba/L11_002C51D0.c +++ b/src/levels/11_joba/L11_002C51D0.c @@ -53,7 +53,7 @@ extern int g_arena_l11_active_flag __attribute__((sda)); extern u8 g_hero_input_enabled __attribute__((sda)); extern void mem_fast_helper_b(void *, int); extern float math_fabs(float); -extern int hero_l11_enter_state(int, int); +extern int hero_l11_set_move_state(int, int); /* Reads the newest button command and sets the hero's attack, jump, cancel and hover flags. It then starts the matching hero state, such as a swing, a jump or a glide. */ void hero_process_input_command(void) @@ -83,14 +83,14 @@ void hero_process_input_command(void) if (command == 12) g_hero_state.hover = 1; if (g_hero_state.attack) { if (active && g_hero_state.mode == 1 && g_hero_state.state != 0x7a) { - hero_l11_enter_state(0x7a,1); return; + hero_l11_set_move_state(0x7a,1); return; } if (g_hero_state.attack && active && (g_hero_state.state != 0x38 || g_hero_state.animationDone)) { - if (g_hero_state.health) { hero_l11_enter_state(0x38,1); return; } - if (g_current_map_index == 2 && g_arena_l11_active_flag) { hero_l11_enter_state(0x7d,1); return; } - if (*(int *)(*(u8 **)(g_hero_state.object + 0x24) + 0x1f0)) { hero_l11_enter_state(0x79,1); return; } - hero_l11_enter_state(0x39,1); return; + if (g_hero_state.health) { hero_l11_set_move_state(0x38,1); return; } + if (g_current_map_index == 2 && g_arena_l11_active_flag) { hero_l11_set_move_state(0x7d,1); return; } + if (*(int *)(*(u8 **)(g_hero_state.object + 0x24) + 0x1f0)) { hero_l11_set_move_state(0x79,1); return; } + hero_l11_set_move_state(0x39,1); return; } } if (g_hero_state.jump && g_hero_state.state != 0x65 && g_hero_state.state != 0x78 && @@ -98,18 +98,18 @@ void hero_process_input_command(void) g_hero_state.jumpTime-g_hero_state.position.f[2] > 0.0f && (g_hero_state.state != 0x66 || g_hero_state.animationDone) && (g_hero_state.motion.f[2] < 0.0f || g_hero_state.state == 0x7b)) { - if (!g_hero_state.health) { hero_l11_enter_state(0x78,1); return; } - hero_l11_enter_state(0x65,1); return; + if (!g_hero_state.health) { hero_l11_set_move_state(0x78,1); return; } + hero_l11_set_move_state(0x65,1); return; } if (!g_hero_state.cancel || g_hero_state.state == 0x78 || g_hero_state.state == 0x74) return; if (!(math_fabs(g_hero_state.jumpTime-(g_hero_state.position.f[2]+0.25f)) < 1.0f)) return; if (!(g_hero_state.jumpTime-g_hero_state.position.f[2] > 0.0f)) return; if (!(g_hero_state.motion.f[2] < 0.0f) && g_hero_state.state != 0x7b) return; if (g_current_map_index == 13) { - hero_l11_enter_state(0x74, 1); + hero_l11_set_move_state(0x74, 1); return; } - hero_l11_enter_state(0x78, 1); + hero_l11_set_move_state(0x78, 1); } diff --git a/src/levels/11_joba/L11_002CB130.c b/src/levels/11_joba/L11_002CB130.c index 85ee6aba7..5b230ce70 100644 --- a/src/levels/11_joba/L11_002CB130.c +++ b/src/levels/11_joba/L11_002CB130.c @@ -69,7 +69,7 @@ extern u8 g_bolt_multiplier __attribute__((sda)); extern u8 g_contact_hit_flag __attribute__((sda)); extern void mem_fast_helper_b(void *, int); extern float math_fabs(float); -extern int hero_l11_enter_state(int, int); +extern int hero_l11_set_move_state(int, int); extern float fade_get_value(void); extern float fade_reduce_value(float); extern void hero_clear_tracked_slots(void); @@ -121,18 +121,18 @@ int hero_handle_contact_hit(long apply) case 0: contact = g_hero_state.contact; if (contact && (*(short *)(contact+0xaa) == 0x4eb /* moby class 1259 */ || *(short *)(contact+0xaa) == 0x558 /* moby class 1368 */)) { - hero_l11_enter_state(0x7d, 1); return 1; + hero_l11_set_move_state(0x7d, 1); return 1; } if ((g_hero_state.state == 1 || g_hero_state.state == 0x1d || g_hero_state.interrupted) && !(entry->flags & 8)) { u8 *hit = part_find_owned_effect_slot(g_hero_state.object, 1, 0); if (hit) AdjustPlayerHealth(FloatToInt(*(float *)(hit+0x2c))); - if (!g_hero_state.health) hero_l11_enter_state(0x16, 1); + if (!g_hero_state.health) hero_l11_set_move_state(0x16, 1); g_hero_state.timer = 0x4d; if (!g_hero_state.soundTimer) g_hero_state.soundTimer = 0x12; hero_play_sound(0x14, 0); return 0; } - if (entry->flags & 8) hero_l11_enter_state(0x8c, 1); - else hero_l11_enter_state(0x16, 1); + if (entry->flags & 8) hero_l11_set_move_state(0x8c, 1); + else hero_l11_set_move_state(0x16, 1); if (g_hero_state.state == 0x8c) qzero(&direction); else { hero_flatten_push_vector((int)&direction, special, g_hero_state.jumpPressed ? 0.0f : 0.055000003f, 0.028333336f); @@ -140,7 +140,7 @@ int hero_handle_contact_hit(long apply) } break; case 1: - hero_l11_enter_state(0x42, 1); + hero_l11_set_move_state(0x42, 1); hero_flatten_push_vector((int)&direction, special, 0.083333336f, 0.050000004f); break; } diff --git a/src/levels/11_joba/L11_002D22C8.c b/src/levels/11_joba/L11_002D22C8.c index acf643c74..44f27e9cd 100644 --- a/src/levels/11_joba/L11_002D22C8.c +++ b/src/levels/11_joba/L11_002D22C8.c @@ -158,7 +158,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -1017,7 +1017,7 @@ void hero_l11_update_state_machine(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l11_state_block)->f[0x180/4] = 0.1f; diff --git a/src/levels/11_joba/L11_002D8EF8-state-g8.c b/src/levels/11_joba/L11_002D8EF8-state-g8.c index fcb8fc7e7..e39d4c7b5 100644 --- a/src/levels/11_joba/L11_002D8EF8-state-g8.c +++ b/src/levels/11_joba/L11_002D8EF8-state-g8.c @@ -73,8 +73,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -144,7 +144,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l11_enter_state(s32 action, s32 animate) { +s32 hero_l11_set_move_state(s32 action, s32 animate) { f32 dir[4]; u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -192,7 +192,9 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -205,7 +207,7 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_gadget_value(0) == 0x51) set_hero_animation(hero_get_gadget_value(0), 0, 18.0f); else set_hero_animation(hero_get_gadget_value(0), 0, -1.0f); @@ -260,7 +262,7 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l11_enter_state(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l11_set_move_state(0x76, 1); return 0; } } WORD(0x2298) = 0; BYTE(0x40C) = 0; BYTE(0x40E) = 0; @@ -290,11 +292,11 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_gadget_value(0) == 0x51) { if (!animate) goto finish; - if (hero_l11_enter_state(0, 0)) set_hero_animation(hero_get_gadget_value(0), 0, 18.0f); + if (hero_l11_set_move_state(0, 0)) set_hero_animation(hero_get_gadget_value(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -319,7 +321,7 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -478,13 +480,13 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l11_enter_state(0x81, 1); return 0; + hero_l11_set_move_state(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l11_input_blocked) { hero_l11_enter_state(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l11_input_blocked) { hero_l11_set_move_state(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l11_enter_state(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l11_set_move_state(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -544,9 +546,9 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_arena_l11_active_flag) hero_l11_enter_state(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l11_enter_state(0x79, 1); - else hero_l11_enter_state(0x39, 1); + if (g_current_map_index == 2 && g_arena_l11_active_flag) hero_l11_set_move_state(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l11_set_move_state(0x79, 1); + else hero_l11_set_move_state(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -583,7 +585,7 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -612,7 +614,7 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -621,7 +623,7 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -756,7 +758,7 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -837,7 +839,7 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -849,7 +851,7 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth(1); @@ -884,7 +886,7 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { set_hero_animation(0x11, 0, 8.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation(0, 0, 9.0f); goto finish; case 0x4B: @@ -918,7 +920,7 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l11_float_sequences[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -962,7 +964,7 @@ s32 hero_l11_enter_state(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l11_enter_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l11_set_move_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/levels/11_joba/L11_002DE9E0-decider.c b/src/levels/11_joba/L11_002DE9E0-decider.c index c33edf999..0dc38684d 100644 --- a/src/levels/11_joba/L11_002DE9E0-decider.c +++ b/src/levels/11_joba/L11_002DE9E0-decider.c @@ -84,7 +84,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_refresh_speed_from_timer(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l11_enter_state(s32, s32); +s32 hero_l11_set_move_state(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -163,7 +163,7 @@ void hero_decide_next_state(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l11_enter_state(0x39, 1); + hero_l11_set_move_state(0x39, 1); goto end; } } @@ -198,7 +198,7 @@ void hero_decide_next_state(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l11_decide_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l11_enter_state(0x74, 1); + hero_l11_set_move_state(0x74, 1); goto end; } } @@ -208,12 +208,12 @@ void hero_decide_next_state(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state(1, 1); + hero_l11_set_move_state(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l11_enter_state(0x82, 1); + hero_l11_set_move_state(0x82, 1); break; } { @@ -249,7 +249,7 @@ void hero_decide_next_state(void) { rec = g_hero_l11_state_records + selected_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l11_enter_state(0x3C, 1); + hero_l11_set_move_state(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -292,12 +292,12 @@ void hero_decide_next_state(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l11_enter_state(0x76, 1); + hero_l11_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); } break; } @@ -318,12 +318,12 @@ void hero_decide_next_state(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l11_input_blocked == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l11_enter_state(0x6E, 1); + hero_l11_set_move_state(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l11_enter_state(4, 1); + hero_l11_set_move_state(4, 1); break; } } @@ -344,28 +344,28 @@ void hero_decide_next_state(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l11_enter_state(2, 1); + hero_l11_set_move_state(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state(1, 1); + hero_l11_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_buttons = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_buttons & 8)) { - hero_l11_enter_state(0x3D, 1); + hero_l11_set_move_state(0x3D, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l11_enter_state(0x3D, 1); + hero_l11_set_move_state(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); } break; case 0x3D: @@ -374,22 +374,22 @@ void hero_decide_next_state(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state(4, 1); + hero_l11_set_move_state(4, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l11_enter_state(2, 1); + hero_l11_set_move_state(2, 1); break; } - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); break; case 0x39: case 0x43: @@ -439,9 +439,9 @@ void hero_decide_next_state(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state(4, 1); + hero_l11_set_move_state(4, 1); } else { - hero_l11_enter_state(0, 0); + hero_l11_set_move_state(0, 0); anim = hero_get_gadget_value(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -453,9 +453,9 @@ void hero_decide_next_state(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l11_enter_state(0, 0); + hero_l11_set_move_state(0, 0); } else { - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); } } break; @@ -488,7 +488,7 @@ void hero_decide_next_state(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state(7, 1); + hero_l11_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -497,7 +497,7 @@ void hero_decide_next_state(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l11_enter_state(0, 0); + hero_l11_set_move_state(0, 0); } break; } @@ -519,7 +519,7 @@ void hero_decide_next_state(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state(7, 1); + hero_l11_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -532,7 +532,7 @@ void hero_decide_next_state(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l11_enter_state(2, 0); + hero_l11_set_move_state(2, 0); set_hero_animation(3, g_hero_l11_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -543,22 +543,22 @@ void hero_decide_next_state(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l11_enter_state(2, 1); + hero_l11_set_move_state(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l11_enter_state(0, 0); + hero_l11_set_move_state(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state(0, 0); + hero_l11_set_move_state(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -575,7 +575,7 @@ void hero_decide_next_state(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state(7, 1); + hero_l11_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -584,7 +584,7 @@ void hero_decide_next_state(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l11_enter_state(0, 0); + hero_l11_set_move_state(0, 0); set_hero_animation(hero_get_gadget_value(0), 0, 15.0f); break; } @@ -596,7 +596,7 @@ void hero_decide_next_state(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); } break; case 0x2: @@ -610,11 +610,11 @@ void hero_decide_next_state(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l11_enter_state(0x76, 1); + hero_l11_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); break; } n = 9; @@ -628,12 +628,12 @@ void hero_decide_next_state(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l11_enter_state(9, 1); + hero_l11_set_move_state(9, 1); } else { - hero_l11_enter_state(7, 1); + hero_l11_set_move_state(7, 1); } } else { - hero_l11_enter_state(7, 1); + hero_l11_set_move_state(7, 1); } break; } @@ -641,11 +641,11 @@ void hero_decide_next_state(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state(1, 1); + hero_l11_set_move_state(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state(4, 1); + hero_l11_set_move_state(4, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -656,7 +656,7 @@ void hero_decide_next_state(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l11_enter_state(0, 0) == 0) { + if (hero_l11_set_move_state(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -696,17 +696,17 @@ void hero_decide_next_state(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l11_enter_state(3, 0); + hero_l11_set_move_state(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l11_enter_state(0x77, 1); + hero_l11_set_move_state(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l11_enter_state(0x77, 1); + hero_l11_set_move_state(0x77, 1); break; } } @@ -724,11 +724,11 @@ void hero_decide_next_state(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l11_enter_state(0x64, 1); + hero_l11_set_move_state(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l11_enter_state(0x63, 1); + hero_l11_set_move_state(0x63, 1); } } else { hero_update_anim_scale(); @@ -736,21 +736,21 @@ void hero_decide_next_state(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state(0x62, 1); + hero_l11_set_move_state(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l11_enter_state(0x62, 1); + hero_l11_set_move_state(0x62, 1); } break; case 0x65: /* switch 2 */ item_level = FLD(g_hero_state, s32, 0x18C0); if ((item_level < 3) && (((item_level * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 7, &probe_result) != 0)) { - hero_l11_enter_state(0x66, 1); + hero_l11_set_move_state(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -793,30 +793,30 @@ void hero_decide_next_state(void) { return; case 0x6D: if ((f32)g_hero_action_param_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); } break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state(1, 1); + hero_l11_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l11_enter_state(7, 1); + hero_l11_set_move_state(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state(4, 1); + hero_l11_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -824,45 +824,45 @@ void hero_decide_next_state(void) { } if (hero_get_gadget_value(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l11_enter_state(0, 0); + hero_l11_set_move_state(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l11_enter_state(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l11_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_gadget_value(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l11_enter_state(2, 1); + hero_l11_set_move_state(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state(1, 1); + hero_l11_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state(0, 0); + hero_l11_set_move_state(0, 0); set_hero_animation(hero_get_gadget_value(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l11_enter_state(0x76, 1); + hero_l11_set_move_state(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l11_enter_state(0x15, 1); + hero_l11_set_move_state(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -870,17 +870,17 @@ void hero_decide_next_state(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l11_enter_state(0x8B, 1); + hero_l11_set_move_state(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); } break; case 0x24: @@ -906,14 +906,14 @@ void hero_decide_next_state(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l11_enter_state(0, 0); + hero_l11_set_move_state(0, 0); set_hero_animation(hero_get_gadget_value(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l11_enter_state(6, 0); + hero_l11_set_move_state(6, 0); } else { - hero_l11_enter_state(6, 0); + hero_l11_set_move_state(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -929,9 +929,9 @@ void hero_decide_next_state(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); } else { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -943,7 +943,7 @@ void hero_decide_next_state(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l11_enter_state(0x2C, 1); + hero_l11_set_move_state(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -960,13 +960,13 @@ void hero_decide_next_state(void) { } } if (FLD(g_hero_state, s32, 0x6F0) >= 6) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); FLD(g_hero_state, s16, 0x204) = 0x1E; } break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l11_enter_state(0x18, 0); + hero_l11_set_move_state(0x18, 0); } break; case 0x18: @@ -975,18 +975,18 @@ void hero_decide_next_state(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l11_enter_state(0x1B, 1); + hero_l11_set_move_state(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -995,7 +995,7 @@ void hero_decide_next_state(void) { point_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; point_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l11_enter_state(0x19, 1); + hero_l11_set_move_state(0x19, 1); } break; } @@ -1006,7 +1006,7 @@ void hero_decide_next_state(void) { point_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; point_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l11_enter_state(0x1A, 1); + hero_l11_set_move_state(0x1A, 1); } } } @@ -1025,18 +1025,18 @@ void hero_decide_next_state(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state(0x18, 1); + hero_l11_set_move_state(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l11_enter_state(0x1B, 1); + hero_l11_set_move_state(0x1B, 1); } break; } @@ -1046,9 +1046,9 @@ void hero_decide_next_state(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); } else { - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); } } break; @@ -1072,12 +1072,12 @@ void hero_decide_next_state(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l11_enter_state(0x39, 1); + hero_l11_set_move_state(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l11_enter_state(0, 0) != 0) { + if (hero_l11_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1085,7 +1085,7 @@ void hero_decide_next_state(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l11_enter_state(0, 0) != 0) { + if (hero_l11_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1099,32 +1099,32 @@ void hero_decide_next_state(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l11_enter_state(2, 1); + hero_l11_set_move_state(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l11_enter_state(3, 0) != 0) { + if (hero_l11_set_move_state(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l11_enter_state(8, 1); + hero_l11_set_move_state(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state(0x17, 1); + hero_l11_set_move_state(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l11_enter_state(0x71, 1); + hero_l11_set_move_state(0x71, 1); } } break; @@ -1155,7 +1155,7 @@ void hero_decide_next_state(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l11_enter_state(0, 0) != 0) { + if (hero_l11_set_move_state(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1165,9 +1165,9 @@ void hero_decide_next_state(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l11_enter_state(0x74, 1); + hero_l11_set_move_state(0x74, 1); } else { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); } } break; @@ -1180,16 +1180,16 @@ void hero_decide_next_state(void) { ok = 1; } if (ok != 0) { - hero_l11_enter_state(0x11, 1); + hero_l11_set_move_state(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state(0x17, 1); + hero_l11_set_move_state(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1200,23 +1200,23 @@ void hero_decide_next_state(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l11_enter_state(3, 0) != 0) { + if (hero_l11_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state(4, 1); + hero_l11_set_move_state(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_speed_limit_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l11_enter_state(2, 1); + hero_l11_set_move_state(2, 1); break; } - hero_l11_enter_state(2, 0); + hero_l11_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1225,21 +1225,21 @@ void hero_decide_next_state(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_speed_limit_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l11_enter_state(2, 1); + hero_l11_set_move_state(2, 1); break; } - hero_l11_enter_state(2, 0); + hero_l11_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l11_animation_id_extra, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l11_enter_state(0, 0) != 0) { + if (hero_l11_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_gadget_value(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l11_enter_state(0, 0) != 0) { + } else if (hero_l11_set_move_state(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1287,14 +1287,14 @@ void hero_decide_next_state(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state(0xB, 1); + hero_l11_set_move_state(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l11_enter_state(0x82, 1); + hero_l11_set_move_state(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1303,25 +1303,25 @@ void hero_decide_next_state(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l11_enter_state(0xA, 1); + hero_l11_set_move_state(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l11_enter_state(0x10, 1); + hero_l11_set_move_state(0x10, 1); } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l11_enter_state(0x71, 1); + hero_l11_set_move_state(0x71, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l11_enter_state(0x77, 1); + hero_l11_set_move_state(0x77, 1); break; } } @@ -1425,7 +1425,7 @@ void hero_decide_next_state(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l11_enter_state(3, 0) != 0) { + if (hero_l11_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1433,13 +1433,13 @@ void hero_decide_next_state(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_limit_table[0][2])) { - hero_l11_enter_state(7, 1); + hero_l11_set_move_state(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l11_enter_state(7, 1); + hero_l11_set_move_state(7, 1); } else if (g_hero_speed_limit_table[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l11_enter_state(9, 1); + hero_l11_set_move_state(9, 1); } else { - hero_l11_enter_state(7, 1); + hero_l11_set_move_state(7, 1); } break; } @@ -1447,10 +1447,10 @@ void hero_decide_next_state(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_action(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); break; } { @@ -1460,7 +1460,7 @@ void hero_decide_next_state(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l11_enter_state(0x11, 1); + hero_l11_set_move_state(0x11, 1); break; } } @@ -1489,7 +1489,7 @@ void hero_decide_next_state(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l11_enter_state(0xE, 1); + hero_l11_set_move_state(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1499,32 +1499,32 @@ void hero_decide_next_state(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l11_enter_state(8, 1); + hero_l11_set_move_state(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l11_enter_state(0x17, 1); + hero_l11_set_move_state(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l11_enter_state(0x79, 1); + hero_l11_set_move_state(0x79, 1); } else { - hero_l11_enter_state(0x39, 1); + hero_l11_set_move_state(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l11_enter_state(0x82, 1); + hero_l11_set_move_state(0x82, 1); } else { - hero_l11_enter_state(0, 0); + hero_l11_set_move_state(0, 0); } } break; @@ -1534,8 +1534,8 @@ void hero_decide_next_state(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l11_enter_state(0x39, 1); - } else if (hero_l11_enter_state(0, 0) != 0) { + hero_l11_set_move_state(0x39, 1); + } else if (hero_l11_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_gadget_value(0), 0, 13.0f); } } @@ -1560,28 +1560,28 @@ void hero_decide_next_state(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l11_enter_state(0x4E, 1); + hero_l11_set_move_state(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state(1, 1); + hero_l11_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l11_enter_state(0x41, 1); + hero_l11_set_move_state(0x41, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l11_enter_state(0x45, 1); + hero_l11_set_move_state(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l11_enter_state(0x4D, 1); + hero_l11_set_move_state(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l11_enter_state(0x40, 1); + hero_l11_set_move_state(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -1594,14 +1594,14 @@ void hero_decide_next_state(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l11_enter_state(0x4E, 1); + hero_l11_set_move_state(0x4E, 1); break; } rec = (u8 *)&g_hero_action_param_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l11_enter_state(0x3F, 0); + hero_l11_set_move_state(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -1610,13 +1610,13 @@ void hero_decide_next_state(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0x10) ? n : 0xF, NULL) != 0) { - hero_l11_enter_state(0x4D, 1); + hero_l11_set_move_state(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l11_enter_state(0x45, 1); + hero_l11_set_move_state(0x45, 1); } break; } @@ -1679,42 +1679,42 @@ void hero_decide_next_state(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l11_enter_state(0x45, 1); + hero_l11_set_move_state(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_limit_table[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l11_enter_state(0x40, 1); + hero_l11_set_move_state(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l11_enter_state(0x3F, 1); + hero_l11_set_move_state(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l11_enter_state(0x41, 1); + hero_l11_set_move_state(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 5, NULL) != 0)) { - hero_l11_enter_state(0x4D, 1); + hero_l11_set_move_state(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state(0x46, 1); + hero_l11_set_move_state(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l11_enter_state(0x4B, 1); + hero_l11_set_move_state(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l11_enter_state(0x41, 1); + hero_l11_set_move_state(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state(0x46, 1); + hero_l11_set_move_state(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -1724,11 +1724,11 @@ void hero_decide_next_state(void) { FLD(g_hero_state, s16, 0x1EE) = 0xC - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l11_enter_state(0x40, 1); + hero_l11_set_move_state(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l11_enter_state(0x3F, 1); + hero_l11_set_move_state(0x3F, 1); } break; case 0x41: @@ -1740,29 +1740,29 @@ void hero_decide_next_state(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l11_enter_state(0x43, 1); + hero_l11_set_move_state(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l11_enter_state(0x40, 1); + hero_l11_set_move_state(0x40, 1); } else { - hero_l11_enter_state(0x3F, 1); + hero_l11_set_move_state(0x3F, 1); } } else { - hero_l11_enter_state(0x3F, 1); + hero_l11_set_move_state(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state(0x46, 1); + hero_l11_set_move_state(0x46, 1); break; } if ((PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l11_enter_state(0x4B, 1); + hero_l11_set_move_state(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l11_enter_state(0x3F, 1); + hero_l11_set_move_state(0x3F, 1); } break; case 0x4E: @@ -1771,9 +1771,9 @@ void hero_decide_next_state(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l11_enter_state(0x41, 1); + hero_l11_set_move_state(0x41, 1); } else { - hero_l11_enter_state(0x3F, 1); + hero_l11_set_move_state(0x3F, 1); } } break; @@ -1783,7 +1783,7 @@ void hero_decide_next_state(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l11_enter_state(0x4E, 1); + hero_l11_set_move_state(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.025000002f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -1809,55 +1809,55 @@ void hero_decide_next_state(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l11_enter_state(0x45, 1); + hero_l11_set_move_state(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l11_enter_state(0x4D, 1); + hero_l11_set_move_state(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l11_enter_state(0x41, 1); + hero_l11_set_move_state(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l11_enter_state(0x3F, 1); + hero_l11_set_move_state(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l11_enter_state(0x41, 1); + hero_l11_set_move_state(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x24) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l11_enter_state(0x43, 1); + hero_l11_set_move_state(0x43, 1); } else { - hero_l11_enter_state(0x3F, 0); + hero_l11_set_move_state(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state(0x47, 1); + hero_l11_set_move_state(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)point_a = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l11_enter_state(0x41, 1); + hero_l11_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state(0x41, 1); + hero_l11_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l11_enter_state(0x48, 1); + hero_l11_set_move_state(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1866,7 +1866,7 @@ void hero_decide_next_state(void) { point_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; point_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)point_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l11_enter_state(0x49, 1); + hero_l11_set_move_state(0x49, 1); } break; } @@ -1877,7 +1877,7 @@ void hero_decide_next_state(void) { point_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; point_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)point_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l11_enter_state(0x4A, 1); + hero_l11_set_move_state(0x4A, 1); } } } @@ -1896,17 +1896,17 @@ void hero_decide_next_state(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state(0x47, 1); + hero_l11_set_move_state(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l11_enter_state(0x41, 1); + hero_l11_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l11_enter_state(0x48, 1); + hero_l11_set_move_state(0x48, 1); } break; } @@ -1921,7 +1921,7 @@ void hero_decide_next_state(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l11_enter_state(0, 0); + hero_l11_set_move_state(0, 0); anim = hero_get_gadget_value(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1932,7 +1932,7 @@ void hero_decide_next_state(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l11_enter_state(0, 0); + hero_l11_set_move_state(0, 0); } break; case 0x22: @@ -1942,12 +1942,12 @@ void hero_decide_next_state(void) { hero_choose_jump_or_roll_move(); break; } - hero_l11_enter_state(7, 1); + hero_l11_set_move_state(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l11_enter_state(0, 0); + hero_l11_set_move_state(0, 0); } break; default: diff --git a/src/levels/11_joba/L11_00411D40-g8.c b/src/levels/11_joba/L11_00411D40-g8.c index 264244f85..65041b12a 100644 --- a/src/levels/11_joba/L11_00411D40-g8.c +++ b/src/levels/11_joba/L11_00411D40-g8.c @@ -37,7 +37,7 @@ extern f32 math_fast_sin_or_cos_b(f32); extern void FastVecAdd(void *, void *, void *); extern void mem_fast_helper_b(void *, s32); extern void cam_set_mode_state(s32); -extern s32 hero_l11_enter_state(s32, s32); +extern s32 hero_l11_set_move_state(s32, s32); extern void anim_start_blended(void *, s32, s32, s32); extern void SetCamera5Pose(void *, void *, s32, s32, s32); extern f32 fast_vec_dist(void *, void *); @@ -110,7 +110,7 @@ void TurretUpdate(TurretMoby *moby) { mem_fast_helper_b(&g_hero_state.velocity, 0xA0); if (g_pad_state.pressed & 0x10) { cam_set_mode_state(0); - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); moby->command = 2; moby->state = 4; moby->speed = 1.0f; @@ -135,7 +135,7 @@ void TurretUpdate(TurretMoby *moby) { g_hero_state.state != 0x39 && g_hero_state.ground == moby && fast_vec_dist(&seat, g_hero_state.moby + 0x10) < 1.2f && vars->mount_delay == 0 && D_L11_001A8FB4_block[0] == 0) { moby->command = 1; - hero_l11_enter_state(0x31, 1); + hero_l11_set_move_state(0x31, 1); } } switch (moby->state) { diff --git a/src/levels/11_joba/L11_0043E1A0-main-g64.c b/src/levels/11_joba/L11_0043E1A0-main-g64.c index 88bbf7b0b..58bef3637 100644 --- a/src/levels/11_joba/L11_0043E1A0-main-g64.c +++ b/src/levels/11_joba/L11_0043E1A0-main-g64.c @@ -215,7 +215,7 @@ extern void global_object_start(char *, int); extern void script_queue_keyed_request(s32, s32); extern s32 moby_has_free_child_slot_state2(u8 *); extern void moby_try_alloc_enter_state2(void *); -extern s32 hero_l11_enter_state(s32, s32); +extern s32 hero_l11_set_move_state(s32, s32); extern int arena_get_challenge_display_id(unsigned int); extern int arena_get_challenge_flag_index(unsigned int); extern void arena_end_frame(u8 *); @@ -768,10 +768,10 @@ void arena_controller_update(u8 *obj) { HERO->i[0xF4 / 4] = 0; if (HERO->i[0x2294 / 4] != 7) { if (HERO->i[0x2294 / 4] != 0x81) { - hero_l11_enter_state(7, 1); + hero_l11_set_move_state(7, 1); } } else { - hero_l11_enter_state(0x81, 1); + hero_l11_set_move_state(0x81, 1); } if (vec_distance_xy(&HERO->f[0x80 / 4], light_rise->pos) < 0.01f) { HERO->f[0x84 / 4] += 0.01f; @@ -893,7 +893,7 @@ void arena_controller_update(u8 *obj) { arena_queue_voice_line(obj, 4); } } else { - hero_l11_enter_state(0x6F, 1); + hero_l11_set_move_state(0x6F, 1); OBJ->phase = 2; st->mode = 4; OBJ->timer = 0; @@ -928,7 +928,7 @@ void arena_controller_update(u8 *obj) { if (OBJ->timer >= 0xB5) { HERO->h[0x348 / 2] = 0; g_hero_speed_param = 5.0f; - hero_l11_enter_state(0x81, 1); + hero_l11_set_move_state(0x81, 1); OBJ->phase = 3; } } else if (OBJ->phase == 3) { diff --git a/src/levels/11_joba/L11_00443498-g8.c b/src/levels/11_joba/L11_00443498-g8.c index d772fe967..95a892d59 100644 --- a/src/levels/11_joba/L11_00443498-g8.c +++ b/src/levels/11_joba/L11_00443498-g8.c @@ -5,7 +5,7 @@ extern int mode_get_stack_top(void); extern int flag_is_byte_set(void); extern int arena_get_challenge_flag_index(unsigned int); -extern int hero_l11_enter_state(int, int); +extern int hero_l11_set_move_state(int, int); extern int snd_play_from_global_bank(int, int, void *); extern int FastDecTimer(short *); extern void moby_set_state(u8 *, int, int); @@ -46,7 +46,7 @@ void UpdateJobaClassSelectionMenu(u8 *object) int i, found; InputView *input; if (mode_get_stack_top()==5) return; - if (g_game_mode[0]!=0x6f) hero_l11_enter_state(0x6f,1); + if (g_game_mode[0]!=0x6f) hero_l11_set_move_state(0x6f,1); if (H(0x1ea)==0) { if ((((InputView *)g_pad_state)->field1c4&0x2000) && H(0x1e8)<12) { for (i=H(0x1e8)+1;i<13;i++) { diff --git a/src/levels/11_joba/L11_00445990-g8.c b/src/levels/11_joba/L11_00445990-g8.c index 4723311c5..9e06e5725 100644 --- a/src/levels/11_joba/L11_00445990-g8.c +++ b/src/levels/11_joba/L11_00445990-g8.c @@ -14,7 +14,7 @@ typedef struct { extern L11_00445990_Rec g_item_l11_record_table[]; -extern s32 hero_l11_enter_state(s32, s32); +extern s32 hero_l11_set_move_state(s32, s32); extern s32 PadPressedWithin(s32, s32, s32 *); extern s32 arena_get_challenge_flag_index(s32); extern s32 flag_is_byte_set(void); @@ -30,7 +30,7 @@ void joba_menu_select_next(char *moby) { L11_00445990_Rec *record; if (g_game_mode != 0x6F) - hero_l11_enter_state(0x6F, 1); + hero_l11_set_move_state(0x6F, 1); if (PadPressedWithin(0x40, 0x3C, 0) != 0) { moby_set_state(moby, 7, -1); *(s16 *)(state + 0x1E8) = *(u16 *)(state + 0x1F0); diff --git a/src/levels/12_todano/L12_002B85E0-contact.c b/src/levels/12_todano/L12_002B85E0-contact.c index f0ba1d292..8dc652379 100644 --- a/src/levels/12_todano/L12_002B85E0-contact.c +++ b/src/levels/12_todano/L12_002B85E0-contact.c @@ -67,7 +67,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l12_set_action(s32, s32); +extern s32 hero_l12_set_move_state(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth(s32); extern int hero_play_sound(s32, s32); @@ -138,7 +138,7 @@ s32 hero_l12_apply_contact_push(s32 apply_response) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB /* moby class */ || *(s16 *)(other + 0xAA) == 0x558 /* moby class */)) { - hero_l12_set_action(0x7D, 1); + hero_l12_set_move_state(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -149,7 +149,7 @@ s32 hero_l12_apply_contact_push(s32 apply_response) { AdjustPlayerHealth(FloatToInt(*(float *)(r + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l12_set_action(0x16, 1); + hero_l12_set_move_state(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -159,13 +159,13 @@ s32 hero_l12_apply_contact_push(s32 apply_response) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l12_set_action(0x72, 1); + hero_l12_set_move_state(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l12_set_action(0x73, 1); + hero_l12_set_move_state(0x73, 1); } else if (e->f24 & 8) { - hero_l12_set_action(0x8C, 1); + hero_l12_set_move_state(0x8C, 1); } else { - hero_l12_set_action(0x16, 1); + hero_l12_set_move_state(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&vec); @@ -177,7 +177,7 @@ s32 hero_l12_apply_contact_push(s32 apply_response) { } break; case 1: - hero_l12_set_action(0x42, 1); + hero_l12_set_move_state(0x42, 1); hero_flatten_push_vector(&vec, flag, 0.083333336f, 0.050000004f); break; } diff --git a/src/levels/12_todano/L12_002B85E0.c b/src/levels/12_todano/L12_002B85E0.c index 2da4e7b4e..6c31b19ba 100644 --- a/src/levels/12_todano/L12_002B85E0.c +++ b/src/levels/12_todano/L12_002B85E0.c @@ -155,7 +155,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -719,7 +719,7 @@ void hero_l12_update_state_machine(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { temp_a2 = ((Hero *)g_hero_state)->i[0x2440/4]; if (temp_a2 != -1) { @@ -1462,7 +1462,7 @@ void hero_l12_update_state_machine(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_state_copy_a)->f[0x180/4] = 0.1f; diff --git a/src/levels/12_todano/L12_002C8BD0-state-g8.c b/src/levels/12_todano/L12_002C8BD0-state-g8.c index 2fb6000e5..f06e07a80 100644 --- a/src/levels/12_todano/L12_002C8BD0-state-g8.c +++ b/src/levels/12_todano/L12_002C8BD0-state-g8.c @@ -89,8 +89,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -155,7 +155,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l12_set_action(s32 action, s32 animate) { +s32 hero_l12_set_move_state(s32 action, s32 animate) { f32 dir[4]; u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -203,7 +203,9 @@ s32 hero_l12_set_action(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -216,8 +218,8 @@ s32 hero_l12_set_action(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l12_set_action(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l12_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_or_form_id(0) == 0x51) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_or_form_id(0), 0, -1.0f); @@ -364,7 +366,7 @@ s32 hero_l12_set_action(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l12_set_action(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l12_set_move_state(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -410,12 +412,12 @@ s32 hero_l12_set_action(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l12_set_action(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l12_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_or_form_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l12_set_action(0, 0)) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); + if (hero_l12_set_move_state(0, 0)) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -440,7 +442,7 @@ s32 hero_l12_set_action(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -599,13 +601,13 @@ s32 hero_l12_set_action(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l12_set_action(0x81, 1); return 0; + hero_l12_set_move_state(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l12_action_block_flag) { hero_l12_set_action(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l12_action_block_flag) { hero_l12_set_move_state(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l12_set_action(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l12_set_move_state(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -680,9 +682,9 @@ s32 hero_l12_set_action(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_condition_flag) hero_l12_set_action(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l12_set_action(0x79, 1); - else hero_l12_set_action(0x39, 1); + if (g_current_map_index == 2 && g_hero_condition_flag) hero_l12_set_move_state(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l12_set_move_state(0x79, 1); + else hero_l12_set_move_state(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -719,7 +721,7 @@ s32 hero_l12_set_action(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -748,7 +750,7 @@ s32 hero_l12_set_action(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -757,7 +759,7 @@ s32 hero_l12_set_action(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -893,7 +895,7 @@ s32 hero_l12_set_action(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -974,7 +976,7 @@ s32 hero_l12_set_action(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -986,7 +988,7 @@ s32 hero_l12_set_action(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth(1); @@ -1021,7 +1023,7 @@ s32 hero_l12_set_action(s32 action, s32 animate) { set_hero_animation(0x11, 0, 8.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation(0, 0, 9.0f); goto finish; case 0x4B: @@ -1055,7 +1057,7 @@ s32 hero_l12_set_action(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l12_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1099,7 +1101,7 @@ s32 hero_l12_set_action(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l12_set_action(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l12_set_move_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/levels/12_todano/L12_002CF7B0-decider.c b/src/levels/12_todano/L12_002CF7B0-decider.c index a670d6ddd..d154a3b22 100644 --- a/src/levels/12_todano/L12_002CF7B0-decider.c +++ b/src/levels/12_todano/L12_002CF7B0-decider.c @@ -83,7 +83,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l12_set_action(s32, s32); +s32 hero_l12_set_move_state(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -161,7 +161,7 @@ void hero_decide_todano_state(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l12_set_action(0x39, 1); + hero_l12_set_move_state(0x39, 1); goto end; } } @@ -196,7 +196,7 @@ void hero_decide_todano_state(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_todano_hero_height_limit) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l12_set_action(0x74, 1); + hero_l12_set_move_state(0x74, 1); goto end; } } @@ -207,12 +207,12 @@ void hero_decide_todano_state(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action(1, 1); + hero_l12_set_move_state(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l12_set_action(0x82, 1); + hero_l12_set_move_state(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -249,7 +249,7 @@ void hero_decide_todano_state(void) { rec = g_item_l12_record_table + selected_slot * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l12_set_action(0x3C, 1); + hero_l12_set_move_state(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -292,12 +292,12 @@ void hero_decide_todano_state(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l12_set_action(0x76, 1); + hero_l12_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); } break; } @@ -318,17 +318,17 @@ void hero_decide_todano_state(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l12_action_block_flag == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l12_set_action(0x6E, 1); + hero_l12_set_move_state(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l12_set_action(4, 1); + hero_l12_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l12_set_action(0x2E, 1); + hero_l12_set_move_state(0x2E, 1); break; } { @@ -348,28 +348,28 @@ void hero_decide_todano_state(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l12_set_action(2, 1); + hero_l12_set_move_state(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action(1, 1); + hero_l12_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l12_set_action(0x3D, 1); + hero_l12_set_move_state(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l12_set_action(0x3D, 1); + hero_l12_set_move_state(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l12_set_action(0, 1); + hero_l12_set_move_state(0, 1); } break; case 0x3D: @@ -378,22 +378,22 @@ void hero_decide_todano_state(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action(4, 1); + hero_l12_set_move_state(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l12_set_action(2, 1); + hero_l12_set_move_state(2, 1); break; } - hero_l12_set_action(0, 1); + hero_l12_set_move_state(0, 1); break; case 0x39: case 0x43: @@ -432,25 +432,25 @@ void hero_decide_todano_state(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l12_set_action(0x33, 1); + hero_l12_set_move_state(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l12_set_action(0x34, 1); + hero_l12_set_move_state(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l12_set_action(0x32, 1); + hero_l12_set_move_state(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l12_set_action(0x33, 1); + hero_l12_set_move_state(0x33, 1); } } break; @@ -463,81 +463,81 @@ void hero_decide_todano_state(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l12_set_action(0x32, 1); + hero_l12_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l12_set_action(0x34, 1); + hero_l12_set_move_state(0x34, 1); } else { - hero_l12_set_action(0x32, 1); + hero_l12_set_move_state(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l12_set_action(0x12, 1); + hero_l12_set_move_state(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l12_set_action(0x32, 1); + hero_l12_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l12_set_action(0x34, 1); + hero_l12_set_move_state(0x34, 1); } else { - hero_l12_set_action(0x32, 1); + hero_l12_set_move_state(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l12_set_action(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l12_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l12_set_action(0x35, 1); + hero_l12_set_move_state(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l12_set_action(0x12, 1); + hero_l12_set_move_state(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l12_set_action(0x32, 1); + hero_l12_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l12_set_action(0x34, 1); + hero_l12_set_move_state(0x34, 1); } else { - hero_l12_set_action(0x32, 1); + hero_l12_set_move_state(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l12_set_action(0x70, 0); + hero_l12_set_move_state(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l12_set_action(0x36, 1); + hero_l12_set_move_state(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action(0x67, 1); + hero_l12_set_move_state(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action(0x33, 1); + hero_l12_set_move_state(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l12_set_action(0x33, 0); + hero_l12_set_move_state(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action(0x67, 1); + hero_l12_set_move_state(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l12_set_action(0x36, 0); + hero_l12_set_move_state(0x36, 0); } break; case 0x1: @@ -571,9 +571,9 @@ void hero_decide_todano_state(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action(4, 1); + hero_l12_set_move_state(4, 1); } else { - hero_l12_set_action(0, 0); + hero_l12_set_move_state(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -585,9 +585,9 @@ void hero_decide_todano_state(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l12_set_action(0, 0); + hero_l12_set_move_state(0, 0); } else { - hero_l12_set_action(0, 1); + hero_l12_set_move_state(0, 1); } } break; @@ -620,7 +620,7 @@ void hero_decide_todano_state(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action(7, 1); + hero_l12_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -629,7 +629,7 @@ void hero_decide_todano_state(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l12_set_action(0, 0); + hero_l12_set_move_state(0, 0); } break; } @@ -651,7 +651,7 @@ void hero_decide_todano_state(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action(7, 1); + hero_l12_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -664,7 +664,7 @@ void hero_decide_todano_state(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l12_set_action(2, 0); + hero_l12_set_move_state(2, 0); set_hero_animation(3, g_hero_l12_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -675,22 +675,22 @@ void hero_decide_todano_state(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l12_set_action(2, 1); + hero_l12_set_move_state(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l12_set_action(0, 0); + hero_l12_set_move_state(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action(0, 0); + hero_l12_set_move_state(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l12_set_action(0, 1); + hero_l12_set_move_state(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -707,7 +707,7 @@ void hero_decide_todano_state(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action(7, 1); + hero_l12_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -716,7 +716,7 @@ void hero_decide_todano_state(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l12_set_action(0, 0); + hero_l12_set_move_state(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, 15.0f); break; } @@ -728,7 +728,7 @@ void hero_decide_todano_state(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action(0, 1); + hero_l12_set_move_state(0, 1); } break; case 0x2: @@ -742,11 +742,11 @@ void hero_decide_todano_state(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l12_set_action(0x76, 1); + hero_l12_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); break; } n = 9; @@ -760,12 +760,12 @@ void hero_decide_todano_state(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l12_set_action(9, 1); + hero_l12_set_move_state(9, 1); } else { - hero_l12_set_action(7, 1); + hero_l12_set_move_state(7, 1); } } else { - hero_l12_set_action(7, 1); + hero_l12_set_move_state(7, 1); } break; } @@ -773,11 +773,11 @@ void hero_decide_todano_state(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action(1, 1); + hero_l12_set_move_state(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action(4, 1); + hero_l12_set_move_state(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -794,21 +794,21 @@ void hero_decide_todano_state(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l12_set_action(0x2E, 1); + hero_l12_set_move_state(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l12_set_action(2, 1); + hero_l12_set_move_state(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l12_set_action(0x70, 1); + hero_l12_set_move_state(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l12_set_action(2, 1); + hero_l12_set_move_state(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -819,7 +819,7 @@ void hero_decide_todano_state(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l12_set_action(0, 0) == 0) { + if (hero_l12_set_move_state(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -836,7 +836,7 @@ void hero_decide_todano_state(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l12_set_action(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l12_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } if (FLD(cur_move, u8, 0x43) == 0x37) { @@ -857,7 +857,7 @@ void hero_decide_todano_state(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l12_set_action(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l12_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -891,17 +891,17 @@ void hero_decide_todano_state(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l12_set_action(3, 0); + hero_l12_set_move_state(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l12_set_action(0x77, 1); + hero_l12_set_move_state(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l12_set_action(0x77, 1); + hero_l12_set_move_state(0x77, 1); break; } } @@ -919,11 +919,11 @@ void hero_decide_todano_state(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l12_set_action(0x64, 1); + hero_l12_set_move_state(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l12_set_action(0x63, 1); + hero_l12_set_move_state(0x63, 1); } } else { hero_update_anim_scale(); @@ -931,21 +931,21 @@ void hero_decide_todano_state(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action(0x62, 1); + hero_l12_set_move_state(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l12_set_action(0, 1); + hero_l12_set_move_state(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l12_set_action(0x62, 1); + hero_l12_set_move_state(0x62, 1); } break; case 0x65: /* switch 2 */ spawn_count = FLD(g_hero_state, s32, 0x18C0); if ((spawn_count < 3) && (((spawn_count * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 7, &spawn_slot) != 0)) { - hero_l12_set_action(0x66, 1); + hero_l12_set_move_state(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -988,7 +988,7 @@ void hero_decide_todano_state(void) { return; case 0x6D: if ((f32)g_hero_l12_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l12_set_action(0, 1); + hero_l12_set_move_state(0, 1); } break; case 0x30: @@ -1001,7 +1001,7 @@ void hero_decide_todano_state(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l12_set_action(0, 0) != 0) { + if (hero_l12_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1009,25 +1009,25 @@ void hero_decide_todano_state(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action(1, 1); + hero_l12_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l12_set_action(7, 1); + hero_l12_set_move_state(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action(4, 1); + hero_l12_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action(0, 1); + hero_l12_set_move_state(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1035,45 +1035,45 @@ void hero_decide_todano_state(void) { } if (hero_get_weapon_or_form_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l12_set_action(0, 0); + hero_l12_set_move_state(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l12_set_action(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l12_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l12_set_action(2, 1); + hero_l12_set_move_state(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action(1, 1); + hero_l12_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action(0, 0); + hero_l12_set_move_state(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l12_set_action(0x76, 1); + hero_l12_set_move_state(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l12_set_action(0x15, 1); + hero_l12_set_move_state(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l12_set_action(0, 1); + hero_l12_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1081,17 +1081,17 @@ void hero_decide_todano_state(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l12_set_action(0x8B, 1); + hero_l12_set_move_state(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l12_set_action(0, 1); + hero_l12_set_move_state(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l12_set_action(0, 1); + hero_l12_set_move_state(0, 1); } break; case 0x24: @@ -1117,14 +1117,14 @@ void hero_decide_todano_state(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l12_set_action(0, 0); + hero_l12_set_move_state(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l12_set_action(6, 0); + hero_l12_set_move_state(6, 0); } else { - hero_l12_set_action(6, 0); + hero_l12_set_move_state(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1140,9 +1140,9 @@ void hero_decide_todano_state(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l12_set_action(0, 1); + hero_l12_set_move_state(0, 1); } else { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1154,7 +1154,7 @@ void hero_decide_todano_state(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l12_set_action(0x2C, 1); + hero_l12_set_move_state(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1171,13 +1171,13 @@ void hero_decide_todano_state(void) { } } if (FLD(g_hero_state, s32, 0x6F0) >= 6) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); FLD(g_hero_state, s16, 0x204) = 0x1E; } break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l12_set_action(0x18, 0); + hero_l12_set_move_state(0x18, 0); } break; case 0x18: @@ -1186,18 +1186,18 @@ void hero_decide_todano_state(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l12_set_action(0x1B, 1); + hero_l12_set_move_state(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1206,7 +1206,7 @@ void hero_decide_todano_state(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l12_set_action(0x19, 1); + hero_l12_set_move_state(0x19, 1); } break; } @@ -1217,7 +1217,7 @@ void hero_decide_todano_state(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l12_set_action(0x1A, 1); + hero_l12_set_move_state(0x1A, 1); } } } @@ -1236,18 +1236,18 @@ void hero_decide_todano_state(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action(0x18, 1); + hero_l12_set_move_state(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l12_set_action(0x1B, 1); + hero_l12_set_move_state(0x1B, 1); } break; } @@ -1257,9 +1257,9 @@ void hero_decide_todano_state(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); } else { - hero_l12_set_action(0, 1); + hero_l12_set_move_state(0, 1); } } break; @@ -1283,12 +1283,12 @@ void hero_decide_todano_state(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action(0x39, 1); + hero_l12_set_move_state(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l12_set_action(0, 0) != 0) { + if (hero_l12_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1296,7 +1296,7 @@ void hero_decide_todano_state(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l12_set_action(0, 0) != 0) { + if (hero_l12_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1310,32 +1310,32 @@ void hero_decide_todano_state(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l12_set_action(2, 1); + hero_l12_set_move_state(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l12_set_action(3, 0) != 0) { + if (hero_l12_set_move_state(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l12_set_action(0, 1); + hero_l12_set_move_state(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l12_set_action(8, 1); + hero_l12_set_move_state(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action(0x17, 1); + hero_l12_set_move_state(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l12_set_action(0x71, 1); + hero_l12_set_move_state(0x71, 1); } } break; @@ -1366,7 +1366,7 @@ void hero_decide_todano_state(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l12_set_action(0, 0) != 0) { + if (hero_l12_set_move_state(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1376,9 +1376,9 @@ void hero_decide_todano_state(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l12_set_action(0x74, 1); + hero_l12_set_move_state(0x74, 1); } else { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); } } break; @@ -1391,16 +1391,16 @@ void hero_decide_todano_state(void) { ok = 1; } if (ok != 0) { - hero_l12_set_action(0x11, 1); + hero_l12_set_move_state(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action(0x17, 1); + hero_l12_set_move_state(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1411,23 +1411,23 @@ void hero_decide_todano_state(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l12_set_action(3, 0) != 0) { + if (hero_l12_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action(4, 1); + hero_l12_set_move_state(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_l12_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l12_set_action(2, 1); + hero_l12_set_move_state(2, 1); break; } - hero_l12_set_action(2, 0); + hero_l12_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1436,21 +1436,21 @@ void hero_decide_todano_state(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_l12_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l12_set_action(2, 1); + hero_l12_set_move_state(2, 1); break; } - hero_l12_set_action(2, 0); + hero_l12_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l12_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l12_set_action(0, 0) != 0) { + if (hero_l12_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l12_set_action(0, 0) != 0) { + } else if (hero_l12_set_move_state(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1498,14 +1498,14 @@ void hero_decide_todano_state(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action(0xB, 1); + hero_l12_set_move_state(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l12_set_action(0x82, 1); + hero_l12_set_move_state(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1514,25 +1514,25 @@ void hero_decide_todano_state(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l12_set_action(0xA, 1); + hero_l12_set_move_state(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l12_set_action(0x10, 1); + hero_l12_set_move_state(0x10, 1); } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l12_set_action(0x71, 1); + hero_l12_set_move_state(0x71, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l12_set_action(0x77, 1); + hero_l12_set_move_state(0x77, 1); break; } } @@ -1636,7 +1636,7 @@ void hero_decide_todano_state(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l12_set_action(3, 0) != 0) { + if (hero_l12_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1644,13 +1644,13 @@ void hero_decide_todano_state(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l12_speed_params[0][2])) { - hero_l12_set_action(7, 1); + hero_l12_set_move_state(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l12_set_action(7, 1); + hero_l12_set_move_state(7, 1); } else if (g_hero_l12_speed_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l12_set_action(9, 1); + hero_l12_set_move_state(9, 1); } else { - hero_l12_set_action(7, 1); + hero_l12_set_move_state(7, 1); } break; } @@ -1658,10 +1658,10 @@ void hero_decide_todano_state(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); break; } { @@ -1671,7 +1671,7 @@ void hero_decide_todano_state(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &tmp_d) != 0) && (tmp_d < FLD(g_hero_state, s32, 0x1B8))) { - hero_l12_set_action(0x11, 1); + hero_l12_set_move_state(0x11, 1); break; } } @@ -1700,7 +1700,7 @@ void hero_decide_todano_state(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l12_set_action(0xE, 1); + hero_l12_set_move_state(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1710,32 +1710,32 @@ void hero_decide_todano_state(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l12_set_action(8, 1); + hero_l12_set_move_state(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l12_set_action(0x17, 1); + hero_l12_set_move_state(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l12_set_action(6, 1); + hero_l12_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l12_set_action(0x79, 1); + hero_l12_set_move_state(0x79, 1); } else { - hero_l12_set_action(0x39, 1); + hero_l12_set_move_state(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l12_set_action(0x82, 1); + hero_l12_set_move_state(0x82, 1); } else { - hero_l12_set_action(0, 0); + hero_l12_set_move_state(0, 0); } } break; @@ -1745,8 +1745,8 @@ void hero_decide_todano_state(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action(0x39, 1); - } else if (hero_l12_set_action(0, 0) != 0) { + hero_l12_set_move_state(0x39, 1); + } else if (hero_l12_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 13.0f); } } @@ -1771,28 +1771,28 @@ void hero_decide_todano_state(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l12_set_action(0x4E, 1); + hero_l12_set_move_state(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action(1, 1); + hero_l12_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l12_set_action(0x41, 1); + hero_l12_set_move_state(0x41, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l12_set_action(0x45, 1); + hero_l12_set_move_state(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l12_set_action(0x4D, 1); + hero_l12_set_move_state(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l12_set_action(0x40, 1); + hero_l12_set_move_state(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -1805,14 +1805,14 @@ void hero_decide_todano_state(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l12_set_action(0x4E, 1); + hero_l12_set_move_state(0x4E, 1); break; } rec = (u8 *)&g_hero_l12_action_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l12_set_action(0x3F, 0); + hero_l12_set_move_state(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -1821,13 +1821,13 @@ void hero_decide_todano_state(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0x10) ? n : 0xF, NULL) != 0) { - hero_l12_set_action(0x4D, 1); + hero_l12_set_move_state(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l12_set_action(0x45, 1); + hero_l12_set_move_state(0x45, 1); } break; } @@ -1890,42 +1890,42 @@ void hero_decide_todano_state(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l12_set_action(0x45, 1); + hero_l12_set_move_state(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l12_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l12_set_action(0x40, 1); + hero_l12_set_move_state(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l12_set_action(0x3F, 1); + hero_l12_set_move_state(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l12_set_action(0x41, 1); + hero_l12_set_move_state(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 5, NULL) != 0)) { - hero_l12_set_action(0x4D, 1); + hero_l12_set_move_state(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action(0x46, 1); + hero_l12_set_move_state(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l12_set_action(0x4B, 1); + hero_l12_set_move_state(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l12_set_action(0x41, 1); + hero_l12_set_move_state(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action(0x46, 1); + hero_l12_set_move_state(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -1935,11 +1935,11 @@ void hero_decide_todano_state(void) { FLD(g_hero_state, s16, 0x1EE) = 0xC - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l12_set_action(0x40, 1); + hero_l12_set_move_state(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l12_set_action(0x3F, 1); + hero_l12_set_move_state(0x3F, 1); } break; case 0x41: @@ -1951,29 +1951,29 @@ void hero_decide_todano_state(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action(0x43, 1); + hero_l12_set_move_state(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l12_set_action(0x40, 1); + hero_l12_set_move_state(0x40, 1); } else { - hero_l12_set_action(0x3F, 1); + hero_l12_set_move_state(0x3F, 1); } } else { - hero_l12_set_action(0x3F, 1); + hero_l12_set_move_state(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action(0x46, 1); + hero_l12_set_move_state(0x46, 1); break; } if ((PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l12_set_action(0x4B, 1); + hero_l12_set_move_state(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l12_set_action(0x3F, 1); + hero_l12_set_move_state(0x3F, 1); } break; case 0x4E: @@ -1982,9 +1982,9 @@ void hero_decide_todano_state(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l12_set_action(0x41, 1); + hero_l12_set_move_state(0x41, 1); } else { - hero_l12_set_action(0x3F, 1); + hero_l12_set_move_state(0x3F, 1); } } break; @@ -1994,7 +1994,7 @@ void hero_decide_todano_state(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l12_set_action(0x4E, 1); + hero_l12_set_move_state(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.025000002f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2020,55 +2020,55 @@ void hero_decide_todano_state(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l12_set_action(0x45, 1); + hero_l12_set_move_state(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l12_set_action(0x4D, 1); + hero_l12_set_move_state(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l12_set_action(0x41, 1); + hero_l12_set_move_state(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l12_set_action(0x3F, 1); + hero_l12_set_move_state(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l12_set_action(0x41, 1); + hero_l12_set_move_state(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x24) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action(0x43, 1); + hero_l12_set_move_state(0x43, 1); } else { - hero_l12_set_action(0x3F, 0); + hero_l12_set_move_state(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action(0x47, 1); + hero_l12_set_move_state(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)vec_a = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l12_set_action(0x41, 1); + hero_l12_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action(0x41, 1); + hero_l12_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l12_set_action(0x48, 1); + hero_l12_set_move_state(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2077,7 +2077,7 @@ void hero_decide_todano_state(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l12_set_action(0x49, 1); + hero_l12_set_move_state(0x49, 1); } break; } @@ -2088,7 +2088,7 @@ void hero_decide_todano_state(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l12_set_action(0x4A, 1); + hero_l12_set_move_state(0x4A, 1); } } } @@ -2107,17 +2107,17 @@ void hero_decide_todano_state(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action(0x47, 1); + hero_l12_set_move_state(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l12_set_action(0x41, 1); + hero_l12_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l12_set_action(0x48, 1); + hero_l12_set_move_state(0x48, 1); } break; } @@ -2132,7 +2132,7 @@ void hero_decide_todano_state(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l12_set_action(0, 0); + hero_l12_set_move_state(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -2143,7 +2143,7 @@ void hero_decide_todano_state(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l12_set_action(0, 0); + hero_l12_set_move_state(0, 0); } break; case 0x22: @@ -2153,12 +2153,12 @@ void hero_decide_todano_state(void) { hero_choose_jump_or_roll_move(); break; } - hero_l12_set_action(7, 1); + hero_l12_set_move_state(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l12_set_action(0, 0); + hero_l12_set_move_state(0, 0); } break; default: diff --git a/src/levels/13_boldan/L13_002CEF00-state-g8.c b/src/levels/13_boldan/L13_002CEF00-state-g8.c index fbd88154e..9b61b70e0 100644 --- a/src/levels/13_boldan/L13_002CEF00-state-g8.c +++ b/src/levels/13_boldan/L13_002CEF00-state-g8.c @@ -81,8 +81,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -147,7 +147,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_change_action(s32 action, s32 animate) { +s32 hero_l13_set_move_state(s32 action, s32 animate) { f32 dir[4]; u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -195,7 +195,9 @@ s32 hero_change_action(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -208,8 +210,8 @@ s32 hero_change_action(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_change_action(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_change_action(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l13_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_or_form_id(0) == 0x51) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_or_form_id(0), 0, -1.0f); @@ -356,7 +358,7 @@ s32 hero_change_action(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_change_action(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l13_set_move_state(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -402,12 +404,12 @@ s32 hero_change_action(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_change_action(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_change_action(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l13_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_or_form_id(0) == 0x51) { if (!animate) goto finish; - if (hero_change_action(0, 0)) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); + if (hero_l13_set_move_state(0, 0)) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -432,7 +434,7 @@ s32 hero_change_action(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_change_action(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -597,13 +599,13 @@ s32 hero_change_action(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_change_action(0x81, 1); return 0; + hero_l13_set_move_state(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_aim_blocked) { hero_change_action(0x6E, 1); return 0; } + action != 0x38 && !g_hero_aim_blocked) { hero_l13_set_move_state(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_change_action(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l13_set_move_state(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -678,9 +680,9 @@ s32 hero_change_action(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_map_action_flag) hero_change_action(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_change_action(0x79, 1); - else hero_change_action(0x39, 1); + if (g_current_map_index == 2 && g_hero_map_action_flag) hero_l13_set_move_state(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l13_set_move_state(0x79, 1); + else hero_l13_set_move_state(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -731,7 +733,7 @@ s32 hero_change_action(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -760,7 +762,7 @@ s32 hero_change_action(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -769,7 +771,7 @@ s32 hero_change_action(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -911,7 +913,7 @@ s32 hero_change_action(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -1002,7 +1004,7 @@ s32 hero_change_action(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -1014,7 +1016,7 @@ s32 hero_change_action(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth(1); @@ -1049,7 +1051,7 @@ s32 hero_change_action(s32 action, s32 animate) { set_hero_animation(0x11, 0, 8.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_change_action(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation(0, 0, 9.0f); goto finish; case 0x4B: @@ -1083,7 +1085,7 @@ s32 hero_change_action(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l13_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_change_action(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1127,7 +1129,7 @@ s32 hero_change_action(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_change_action(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l13_set_move_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/levels/13_boldan/L13_00306F38-gate.c b/src/levels/13_boldan/L13_00306F38-gate.c index f5569b044..125c177bb 100644 --- a/src/levels/13_boldan/L13_00306F38-gate.c +++ b/src/levels/13_boldan/L13_00306F38-gate.c @@ -2,7 +2,7 @@ extern void moby_mark_spawned(void *); extern int hero_is_current_selected_id(void *); extern int IsPointInCuboid(void *,int); -extern int hero_change_action(int,int); +extern int hero_l13_set_move_state(int,int); extern void math_apply_axis_rotation_to_quat(void *,void *,void *,float); extern float vec_distance_xy(void *,void *); extern struct { char pad[0x348]; short state; } g_hero_state; @@ -23,7 +23,7 @@ void gate_l13_update(char *moby) { if (hero_is_current_selected_id(moby)) { if (g_hero_state.state==1 && IsPointInCuboid((char *)&g_hero_state+0x80,*(int *)(vars+8))) { *(u16 *)(moby+0x96)=0; - hero_change_action(0x6F,1); + hero_l13_set_move_state(0x6F,1); *(u8 *)(moby+0x20)=2; } if (*(int *)(vars+8)!=-1 || !*(char **)(vars+0xC)) break; @@ -42,7 +42,7 @@ void gate_l13_update(char *moby) { math_apply_axis_rotation_to_quat(moby+0xE0,moby+0xE0,moby+0xD0,0.017453294f); (*(u16 *)(moby+0x96))++; } else { - hero_change_action(0,1); + hero_l13_set_move_state(0,1); *(u8 *)(moby+0x20)=7; } break; diff --git a/src/levels/14_aranos_prison/L14_003CB868.c b/src/levels/14_aranos_prison/L14_003CB868.c index 7c5ce0e3e..0c175b7b4 100644 --- a/src/levels/14_aranos_prison/L14_003CB868.c +++ b/src/levels/14_aranos_prison/L14_003CB868.c @@ -13,7 +13,7 @@ extern float math_random_float_range(float a, float b); extern float square_root(float a); extern void FastVecScale(void *dst, void *src, float s); extern void entity_start_launch_to_target(char *e, void *v, float a, float b, float c); -extern s32 hero_l00_set_action(int a0, int a1); +extern s32 hero_l00_set_move_state(int a0, int a1); extern unsigned short *g_group_entity_lists[]; extern unsigned char *g_moby_l14_pool MACRO_ADDR; extern int g_group_link_limit __attribute__((sda)); @@ -83,7 +83,7 @@ void UpdateLaunchVolume(char *self) { fall_height = (top_height - projected[2]) * 2.0f; duration += square_root(fall_height / 0.0055555557f); FastVecSub(launch_velocity, projected, hero_now + 0x80); FastVecScale(launch_velocity, launch_velocity, 1.0f / duration); launch_velocity[2] = square_root(rise_height * 0.0055555557f); - hero_l00_set_action(0x44, 1); + hero_l00_set_move_state(0x44, 1); qcopy(hero_now + 0xF0, launch_velocity); } } diff --git a/src/levels/14_aranos_prison/L14_003F4F98.c b/src/levels/14_aranos_prison/L14_003F4F98.c index 949471f13..843864ecd 100644 --- a/src/levels/14_aranos_prison/L14_003F4F98.c +++ b/src/levels/14_aranos_prison/L14_003F4F98.c @@ -518,7 +518,7 @@ extern void lift_request_start(void *); extern void moby_mark_spawned(void *); extern void lift_set_moving_state(void *); extern void moby_set_state(void *, int, int); -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern int math_fast_float_d(void *); extern float math_fast_sin_or_cos_b(float); extern void gfx_add_draw_callback_third(void (*)(void *), void *); @@ -668,7 +668,7 @@ void lift_scene_update(unsigned char *moby) { if (flag_set_first_pending(moby)) { state->waitTimer = state->fadeLength; state->fadeTimer = state->fadeLength * 2; - hero_l00_set_action(0x6F, 1); + hero_l00_set_move_state(0x6F, 1); } if (math_fast_float_d(&state->waitTimer)) moby_set_state(moby, state->nextState, -1); diff --git a/src/levels/15_gorn/L15_0042DCE0-g8.c b/src/levels/15_gorn/L15_0042DCE0-g8.c index 312098c50..8e5665980 100644 --- a/src/levels/15_gorn/L15_0042DCE0-g8.c +++ b/src/levels/15_gorn/L15_0042DCE0-g8.c @@ -106,7 +106,7 @@ extern s32 slot_find_active_in_chain(s32 index); extern void level_select_random_object(void); extern void level_store_pair_with_increment(s32 a0, s32 a1); extern void moby_set_flag_bit(Moby *moby, s32 enabled); -extern s32 hero_l00_set_action(s32 action, s32 animate); +extern s32 hero_l00_set_move_state(s32 action, s32 animate); extern void hero_set_state_value_c(s32 value); extern s32 LockedEntryMenuInput(void); extern void ship_save_transform_state(void); @@ -209,7 +209,7 @@ void UpdateGornController(Moby *moby) if (g_gorn_message_counter++ < 5 || g_challenge_mode == 2) break; - hero_l00_set_action(0x31, 0); + hero_l00_set_move_state(0x31, 0); if (g_gorn_enabled_flag) { hero_set_state_value_c(on); g_challenge_menu_choice = LockedEntryMenuInput(); diff --git a/src/levels/16_snivelak/L16_002AD320.c b/src/levels/16_snivelak/L16_002AD320.c index 5a760db9e..01afedc73 100644 --- a/src/levels/16_snivelak/L16_002AD320.c +++ b/src/levels/16_snivelak/L16_002AD320.c @@ -123,7 +123,7 @@ extern int g_hero_special_enter_flag __attribute__((sda)); extern u8 g_hero_input_enabled __attribute__((sda)); extern void mem_fast_helper_b(void *, int); extern float math_fabs(float); -extern int hero_l16_enter_state(int, int); +extern int hero_l16_set_move_state(int, int); /* Same body as func_L11_002C51D0, with this function's own callees. */ /* Reads the controller command for the player and starts the attack, jump or hover state it asks for. */ @@ -155,10 +155,10 @@ void hero_read_command_start_action(void) if (g_hero_state.attack) { if (g_hero_state.attack && active && (g_hero_state.state != 0x38 || g_hero_state.animationDone)) { - if (g_hero_state.health) { hero_l16_enter_state(0x38,1); return; } - if (g_current_map_index == 2 && g_hero_special_enter_flag) { hero_l16_enter_state(0x7d,1); return; } - if (*(int *)(*(u8 **)(g_hero_state.object + 0x24) + 0x1f0)) { hero_l16_enter_state(0x79,1); return; } - hero_l16_enter_state(0x39,1); return; + if (g_hero_state.health) { hero_l16_set_move_state(0x38,1); return; } + if (g_current_map_index == 2 && g_hero_special_enter_flag) { hero_l16_set_move_state(0x7d,1); return; } + if (*(int *)(*(u8 **)(g_hero_state.object + 0x24) + 0x1f0)) { hero_l16_set_move_state(0x79,1); return; } + hero_l16_set_move_state(0x39,1); return; } } if (g_hero_state.jump && g_hero_state.state != 0x65 && g_hero_state.state != 0x78 && @@ -166,18 +166,18 @@ void hero_read_command_start_action(void) g_hero_state.jumpTime-g_hero_state.position.f[2] > 0.0f && (g_hero_state.state != 0x66 || g_hero_state.animationDone) && (g_hero_state.motion.f[2] < 0.0f || g_hero_state.state == 0x7b)) { - if (!g_hero_state.health) { hero_l16_enter_state(0x78,1); return; } - hero_l16_enter_state(0x65,1); return; + if (!g_hero_state.health) { hero_l16_set_move_state(0x78,1); return; } + hero_l16_set_move_state(0x65,1); return; } if (!g_hero_state.cancel || g_hero_state.state == 0x78 || g_hero_state.state == 0x74) return; if (!(math_fabs(g_hero_state.jumpTime-(g_hero_state.position.f[2]+0.25f)) < 1.0f)) return; if (!(g_hero_state.jumpTime-g_hero_state.position.f[2] > 0.0f)) return; if (!(g_hero_state.motion.f[2] < 0.0f) && g_hero_state.state != 0x7b) return; if (g_current_map_index == 13) { - hero_l16_enter_state(0x74, 1); + hero_l16_set_move_state(0x74, 1); return; } - hero_l16_enter_state(0x78, 1); + hero_l16_set_move_state(0x78, 1); } diff --git a/src/levels/16_snivelak/L16_002B3250.c b/src/levels/16_snivelak/L16_002B3250.c index c168711df..b2425a5be 100644 --- a/src/levels/16_snivelak/L16_002B3250.c +++ b/src/levels/16_snivelak/L16_002B3250.c @@ -66,7 +66,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l16_enter_state(unsigned long, unsigned long); +extern s32 hero_l16_set_move_state(unsigned long, unsigned long); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth(s32); extern int hero_play_sound(s32, s32); @@ -141,7 +141,7 @@ s32 hero_handle_contact_reaction(s32 apply_reaction) { case 0: contact_moby = g_hero_state.f249C; if (contact_moby != 0 && (*(s16 *)(contact_moby + 0xAA) == 0x4EB /* moby class 1259 */ || *(s16 *)(contact_moby + 0xAA) == 0x558 /* moby class 1368 */)) { - hero_l16_enter_state(0x7D, 1); + hero_l16_set_move_state(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -152,7 +152,7 @@ s32 hero_handle_contact_reaction(s32 apply_reaction) { AdjustPlayerHealth(FloatToInt(*(float *)(hit_info + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l16_enter_state(0x16, 1); + hero_l16_set_move_state(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -162,9 +162,9 @@ s32 hero_handle_contact_reaction(s32 apply_reaction) { return 0; } if (entry->f24 & 8) { - hero_l16_enter_state(0x8C, 1); + hero_l16_set_move_state(0x8C, 1); } else { - hero_l16_enter_state(0x16, 1); + hero_l16_set_move_state(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&impulse); diff --git a/src/levels/16_snivelak/L16_002B9FF0.c b/src/levels/16_snivelak/L16_002B9FF0.c index a7f78be37..d0cf81674 100644 --- a/src/levels/16_snivelak/L16_002B9FF0.c +++ b/src/levels/16_snivelak/L16_002B9FF0.c @@ -161,7 +161,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -180,7 +180,7 @@ extern s32 shooter_update_ranged_attack(s32); extern s32 hero_get_weapon_anim_id(s32); extern void hero_exit_vehicle_mode(s32); extern void ClipHeroVelocityAgainstWall(s32); -extern s32 hero_l20_set_state(s32, s32); +extern s32 hero_l20_set_move_state(s32, s32); /* Runs the player's per-frame behaviour for the current action (walking, jumping, swinging, swimming and so on). */ void hero_update_state_handler(void) { f32 speed62; @@ -999,7 +999,7 @@ void hero_update_state_handler(void) { coll_process_hit(0.4f, (s32)((TI128*)vec_a), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec_b)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_snivelak_hero_state)->f[0x180/4] = 0.1f; diff --git a/src/levels/16_snivelak/L16_002C0BC8-state-g8.c b/src/levels/16_snivelak/L16_002C0BC8-state-g8.c index 5b5ae0605..7eaae5fab 100644 --- a/src/levels/16_snivelak/L16_002C0BC8-state-g8.c +++ b/src/levels/16_snivelak/L16_002C0BC8-state-g8.c @@ -74,8 +74,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -144,7 +144,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l16_enter_state(s32 action, s32 animate) { +s32 hero_l16_set_move_state(s32 action, s32 animate) { f32 dir[4]; u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -192,7 +192,9 @@ s32 hero_l16_enter_state(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -205,7 +207,7 @@ s32 hero_l16_enter_state(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_enter_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_anim_id(0) == 0x51) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_anim_id(0), 0, -1.0f); @@ -256,7 +258,7 @@ s32 hero_l16_enter_state(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l16_enter_state(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l16_set_move_state(0x76, 1); return 0; } } WORD(0x2298) = 0; BYTE(0x40C) = 0; BYTE(0x40E) = 0; @@ -286,11 +288,11 @@ s32 hero_l16_enter_state(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_enter_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_set_move_state(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_anim_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l16_enter_state(0, 0)) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); + if (hero_l16_set_move_state(0, 0)) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -315,7 +317,7 @@ s32 hero_l16_enter_state(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_enter_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -479,13 +481,13 @@ s32 hero_l16_enter_state(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 /* moby class 2489 */ || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05 /* moby class 3845 */)) { - hero_l16_enter_state(0x81, 1); return 0; + hero_l16_set_move_state(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_action_lock_flag) { hero_l16_enter_state(0x6E, 1); return 0; } + action != 0x38 && !g_hero_action_lock_flag) { hero_l16_set_move_state(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l16_enter_state(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l16_set_move_state(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -545,9 +547,9 @@ s32 hero_l16_enter_state(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_special_enter_flag) hero_l16_enter_state(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l16_enter_state(0x79, 1); - else hero_l16_enter_state(0x39, 1); + if (g_current_map_index == 2 && g_hero_special_enter_flag) hero_l16_set_move_state(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l16_set_move_state(0x79, 1); + else hero_l16_set_move_state(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -595,7 +597,7 @@ s32 hero_l16_enter_state(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -621,7 +623,7 @@ s32 hero_l16_enter_state(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -630,7 +632,7 @@ s32 hero_l16_enter_state(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -769,7 +771,7 @@ s32 hero_l16_enter_state(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -834,7 +836,7 @@ s32 hero_l16_enter_state(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -846,7 +848,7 @@ s32 hero_l16_enter_state(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth(1); @@ -885,7 +887,7 @@ s32 hero_l16_enter_state(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l16_enter_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l16_set_move_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/levels/16_snivelak/L16_002C6378-decider.c b/src/levels/16_snivelak/L16_002C6378-decider.c index ff16bf7d5..25ebb199c 100644 --- a/src/levels/16_snivelak/L16_002C6378-decider.c +++ b/src/levels/16_snivelak/L16_002C6378-decider.c @@ -82,7 +82,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_refresh_speed_from_timer(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l16_enter_state(s32, s32); +s32 hero_l16_set_move_state(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -162,7 +162,7 @@ void hero_decide_state_snivelak(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l16_enter_state(0x39, 1); + hero_l16_set_move_state(0x39, 1); goto end; } } @@ -191,7 +191,7 @@ void hero_decide_state_snivelak(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_snivelak_hero_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l16_enter_state(0x74, 1); + hero_l16_set_move_state(0x74, 1); goto end; } } @@ -201,12 +201,12 @@ void hero_decide_state_snivelak(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state(1, 1); + hero_l16_set_move_state(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l16_enter_state(0x82, 1); + hero_l16_set_move_state(0x82, 1); break; } { @@ -242,7 +242,7 @@ void hero_decide_state_snivelak(void) { rec = g_hero_record_table + sp40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l16_enter_state(0x3C, 1); + hero_l16_set_move_state(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -285,12 +285,12 @@ void hero_decide_state_snivelak(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l16_enter_state(0x76, 1); + hero_l16_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); } break; } @@ -311,17 +311,17 @@ void hero_decide_state_snivelak(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_action_lock_flag == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l16_enter_state(0x6E, 1); + hero_l16_set_move_state(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l16_enter_state(4, 1); + hero_l16_set_move_state(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state(0x27, 1); + hero_l16_set_move_state(0x27, 1); break; } { @@ -341,28 +341,28 @@ void hero_decide_state_snivelak(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l16_enter_state(2, 1); + hero_l16_set_move_state(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state(1, 1); + hero_l16_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l16_enter_state(0x3D, 1); + hero_l16_set_move_state(0x3D, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l16_enter_state(0x3D, 1); + hero_l16_set_move_state(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l16_enter_state(0, 1); + hero_l16_set_move_state(0, 1); } break; case 0x3D: @@ -371,22 +371,22 @@ void hero_decide_state_snivelak(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state(4, 1); + hero_l16_set_move_state(4, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l16_enter_state(2, 1); + hero_l16_set_move_state(2, 1); break; } - hero_l16_enter_state(0, 1); + hero_l16_set_move_state(0, 1); break; case 0x39: case 0x43: @@ -436,9 +436,9 @@ void hero_decide_state_snivelak(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state(4, 1); + hero_l16_set_move_state(4, 1); } else { - hero_l16_enter_state(0, 0); + hero_l16_set_move_state(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -450,9 +450,9 @@ void hero_decide_state_snivelak(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l16_enter_state(0, 0); + hero_l16_set_move_state(0, 0); } else { - hero_l16_enter_state(0, 1); + hero_l16_set_move_state(0, 1); } } break; @@ -485,7 +485,7 @@ void hero_decide_state_snivelak(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state(7, 1); + hero_l16_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -494,7 +494,7 @@ void hero_decide_state_snivelak(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l16_enter_state(0, 0); + hero_l16_set_move_state(0, 0); } break; } @@ -516,7 +516,7 @@ void hero_decide_state_snivelak(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state(7, 1); + hero_l16_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -529,7 +529,7 @@ void hero_decide_state_snivelak(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l16_enter_state(2, 0); + hero_l16_set_move_state(2, 0); set_hero_animation(3, g_hero_l16_animation_table[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -540,22 +540,22 @@ void hero_decide_state_snivelak(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l16_enter_state(2, 1); + hero_l16_set_move_state(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l16_enter_state(0, 0); + hero_l16_set_move_state(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state(0, 0); + hero_l16_set_move_state(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l16_enter_state(0, 1); + hero_l16_set_move_state(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -572,7 +572,7 @@ void hero_decide_state_snivelak(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state(7, 1); + hero_l16_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -581,7 +581,7 @@ void hero_decide_state_snivelak(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l16_enter_state(0, 0); + hero_l16_set_move_state(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, 15.0f); break; } @@ -593,7 +593,7 @@ void hero_decide_state_snivelak(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state(0, 1); + hero_l16_set_move_state(0, 1); } break; case 0x2: @@ -607,11 +607,11 @@ void hero_decide_state_snivelak(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l16_enter_state(0x76, 1); + hero_l16_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); break; } n = 9; @@ -625,12 +625,12 @@ void hero_decide_state_snivelak(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l16_enter_state(9, 1); + hero_l16_set_move_state(9, 1); } else { - hero_l16_enter_state(7, 1); + hero_l16_set_move_state(7, 1); } } else { - hero_l16_enter_state(7, 1); + hero_l16_set_move_state(7, 1); } break; } @@ -638,15 +638,15 @@ void hero_decide_state_snivelak(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state(1, 1); + hero_l16_set_move_state(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state(4, 1); + hero_l16_set_move_state(4, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state(0x27, 1); + hero_l16_set_move_state(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -657,7 +657,7 @@ void hero_decide_state_snivelak(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l16_enter_state(0, 0) == 0) { + if (hero_l16_set_move_state(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -697,17 +697,17 @@ void hero_decide_state_snivelak(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l16_enter_state(3, 0); + hero_l16_set_move_state(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l16_enter_state(0x77, 1); + hero_l16_set_move_state(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l16_enter_state(0x77, 1); + hero_l16_set_move_state(0x77, 1); break; } } @@ -725,11 +725,11 @@ void hero_decide_state_snivelak(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l16_enter_state(0x64, 1); + hero_l16_set_move_state(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l16_enter_state(0x63, 1); + hero_l16_set_move_state(0x63, 1); } } else { hero_update_anim_scale(); @@ -737,22 +737,22 @@ void hero_decide_state_snivelak(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state(0x62, 1); + hero_l16_set_move_state(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l16_enter_state(0, 1); + hero_l16_set_move_state(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l16_enter_state(0x62, 1); + hero_l16_set_move_state(0x62, 1); } break; case 0x65: { s32 n = FLD(g_hero_state, s32, 0x18C0); if ((n < 3) && (((n * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40, 7, &sp44) != 0)) { - hero_l16_enter_state(0x66, 1); + hero_l16_set_move_state(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -786,29 +786,29 @@ void hero_decide_state_snivelak(void) { return; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state(1, 1); + hero_l16_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l16_enter_state(7, 1); + hero_l16_set_move_state(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state(4, 1); + hero_l16_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state(0, 1); + hero_l16_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state(0x27, 1); + hero_l16_set_move_state(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -816,45 +816,45 @@ void hero_decide_state_snivelak(void) { } if (hero_get_weapon_anim_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l16_enter_state(0, 0); + hero_l16_set_move_state(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l16_enter_state(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l16_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l16_enter_state(2, 1); + hero_l16_set_move_state(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state(1, 1); + hero_l16_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state(0, 0); + hero_l16_set_move_state(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l16_enter_state(0x76, 1); + hero_l16_set_move_state(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l16_enter_state(0x15, 1); + hero_l16_set_move_state(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l16_enter_state(0, 1); + hero_l16_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -862,17 +862,17 @@ void hero_decide_state_snivelak(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l16_enter_state(0x8B, 1); + hero_l16_set_move_state(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l16_enter_state(0, 1); + hero_l16_set_move_state(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l16_enter_state(0, 1); + hero_l16_set_move_state(0, 1); } break; case 0x24: @@ -898,14 +898,14 @@ void hero_decide_state_snivelak(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l16_enter_state(0, 0); + hero_l16_set_move_state(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l16_enter_state(6, 0); + hero_l16_set_move_state(6, 0); } else { - hero_l16_enter_state(6, 0); + hero_l16_set_move_state(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -921,9 +921,9 @@ void hero_decide_state_snivelak(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l16_enter_state(0, 1); + hero_l16_set_move_state(0, 1); } else { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -935,7 +935,7 @@ void hero_decide_state_snivelak(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l16_enter_state(0x2C, 1); + hero_l16_set_move_state(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -984,11 +984,11 @@ void hero_decide_state_snivelak(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.21666668f); FLD(g_hero_state, f32, 0x128) = 0.16666667f; - hero_l16_enter_state(0x16, 1); + hero_l16_set_move_state(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x46; FLD(g_hero_state, s16, 0x1D0) = 0x46; } else { - hero_l16_enter_state(0x3E, 1); + hero_l16_set_move_state(0x3E, 1); } break; } @@ -1001,7 +1001,7 @@ void hero_decide_state_snivelak(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l16_enter_state(0x28, 1); + hero_l16_set_move_state(0x28, 1); } break; } @@ -1012,16 +1012,16 @@ void hero_decide_state_snivelak(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x46; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l16_enter_state(0x74, 1); + hero_l16_set_move_state(0x74, 1); } else { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { - hero_l16_enter_state(0x2A, 1); + hero_l16_set_move_state(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1038,7 +1038,7 @@ void hero_decide_state_snivelak(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l16_enter_state(0x28, 1); + hero_l16_set_move_state(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)v20 = 0; @@ -1055,7 +1055,7 @@ void hero_decide_state_snivelak(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 5, NULL) != 0) && ((f32)g_hero_state_record_table[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l16_enter_state(0x28, 1); + hero_l16_set_move_state(0x28, 1); break; } top = 0xE; @@ -1064,19 +1064,19 @@ void hero_decide_state_snivelak(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l16_enter_state(0x2A, 1); + hero_l16_set_move_state(0x2A, 1); } break; } if ((f32)g_hero_state_record_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l16_enter_state(0x27, 1); + hero_l16_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x6C8) >= 6)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l16_enter_state(0x74, 1); + hero_l16_set_move_state(0x74, 1); } else { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1085,7 +1085,7 @@ void hero_decide_state_snivelak(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l16_enter_state(0x27, 1); + hero_l16_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0xA) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1121,7 +1121,7 @@ void hero_decide_state_snivelak(void) { find_nearest_path_point(sp50, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), sp5C, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l16_enter_state(0x29, 1); + hero_l16_set_move_state(0x29, 1); break; } } @@ -1169,7 +1169,7 @@ void hero_decide_state_snivelak(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x46; FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1177,7 +1177,7 @@ void hero_decide_state_snivelak(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l16_enter_state(0x71, 1); + hero_l16_set_move_state(0x71, 1); break; } { @@ -1189,7 +1189,7 @@ void hero_decide_state_snivelak(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l16_enter_state(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l16_set_move_state(0, 0) != 0)) { set_hero_animation(0xC, 4, 6.0f); } } else if (st == 0x3E) { @@ -1198,18 +1198,18 @@ void hero_decide_state_snivelak(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)sp64, 0.5f, -1.0f); } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state(0x27, 1); + hero_l16_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l16_enter_state(0x27, 1); + hero_l16_set_move_state(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l16_enter_state(0x18, 0); + hero_l16_set_move_state(0x18, 0); } break; case 0x18: @@ -1218,18 +1218,18 @@ void hero_decide_state_snivelak(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l16_enter_state(0x1B, 1); + hero_l16_set_move_state(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1238,7 +1238,7 @@ void hero_decide_state_snivelak(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l16_enter_state(0x19, 1); + hero_l16_set_move_state(0x19, 1); } break; } @@ -1249,7 +1249,7 @@ void hero_decide_state_snivelak(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l16_enter_state(0x1A, 1); + hero_l16_set_move_state(0x1A, 1); } } } @@ -1268,18 +1268,18 @@ void hero_decide_state_snivelak(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state(0x18, 1); + hero_l16_set_move_state(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l16_enter_state(0x1B, 1); + hero_l16_set_move_state(0x1B, 1); } break; } @@ -1289,9 +1289,9 @@ void hero_decide_state_snivelak(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); } else { - hero_l16_enter_state(0, 1); + hero_l16_set_move_state(0, 1); } } break; @@ -1315,12 +1315,12 @@ void hero_decide_state_snivelak(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l16_enter_state(0x39, 1); + hero_l16_set_move_state(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l16_enter_state(0, 0) != 0) { + if (hero_l16_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1328,7 +1328,7 @@ void hero_decide_state_snivelak(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l16_enter_state(0, 0) != 0) { + if (hero_l16_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1342,32 +1342,32 @@ void hero_decide_state_snivelak(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l16_enter_state(2, 1); + hero_l16_set_move_state(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l16_enter_state(3, 0) != 0) { + if (hero_l16_set_move_state(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l16_enter_state(0, 1); + hero_l16_set_move_state(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l16_enter_state(8, 1); + hero_l16_set_move_state(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l16_enter_state(0x17, 1); + hero_l16_set_move_state(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state(0x27, 1); + hero_l16_set_move_state(0x27, 1); break; } } @@ -1399,7 +1399,7 @@ void hero_decide_state_snivelak(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l16_enter_state(0, 0) != 0) { + if (hero_l16_set_move_state(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1410,12 +1410,12 @@ void hero_decide_state_snivelak(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l16_enter_state(0x74, 1); + hero_l16_set_move_state(0x74, 1); } else { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); } } else { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); } } break; @@ -1428,16 +1428,16 @@ void hero_decide_state_snivelak(void) { ok = 1; } if (ok != 0) { - hero_l16_enter_state(0x11, 1); + hero_l16_set_move_state(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l16_enter_state(0x17, 1); + hero_l16_set_move_state(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1448,23 +1448,23 @@ void hero_decide_state_snivelak(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l16_enter_state(3, 0) != 0) { + if (hero_l16_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state(4, 1); + hero_l16_set_move_state(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l16_speed_params[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l16_enter_state(2, 1); + hero_l16_set_move_state(2, 1); break; } - hero_l16_enter_state(2, 0); + hero_l16_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1473,21 +1473,21 @@ void hero_decide_state_snivelak(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l16_speed_params[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l16_enter_state(2, 1); + hero_l16_set_move_state(2, 1); break; } - hero_l16_enter_state(2, 0); + hero_l16_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l16_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l16_enter_state(0, 0) != 0) { + if (hero_l16_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l16_enter_state(0, 0) != 0) { + } else if (hero_l16_set_move_state(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1533,14 +1533,14 @@ void hero_decide_state_snivelak(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state(0xB, 1); + hero_l16_set_move_state(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l16_enter_state(0x82, 1); + hero_l16_set_move_state(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1549,25 +1549,25 @@ void hero_decide_state_snivelak(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l16_enter_state(0xA, 1); + hero_l16_set_move_state(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l16_enter_state(0x10, 1); + hero_l16_set_move_state(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state(0x27, 1); + hero_l16_set_move_state(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l16_enter_state(0x77, 1); + hero_l16_set_move_state(0x77, 1); break; } } @@ -1671,7 +1671,7 @@ void hero_decide_state_snivelak(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l16_enter_state(3, 0) != 0) { + if (hero_l16_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1679,13 +1679,13 @@ void hero_decide_state_snivelak(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l16_speed_params[0][2])) { - hero_l16_enter_state(7, 1); + hero_l16_set_move_state(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l16_enter_state(7, 1); + hero_l16_set_move_state(7, 1); } else if (g_hero_l16_speed_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l16_enter_state(9, 1); + hero_l16_set_move_state(9, 1); } else { - hero_l16_enter_state(7, 1); + hero_l16_set_move_state(7, 1); } break; } @@ -1693,10 +1693,10 @@ void hero_decide_state_snivelak(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_action(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); break; } { @@ -1706,7 +1706,7 @@ void hero_decide_state_snivelak(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l16_enter_state(0x11, 1); + hero_l16_set_move_state(0x11, 1); break; } } @@ -1735,7 +1735,7 @@ void hero_decide_state_snivelak(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l16_enter_state(0xE, 1); + hero_l16_set_move_state(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1745,32 +1745,32 @@ void hero_decide_state_snivelak(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l16_enter_state(8, 1); + hero_l16_set_move_state(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l16_enter_state(0x17, 1); + hero_l16_set_move_state(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l16_enter_state(6, 1); + hero_l16_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l16_enter_state(0x79, 1); + hero_l16_set_move_state(0x79, 1); } else { - hero_l16_enter_state(0x39, 1); + hero_l16_set_move_state(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l16_enter_state(0x82, 1); + hero_l16_set_move_state(0x82, 1); } else { - hero_l16_enter_state(0, 0); + hero_l16_set_move_state(0, 0); } } break; @@ -1780,8 +1780,8 @@ void hero_decide_state_snivelak(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l16_enter_state(0x39, 1); - } else if (hero_l16_enter_state(0, 0) != 0) { + hero_l16_set_move_state(0x39, 1); + } else if (hero_l16_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 13.0f); } } @@ -1802,7 +1802,7 @@ void hero_decide_state_snivelak(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l16_enter_state(0, 0); + hero_l16_set_move_state(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1813,7 +1813,7 @@ void hero_decide_state_snivelak(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l16_enter_state(0, 0); + hero_l16_set_move_state(0, 0); } break; case 0x22: @@ -1823,12 +1823,12 @@ void hero_decide_state_snivelak(void) { hero_choose_jump_or_roll_move(); break; } - hero_l16_enter_state(7, 1); + hero_l16_set_move_state(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l16_enter_state(0, 0); + hero_l16_set_move_state(0, 0); } break; default: diff --git a/src/levels/17_smolg/L17_003C7C70-g8.c b/src/levels/17_smolg/L17_003C7C70-g8.c index 594a72ef7..bf36824c9 100644 --- a/src/levels/17_smolg/L17_003C7C70-g8.c +++ b/src/levels/17_smolg/L17_003C7C70-g8.c @@ -346,7 +346,7 @@ extern int ForceClaimNotice(s32, s32, s32); extern s32 PlayMobySound(s32, s32, void *); extern void moby_set_flag_bit(void *, s32); extern void cam_lock_entry(s32); -extern s32 hero_change_action(s32, s32); +extern s32 hero_l13_set_move_state(s32, s32); /* func_L17_0041EAA8's state record. */ typedef struct { @@ -421,7 +421,7 @@ void target_pad_update(u8 *obj) } if (pad_vars->cuboid >= 0 && IsPointInCuboid(g_hero_state.pos, pad_vars->cuboid) && g_hero_state.mode == 0x82) - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); } /* func_L17_00420E08's state record. */ diff --git a/src/levels/18_damosel/L18_002D01B0-contact.c b/src/levels/18_damosel/L18_002D01B0-contact.c index 44119ef7d..8c2b44d82 100644 --- a/src/levels/18_damosel/L18_002D01B0-contact.c +++ b/src/levels/18_damosel/L18_002D01B0-contact.c @@ -68,7 +68,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l18_set_action(s32, s32); +extern s32 hero_l18_set_move_state(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth(s32); extern int hero_play_sound(s32, s32); @@ -155,7 +155,7 @@ s32 hero_handle_hit_object_contact(s32 apply_push) { case 0: hit_moby = g_hero_state.f249C; if (hit_moby != 0 && (*(s16 *)(hit_moby + 0xAA) == 0x4EB /* moby class 1259 */ || *(s16 *)(hit_moby + 0xAA) == 0x558 /* moby class 1368 */)) { - hero_l18_set_action(0x7D, 1); + hero_l18_set_move_state(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -166,7 +166,7 @@ s32 hero_handle_hit_object_contact(s32 apply_push) { AdjustPlayerHealth(FloatToInt(*(float *)(hit_info + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l18_set_action(0x16, 1); + hero_l18_set_move_state(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -176,13 +176,13 @@ s32 hero_handle_hit_object_contact(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l18_set_action(0x72, 1); + hero_l18_set_move_state(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l18_set_action(0x73, 1); + hero_l18_set_move_state(0x73, 1); } else if (entry->f24 & 8) { - hero_l18_set_action(0x8C, 1); + hero_l18_set_move_state(0x8C, 1); } else { - hero_l18_set_action(0x16, 1); + hero_l18_set_move_state(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&push_vec); @@ -194,7 +194,7 @@ s32 hero_handle_hit_object_contact(s32 apply_push) { } break; case 4: - hero_l18_set_action(0x90, 1); + hero_l18_set_move_state(0x90, 1); hero_flatten_push_vector(&push_vec, is_special, 0.083333336f, 0.050000004f); break; } diff --git a/src/levels/18_damosel/L18_002D7650.c b/src/levels/18_damosel/L18_002D7650.c index d5f48e920..3f8caeed4 100644 --- a/src/levels/18_damosel/L18_002D7650.c +++ b/src/levels/18_damosel/L18_002D7650.c @@ -156,7 +156,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -175,7 +175,7 @@ extern s32 shooter_update_ranged_attack(s32); extern s32 hero_get_screen_id(s32); extern void hero_detach_from_object(s32); extern void ClipHeroVelocityAtWall(s32); -extern s32 hero_l18_set_action(s32, s32); +extern s32 hero_l18_set_move_state(s32, s32); /* Runs the hero's per-frame state machine, switching on the current state and updating movement, animation and effects. */ void hero_l18_update_state_machine(void) { f32 speed62; @@ -683,7 +683,7 @@ void hero_l18_update_state_machine(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { temp_a2 = ((Hero *)g_hero_state)->i[0x2440/4]; if (temp_a2 != -1) { @@ -1388,7 +1388,7 @@ void hero_l18_update_state_machine(void) { coll_process_hit(0.4f, (s32)((TI128*)vec0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l18_state_extra)->f[0x180/4] = 0.1f; @@ -2756,7 +2756,7 @@ void hero_l18_update_state_machine(void) { } hero_try_surface_push_response(3.7f, 0.0f, 0.35f); if (shooter_update_ranged_attack((s32) temp_fp) != 0) { - hero_l18_set_action(0x8D, 1); + hero_l18_set_move_state(0x8D, 1); } } break; diff --git a/src/levels/18_damosel/L18_002E0070-state-g8.c b/src/levels/18_damosel/L18_002E0070-state-g8.c index 9f83af0ee..c518b5906 100644 --- a/src/levels/18_damosel/L18_002E0070-state-g8.c +++ b/src/levels/18_damosel/L18_002E0070-state-g8.c @@ -71,8 +71,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -144,7 +144,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l18_set_action(s32 action, s32 animate) { +s32 hero_l18_set_move_state(s32 action, s32 animate) { f32 dir[4]; u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -192,7 +192,9 @@ s32 hero_l18_set_action(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -205,8 +207,8 @@ s32 hero_l18_set_action(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { snd_start_mode_sound(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l18_set_action(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l18_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_screen_id(0) == 0x51) set_hero_animation(hero_get_screen_id(0), 0, 18.0f); else set_hero_animation(hero_get_screen_id(0), 0, -1.0f); @@ -341,7 +343,7 @@ s32 hero_l18_set_action(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l18_set_action(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l18_set_move_state(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -381,12 +383,12 @@ s32 hero_l18_set_action(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l18_set_action(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l18_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_screen_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l18_set_action(0, 0)) set_hero_animation(hero_get_screen_id(0), 0, 18.0f); + if (hero_l18_set_move_state(0, 0)) set_hero_animation(hero_get_screen_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -411,7 +413,7 @@ s32 hero_l18_set_action(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -565,13 +567,13 @@ s32 hero_l18_set_action(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 /* moby class 2489 */ || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05 /* moby class 3845 */)) { - hero_l18_set_action(0x81, 1); return 0; + hero_l18_set_move_state(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_action_lock) { hero_l18_set_action(0x6E, 1); return 0; } + action != 0x38 && !g_hero_action_lock) { hero_l18_set_move_state(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l18_set_action(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l18_set_move_state(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -678,7 +680,7 @@ s32 hero_l18_set_action(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -704,7 +706,7 @@ s32 hero_l18_set_action(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -713,7 +715,7 @@ s32 hero_l18_set_action(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -851,7 +853,7 @@ s32 hero_l18_set_action(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -920,7 +922,7 @@ s32 hero_l18_set_action(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -932,7 +934,7 @@ s32 hero_l18_set_action(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth(1); @@ -943,7 +945,7 @@ s32 hero_l18_set_action(s32 action, s32 animate) { goto finish; case 0x8D: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state(0x94, 1); return 0; } if (!animate) goto finish; set_hero_animation(13, 0, 9.0f); goto finish; case 0x8F: @@ -964,7 +966,7 @@ s32 hero_l18_set_action(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l18_float_sequences[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x8E: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state(0x94, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); BYTE(0x40C) = 0; BYTE(0x40F) = 0; if (WORD(0x22A4) == 0) REAL(0x1B4) = vec_length_xy(VEC(0x160)); @@ -993,7 +995,7 @@ s32 hero_l18_set_action(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l18_set_action(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l18_set_move_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/levels/18_damosel/L18_002E68B0-decider.c b/src/levels/18_damosel/L18_002E68B0-decider.c index fdeaf8830..d6fc786ce 100644 --- a/src/levels/18_damosel/L18_002E68B0-decider.c +++ b/src/levels/18_damosel/L18_002E68B0-decider.c @@ -84,7 +84,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l18_set_action(s32, s32); +s32 hero_l18_set_move_state(s32, s32); void snd_start_mode_sound(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -164,7 +164,7 @@ void hero_update_state_decider(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l18_set_action(0x39, 1); + hero_l18_set_move_state(0x39, 1); goto end; } } @@ -194,15 +194,15 @@ void hero_update_state_decider(void) { if (FLD(g_hero_state, f32, 0x88) < g_hero_l18_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { if (FLD(g_hero_state, u8, 0x22B4) == 4) { - hero_l18_set_action(0x91, 1); + hero_l18_set_move_state(0x91, 1); goto end; } - hero_l18_set_action(0x74, 1); + hero_l18_set_move_state(0x74, 1); goto end; } } if ((FLD(g_hero_state, u8, 0x22B4) == 4) && (FLD(g_hero_state, f32, 0x88) < FLD(FLD(FLD(g_hero_state, void *, 0x2290), void *, 0x68), f32, 0x3EC))) { - hero_l18_set_action(0x91, 1); + hero_l18_set_move_state(0x91, 1); } switch (FLD(g_hero_state, u32, 0x2294)) { case 0x0: @@ -211,12 +211,12 @@ void hero_update_state_decider(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action(1, 1); + hero_l18_set_move_state(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l18_set_action(0x82, 1); + hero_l18_set_move_state(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -253,7 +253,7 @@ void hero_update_state_decider(void) { rec = g_item_l18_record_table + selected_slot * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l18_set_action(0x3C, 1); + hero_l18_set_move_state(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -296,12 +296,12 @@ void hero_update_state_decider(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l18_set_action(0x76, 1); + hero_l18_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); } break; } @@ -322,21 +322,21 @@ void hero_update_state_decider(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_action_lock == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l18_set_action(0x6E, 1); + hero_l18_set_move_state(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l18_set_action(4, 1); + hero_l18_set_move_state(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action(0x27, 1); + hero_l18_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l18_set_action(0x2E, 1); + hero_l18_set_move_state(0x2E, 1); break; } { @@ -356,28 +356,28 @@ void hero_update_state_decider(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l18_set_action(2, 1); + hero_l18_set_move_state(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action(1, 1); + hero_l18_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((unused_pad3_c = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (unused_pad3_c & 8)) { - hero_l18_set_action(0x3D, 1); + hero_l18_set_move_state(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l18_set_action(0x3D, 1); + hero_l18_set_move_state(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); } break; case 0x3D: @@ -386,22 +386,22 @@ void hero_update_state_decider(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action(4, 1); + hero_l18_set_move_state(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l18_set_action(2, 1); + hero_l18_set_move_state(2, 1); break; } - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); break; case 0x39: case 0x43: @@ -434,25 +434,25 @@ void hero_update_state_decider(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l18_set_action(0x33, 1); + hero_l18_set_move_state(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l18_set_action(0x34, 1); + hero_l18_set_move_state(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l18_set_action(0x32, 1); + hero_l18_set_move_state(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l18_set_action(0x33, 1); + hero_l18_set_move_state(0x33, 1); } } break; @@ -465,81 +465,81 @@ void hero_update_state_decider(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l18_set_action(0x32, 1); + hero_l18_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l18_set_action(0x34, 1); + hero_l18_set_move_state(0x34, 1); } else { - hero_l18_set_action(0x32, 1); + hero_l18_set_move_state(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l18_set_action(0x12, 1); + hero_l18_set_move_state(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l18_set_action(0x32, 1); + hero_l18_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l18_set_action(0x34, 1); + hero_l18_set_move_state(0x34, 1); } else { - hero_l18_set_action(0x32, 1); + hero_l18_set_move_state(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l18_set_action(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l18_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_screen_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l18_set_action(0x35, 1); + hero_l18_set_move_state(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l18_set_action(0x12, 1); + hero_l18_set_move_state(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l18_set_action(0x32, 1); + hero_l18_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l18_set_action(0x34, 1); + hero_l18_set_move_state(0x34, 1); } else { - hero_l18_set_action(0x32, 1); + hero_l18_set_move_state(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l18_set_action(0x70, 0); + hero_l18_set_move_state(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l18_set_action(0x36, 1); + hero_l18_set_move_state(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action(0x67, 1); + hero_l18_set_move_state(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action(0x33, 1); + hero_l18_set_move_state(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l18_set_action(0x33, 0); + hero_l18_set_move_state(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action(0x67, 1); + hero_l18_set_move_state(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l18_set_action(0x36, 0); + hero_l18_set_move_state(0x36, 0); } break; case 0x1: @@ -573,9 +573,9 @@ void hero_update_state_decider(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { snd_start_mode_sound(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action(4, 1); + hero_l18_set_move_state(4, 1); } else { - hero_l18_set_action(0, 0); + hero_l18_set_move_state(0, 0); anim = hero_get_screen_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -587,9 +587,9 @@ void hero_update_state_decider(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l18_set_action(0, 0); + hero_l18_set_move_state(0, 0); } else { - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); } } break; @@ -622,7 +622,7 @@ void hero_update_state_decider(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action(7, 1); + hero_l18_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -631,7 +631,7 @@ void hero_update_state_decider(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l18_set_action(0, 0); + hero_l18_set_move_state(0, 0); } break; } @@ -653,7 +653,7 @@ void hero_update_state_decider(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action(7, 1); + hero_l18_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -666,7 +666,7 @@ void hero_update_state_decider(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l18_set_action(2, 0); + hero_l18_set_move_state(2, 0); set_hero_animation(3, g_hero_l18_anim_table[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -677,22 +677,22 @@ void hero_update_state_decider(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l18_set_action(2, 1); + hero_l18_set_move_state(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l18_set_action(0, 0); + hero_l18_set_move_state(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action(0, 0); + hero_l18_set_move_state(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -709,7 +709,7 @@ void hero_update_state_decider(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action(7, 1); + hero_l18_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -718,7 +718,7 @@ void hero_update_state_decider(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l18_set_action(0, 0); + hero_l18_set_move_state(0, 0); set_hero_animation(hero_get_screen_id(0), 0, 15.0f); break; } @@ -730,7 +730,7 @@ void hero_update_state_decider(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); } break; case 0x2: @@ -744,11 +744,11 @@ void hero_update_state_decider(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l18_set_action(0x76, 1); + hero_l18_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); break; } n = 9; @@ -762,12 +762,12 @@ void hero_update_state_decider(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l18_set_action(9, 1); + hero_l18_set_move_state(9, 1); } else { - hero_l18_set_action(7, 1); + hero_l18_set_move_state(7, 1); } } else { - hero_l18_set_action(7, 1); + hero_l18_set_move_state(7, 1); } break; } @@ -775,11 +775,11 @@ void hero_update_state_decider(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action(1, 1); + hero_l18_set_move_state(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action(4, 1); + hero_l18_set_move_state(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -796,25 +796,25 @@ void hero_update_state_decider(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l18_set_action(0x2E, 1); + hero_l18_set_move_state(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l18_set_action(2, 1); + hero_l18_set_move_state(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l18_set_action(0x70, 1); + hero_l18_set_move_state(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l18_set_action(2, 1); + hero_l18_set_move_state(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action(0x27, 1); + hero_l18_set_move_state(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -825,7 +825,7 @@ void hero_update_state_decider(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l18_set_action(0, 0) == 0) { + if (hero_l18_set_move_state(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -842,7 +842,7 @@ void hero_update_state_decider(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l18_set_action(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l18_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_screen_id(0), 0, 17.0f); } if (FLD(hero_moby, u8, 0x43) == 0x37) { @@ -863,7 +863,7 @@ void hero_update_state_decider(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l18_set_action(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l18_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_screen_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -897,17 +897,17 @@ void hero_update_state_decider(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l18_set_action(3, 0); + hero_l18_set_move_state(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l18_set_action(0x77, 1); + hero_l18_set_move_state(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l18_set_action(0x77, 1); + hero_l18_set_move_state(0x77, 1); break; } } @@ -925,11 +925,11 @@ void hero_update_state_decider(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l18_set_action(0x64, 1); + hero_l18_set_move_state(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l18_set_action(0x63, 1); + hero_l18_set_move_state(0x63, 1); } } else { hero_update_anim_scale(); @@ -937,42 +937,42 @@ void hero_update_state_decider(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action(0x62, 1); + hero_l18_set_move_state(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l18_set_action(0x62, 1); + hero_l18_set_move_state(0x62, 1); } break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action(1, 1); + hero_l18_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l18_set_action(7, 1); + hero_l18_set_move_state(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action(4, 1); + hero_l18_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action(0x27, 1); + hero_l18_set_move_state(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -980,45 +980,45 @@ void hero_update_state_decider(void) { } if (hero_get_screen_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l18_set_action(0, 0); + hero_l18_set_move_state(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l18_set_action(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l18_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_screen_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l18_set_action(2, 1); + hero_l18_set_move_state(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action(1, 1); + hero_l18_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action(0, 0); + hero_l18_set_move_state(0, 0); set_hero_animation(hero_get_screen_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l18_set_action(0x76, 1); + hero_l18_set_move_state(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l18_set_action(0x15, 1); + hero_l18_set_move_state(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); } } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); } break; case 0x24: @@ -1044,14 +1044,14 @@ void hero_update_state_decider(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l18_set_action(0, 0); + hero_l18_set_move_state(0, 0); set_hero_animation(hero_get_screen_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l18_set_action(6, 0); + hero_l18_set_move_state(6, 0); } else { - hero_l18_set_action(6, 0); + hero_l18_set_move_state(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1067,9 +1067,9 @@ void hero_update_state_decider(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); } else { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1081,7 +1081,7 @@ void hero_update_state_decider(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l18_set_action(0x2C, 1); + hero_l18_set_move_state(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1130,11 +1130,11 @@ void hero_update_state_decider(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.21666668f); FLD(g_hero_state, f32, 0x128) = 0.16666667f; - hero_l18_set_action(0x16, 1); + hero_l18_set_move_state(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x46; FLD(g_hero_state, s16, 0x1D0) = 0x46; } else { - hero_l18_set_action(0x3E, 1); + hero_l18_set_move_state(0x3E, 1); } break; } @@ -1147,7 +1147,7 @@ void hero_update_state_decider(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l18_set_action(0x28, 1); + hero_l18_set_move_state(0x28, 1); } break; } @@ -1158,16 +1158,16 @@ void hero_update_state_decider(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x46; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l18_set_action(0x74, 1); + hero_l18_set_move_state(0x74, 1); } else { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { - hero_l18_set_action(0x2A, 1); + hero_l18_set_move_state(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1184,7 +1184,7 @@ void hero_update_state_decider(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l18_set_action(0x28, 1); + hero_l18_set_move_state(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)probe_vec = 0; @@ -1201,7 +1201,7 @@ void hero_update_state_decider(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 5, NULL) != 0) && ((f32)g_hero_l18_state_records[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l18_set_action(0x28, 1); + hero_l18_set_move_state(0x28, 1); break; } top = 0xE; @@ -1210,19 +1210,19 @@ void hero_update_state_decider(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l18_set_action(0x2A, 1); + hero_l18_set_move_state(0x2A, 1); } break; } if ((f32)g_hero_l18_state_records[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l18_set_action(0x27, 1); + hero_l18_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x6C8) >= 6)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l18_set_action(0x74, 1); + hero_l18_set_move_state(0x74, 1); } else { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1231,7 +1231,7 @@ void hero_update_state_decider(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l18_set_action(0x27, 1); + hero_l18_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0xA) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1267,7 +1267,7 @@ void hero_update_state_decider(void) { find_nearest_path_point(path_segment, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), path_segment_index, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l18_set_action(0x29, 1); + hero_l18_set_move_state(0x29, 1); break; } } @@ -1315,7 +1315,7 @@ void hero_update_state_decider(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x46; FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1323,7 +1323,7 @@ void hero_update_state_decider(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l18_set_action(0x71, 1); + hero_l18_set_move_state(0x71, 1); break; } { @@ -1335,7 +1335,7 @@ void hero_update_state_decider(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l18_set_action(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l18_set_move_state(0, 0) != 0)) { set_hero_animation(0xC, 4, 6.0f); } } else if (st == 0x3E) { @@ -1344,18 +1344,18 @@ void hero_update_state_decider(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)impact_level_b, 0.5f, -1.0f); } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action(0x27, 1); + hero_l18_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l18_set_action(0x27, 1); + hero_l18_set_move_state(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l18_set_action(0x18, 0); + hero_l18_set_move_state(0x18, 0); } break; case 0x18: @@ -1364,18 +1364,18 @@ void hero_update_state_decider(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l18_set_action(0x1B, 1); + hero_l18_set_move_state(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1384,7 +1384,7 @@ void hero_update_state_decider(void) { probe_pos[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; probe_pos[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)probe_pos, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l18_set_action(0x19, 1); + hero_l18_set_move_state(0x19, 1); } break; } @@ -1395,7 +1395,7 @@ void hero_update_state_decider(void) { probe_pos[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; probe_pos[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)probe_pos, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l18_set_action(0x1A, 1); + hero_l18_set_move_state(0x1A, 1); } } } @@ -1414,18 +1414,18 @@ void hero_update_state_decider(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)probe_pos, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action(0x18, 1); + hero_l18_set_move_state(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l18_set_action(0x1B, 1); + hero_l18_set_move_state(0x1B, 1); } break; } @@ -1435,9 +1435,9 @@ void hero_update_state_decider(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); } else { - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); } } break; @@ -1461,12 +1461,12 @@ void hero_update_state_decider(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action(0x39, 1); + hero_l18_set_move_state(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l18_set_action(0, 0) != 0) { + if (hero_l18_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1474,7 +1474,7 @@ void hero_update_state_decider(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l18_set_action(0, 0) != 0) { + if (hero_l18_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1488,32 +1488,32 @@ void hero_update_state_decider(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l18_set_action(2, 1); + hero_l18_set_move_state(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l18_set_action(3, 0) != 0) { + if (hero_l18_set_move_state(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l18_set_action(8, 1); + hero_l18_set_move_state(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l18_set_action(0x17, 1); + hero_l18_set_move_state(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action(0x27, 1); + hero_l18_set_move_state(0x27, 1); break; } } @@ -1545,7 +1545,7 @@ void hero_update_state_decider(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == MOBY_CLASS_LEVITATOR_PAD)) { - if (hero_l18_set_action(0, 0) != 0) { + if (hero_l18_set_move_state(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1555,9 +1555,9 @@ void hero_update_state_decider(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l18_set_action(0x74, 1); + hero_l18_set_move_state(0x74, 1); } else { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); } } break; @@ -1570,16 +1570,16 @@ void hero_update_state_decider(void) { ok = 1; } if (ok != 0) { - hero_l18_set_action(0x11, 1); + hero_l18_set_move_state(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l18_set_action(0x17, 1); + hero_l18_set_move_state(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1590,23 +1590,23 @@ void hero_update_state_decider(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l18_set_action(3, 0) != 0) { + if (hero_l18_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action(4, 1); + hero_l18_set_move_state(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_l18_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l18_set_action(2, 1); + hero_l18_set_move_state(2, 1); break; } - hero_l18_set_action(2, 0); + hero_l18_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1615,21 +1615,21 @@ void hero_update_state_decider(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_l18_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l18_set_action(2, 1); + hero_l18_set_move_state(2, 1); break; } - hero_l18_set_action(2, 0); + hero_l18_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_anim_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l18_set_action(0, 0) != 0) { + if (hero_l18_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_screen_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l18_set_action(0, 0) != 0) { + } else if (hero_l18_set_move_state(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1677,14 +1677,14 @@ void hero_update_state_decider(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action(0xB, 1); + hero_l18_set_move_state(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l18_set_action(0x82, 1); + hero_l18_set_move_state(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1693,25 +1693,25 @@ void hero_update_state_decider(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l18_set_action(0xA, 1); + hero_l18_set_move_state(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l18_set_action(0x10, 1); + hero_l18_set_move_state(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action(0x27, 1); + hero_l18_set_move_state(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l18_set_action(0x77, 1); + hero_l18_set_move_state(0x77, 1); break; } } @@ -1815,7 +1815,7 @@ void hero_update_state_decider(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l18_set_action(3, 0) != 0) { + if (hero_l18_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1823,13 +1823,13 @@ void hero_update_state_decider(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l18_speed_params[0][2])) { - hero_l18_set_action(7, 1); + hero_l18_set_move_state(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l18_set_action(7, 1); + hero_l18_set_move_state(7, 1); } else if (g_hero_l18_speed_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l18_set_action(9, 1); + hero_l18_set_move_state(9, 1); } else { - hero_l18_set_action(7, 1); + hero_l18_set_move_state(7, 1); } break; } @@ -1837,10 +1837,10 @@ void hero_update_state_decider(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); break; } { @@ -1850,7 +1850,7 @@ void hero_update_state_decider(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &frame_limit) != 0) && (frame_limit < FLD(g_hero_state, s32, 0x1B8))) { - hero_l18_set_action(0x11, 1); + hero_l18_set_move_state(0x11, 1); break; } } @@ -1879,7 +1879,7 @@ void hero_update_state_decider(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l18_set_action(0xE, 1); + hero_l18_set_move_state(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1889,28 +1889,28 @@ void hero_update_state_decider(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l18_set_action(8, 1); + hero_l18_set_move_state(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l18_set_action(0x17, 1); + hero_l18_set_move_state(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l18_set_action(6, 1); + hero_l18_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action(0x39, 1); + hero_l18_set_move_state(0x39, 1); } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l18_set_action(0x82, 1); + hero_l18_set_move_state(0x82, 1); } else { - hero_l18_set_action(0, 0); + hero_l18_set_move_state(0, 0); } } break; @@ -1920,8 +1920,8 @@ void hero_update_state_decider(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action(0x39, 1); - } else if (hero_l18_set_action(0, 0) != 0) { + hero_l18_set_move_state(0x39, 1); + } else if (hero_l18_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_screen_id(0), 0, 13.0f); } } @@ -1938,35 +1938,35 @@ void hero_update_state_decider(void) { set_hero_animation(0xD, 0, 12.0f); } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l18_set_action(0x94, 1); + hero_l18_set_move_state(0x94, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action(1, 1); + hero_l18_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l18_set_action(0x8F, 1); + hero_l18_set_move_state(0x8F, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l18_set_action(0x92, 1); + hero_l18_set_move_state(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != MOBY_CLASS_RECEIVER_BOT) && (PadPressedWithin(0x80, 9, NULL) != 0)) { - hero_l18_set_action(0x93, 1); + hero_l18_set_move_state(0x93, 1); break; } hero_resolve_stick_direction(0, 1.0f); turned = hero_is_turned_past_angle(0.17453295f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (turned != 0)) { - hero_l18_set_action(0x8E, 1); + hero_l18_set_move_state(0x8E, 1); } break; } case 0x93: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l18_set_action(0x94, 1); + hero_l18_set_move_state(0x94, 1); } break; case 0x92: @@ -2032,20 +2032,20 @@ void hero_update_state_decider(void) { after_pose: if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l18_set_action(0x92, 1); + hero_l18_set_move_state(0x92, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l18_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l18_set_action(0x8E, 1); + hero_l18_set_move_state(0x8E, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l18_set_action(0x8D, 1); + hero_l18_set_move_state(0x8D, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l18_set_action(0x8F, 1); + hero_l18_set_move_state(0x8F, 1); } break; } @@ -2058,15 +2058,15 @@ void hero_update_state_decider(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action(0x91, 1); + hero_l18_set_move_state(0x91, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l18_set_action(0x8E, 1); + hero_l18_set_move_state(0x8E, 1); } else { - hero_l18_set_action(0x8D, 1); + hero_l18_set_move_state(0x8D, 1); } } else { - hero_l18_set_action(0x8D, 1); + hero_l18_set_move_state(0x8D, 1); } } break; @@ -2076,43 +2076,43 @@ void hero_update_state_decider(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l18_set_action(0x8F, 1); + hero_l18_set_move_state(0x8F, 1); } else { - hero_l18_set_action(0x8D, 1); + hero_l18_set_move_state(0x8D, 1); } } break; case 0x8E: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l18_set_action(0x94, 1); + hero_l18_set_move_state(0x94, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l18_set_action(0x92, 1); + hero_l18_set_move_state(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != MOBY_CLASS_RECEIVER_BOT) && (PadPressedWithin(0x80, 9, NULL) != 0)) { - hero_l18_set_action(0x93, 1); + hero_l18_set_move_state(0x93, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l18_set_action(0x8F, 1); + hero_l18_set_move_state(0x8F, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f) && (FLD(g_hero_state, s16, 0x1454) == 0)) { - hero_l18_set_action(0x8D, 1); + hero_l18_set_move_state(0x8D, 1); } break; case 0x90: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l18_set_action(0x8F, 1); + hero_l18_set_move_state(0x8F, 1); break; } if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x1B8) >= 0x24)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action(0x91, 1); + hero_l18_set_move_state(0x91, 1); } else { - hero_l18_set_action(0x8D, 0); + hero_l18_set_move_state(0x8D, 0); } } break; @@ -2127,7 +2127,7 @@ void hero_update_state_decider(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l18_set_action(0, 0); + hero_l18_set_move_state(0, 0); anim = hero_get_screen_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -2138,7 +2138,7 @@ void hero_update_state_decider(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l18_set_action(0, 0); + hero_l18_set_move_state(0, 0); } break; case 0x22: @@ -2148,12 +2148,12 @@ void hero_update_state_decider(void) { hero_choose_jump_or_roll_move(); break; } - hero_l18_set_action(7, 1); + hero_l18_set_move_state(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l18_set_action(0, 0); + hero_l18_set_move_state(0, 0); } break; default: diff --git a/src/levels/18_damosel/L18_003FB708.c b/src/levels/18_damosel/L18_003FB708.c index 9d6bda251..65bab2988 100644 --- a/src/levels/18_damosel/L18_003FB708.c +++ b/src/levels/18_damosel/L18_003FB708.c @@ -124,7 +124,7 @@ extern void gfx_queue_draw_callback(void *, void *); extern void protopet_start_enter_anim(char *, int); extern void part_spawn_upward(char *); extern void part_spawn_spray(char *); -extern s32 hero_l18_set_action(int, int); +extern s32 hero_l18_set_move_state(int, int); /* Updates the train: it rides its rail path or follows another object, speeds up and slows down, falls when released, and plays its sounds and effects. */ @@ -259,7 +259,7 @@ void train_l18_update(char *moby) FastVecScale(vm[1], moby + 0xC0, -g_train_push_speed_back); vm[1][2] = g_train_push_speed_back * 4.0f; vm[1][3] = 5627.9248f; - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); g = (f32)g_player_stats[0] * 30.0f; part_queue_impact_effect(target, moby, 0x10001, g_hero_state + 0x80, vm[1], g > 100.0f ? g : 100.0f); vars->iE0 = g_train_timer_start; diff --git a/src/levels/18_damosel/L18_00447128-g8.c b/src/levels/18_damosel/L18_00447128-g8.c index d144372fc..7b143be13 100644 --- a/src/levels/18_damosel/L18_00447128-g8.c +++ b/src/levels/18_damosel/L18_00447128-g8.c @@ -65,7 +65,7 @@ extern void vec_scale_to_length(void *, void *, float); extern void make_hit_descriptor(void *, void *, int, float, void *); extern void QueueMobyImpact(void *, void *); extern int StartAttachedEffect(void *, int, void *); -extern s32 hero_l18_set_action(int, int); +extern s32 hero_l18_set_move_state(int, int); extern void vec_clear_128(void *); extern void matrix_mul_vec3(void *, void *, void *); extern void vec_compute_object_to_target(void *, void *, void *, float); @@ -180,7 +180,7 @@ void lava_l18_gun_update(u8 *obj) math_spring_float_to_goal(state + 0x50, state + 0x54, 0.0f, 0.06f, 0.01f, 0.125f); *(int *)(state + 0x60) = 0; } - if (g_hero_state.action == 1) hero_l18_set_action(29, 1); + if (g_hero_state.action == 1) hero_l18_set_move_state(29, 1); moby_transform_joint_to_world(obj, 0, state); vec_clear_128(velocity); velocity[1] = -1.0f; diff --git a/src/levels/19_grelbin/L19_002B0148-flags.c b/src/levels/19_grelbin/L19_002B0148-flags.c index eb4c5ab3b..eeb1ea169 100644 --- a/src/levels/19_grelbin/L19_002B0148-flags.c +++ b/src/levels/19_grelbin/L19_002B0148-flags.c @@ -8,7 +8,7 @@ extern int g_hero_l19_special_state_flag __attribute__((sda)); extern u8 g_hero_input_enabled __attribute__((sda)); extern void mem_fast_helper_b(void *, int); extern float math_fabs(float); -extern int hero_l19_set_state(int, int); +extern int hero_l19_set_move_state(int, int); typedef int Quadword __attribute__((mode(TI))); typedef union { Quadword word; float f[4]; } Vector; typedef struct { @@ -98,16 +98,16 @@ void hero_process_button_command(void) if (g_hero_state.attack) { if (g_hero_state.attack && active && (g_hero_state.state != 0x38 || g_hero_state.animationDone)) { - if (g_hero_state.health) { hero_l19_set_state(0x38,1); return; } - if (g_current_map_index == 2 && g_hero_l19_special_state_flag) { hero_l19_set_state(0x7d,1); return; } - if (*(int *)(*(u8 **)(g_hero_state.object + 0x24) + 0x1f0)) { hero_l19_set_state(0x79,1); return; } - hero_l19_set_state(0x39,1); return; + if (g_hero_state.health) { hero_l19_set_move_state(0x38,1); return; } + if (g_current_map_index == 2 && g_hero_l19_special_state_flag) { hero_l19_set_move_state(0x7d,1); return; } + if (*(int *)(*(u8 **)(g_hero_state.object + 0x24) + 0x1f0)) { hero_l19_set_move_state(0x79,1); return; } + hero_l19_set_move_state(0x39,1); return; } } if (g_hero_state.flag149c && g_hero_state.state != 0x7c && math_fabs(g_hero_state.t330-(g_hero_state.position.f[2]+0.25f)) < 1.0f && g_hero_state.t330-g_hero_state.position.f[2] > 0.0f && (g_hero_state.motion.f[2] < 0.0f || g_hero_state.state == 0x7b)) { - hero_l19_set_state(0x7c,1); + hero_l19_set_move_state(0x7c,1); } } diff --git a/src/levels/19_grelbin/L19_002B5BF0-contact.c b/src/levels/19_grelbin/L19_002B5BF0-contact.c index 6c720e664..654d66ac9 100644 --- a/src/levels/19_grelbin/L19_002B5BF0-contact.c +++ b/src/levels/19_grelbin/L19_002B5BF0-contact.c @@ -68,7 +68,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l19_set_state(s32, s32); +extern s32 hero_l19_set_move_state(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth(s32); extern int hero_play_sound(s32, s32); @@ -150,7 +150,7 @@ s32 hero_l19_apply_contact_push(s32 apply_push) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB /* moby class 1259 */ || *(s16 *)(other + 0xAA) == 0x558 /* moby class 1368 */)) { - hero_l19_set_state(0x7D, 1); + hero_l19_set_move_state(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -161,7 +161,7 @@ s32 hero_l19_apply_contact_push(s32 apply_push) { AdjustPlayerHealth(FloatToInt(*(float *)(r + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l19_set_state(0x16, 1); + hero_l19_set_move_state(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -171,13 +171,13 @@ s32 hero_l19_apply_contact_push(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l19_set_state(0x72, 1); + hero_l19_set_move_state(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l19_set_state(0x73, 1); + hero_l19_set_move_state(0x73, 1); } else if (e->f24 & 8) { - hero_l19_set_state(0x8C, 1); + hero_l19_set_move_state(0x8C, 1); } else { - hero_l19_set_state(0x16, 1); + hero_l19_set_move_state(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&vec); @@ -189,7 +189,7 @@ s32 hero_l19_apply_contact_push(s32 apply_push) { } break; case 4: - hero_l19_set_state(0x90, 1); + hero_l19_set_move_state(0x90, 1); hero_flatten_push_vector(&vec, flag, 0.083333336f, 0.050000004f); break; } diff --git a/src/levels/19_grelbin/L19_002BCA50.c b/src/levels/19_grelbin/L19_002BCA50.c index 777ba6028..c1310aba1 100644 --- a/src/levels/19_grelbin/L19_002BCA50.c +++ b/src/levels/19_grelbin/L19_002BCA50.c @@ -167,7 +167,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -182,7 +182,7 @@ extern s32 shooter_update_ranged_attack(s32); extern s32 hero_get_anim_id(s32); extern void hero_detach_from_object(s32); extern void ClipHeroVelocityAtWall(s32); -extern s32 hero_l19_set_state(s32, s32); +extern s32 hero_l19_set_move_state(s32, s32); /* Runs the hero's state machine once per frame in Grelbin: walking, jumping, gliding, swinging and the rest. */ void hero_l19_update_state_machine(void) { f32 frame_floateed62; @@ -717,7 +717,7 @@ void hero_l19_update_state_machine(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { value14 = ((Hero *)g_hero_state)->i[0x2440/4]; if (value14 != -1) { @@ -1439,7 +1439,7 @@ void hero_l19_update_state_machine(void) { coll_process_hit(0.4f, (s32)((TI128*)vec0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l19_state_block)->f[0x180/4] = 0.1f; @@ -2425,7 +2425,7 @@ void hero_l19_update_state_machine(void) { } hero_try_surface_push_response(3.7f, 0.0f, 0.35f); if (shooter_update_ranged_attack((s32) ptr15) != 0) { - hero_l19_set_state(0x8D, 1); + hero_l19_set_move_state(0x8D, 1); } } break; diff --git a/src/levels/19_grelbin/L19_002C44F8.c b/src/levels/19_grelbin/L19_002C44F8.c index cc979585d..2e93227fa 100644 --- a/src/levels/19_grelbin/L19_002C44F8.c +++ b/src/levels/19_grelbin/L19_002C44F8.c @@ -79,8 +79,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -153,7 +153,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l19_set_state(s32 action, s32 animate) { +s32 hero_l19_set_move_state(s32 action, s32 animate) { u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 oldStep; @@ -200,7 +200,9 @@ s32 hero_l19_set_state(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -213,7 +215,7 @@ s32 hero_l19_set_state(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { snd_start_mode_sound(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_anim_id(0) == 0x51) set_hero_animation(hero_get_anim_id(0), 0, 18.0f); else set_hero_animation(hero_get_anim_id(0), 0, -1.0f); @@ -362,7 +364,7 @@ s32 hero_l19_set_state(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l19_set_state(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l19_set_move_state(0x76, 1); return 0; } } if (BYTE(0x22B9) || WORD(0x2294) == 0x70) { WORD(0x2294) = 0x70; set_hero_animation(0x59, 0, 8.0f); goto finish; @@ -395,11 +397,11 @@ s32 hero_l19_set_state(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_anim_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l19_set_state(0, 0)) set_hero_animation(hero_get_anim_id(0), 0, 18.0f); + if (hero_l19_set_move_state(0, 0)) set_hero_animation(hero_get_anim_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -424,7 +426,7 @@ s32 hero_l19_set_state(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -568,13 +570,13 @@ s32 hero_l19_set_state(s32 action, s32 animate) { case 0x45: case 0x48: case 0x5B: case 0x66: case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 /* moby class 2489 */ || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05 /* moby class 3845 */)) { - hero_l19_set_state(0x81, 1); return 0; + hero_l19_set_move_state(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_aim_block_flag) { hero_l19_set_state(0x6E, 1); return 0; } + action != 0x38 && !g_hero_aim_block_flag) { hero_l19_set_move_state(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l19_set_state(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l19_set_move_state(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -648,9 +650,9 @@ s32 hero_l19_set_state(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_l19_special_state_flag) { hero_l19_set_state(0x7D, 1); return 0; } - if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l19_set_state(0x79, 1); - else hero_l19_set_state(0x39, 1); + if (g_current_map_index == 2 && g_hero_l19_special_state_flag) { hero_l19_set_move_state(0x7D, 1); return 0; } + if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l19_set_move_state(0x79, 1); + else hero_l19_set_move_state(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -690,7 +692,7 @@ s32 hero_l19_set_state(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -716,7 +718,7 @@ s32 hero_l19_set_state(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -725,7 +727,7 @@ s32 hero_l19_set_state(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -858,7 +860,7 @@ s32 hero_l19_set_state(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -917,7 +919,7 @@ s32 hero_l19_set_state(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -929,7 +931,7 @@ s32 hero_l19_set_state(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth(1); @@ -945,7 +947,7 @@ s32 hero_l19_set_state(s32 action, s32 animate) { set_hero_animation(0x6A, 0, 8.0f); goto finish; case 0x8D: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state(0x94, 1); return 0; } if (!animate) goto finish; set_hero_animation(13, 0, 9.0f); goto finish; case 0x8F: @@ -966,7 +968,7 @@ s32 hero_l19_set_state(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l19_float_sequences[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x8E: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state(0x94, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); BYTE(0x40C) = 0; BYTE(0x40F) = 0; if (WORD(0x22A4) == 0) REAL(0x1B4) = vec_length_xy(VEC(0x160)); @@ -995,7 +997,7 @@ s32 hero_l19_set_state(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l19_set_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l19_set_move_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/levels/19_grelbin/L19_002CAAB0-fn.c b/src/levels/19_grelbin/L19_002CAAB0-fn.c index 2cb74b368..d7b39c553 100644 --- a/src/levels/19_grelbin/L19_002CAAB0-fn.c +++ b/src/levels/19_grelbin/L19_002CAAB0-fn.c @@ -102,7 +102,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l19_set_state(s32, s32); +s32 hero_l19_set_move_state(s32, s32); void snd_start_mode_sound(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -180,7 +180,7 @@ void hero_l19_decide_state_transition(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l19_set_state(0x39, 1); + hero_l19_set_move_state(0x39, 1); goto end; } } @@ -210,15 +210,15 @@ void hero_l19_decide_state_transition(void) { if (FLD(g_hero_state, f32, 0x88) < g_mover_current_value) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { if (FLD(g_hero_state, u8, 0x22B4) == 4) { - hero_l19_set_state(0x91, 1); + hero_l19_set_move_state(0x91, 1); goto end; } - hero_l19_set_state(0x74, 1); + hero_l19_set_move_state(0x74, 1); goto end; } } if ((FLD(g_hero_state, u8, 0x22B4) == 4) && (FLD(g_hero_state, f32, 0x88) < FLD(FLD(FLD(g_hero_state, void *, 0x2290), void *, 0x68), f32, 0x3EC))) { - hero_l19_set_state(0x91, 1); + hero_l19_set_move_state(0x91, 1); } switch (FLD(g_hero_state, u32, 0x2294)) { case 0x0: @@ -226,12 +226,12 @@ void hero_l19_decide_state_transition(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state(1, 1); + hero_l19_set_move_state(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l19_set_state(0x82, 1); + hero_l19_set_move_state(0x82, 1); break; } { @@ -267,7 +267,7 @@ void hero_l19_decide_state_transition(void) { rec = g_hero_l19_slot_records + selected_slot * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l19_set_state(0x3C, 1); + hero_l19_set_move_state(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -310,12 +310,12 @@ void hero_l19_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l19_set_state(0x76, 1); + hero_l19_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); } break; } @@ -336,12 +336,12 @@ void hero_l19_decide_state_transition(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_aim_block_flag == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l19_set_state(0x6E, 1); + hero_l19_set_move_state(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l19_set_state(4, 1); + hero_l19_set_move_state(4, 1); break; } } @@ -362,28 +362,28 @@ void hero_l19_decide_state_transition(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l19_set_state(2, 1); + hero_l19_set_move_state(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state(1, 1); + hero_l19_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_bits = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_bits & 8)) { - hero_l19_set_state(0x3D, 1); + hero_l19_set_move_state(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l19_set_state(0x3D, 1); + hero_l19_set_move_state(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l19_set_state(0, 1); + hero_l19_set_move_state(0, 1); } break; case 0x3D: @@ -392,22 +392,22 @@ void hero_l19_decide_state_transition(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state(4, 1); + hero_l19_set_move_state(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l19_set_state(2, 1); + hero_l19_set_move_state(2, 1); break; } - hero_l19_set_state(0, 1); + hero_l19_set_move_state(0, 1); break; case 0x39: case 0x43: @@ -446,25 +446,25 @@ void hero_l19_decide_state_transition(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l19_set_state(0x33, 1); + hero_l19_set_move_state(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l19_set_state(0x34, 1); + hero_l19_set_move_state(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l19_set_state(0x32, 1); + hero_l19_set_move_state(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l19_set_state(0x33, 1); + hero_l19_set_move_state(0x33, 1); } } break; @@ -477,81 +477,81 @@ void hero_l19_decide_state_transition(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l19_set_state(0x32, 1); + hero_l19_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l19_set_state(0x34, 1); + hero_l19_set_move_state(0x34, 1); } else { - hero_l19_set_state(0x32, 1); + hero_l19_set_move_state(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l19_set_state(0x12, 1); + hero_l19_set_move_state(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l19_set_state(0x32, 1); + hero_l19_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l19_set_state(0x34, 1); + hero_l19_set_move_state(0x34, 1); } else { - hero_l19_set_state(0x32, 1); + hero_l19_set_move_state(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l19_set_state(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l19_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_anim_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l19_set_state(0x35, 1); + hero_l19_set_move_state(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l19_set_state(0x12, 1); + hero_l19_set_move_state(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l19_set_state(0x32, 1); + hero_l19_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l19_set_state(0x34, 1); + hero_l19_set_move_state(0x34, 1); } else { - hero_l19_set_state(0x32, 1); + hero_l19_set_move_state(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l19_set_state(0x70, 0); + hero_l19_set_move_state(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l19_set_state(0x36, 1); + hero_l19_set_move_state(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state(0x67, 1); + hero_l19_set_move_state(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state(0x33, 1); + hero_l19_set_move_state(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l19_set_state(0x33, 0); + hero_l19_set_move_state(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state(0x67, 1); + hero_l19_set_move_state(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l19_set_state(0x36, 0); + hero_l19_set_move_state(0x36, 0); } break; case 0x1: @@ -585,9 +585,9 @@ void hero_l19_decide_state_transition(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { snd_start_mode_sound(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state(4, 1); + hero_l19_set_move_state(4, 1); } else { - hero_l19_set_state(0, 0); + hero_l19_set_move_state(0, 0); anim = hero_get_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -599,9 +599,9 @@ void hero_l19_decide_state_transition(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l19_set_state(0, 0); + hero_l19_set_move_state(0, 0); } else { - hero_l19_set_state(0, 1); + hero_l19_set_move_state(0, 1); } } break; @@ -634,7 +634,7 @@ void hero_l19_decide_state_transition(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state(7, 1); + hero_l19_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -643,7 +643,7 @@ void hero_l19_decide_state_transition(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l19_set_state(0, 0); + hero_l19_set_move_state(0, 0); } break; } @@ -665,7 +665,7 @@ void hero_l19_decide_state_transition(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state(7, 1); + hero_l19_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -678,7 +678,7 @@ void hero_l19_decide_state_transition(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l19_set_state(2, 0); + hero_l19_set_move_state(2, 0); set_hero_animation(3, g_hero_l19_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -689,22 +689,22 @@ void hero_l19_decide_state_transition(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l19_set_state(2, 1); + hero_l19_set_move_state(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l19_set_state(0, 0); + hero_l19_set_move_state(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state(0, 0); + hero_l19_set_move_state(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l19_set_state(0, 1); + hero_l19_set_move_state(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -721,7 +721,7 @@ void hero_l19_decide_state_transition(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state(7, 1); + hero_l19_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -730,7 +730,7 @@ void hero_l19_decide_state_transition(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l19_set_state(0, 0); + hero_l19_set_move_state(0, 0); set_hero_animation(hero_get_anim_id(0), 0, 15.0f); break; } @@ -742,7 +742,7 @@ void hero_l19_decide_state_transition(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state(0, 1); + hero_l19_set_move_state(0, 1); } break; case 0x2: @@ -756,11 +756,11 @@ void hero_l19_decide_state_transition(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l19_set_state(0x76, 1); + hero_l19_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); break; } n = 9; @@ -774,12 +774,12 @@ void hero_l19_decide_state_transition(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l19_set_state(9, 1); + hero_l19_set_move_state(9, 1); } else { - hero_l19_set_state(7, 1); + hero_l19_set_move_state(7, 1); } } else { - hero_l19_set_state(7, 1); + hero_l19_set_move_state(7, 1); } break; } @@ -787,21 +787,21 @@ void hero_l19_decide_state_transition(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state(1, 1); + hero_l19_set_move_state(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state(4, 1); + hero_l19_set_move_state(4, 1); break; } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l19_set_state(0x70, 1); + hero_l19_set_move_state(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l19_set_state(2, 1); + hero_l19_set_move_state(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -812,7 +812,7 @@ void hero_l19_decide_state_transition(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l19_set_state(0, 0) == 0) { + if (hero_l19_set_move_state(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -829,7 +829,7 @@ void hero_l19_decide_state_transition(void) { hero_update_anim_scale(); } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l19_set_state(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l19_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_anim_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -863,17 +863,17 @@ void hero_l19_decide_state_transition(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l19_set_state(3, 0); + hero_l19_set_move_state(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l19_set_state(0x77, 1); + hero_l19_set_move_state(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l19_set_state(0x77, 1); + hero_l19_set_move_state(0x77, 1); break; } } @@ -891,11 +891,11 @@ void hero_l19_decide_state_transition(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l19_set_state(0x64, 1); + hero_l19_set_move_state(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l19_set_state(0x63, 1); + hero_l19_set_move_state(0x63, 1); } } else { hero_update_anim_scale(); @@ -903,15 +903,15 @@ void hero_l19_decide_state_transition(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state(0x62, 1); + hero_l19_set_move_state(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l19_set_state(0, 1); + hero_l19_set_move_state(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l19_set_state(0x62, 1); + hero_l19_set_move_state(0x62, 1); } break; case 0x79: @@ -926,25 +926,25 @@ void hero_l19_decide_state_transition(void) { return; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state(1, 1); + hero_l19_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l19_set_state(7, 1); + hero_l19_set_move_state(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state(4, 1); + hero_l19_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state(0, 1); + hero_l19_set_move_state(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -952,45 +952,45 @@ void hero_l19_decide_state_transition(void) { } if (hero_get_anim_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l19_set_state(0, 0); + hero_l19_set_move_state(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l19_set_state(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l19_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_anim_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l19_set_state(2, 1); + hero_l19_set_move_state(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state(1, 1); + hero_l19_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state(0, 0); + hero_l19_set_move_state(0, 0); set_hero_animation(hero_get_anim_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l19_set_state(0x76, 1); + hero_l19_set_move_state(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l19_set_state(0x15, 1); + hero_l19_set_move_state(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l19_set_state(0, 1); + hero_l19_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -998,17 +998,17 @@ void hero_l19_decide_state_transition(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l19_set_state(0x8B, 1); + hero_l19_set_move_state(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l19_set_state(0, 1); + hero_l19_set_move_state(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l19_set_state(0, 1); + hero_l19_set_move_state(0, 1); } break; case 0x24: @@ -1034,14 +1034,14 @@ void hero_l19_decide_state_transition(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l19_set_state(0, 0); + hero_l19_set_move_state(0, 0); set_hero_animation(hero_get_anim_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l19_set_state(6, 0); + hero_l19_set_move_state(6, 0); } else { - hero_l19_set_state(6, 0); + hero_l19_set_move_state(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1057,9 +1057,9 @@ void hero_l19_decide_state_transition(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l19_set_state(0, 1); + hero_l19_set_move_state(0, 1); } else { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1071,7 +1071,7 @@ void hero_l19_decide_state_transition(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l19_set_state(0x2C, 1); + hero_l19_set_move_state(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1079,7 +1079,7 @@ void hero_l19_decide_state_transition(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l19_set_state(0x18, 0); + hero_l19_set_move_state(0x18, 0); } break; case 0x18: @@ -1088,18 +1088,18 @@ void hero_l19_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l19_set_state(0x1B, 1); + hero_l19_set_move_state(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1108,7 +1108,7 @@ void hero_l19_decide_state_transition(void) { joint_pos_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; joint_pos_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)joint_pos_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l19_set_state(0x19, 1); + hero_l19_set_move_state(0x19, 1); } break; } @@ -1119,7 +1119,7 @@ void hero_l19_decide_state_transition(void) { joint_pos_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; joint_pos_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)joint_pos_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l19_set_state(0x1A, 1); + hero_l19_set_move_state(0x1A, 1); } } } @@ -1138,18 +1138,18 @@ void hero_l19_decide_state_transition(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)joint_pos_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state(0x18, 1); + hero_l19_set_move_state(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l19_set_state(0x1B, 1); + hero_l19_set_move_state(0x1B, 1); } break; } @@ -1159,9 +1159,9 @@ void hero_l19_decide_state_transition(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); } else { - hero_l19_set_state(0, 1); + hero_l19_set_move_state(0, 1); } } break; @@ -1185,12 +1185,12 @@ void hero_l19_decide_state_transition(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state(0x39, 1); + hero_l19_set_move_state(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l19_set_state(0, 0) != 0) { + if (hero_l19_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1198,7 +1198,7 @@ void hero_l19_decide_state_transition(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l19_set_state(0, 0) != 0) { + if (hero_l19_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1212,28 +1212,28 @@ void hero_l19_decide_state_transition(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l19_set_state(2, 1); + hero_l19_set_move_state(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l19_set_state(3, 0) != 0) { + if (hero_l19_set_move_state(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l19_set_state(0, 1); + hero_l19_set_move_state(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l19_set_state(8, 1); + hero_l19_set_move_state(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l19_set_state(0x17, 1); + hero_l19_set_move_state(0x17, 1); break; } } @@ -1265,7 +1265,7 @@ void hero_l19_decide_state_transition(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l19_set_state(0, 0) != 0) { + if (hero_l19_set_move_state(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1276,12 +1276,12 @@ void hero_l19_decide_state_transition(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l19_set_state(0x74, 1); + hero_l19_set_move_state(0x74, 1); } else { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); } } else { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); } } break; @@ -1294,16 +1294,16 @@ void hero_l19_decide_state_transition(void) { ok = 1; } if (ok != 0) { - hero_l19_set_state(0x11, 1); + hero_l19_set_move_state(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l19_set_state(0x17, 1); + hero_l19_set_move_state(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1314,23 +1314,23 @@ void hero_l19_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l19_set_state(3, 0) != 0) { + if (hero_l19_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state(4, 1); + hero_l19_set_move_state(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_limits[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l19_set_state(2, 1); + hero_l19_set_move_state(2, 1); break; } - hero_l19_set_state(2, 0); + hero_l19_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1339,21 +1339,21 @@ void hero_l19_decide_state_transition(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_limits[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l19_set_state(2, 1); + hero_l19_set_move_state(2, 1); break; } - hero_l19_set_state(2, 0); + hero_l19_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l19_animation_id_extra, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l19_set_state(0, 0) != 0) { + if (hero_l19_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_anim_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l19_set_state(0, 0) != 0) { + } else if (hero_l19_set_move_state(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1399,14 +1399,14 @@ void hero_l19_decide_state_transition(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state(0xB, 1); + hero_l19_set_move_state(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l19_set_state(0x82, 1); + hero_l19_set_move_state(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1415,21 +1415,21 @@ void hero_l19_decide_state_transition(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l19_set_state(0xA, 1); + hero_l19_set_move_state(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l19_set_state(0x10, 1); + hero_l19_set_move_state(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l19_set_state(0x77, 1); + hero_l19_set_move_state(0x77, 1); break; } } @@ -1533,7 +1533,7 @@ void hero_l19_decide_state_transition(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l19_set_state(3, 0) != 0) { + if (hero_l19_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1541,13 +1541,13 @@ void hero_l19_decide_state_transition(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_limits[0][2])) { - hero_l19_set_state(7, 1); + hero_l19_set_move_state(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l19_set_state(7, 1); + hero_l19_set_move_state(7, 1); } else if (g_hero_speed_limits[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l19_set_state(9, 1); + hero_l19_set_move_state(9, 1); } else { - hero_l19_set_state(7, 1); + hero_l19_set_move_state(7, 1); } break; } @@ -1555,10 +1555,10 @@ void hero_l19_decide_state_transition(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_action(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); break; } { @@ -1568,7 +1568,7 @@ void hero_l19_decide_state_transition(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l19_set_state(0x11, 1); + hero_l19_set_move_state(0x11, 1); break; } } @@ -1597,7 +1597,7 @@ void hero_l19_decide_state_transition(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l19_set_state(0xE, 1); + hero_l19_set_move_state(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1607,32 +1607,32 @@ void hero_l19_decide_state_transition(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l19_set_state(8, 1); + hero_l19_set_move_state(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l19_set_state(0x17, 1); + hero_l19_set_move_state(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l19_set_state(6, 1); + hero_l19_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l19_set_state(0x79, 1); + hero_l19_set_move_state(0x79, 1); } else { - hero_l19_set_state(0x39, 1); + hero_l19_set_move_state(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l19_set_state(0x82, 1); + hero_l19_set_move_state(0x82, 1); } else { - hero_l19_set_state(0, 0); + hero_l19_set_move_state(0, 0); } } break; @@ -1642,8 +1642,8 @@ void hero_l19_decide_state_transition(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state(0x39, 1); - } else if (hero_l19_set_state(0, 0) != 0) { + hero_l19_set_move_state(0x39, 1); + } else if (hero_l19_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_anim_id(0), 0, 13.0f); } } @@ -1660,35 +1660,35 @@ void hero_l19_decide_state_transition(void) { set_hero_animation(0xD, 0, 12.0f); } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l19_set_state(0x94, 1); + hero_l19_set_move_state(0x94, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state(1, 1); + hero_l19_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l19_set_state(0x8F, 1); + hero_l19_set_move_state(0x8F, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l19_set_state(0x92, 1); + hero_l19_set_move_state(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != 0xEE1) && (PadPressedWithin(0x80, 9, NULL) != 0)) { - hero_l19_set_state(0x93, 1); + hero_l19_set_move_state(0x93, 1); break; } hero_resolve_stick_direction(0, 1.0f); turned = hero_is_turned_past_angle(0.17453295f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (turned != 0)) { - hero_l19_set_state(0x8E, 1); + hero_l19_set_move_state(0x8E, 1); } break; } case 0x93: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l19_set_state(0x94, 1); + hero_l19_set_move_state(0x94, 1); } break; case 0x92: @@ -1754,20 +1754,20 @@ void hero_l19_decide_state_transition(void) { after_pose: if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l19_set_state(0x92, 1); + hero_l19_set_move_state(0x92, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_limits[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l19_set_state(0x8E, 1); + hero_l19_set_move_state(0x8E, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l19_set_state(0x8D, 1); + hero_l19_set_move_state(0x8D, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l19_set_state(0x8F, 1); + hero_l19_set_move_state(0x8F, 1); } break; } @@ -1780,15 +1780,15 @@ void hero_l19_decide_state_transition(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state(0x91, 1); + hero_l19_set_move_state(0x91, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l19_set_state(0x8E, 1); + hero_l19_set_move_state(0x8E, 1); } else { - hero_l19_set_state(0x8D, 1); + hero_l19_set_move_state(0x8D, 1); } } else { - hero_l19_set_state(0x8D, 1); + hero_l19_set_move_state(0x8D, 1); } } break; @@ -1798,43 +1798,43 @@ void hero_l19_decide_state_transition(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l19_set_state(0x8F, 1); + hero_l19_set_move_state(0x8F, 1); } else { - hero_l19_set_state(0x8D, 1); + hero_l19_set_move_state(0x8D, 1); } } break; case 0x8E: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l19_set_state(0x94, 1); + hero_l19_set_move_state(0x94, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l19_set_state(0x92, 1); + hero_l19_set_move_state(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != 0xEE1) && (PadPressedWithin(0x80, 9, NULL) != 0)) { - hero_l19_set_state(0x93, 1); + hero_l19_set_move_state(0x93, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l19_set_state(0x8F, 1); + hero_l19_set_move_state(0x8F, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f) && (FLD(g_hero_state, s16, 0x1454) == 0)) { - hero_l19_set_state(0x8D, 1); + hero_l19_set_move_state(0x8D, 1); } break; case 0x90: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l19_set_state(0x8F, 1); + hero_l19_set_move_state(0x8F, 1); break; } if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x1B8) >= 0x24)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state(0x91, 1); + hero_l19_set_move_state(0x91, 1); } else { - hero_l19_set_state(0x8D, 0); + hero_l19_set_move_state(0x8D, 0); } } break; @@ -1849,7 +1849,7 @@ void hero_l19_decide_state_transition(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l19_set_state(0, 0); + hero_l19_set_move_state(0, 0); anim = hero_get_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1860,7 +1860,7 @@ void hero_l19_decide_state_transition(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l19_set_state(0, 0); + hero_l19_set_move_state(0, 0); } break; case 0x22: @@ -1870,12 +1870,12 @@ void hero_l19_decide_state_transition(void) { hero_choose_jump_or_roll_move(); break; } - hero_l19_set_state(7, 1); + hero_l19_set_move_state(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l19_set_state(0, 0); + hero_l19_set_move_state(0, 0); } break; default: diff --git a/src/levels/20_yeedil/L20_002B7A48-g8.c b/src/levels/20_yeedil/L20_002B7A48-g8.c index 8d41c4618..158b648a6 100644 --- a/src/levels/20_yeedil/L20_002B7A48-g8.c +++ b/src/levels/20_yeedil/L20_002B7A48-g8.c @@ -47,7 +47,7 @@ extern void hero_process_action_command(void); extern int hero_find_ledge_grab(char *, char *, char *); extern void UpdateHeroMotionResponseParameters(void); extern s32 FastDecTimer(s32); -extern s32 hero_l20_set_state(s32, s32); +extern s32 hero_l20_set_move_state(s32, s32); extern s32 subtitle_request_voice_line(s32, s32); extern void hero_l20_decide_state_transition(void); extern void RebuildRegionObjectMembership(void); @@ -93,7 +93,7 @@ void hero_l20_update_frame(void) if (*(int *)(base + 0x2294) != 0x6F) { if (FastDecTimer(*(int *)(*(int *)(base + 0x2290) + 0x68) + 0x3BC) != 0) { *(int *)(base + 0x24CC) = 0; - hero_l20_set_state(0x91, 1); + hero_l20_set_move_state(0x91, 1); } if (g_current_map_index == 0x14) { if (g_hero_frame_flag == 0) { diff --git a/src/levels/20_yeedil/L20_002B7A48.c b/src/levels/20_yeedil/L20_002B7A48.c index 99f07d5f5..29f4b1df1 100644 --- a/src/levels/20_yeedil/L20_002B7A48.c +++ b/src/levels/20_yeedil/L20_002B7A48.c @@ -53,7 +53,7 @@ extern void attachment_reset_all(void); extern int level_run_slot_callback(s32); extern void hero_clear_queued_anim(void); extern void func_002A677C(s32); -extern s32 hero_l20_set_state(s32, s32); +extern s32 hero_l20_set_move_state(s32, s32); extern void set_hero_animation(f32, s32, s32); extern s32 g_pad_pressed_flags[]; extern void UpdateYeedilHeroCollisionCapsule(void); @@ -159,7 +159,7 @@ void SetYeedilHeroVehicleMode(s32 new_mode, s32 animation, char *attach_object) *(u16 *)(D + 0x24D4) = *(u16 *)(D + 0x24CC); *(s32 *)(D + 0x24CC) = 3; } - hero_l20_set_state(p1, 2); + hero_l20_set_move_state(p1, 2); if (p0 == 4) set_hero_animation(5.0f, 0xF, 0); } diff --git a/src/levels/20_yeedil/L20_002C5A48-qcopy.c b/src/levels/20_yeedil/L20_002C5A48-qcopy.c index e98639a46..b7da0e066 100644 --- a/src/levels/20_yeedil/L20_002C5A48-qcopy.c +++ b/src/levels/20_yeedil/L20_002C5A48-qcopy.c @@ -17,7 +17,7 @@ extern void hero_clear_tracked_slots(void); extern void hero_clear_queued_anim(void); extern s32 anim_copy_entry_data(char *, s32, s32, s32); extern void cam_reset_default(void); -extern s32 hero_l20_set_state(s32, s32); +extern s32 hero_l20_set_move_state(s32, s32); /* Apart from the leading state-1 block this is the same code as func_L18_002CFF48 (src/levels/shared/L18_002CFD68-qcopy.c), and it needs the same grouped-copy profile. @@ -93,7 +93,7 @@ void hero_exit_vehicle_mode(s32 keep) goto done; } reset: - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); done: if (g_hero_state[0x22B4] == 4) cam_reset_default(); } diff --git a/src/levels/20_yeedil/L20_002C5D00-contact.c b/src/levels/20_yeedil/L20_002C5D00-contact.c index 18adede75..8847fadbb 100644 --- a/src/levels/20_yeedil/L20_002C5D00-contact.c +++ b/src/levels/20_yeedil/L20_002C5D00-contact.c @@ -68,7 +68,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l20_set_state(s32, s32); +extern s32 hero_l20_set_move_state(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth(s32); extern int hero_play_sound(s32, s32); @@ -155,7 +155,7 @@ s32 hero_handle_hazard_contact(s32 apply_push) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB /* moby class 1259 */ || *(s16 *)(other + 0xAA) == 0x558 /* moby class 1368 */)) { - hero_l20_set_state(0x7D, 1); + hero_l20_set_move_state(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -166,7 +166,7 @@ s32 hero_handle_hazard_contact(s32 apply_push) { AdjustPlayerHealth(FloatToInt(*(float *)(r + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l20_set_state(0x16, 1); + hero_l20_set_move_state(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -176,13 +176,13 @@ s32 hero_handle_hazard_contact(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l20_set_state(0x72, 1); + hero_l20_set_move_state(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l20_set_state(0x73, 1); + hero_l20_set_move_state(0x73, 1); } else if (e->f24 & 8) { - hero_l20_set_state(0x8C, 1); + hero_l20_set_move_state(0x8C, 1); } else { - hero_l20_set_state(0x16, 1); + hero_l20_set_move_state(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&vec); @@ -194,11 +194,11 @@ s32 hero_handle_hazard_contact(s32 apply_push) { } break; case 1: - hero_l20_set_state(0x42, 1); + hero_l20_set_move_state(0x42, 1); hero_flatten_push_vector(&vec, flag, 0.083333336f, 0.050000004f); break; case 4: - hero_l20_set_state(0x90, 1); + hero_l20_set_move_state(0x90, 1); hero_flatten_push_vector(&vec, flag, 0.083333336f, 0.050000004f); break; } diff --git a/src/levels/20_yeedil/L20_002CD928.c b/src/levels/20_yeedil/L20_002CD928.c index 30beb288e..4548d58a4 100644 --- a/src/levels/20_yeedil/L20_002CD928.c +++ b/src/levels/20_yeedil/L20_002CD928.c @@ -169,7 +169,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -188,7 +188,7 @@ extern s32 shooter_update_ranged_attack(s32); extern s32 SelectHeroStateAnimation(s32); extern void hero_exit_vehicle_mode(s32); extern void hero_slide_along_wall(s32); -extern s32 hero_l20_set_state(s32, s32); +extern s32 hero_l20_set_move_state(s32, s32); /* Runs the hero state machine for one frame: one big switch on the hero state decides movement and animation. */ void hero_l20_update_state_machine(void) { f32 speed62; @@ -730,7 +730,7 @@ void hero_l20_update_state_machine(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { temp_a2 = ((Hero *)g_hero_state)->i[0x2440/4]; if (temp_a2 != -1) { @@ -1473,7 +1473,7 @@ void hero_l20_update_state_machine(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l20_extra_state)->f[0x180/4] = 0.1f; @@ -3112,7 +3112,7 @@ void hero_l20_update_state_machine(void) { } hero_try_surface_push_response(3.7f, 0.0f, 0.35f); if (shooter_update_ranged_attack((s32) temp_fp) != 0) { - hero_l20_set_state(0x8D, 1); + hero_l20_set_move_state(0x8D, 1); } } break; diff --git a/src/levels/20_yeedil/L20_002D6488-timers-g8.c b/src/levels/20_yeedil/L20_002D6488-timers-g8.c index bb3604cb0..9f4364bac 100644 --- a/src/levels/20_yeedil/L20_002D6488-timers-g8.c +++ b/src/levels/20_yeedil/L20_002D6488-timers-g8.c @@ -91,7 +91,7 @@ extern float g_hero_timer_trigger_a, g_hero_timer_trigger_b; /* The equipment flag at 0x1A7AFF: a small-data object at a nonzero offset, length 2 for reorg. */ extern unsigned char g_hero_event_flags[] __attribute__((sda)); extern void hero_ease_lean_to_upright(void), hero_queue_glow_draw_routine(void), hero_update_landing_slide(void), hero_record_play_counters(void); -extern s32 hero_l20_set_state(int, int); +extern s32 hero_l20_set_move_state(int, int); extern int FastDecTimer(void *), math_fast_float_d(void *); extern void vec_clear_128(void *); extern int moby_is_in_special_class_range(void *), math_random_int_below(int); @@ -176,7 +176,7 @@ void hero_l20_update_timers(void) { if (g_hero_state.field_24CC && !D_L20_001A8F00_abs && g_hero_state.mode == 4 && g_hero_state.field_2294 != 0x6F && (g_pad_state.pressed&0x10)) { g_hero_state.field_1E0 = 0; g_hero_state.field_24CC = 0; - hero_l20_set_state(0x91, 1); + hero_l20_set_move_state(0x91, 1); } if (!D_L20_001A8F00_abs) { if (g_hero_timer_trigger_a>0) g_hero_state.field_22A++; diff --git a/src/levels/20_yeedil/L20_002D6488.c b/src/levels/20_yeedil/L20_002D6488.c index deaa1e31f..7285c141b 100644 --- a/src/levels/20_yeedil/L20_002D6488.c +++ b/src/levels/20_yeedil/L20_002D6488.c @@ -9,7 +9,7 @@ extern unsigned char g_hero_load_mode_switch; -extern int hero_l20_set_state(int a0, int a1); +extern int hero_l20_set_move_state(int a0, int a1); /* Picks the variant of the shared loader the current game state selects. */ void hero_load_state_by_game_mode(int flag) @@ -18,13 +18,13 @@ void hero_load_state_by_game_mode(int flag) switch (g_hero_load_mode_switch) { case 0: - hero_l20_set_state(0, a1); + hero_l20_set_move_state(0, a1); break; case 1: - hero_l20_set_state(0x3F, a1); + hero_l20_set_move_state(0x3F, a1); break; case 4: - hero_l20_set_state(0x8D, a1); + hero_l20_set_move_state(0x8D, a1); break; } } diff --git a/src/levels/20_yeedil/L20_002D7730-state-g8.c b/src/levels/20_yeedil/L20_002D7730-state-g8.c index 218811483..e87f166b8 100644 --- a/src/levels/20_yeedil/L20_002D7730-state-g8.c +++ b/src/levels/20_yeedil/L20_002D7730-state-g8.c @@ -82,8 +82,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -149,7 +149,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l20_set_state(s32 action, s32 animate) { +s32 hero_l20_set_move_state(s32 action, s32 animate) { f32 dir[4]; u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -197,7 +197,9 @@ s32 hero_l20_set_state(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -210,8 +212,8 @@ s32 hero_l20_set_state(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_load_state_by_game_mode(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l20_set_state(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l20_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (SelectHeroStateAnimation(0) == 0x51) set_hero_animation(SelectHeroStateAnimation(0), 0, 18.0f); else set_hero_animation(SelectHeroStateAnimation(0), 0, -1.0f); @@ -358,7 +360,7 @@ s32 hero_l20_set_state(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l20_set_state(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l20_set_move_state(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -404,12 +406,12 @@ s32 hero_l20_set_state(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l20_set_state(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l20_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (SelectHeroStateAnimation(0) == 0x51) { if (!animate) goto finish; - if (hero_l20_set_state(0, 0)) set_hero_animation(SelectHeroStateAnimation(0), 0, 18.0f); + if (hero_l20_set_move_state(0, 0)) set_hero_animation(SelectHeroStateAnimation(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -434,7 +436,7 @@ s32 hero_l20_set_state(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -600,13 +602,13 @@ s32 hero_l20_set_state(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 /* moby class 2489 */ || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05 /* moby class 3845 */)) { - hero_l20_set_state(0x81, 1); return 0; + hero_l20_set_move_state(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l20_lock_flag_b) { hero_l20_set_state(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l20_lock_flag_b) { hero_l20_set_move_state(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l20_set_state(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l20_set_move_state(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -681,9 +683,9 @@ s32 hero_l20_set_state(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_special_map_flag) hero_l20_set_state(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l20_set_state(0x79, 1); - else hero_l20_set_state(0x39, 1); + if (g_current_map_index == 2 && g_hero_special_map_flag) hero_l20_set_move_state(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l20_set_move_state(0x79, 1); + else hero_l20_set_move_state(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -746,7 +748,7 @@ s32 hero_l20_set_state(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -775,7 +777,7 @@ s32 hero_l20_set_state(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -784,7 +786,7 @@ s32 hero_l20_set_state(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -927,7 +929,7 @@ s32 hero_l20_set_state(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -1022,7 +1024,7 @@ s32 hero_l20_set_state(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -1034,7 +1036,7 @@ s32 hero_l20_set_state(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth(1); @@ -1069,7 +1071,7 @@ s32 hero_l20_set_state(s32 action, s32 animate) { set_hero_animation(0x11, 0, 8.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation(0, 0, 9.0f); goto finish; case 0x4B: @@ -1103,7 +1105,7 @@ s32 hero_l20_set_state(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l20_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1136,7 +1138,7 @@ s32 hero_l20_set_state(s32 action, s32 animate) { set_hero_animation(12, 0, 6.0f); goto finish; case 0x8D: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state(0x94, 1); return 0; } if (!animate) goto finish; set_hero_animation(13, 0, 9.0f); goto finish; case 0x8F: @@ -1157,7 +1159,7 @@ s32 hero_l20_set_state(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l20_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x8E: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state(0x94, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); BYTE(0x40C) = 0; BYTE(0x40F) = 0; if (WORD(0x22A4) == 0) REAL(0x1B4) = vec_length_xy(VEC(0x160)); @@ -1186,7 +1188,7 @@ s32 hero_l20_set_state(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l20_set_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l20_set_move_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/levels/20_yeedil/L20_002DEBE0-decider.c b/src/levels/20_yeedil/L20_002DEBE0-decider.c index b374ce1a5..7cc196b6e 100644 --- a/src/levels/20_yeedil/L20_002DEBE0-decider.c +++ b/src/levels/20_yeedil/L20_002DEBE0-decider.c @@ -84,7 +84,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l20_set_state(s32, s32); +s32 hero_l20_set_move_state(s32, s32); void hero_load_state_by_game_mode(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -164,7 +164,7 @@ void hero_l20_decide_state_transition(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l20_set_state(0x39, 1); + hero_l20_set_move_state(0x39, 1); goto end; } } @@ -200,15 +200,15 @@ void hero_l20_decide_state_transition(void) { if (FLD(g_hero_state, f32, 0x88) < g_level_shared_float) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { if (FLD(g_hero_state, u8, 0x22B4) == 4) { - hero_l20_set_state(0x91, 1); + hero_l20_set_move_state(0x91, 1); goto end; } - hero_l20_set_state(0x74, 1); + hero_l20_set_move_state(0x74, 1); goto end; } } if ((FLD(g_hero_state, u8, 0x22B4) == 4) && (FLD(g_hero_state, f32, 0x88) < FLD(FLD(FLD(g_hero_state, void *, 0x2290), void *, 0x68), f32, 0x3EC))) { - hero_l20_set_state(0x91, 1); + hero_l20_set_move_state(0x91, 1); } switch (FLD(g_hero_state, u32, 0x2294)) { case 0x0: @@ -217,12 +217,12 @@ void hero_l20_decide_state_transition(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state(1, 1); + hero_l20_set_move_state(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l20_set_state(0x82, 1); + hero_l20_set_move_state(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -259,7 +259,7 @@ void hero_l20_decide_state_transition(void) { rec = g_hero_decision_records + record_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l20_set_state(0x3C, 1); + hero_l20_set_move_state(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -302,12 +302,12 @@ void hero_l20_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l20_set_state(0x76, 1); + hero_l20_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); } break; } @@ -328,21 +328,21 @@ void hero_l20_decide_state_transition(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l20_lock_flag_b == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l20_set_state(0x6E, 1); + hero_l20_set_move_state(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l20_set_state(4, 1); + hero_l20_set_move_state(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state(0x27, 1); + hero_l20_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l20_set_state(0x2E, 1); + hero_l20_set_move_state(0x2E, 1); break; } { @@ -362,28 +362,28 @@ void hero_l20_decide_state_transition(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l20_set_state(2, 1); + hero_l20_set_move_state(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state(1, 1); + hero_l20_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((unused_pad = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (unused_pad & 8)) { - hero_l20_set_state(0x3D, 1); + hero_l20_set_move_state(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l20_set_state(0x3D, 1); + hero_l20_set_move_state(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); } break; case 0x3D: @@ -392,22 +392,22 @@ void hero_l20_decide_state_transition(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state(4, 1); + hero_l20_set_move_state(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l20_set_state(2, 1); + hero_l20_set_move_state(2, 1); break; } - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); break; case 0x39: case 0x43: @@ -446,25 +446,25 @@ void hero_l20_decide_state_transition(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l20_set_state(0x33, 1); + hero_l20_set_move_state(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l20_set_state(0x34, 1); + hero_l20_set_move_state(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l20_set_state(0x32, 1); + hero_l20_set_move_state(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l20_set_state(0x33, 1); + hero_l20_set_move_state(0x33, 1); } } break; @@ -477,81 +477,81 @@ void hero_l20_decide_state_transition(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l20_set_state(0x32, 1); + hero_l20_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l20_set_state(0x34, 1); + hero_l20_set_move_state(0x34, 1); } else { - hero_l20_set_state(0x32, 1); + hero_l20_set_move_state(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l20_set_state(0x12, 1); + hero_l20_set_move_state(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l20_set_state(0x32, 1); + hero_l20_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l20_set_state(0x34, 1); + hero_l20_set_move_state(0x34, 1); } else { - hero_l20_set_state(0x32, 1); + hero_l20_set_move_state(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l20_set_state(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l20_set_move_state(0, 0) != 0)) { set_hero_animation(SelectHeroStateAnimation(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l20_set_state(0x35, 1); + hero_l20_set_move_state(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l20_set_state(0x12, 1); + hero_l20_set_move_state(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l20_set_state(0x32, 1); + hero_l20_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l20_set_state(0x34, 1); + hero_l20_set_move_state(0x34, 1); } else { - hero_l20_set_state(0x32, 1); + hero_l20_set_move_state(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l20_set_state(0x70, 0); + hero_l20_set_move_state(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l20_set_state(0x36, 1); + hero_l20_set_move_state(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state(0x67, 1); + hero_l20_set_move_state(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state(0x33, 1); + hero_l20_set_move_state(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l20_set_state(0x33, 0); + hero_l20_set_move_state(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state(0x67, 1); + hero_l20_set_move_state(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l20_set_state(0x36, 0); + hero_l20_set_move_state(0x36, 0); } break; case 0x1: @@ -585,9 +585,9 @@ void hero_l20_decide_state_transition(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_load_state_by_game_mode(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state(4, 1); + hero_l20_set_move_state(4, 1); } else { - hero_l20_set_state(0, 0); + hero_l20_set_move_state(0, 0); anim = SelectHeroStateAnimation(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -599,9 +599,9 @@ void hero_l20_decide_state_transition(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l20_set_state(0, 0); + hero_l20_set_move_state(0, 0); } else { - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); } } break; @@ -634,7 +634,7 @@ void hero_l20_decide_state_transition(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state(7, 1); + hero_l20_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -643,7 +643,7 @@ void hero_l20_decide_state_transition(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l20_set_state(0, 0); + hero_l20_set_move_state(0, 0); } break; } @@ -665,7 +665,7 @@ void hero_l20_decide_state_transition(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state(7, 1); + hero_l20_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -678,7 +678,7 @@ void hero_l20_decide_state_transition(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l20_set_state(2, 0); + hero_l20_set_move_state(2, 0); set_hero_animation(3, g_hero_l20_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -689,22 +689,22 @@ void hero_l20_decide_state_transition(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l20_set_state(2, 1); + hero_l20_set_move_state(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l20_set_state(0, 0); + hero_l20_set_move_state(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state(0, 0); + hero_l20_set_move_state(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -721,7 +721,7 @@ void hero_l20_decide_state_transition(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state(7, 1); + hero_l20_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -730,7 +730,7 @@ void hero_l20_decide_state_transition(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l20_set_state(0, 0); + hero_l20_set_move_state(0, 0); set_hero_animation(SelectHeroStateAnimation(0), 0, 15.0f); break; } @@ -742,7 +742,7 @@ void hero_l20_decide_state_transition(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); } break; case 0x2: @@ -756,11 +756,11 @@ void hero_l20_decide_state_transition(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l20_set_state(0x76, 1); + hero_l20_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); break; } n = 9; @@ -774,12 +774,12 @@ void hero_l20_decide_state_transition(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l20_set_state(9, 1); + hero_l20_set_move_state(9, 1); } else { - hero_l20_set_state(7, 1); + hero_l20_set_move_state(7, 1); } } else { - hero_l20_set_state(7, 1); + hero_l20_set_move_state(7, 1); } break; } @@ -787,11 +787,11 @@ void hero_l20_decide_state_transition(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state(1, 1); + hero_l20_set_move_state(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state(4, 1); + hero_l20_set_move_state(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -808,25 +808,25 @@ void hero_l20_decide_state_transition(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l20_set_state(0x2E, 1); + hero_l20_set_move_state(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l20_set_state(2, 1); + hero_l20_set_move_state(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l20_set_state(0x70, 1); + hero_l20_set_move_state(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l20_set_state(2, 1); + hero_l20_set_move_state(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state(0x27, 1); + hero_l20_set_move_state(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -837,7 +837,7 @@ void hero_l20_decide_state_transition(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l20_set_state(0, 0) == 0) { + if (hero_l20_set_move_state(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -854,7 +854,7 @@ void hero_l20_decide_state_transition(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l20_set_state(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l20_set_move_state(0, 0) != 0)) { set_hero_animation(SelectHeroStateAnimation(0), 0, 17.0f); } if (FLD(hero_moby, u8, 0x43) == 0x37) { @@ -875,7 +875,7 @@ void hero_l20_decide_state_transition(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l20_set_state(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l20_set_move_state(0, 0) != 0)) { set_hero_animation(SelectHeroStateAnimation(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -909,17 +909,17 @@ void hero_l20_decide_state_transition(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l20_set_state(3, 0); + hero_l20_set_move_state(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l20_set_state(0x77, 1); + hero_l20_set_move_state(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l20_set_state(0x77, 1); + hero_l20_set_move_state(0x77, 1); break; } } @@ -937,11 +937,11 @@ void hero_l20_decide_state_transition(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l20_set_state(0x64, 1); + hero_l20_set_move_state(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l20_set_state(0x63, 1); + hero_l20_set_move_state(0x63, 1); } } else { hero_update_anim_scale(); @@ -949,21 +949,21 @@ void hero_l20_decide_state_transition(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state(0x62, 1); + hero_l20_set_move_state(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l20_set_state(0x62, 1); + hero_l20_set_move_state(0x62, 1); } break; case 0x65: /* switch 2 */ step_level = FLD(g_hero_state, s32, 0x18C0); if ((step_level < 3) && (((step_level * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 7, &button_frame) != 0)) { - hero_l20_set_state(0x66, 1); + hero_l20_set_move_state(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -1006,7 +1006,7 @@ void hero_l20_decide_state_transition(void) { return; case 0x6D: if ((f32)g_hero_l20_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); } break; case 0x30: @@ -1019,7 +1019,7 @@ void hero_l20_decide_state_transition(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l20_set_state(0, 0) != 0) { + if (hero_l20_set_move_state(0, 0) != 0) { set_hero_animation(SelectHeroStateAnimation(0), 0, 17.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1027,29 +1027,29 @@ void hero_l20_decide_state_transition(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state(1, 1); + hero_l20_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l20_set_state(7, 1); + hero_l20_set_move_state(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state(4, 1); + hero_l20_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state(0x27, 1); + hero_l20_set_move_state(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1057,45 +1057,45 @@ void hero_l20_decide_state_transition(void) { } if (SelectHeroStateAnimation(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l20_set_state(0, 0); + hero_l20_set_move_state(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l20_set_state(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l20_set_move_state(0, 0) != 0)) { set_hero_animation(SelectHeroStateAnimation(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l20_set_state(2, 1); + hero_l20_set_move_state(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state(1, 1); + hero_l20_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state(0, 0); + hero_l20_set_move_state(0, 0); set_hero_animation(SelectHeroStateAnimation(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l20_set_state(0x76, 1); + hero_l20_set_move_state(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l20_set_state(0x15, 1); + hero_l20_set_move_state(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1103,17 +1103,17 @@ void hero_l20_decide_state_transition(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l20_set_state(0x8B, 1); + hero_l20_set_move_state(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); } break; case 0x24: @@ -1139,14 +1139,14 @@ void hero_l20_decide_state_transition(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l20_set_state(0, 0); + hero_l20_set_move_state(0, 0); set_hero_animation(SelectHeroStateAnimation(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l20_set_state(6, 0); + hero_l20_set_move_state(6, 0); } else { - hero_l20_set_state(6, 0); + hero_l20_set_move_state(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1162,9 +1162,9 @@ void hero_l20_decide_state_transition(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); } else { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1176,7 +1176,7 @@ void hero_l20_decide_state_transition(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l20_set_state(0x2C, 1); + hero_l20_set_move_state(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1225,11 +1225,11 @@ void hero_l20_decide_state_transition(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.21666668f); FLD(g_hero_state, f32, 0x128) = 0.16666667f; - hero_l20_set_state(0x16, 1); + hero_l20_set_move_state(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x46; FLD(g_hero_state, s16, 0x1D0) = 0x46; } else { - hero_l20_set_state(0x3E, 1); + hero_l20_set_move_state(0x3E, 1); } break; } @@ -1242,7 +1242,7 @@ void hero_l20_decide_state_transition(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l20_set_state(0x28, 1); + hero_l20_set_move_state(0x28, 1); } break; } @@ -1253,16 +1253,16 @@ void hero_l20_decide_state_transition(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x46; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l20_set_state(0x74, 1); + hero_l20_set_move_state(0x74, 1); } else { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { - hero_l20_set_state(0x2A, 1); + hero_l20_set_move_state(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1279,7 +1279,7 @@ void hero_l20_decide_state_transition(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l20_set_state(0x28, 1); + hero_l20_set_move_state(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)v20 = 0; @@ -1296,7 +1296,7 @@ void hero_l20_decide_state_transition(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 5, NULL) != 0) && ((f32)g_hero_l20_action_table[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l20_set_state(0x28, 1); + hero_l20_set_move_state(0x28, 1); break; } top = 0xE; @@ -1305,19 +1305,19 @@ void hero_l20_decide_state_transition(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l20_set_state(0x2A, 1); + hero_l20_set_move_state(0x2A, 1); } break; } if ((f32)g_hero_l20_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l20_set_state(0x27, 1); + hero_l20_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x6C8) >= 6)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l20_set_state(0x74, 1); + hero_l20_set_move_state(0x74, 1); } else { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1326,7 +1326,7 @@ void hero_l20_decide_state_transition(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l20_set_state(0x27, 1); + hero_l20_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0xA) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1362,7 +1362,7 @@ void hero_l20_decide_state_transition(void) { find_nearest_path_point(next_path_point, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), path_wrap, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l20_set_state(0x29, 1); + hero_l20_set_move_state(0x29, 1); break; } } @@ -1410,7 +1410,7 @@ void hero_l20_decide_state_transition(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x46; FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1418,7 +1418,7 @@ void hero_l20_decide_state_transition(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l20_set_state(0x71, 1); + hero_l20_set_move_state(0x71, 1); break; } { @@ -1430,7 +1430,7 @@ void hero_l20_decide_state_transition(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l20_set_state(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l20_set_move_state(0, 0) != 0)) { set_hero_animation(0xC, 4, 6.0f); } } else if (st == 0x3E) { @@ -1439,18 +1439,18 @@ void hero_l20_decide_state_transition(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)turn_angle2, 0.5f, -1.0f); } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state(0x27, 1); + hero_l20_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l20_set_state(0x27, 1); + hero_l20_set_move_state(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l20_set_state(0x18, 0); + hero_l20_set_move_state(0x18, 0); } break; case 0x18: @@ -1459,18 +1459,18 @@ void hero_l20_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l20_set_state(0x1B, 1); + hero_l20_set_move_state(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1479,7 +1479,7 @@ void hero_l20_decide_state_transition(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l20_set_state(0x19, 1); + hero_l20_set_move_state(0x19, 1); } break; } @@ -1490,7 +1490,7 @@ void hero_l20_decide_state_transition(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l20_set_state(0x1A, 1); + hero_l20_set_move_state(0x1A, 1); } } } @@ -1509,18 +1509,18 @@ void hero_l20_decide_state_transition(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state(0x18, 1); + hero_l20_set_move_state(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l20_set_state(0x1B, 1); + hero_l20_set_move_state(0x1B, 1); } break; } @@ -1530,9 +1530,9 @@ void hero_l20_decide_state_transition(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); } else { - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); } } break; @@ -1556,12 +1556,12 @@ void hero_l20_decide_state_transition(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state(0x39, 1); + hero_l20_set_move_state(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l20_set_state(0, 0) != 0) { + if (hero_l20_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1569,7 +1569,7 @@ void hero_l20_decide_state_transition(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l20_set_state(0, 0) != 0) { + if (hero_l20_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1583,32 +1583,32 @@ void hero_l20_decide_state_transition(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l20_set_state(2, 1); + hero_l20_set_move_state(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l20_set_state(3, 0) != 0) { + if (hero_l20_set_move_state(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l20_set_state(0, 1); + hero_l20_set_move_state(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l20_set_state(8, 1); + hero_l20_set_move_state(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state(0x17, 1); + hero_l20_set_move_state(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state(0x27, 1); + hero_l20_set_move_state(0x27, 1); break; } } @@ -1640,7 +1640,7 @@ void hero_l20_decide_state_transition(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == MOBY_CLASS_LEVITATOR_PAD)) { - if (hero_l20_set_state(0, 0) != 0) { + if (hero_l20_set_move_state(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1650,9 +1650,9 @@ void hero_l20_decide_state_transition(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l20_set_state(0x74, 1); + hero_l20_set_move_state(0x74, 1); } else { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); } } break; @@ -1665,16 +1665,16 @@ void hero_l20_decide_state_transition(void) { ok = 1; } if (ok != 0) { - hero_l20_set_state(0x11, 1); + hero_l20_set_move_state(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state(0x17, 1); + hero_l20_set_move_state(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1685,23 +1685,23 @@ void hero_l20_decide_state_transition(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l20_set_state(3, 0) != 0) { + if (hero_l20_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state(4, 1); + hero_l20_set_move_state(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_l20_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l20_set_state(2, 1); + hero_l20_set_move_state(2, 1); break; } - hero_l20_set_state(2, 0); + hero_l20_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1710,21 +1710,21 @@ void hero_l20_decide_state_transition(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_l20_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l20_set_state(2, 1); + hero_l20_set_move_state(2, 1); break; } - hero_l20_set_state(2, 0); + hero_l20_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l20_animation_id_extra, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l20_set_state(0, 0) != 0) { + if (hero_l20_set_move_state(0, 0) != 0) { set_hero_animation(SelectHeroStateAnimation(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l20_set_state(0, 0) != 0) { + } else if (hero_l20_set_move_state(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1772,14 +1772,14 @@ void hero_l20_decide_state_transition(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state(0xB, 1); + hero_l20_set_move_state(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l20_set_state(0x82, 1); + hero_l20_set_move_state(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1788,25 +1788,25 @@ void hero_l20_decide_state_transition(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l20_set_state(0xA, 1); + hero_l20_set_move_state(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l20_set_state(0x10, 1); + hero_l20_set_move_state(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state(0x27, 1); + hero_l20_set_move_state(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l20_set_state(0x77, 1); + hero_l20_set_move_state(0x77, 1); break; } } @@ -1910,7 +1910,7 @@ void hero_l20_decide_state_transition(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l20_set_state(3, 0) != 0) { + if (hero_l20_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1918,13 +1918,13 @@ void hero_l20_decide_state_transition(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l20_speed_params[0][2])) { - hero_l20_set_state(7, 1); + hero_l20_set_move_state(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l20_set_state(7, 1); + hero_l20_set_move_state(7, 1); } else if (g_hero_l20_speed_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l20_set_state(9, 1); + hero_l20_set_move_state(9, 1); } else { - hero_l20_set_state(7, 1); + hero_l20_set_move_state(7, 1); } break; } @@ -1932,10 +1932,10 @@ void hero_l20_decide_state_transition(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); break; } { @@ -1945,7 +1945,7 @@ void hero_l20_decide_state_transition(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &button_frame_b) != 0) && (button_frame_b < FLD(g_hero_state, s32, 0x1B8))) { - hero_l20_set_state(0x11, 1); + hero_l20_set_move_state(0x11, 1); break; } } @@ -1974,7 +1974,7 @@ void hero_l20_decide_state_transition(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l20_set_state(0xE, 1); + hero_l20_set_move_state(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1984,32 +1984,32 @@ void hero_l20_decide_state_transition(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l20_set_state(8, 1); + hero_l20_set_move_state(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l20_set_state(0x17, 1); + hero_l20_set_move_state(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l20_set_state(6, 1); + hero_l20_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l20_set_state(0x79, 1); + hero_l20_set_move_state(0x79, 1); } else { - hero_l20_set_state(0x39, 1); + hero_l20_set_move_state(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l20_set_state(0x82, 1); + hero_l20_set_move_state(0x82, 1); } else { - hero_l20_set_state(0, 0); + hero_l20_set_move_state(0, 0); } } break; @@ -2019,8 +2019,8 @@ void hero_l20_decide_state_transition(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state(0x39, 1); - } else if (hero_l20_set_state(0, 0) != 0) { + hero_l20_set_move_state(0x39, 1); + } else if (hero_l20_set_move_state(0, 0) != 0) { set_hero_animation(SelectHeroStateAnimation(0), 0, 13.0f); } } @@ -2045,28 +2045,28 @@ void hero_l20_decide_state_transition(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state(0x4E, 1); + hero_l20_set_move_state(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state(1, 1); + hero_l20_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state(0x41, 1); + hero_l20_set_move_state(0x41, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l20_set_state(0x45, 1); + hero_l20_set_move_state(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l20_set_state(0x4D, 1); + hero_l20_set_move_state(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l20_set_state(0x40, 1); + hero_l20_set_move_state(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -2079,14 +2079,14 @@ void hero_l20_decide_state_transition(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state(0x4E, 1); + hero_l20_set_move_state(0x4E, 1); break; } rec = (u8 *)&g_hero_l20_action_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l20_set_state(0x3F, 0); + hero_l20_set_move_state(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -2095,13 +2095,13 @@ void hero_l20_decide_state_transition(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0x10) ? n : 0xF, NULL) != 0) { - hero_l20_set_state(0x4D, 1); + hero_l20_set_move_state(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l20_set_state(0x45, 1); + hero_l20_set_move_state(0x45, 1); } break; } @@ -2164,42 +2164,42 @@ void hero_l20_decide_state_transition(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l20_set_state(0x45, 1); + hero_l20_set_move_state(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l20_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l20_set_state(0x40, 1); + hero_l20_set_move_state(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l20_set_state(0x3F, 1); + hero_l20_set_move_state(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l20_set_state(0x41, 1); + hero_l20_set_move_state(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 5, NULL) != 0)) { - hero_l20_set_state(0x4D, 1); + hero_l20_set_move_state(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state(0x46, 1); + hero_l20_set_move_state(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l20_set_state(0x4B, 1); + hero_l20_set_move_state(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l20_set_state(0x41, 1); + hero_l20_set_move_state(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state(0x46, 1); + hero_l20_set_move_state(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -2209,11 +2209,11 @@ void hero_l20_decide_state_transition(void) { FLD(g_hero_state, s16, 0x1EE) = 0xC - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l20_set_state(0x40, 1); + hero_l20_set_move_state(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l20_set_state(0x3F, 1); + hero_l20_set_move_state(0x3F, 1); } break; case 0x41: @@ -2225,29 +2225,29 @@ void hero_l20_decide_state_transition(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state(0x43, 1); + hero_l20_set_move_state(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l20_set_state(0x40, 1); + hero_l20_set_move_state(0x40, 1); } else { - hero_l20_set_state(0x3F, 1); + hero_l20_set_move_state(0x3F, 1); } } else { - hero_l20_set_state(0x3F, 1); + hero_l20_set_move_state(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state(0x46, 1); + hero_l20_set_move_state(0x46, 1); break; } if ((PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l20_set_state(0x4B, 1); + hero_l20_set_move_state(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l20_set_state(0x3F, 1); + hero_l20_set_move_state(0x3F, 1); } break; case 0x4E: @@ -2256,9 +2256,9 @@ void hero_l20_decide_state_transition(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state(0x41, 1); + hero_l20_set_move_state(0x41, 1); } else { - hero_l20_set_state(0x3F, 1); + hero_l20_set_move_state(0x3F, 1); } } break; @@ -2268,7 +2268,7 @@ void hero_l20_decide_state_transition(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state(0x4E, 1); + hero_l20_set_move_state(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.025000002f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2294,55 +2294,55 @@ void hero_l20_decide_state_transition(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l20_set_state(0x45, 1); + hero_l20_set_move_state(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l20_set_state(0x4D, 1); + hero_l20_set_move_state(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l20_set_state(0x41, 1); + hero_l20_set_move_state(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l20_set_state(0x3F, 1); + hero_l20_set_move_state(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l20_set_state(0x41, 1); + hero_l20_set_move_state(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x24) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state(0x43, 1); + hero_l20_set_move_state(0x43, 1); } else { - hero_l20_set_state(0x3F, 0); + hero_l20_set_move_state(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state(0x47, 1); + hero_l20_set_move_state(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)v10 = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l20_set_state(0x41, 1); + hero_l20_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state(0x41, 1); + hero_l20_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l20_set_state(0x48, 1); + hero_l20_set_move_state(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2351,7 +2351,7 @@ void hero_l20_decide_state_transition(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l20_set_state(0x49, 1); + hero_l20_set_move_state(0x49, 1); } break; } @@ -2362,7 +2362,7 @@ void hero_l20_decide_state_transition(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l20_set_state(0x4A, 1); + hero_l20_set_move_state(0x4A, 1); } } } @@ -2381,17 +2381,17 @@ void hero_l20_decide_state_transition(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state(0x47, 1); + hero_l20_set_move_state(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l20_set_state(0x41, 1); + hero_l20_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l20_set_state(0x48, 1); + hero_l20_set_move_state(0x48, 1); } break; } @@ -2402,35 +2402,35 @@ void hero_l20_decide_state_transition(void) { set_hero_animation(0xD, 0, 12.0f); } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state(0x94, 1); + hero_l20_set_move_state(0x94, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state(1, 1); + hero_l20_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state(0x8F, 1); + hero_l20_set_move_state(0x8F, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l20_set_state(0x92, 1); + hero_l20_set_move_state(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != MOBY_CLASS_RECEIVER_BOT) && (PadPressedWithin(0x80, 9, NULL) != 0)) { - hero_l20_set_state(0x93, 1); + hero_l20_set_move_state(0x93, 1); break; } hero_resolve_stick_direction(0, 1.0f); turned = hero_is_turned_past_angle(0.17453295f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (turned != 0)) { - hero_l20_set_state(0x8E, 1); + hero_l20_set_move_state(0x8E, 1); } break; } case 0x93: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state(0x94, 1); + hero_l20_set_move_state(0x94, 1); } break; case 0x92: @@ -2496,20 +2496,20 @@ void hero_l20_decide_state_transition(void) { after_pose: if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l20_set_state(0x92, 1); + hero_l20_set_move_state(0x92, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l20_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l20_set_state(0x8E, 1); + hero_l20_set_move_state(0x8E, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l20_set_state(0x8D, 1); + hero_l20_set_move_state(0x8D, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l20_set_state(0x8F, 1); + hero_l20_set_move_state(0x8F, 1); } break; } @@ -2522,15 +2522,15 @@ void hero_l20_decide_state_transition(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state(0x91, 1); + hero_l20_set_move_state(0x91, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l20_set_state(0x8E, 1); + hero_l20_set_move_state(0x8E, 1); } else { - hero_l20_set_state(0x8D, 1); + hero_l20_set_move_state(0x8D, 1); } } else { - hero_l20_set_state(0x8D, 1); + hero_l20_set_move_state(0x8D, 1); } } break; @@ -2540,43 +2540,43 @@ void hero_l20_decide_state_transition(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state(0x8F, 1); + hero_l20_set_move_state(0x8F, 1); } else { - hero_l20_set_state(0x8D, 1); + hero_l20_set_move_state(0x8D, 1); } } break; case 0x8E: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state(0x94, 1); + hero_l20_set_move_state(0x94, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l20_set_state(0x92, 1); + hero_l20_set_move_state(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != MOBY_CLASS_RECEIVER_BOT) && (PadPressedWithin(0x80, 9, NULL) != 0)) { - hero_l20_set_state(0x93, 1); + hero_l20_set_move_state(0x93, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l20_set_state(0x8F, 1); + hero_l20_set_move_state(0x8F, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f) && (FLD(g_hero_state, s16, 0x1454) == 0)) { - hero_l20_set_state(0x8D, 1); + hero_l20_set_move_state(0x8D, 1); } break; case 0x90: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l20_set_state(0x8F, 1); + hero_l20_set_move_state(0x8F, 1); break; } if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x1B8) >= 0x24)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state(0x91, 1); + hero_l20_set_move_state(0x91, 1); } else { - hero_l20_set_state(0x8D, 0); + hero_l20_set_move_state(0x8D, 0); } } break; @@ -2591,7 +2591,7 @@ void hero_l20_decide_state_transition(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l20_set_state(0, 0); + hero_l20_set_move_state(0, 0); anim = SelectHeroStateAnimation(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -2602,7 +2602,7 @@ void hero_l20_decide_state_transition(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l20_set_state(0, 0); + hero_l20_set_move_state(0, 0); } break; case 0x22: @@ -2612,12 +2612,12 @@ void hero_l20_decide_state_transition(void) { hero_choose_jump_or_roll_move(); break; } - hero_l20_set_state(7, 1); + hero_l20_set_move_state(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l20_set_state(0, 0); + hero_l20_set_move_state(0, 0); } break; default: diff --git a/src/levels/22_dobbo_orbit/L22_002B7550.c b/src/levels/22_dobbo_orbit/L22_002B7550.c index 9507a6ed4..e71d61232 100644 --- a/src/levels/22_dobbo_orbit/L22_002B7550.c +++ b/src/levels/22_dobbo_orbit/L22_002B7550.c @@ -67,7 +67,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l22_set_action(s32, s32); +extern s32 hero_l22_set_move_state(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth(s32); extern int hero_play_sound(s32, s32); @@ -152,7 +152,7 @@ s32 hero_l22_apply_hazard_contact(s32 apply_push) { case 0: other_moby = g_hero_state.f249C; if (other_moby != 0 && (*(s16 *)(other_moby + 0xAA) == 0x4EB /* moby class 1259 */ || *(s16 *)(other_moby + 0xAA) == 0x558 /* moby class 1368 */)) { - hero_l22_set_action(0x7D, 1); + hero_l22_set_move_state(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -163,7 +163,7 @@ s32 hero_l22_apply_hazard_contact(s32 apply_push) { AdjustPlayerHealth(FloatToInt(*(float *)(weapon_moby + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l22_set_action(0x16, 1); + hero_l22_set_move_state(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -173,13 +173,13 @@ s32 hero_l22_apply_hazard_contact(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l22_set_action(0x72, 1); + hero_l22_set_move_state(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l22_set_action(0x73, 1); + hero_l22_set_move_state(0x73, 1); } else if (entry->f24 & 8) { - hero_l22_set_action(0x8C, 1); + hero_l22_set_move_state(0x8C, 1); } else { - hero_l22_set_action(0x16, 1); + hero_l22_set_move_state(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&push); @@ -191,15 +191,15 @@ s32 hero_l22_apply_hazard_contact(s32 apply_push) { } break; case 1: - hero_l22_set_action(0x42, 1); + hero_l22_set_move_state(0x42, 1); hero_flatten_push_vector(&push, flag, 0.083333336f, 0.050000004f); break; case 2: if ((entry->f24 & 4) || g_hero_state.f1874 <= 0) { if (entry->f20 != 0 && *(s16 *)(entry->f20 + 0xAA) == 0x11DF /* moby class 4575 */) { - hero_l22_set_action(0x5A, 1); + hero_l22_set_move_state(0x5A, 1); } else { - hero_l22_set_action(0x59, 1); + hero_l22_set_move_state(0x59, 1); } player_slot_clear_object(g_hero_state.f2290); FastVecScale(&push, &push, 0.095f); diff --git a/src/levels/22_dobbo_orbit/L22_002BF1B0.c b/src/levels/22_dobbo_orbit/L22_002BF1B0.c index c11a7bdd7..67d05be61 100644 --- a/src/levels/22_dobbo_orbit/L22_002BF1B0.c +++ b/src/levels/22_dobbo_orbit/L22_002BF1B0.c @@ -111,7 +111,7 @@ extern void cam_project_vector_onto_view_plane(void *, void *); extern float cam_get_view_space_vector_length(void *); extern float cam_get_view_space_height(void *); extern void cam_set_view_space_vector_length(void *, void *, float); -extern int queue_copy_record_by_index(unsigned int index); +extern int actuator_play_pattern(unsigned int index); extern void moby_update_transform_history_followers(void *, int); extern float ReadPadFloatHistory(int); extern void UpdateHeroAimTarget(float, float, float); @@ -511,7 +511,7 @@ case 0x32: case 0x33: case 0x34: float oldPitch,steer,minimumSteer,pitchChange,controllerScale,rate,maximumInput,steeringLimit; if (H(u32,0x2294)==0x34) { if (H(s32,0x1B8)>70) g_hero_state_machine_word=65535; - snd_update_slot_object(5,H(void*,0x2290),15);queue_copy_record_by_index(22); + snd_update_slot_object(5,H(void*,0x2290),15);actuator_play_pattern(22); } else { int slot=H(s32,0x2440); if (slot!=-1 && FLD(g_sound_state+slot*0x70, void *, 0x88)==H(void*,0x2290) && @@ -1115,7 +1115,7 @@ case 20: coll_process_hit(&workspace.state_14.delta, 0x10, 0.4f, H(void *, 0x2290), workspace.state_14.u.contact); } if (math_is_below_plane_within_depth(25.7f)) { - queue_copy_record_by_index(25); + actuator_play_pattern(25); H(u16, 0x1FA) = 50; if (g_hero_override_flag) { FLD(g_hero_l22_state_block, float, 0x180) = 0.1f; diff --git a/src/levels/23_damosel_orbit/L23_002BBC50.c b/src/levels/23_damosel_orbit/L23_002BBC50.c index d5824a540..b7d641e19 100644 --- a/src/levels/23_damosel_orbit/L23_002BBC50.c +++ b/src/levels/23_damosel_orbit/L23_002BBC50.c @@ -67,7 +67,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l22_set_action(s32, s32); +extern s32 hero_l22_set_move_state(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth(s32); extern int hero_play_sound(s32, s32); @@ -152,7 +152,7 @@ s32 hero_l23_apply_contact_push(s32 apply_push) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB /* moby class 1259 */ || *(s16 *)(other + 0xAA) == 0x558 /* moby class 1368 */)) { - hero_l22_set_action(0x7D, 1); + hero_l22_set_move_state(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -163,7 +163,7 @@ s32 hero_l23_apply_contact_push(s32 apply_push) { AdjustPlayerHealth(FloatToInt(*(float *)(r + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l22_set_action(0x16, 1); + hero_l22_set_move_state(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -173,13 +173,13 @@ s32 hero_l23_apply_contact_push(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l22_set_action(0x72, 1); + hero_l22_set_move_state(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l22_set_action(0x73, 1); + hero_l22_set_move_state(0x73, 1); } else if (e->f24 & 8) { - hero_l22_set_action(0x8C, 1); + hero_l22_set_move_state(0x8C, 1); } else { - hero_l22_set_action(0x16, 1); + hero_l22_set_move_state(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&vec); @@ -191,15 +191,15 @@ s32 hero_l23_apply_contact_push(s32 apply_push) { } break; case 1: - hero_l22_set_action(0x42, 1); + hero_l22_set_move_state(0x42, 1); hero_flatten_push_vector(&vec, flag, 0.083333336f, 0.050000004f); break; case 2: if ((e->f24 & 4) || g_hero_state.f1874 <= 0) { if (e->f20 != 0 && *(s16 *)(e->f20 + 0xAA) == 0x11DF /* moby class 4575 */) { - hero_l22_set_action(0x5A, 1); + hero_l22_set_move_state(0x5A, 1); } else { - hero_l22_set_action(0x59, 1); + hero_l22_set_move_state(0x59, 1); } charged_shot_release(g_hero_state.f2290, 0); FastVecScale(&vec, &vec, 0.095f); diff --git a/src/levels/23_damosel_orbit/L23_002C38B0.c b/src/levels/23_damosel_orbit/L23_002C38B0.c index b3c2dd86a..ad57752c5 100644 --- a/src/levels/23_damosel_orbit/L23_002C38B0.c +++ b/src/levels/23_damosel_orbit/L23_002C38B0.c @@ -109,7 +109,7 @@ extern void cam_project_vector_onto_view_plane(void *, void *); extern float cam_get_view_space_vector_length(void *); extern float cam_get_view_space_height(void *); extern void cam_set_view_space_vector_length(void *, void *, float); -extern int queue_copy_record_by_index(unsigned int index); +extern int actuator_play_pattern(unsigned int index); extern void moby_update_transform_history_followers(void *, int); extern float ReadPadFloatHistory(int); extern void UpdateHeroAimTarget(float, float, float); @@ -503,7 +503,7 @@ case 0x32: case 0x33: case 0x34: float oldPitch,steer,minimumSteer,pitchChange,controllerScale,rate,maximumInput,steeringLimit; if (H(u32,0x2294)==0x34) { if (H(s32,0x1B8)>70) g_hero_state_machine_word=65535; - snd_update_slot_object(5,H(void*,0x2290),15);queue_copy_record_by_index(22); + snd_update_slot_object(5,H(void*,0x2290),15);actuator_play_pattern(22); } else { int slot=H(s32,0x2440); if (slot!=-1 && FLD(g_sound_state+slot*0x70, void *, 0x88)==H(void*,0x2290) && @@ -1108,7 +1108,7 @@ case 20: coll_process_hit(0.4f, &workspace.state_14.delta, 0x10, H(void *, 0x2290), workspace.state_14.u.contact); } if (math_is_below_plane_within_depth(25.7f)) { - queue_copy_record_by_index(25); + actuator_play_pattern(25); H(u16, 0x1FA) = 50; if (g_hero_override_flag) { FLD(g_hero_l23_state_block, float, 0x180) = 0.1f; diff --git a/src/levels/23_damosel_orbit/L23_003BEA00-g8.c b/src/levels/23_damosel_orbit/L23_003BEA00-g8.c index f89cac068..623d6ea30 100644 --- a/src/levels/23_damosel_orbit/L23_003BEA00-g8.c +++ b/src/levels/23_damosel_orbit/L23_003BEA00-g8.c @@ -113,7 +113,7 @@ extern float moby_get_anim_value(char *),math_random_float_range(float,float); extern int math_is_value_within_step(char *,float); extern void *ribbon_trail_create(u8 *,u8 *,u8 *,u8,u8,float,float,float,float,short,short,int,int,int,int,int); extern void moby_transform_joint_to_world(char *,int,char *); -extern int queue_copy_record_by_index(unsigned int); +extern int actuator_play_pattern(unsigned int); /* Per-frame update of the boss-like enemy: checks the hero distance and facing, then runs its state machine (idle, chase, attack, charge, hurt) and finishes with the shared timers. */ void enemy_update_state_machine(u8 *object) @@ -308,7 +308,7 @@ void enemy_update_state_machine(u8 *object) FastVecAdd(point,point,((DispatchState *)state)->f2A0+0xC0); FastVecScale(point,point,15.0f); point[3]=5627.9248f; part_queue_impact_effect((int)g_hero_moby,(int)object,0x10007,(int)(object+0x10),(int)point,g_mothership_impact_param); - queue_copy_record_by_index(43); + actuator_play_pattern(43); SpawnExplosion(g_boss_hit_point,1,10,10,10,10,45,0,1.2f,20.0f,0,1,0,0); ((DispatchState *)state)->f3BE=1; } @@ -319,7 +319,7 @@ void enemy_update_state_machine(u8 *object) if (((DispatchState *)state)->f3B4!=-1) { snd_stop_voice(((DispatchState *)state)->f3B4); ((DispatchState *)state)->f3B4=-1; } } else if ((int)U(object,0x96)>g_enemy_flee_health_threshold) { moby_clear_selected((char *)object); moby_set_state(object,5,0); } else { if ((int)U(object,0x96)>=g_enemy_flee_health_threshold-5 && ((DispatchState *)state)->f3BE) { - snd_start_in_slot(29,0,0); ((DispatchState *)state)->f3BE=0; queue_copy_record_by_index(43); + snd_start_in_slot(29,0,0); ((DispatchState *)state)->f3BE=0; actuator_play_pattern(43); } } break; diff --git a/src/levels/23_damosel_orbit/L23_00416388-boss-g8.c b/src/levels/23_damosel_orbit/L23_00416388-boss-g8.c index 7faeb1c3d..43ef3d557 100644 --- a/src/levels/23_damosel_orbit/L23_00416388-boss-g8.c +++ b/src/levels/23_damosel_orbit/L23_00416388-boss-g8.c @@ -119,7 +119,7 @@ extern void moby_store_position_private(u8 *, void *); extern int player_slot_has_object(unsigned int); extern int charged_shot_get_for_owner(int); extern void charged_shot_release(int, int); -extern int queue_copy_record_by_index(unsigned int); +extern int actuator_play_pattern(unsigned int); extern int moby_check_target_point_from_offset(char *, void *); extern void boss_turn_gun_toward_target(char *); extern void mothership_project_point_onto_surface(char *, float); @@ -155,7 +155,7 @@ extern char *SpawnExplosion(char *, int, int, int, int, int, int, int, float, fl extern void FadeToBlack(int); extern void moby_copy_joint_transform_to_object(u8 *, char *, int, int); extern void hero_reset_position_and_direction(char *, char *, int, int); -extern int hero_l22_set_action(int, int); +extern int hero_l22_set_move_state(int, int); extern char *effect_create_attached(char *, char *); extern void build_axis_rotation_quaternion(char *, int, float); @@ -587,7 +587,7 @@ void mothership_boss_part_update(u8 *object) cancel_hero_item_animation(); release_moby_animation_slot((LvlSlotCtx *)PLAYER, &HERO->slotList); HERO->slotCount = 0; - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); g_charged_l23_blast_timer = 0; return; } @@ -657,5 +657,5 @@ void mothership_boss_part_update(u8 *object) } math_fast_float_d((char *)&g_boss_camera_timer[0]); if (g_boss_camera_timer[0]) - queue_copy_record_by_index(0x2b); + actuator_play_pattern(0x2b); } diff --git a/src/levels/23_damosel_orbit/L23_004177F8-g8.c b/src/levels/23_damosel_orbit/L23_004177F8-g8.c index e88ebdab0..e25a330b3 100644 --- a/src/levels/23_damosel_orbit/L23_004177F8-g8.c +++ b/src/levels/23_damosel_orbit/L23_004177F8-g8.c @@ -195,7 +195,7 @@ extern int mothership_call_helper_return_true(void); extern int L23_DrawEncounterHud(void); extern void cancel_hero_item_animation(void); extern void release_moby_animation_slot(void *, void *); -extern int hero_l22_set_action(int, int); +extern int hero_l22_set_move_state(int, int); extern char *GetLocalizedString(int); extern int level_l00_call_module_handler_with_arg_9(int, int); extern void cam_compute_view_direction(void *, void *, int); @@ -419,7 +419,7 @@ void mothership_update(L23Moby *moby) { cancel_hero_item_animation(); release_moby_animation_slot(game->f2290, game->f1870); game->f187C = 0; - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); } } cam_compute_view_direction(&moby->pos, state->m410, 0); diff --git a/src/levels/23_damosel_orbit/L23_0041B9F0-g8.c b/src/levels/23_damosel_orbit/L23_0041B9F0-g8.c index 5104aab6f..13e440da6 100644 --- a/src/levels/23_damosel_orbit/L23_0041B9F0-g8.c +++ b/src/levels/23_damosel_orbit/L23_0041B9F0-g8.c @@ -82,7 +82,7 @@ extern void cancel_hero_item_animation(void); extern void release_moby_animation_slot(int, void *); -extern s32 hero_l22_set_action(int, int); +extern s32 hero_l22_set_move_state(int, int); extern void gfx_update_color_fade(void *, void *); @@ -149,7 +149,7 @@ void UpdateShieldHitsAndStrength(unsigned char *moby) { cancel_hero_item_animation(); release_moby_animation_slot(g_hero_state.f2290, g_hero_state.f1870); g_hero_state.f187C = 0; - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); return; } } diff --git a/src/levels/23_damosel_orbit/L23_00422668.c b/src/levels/23_damosel_orbit/L23_00422668.c index 8cf9ab0de..1da3e68a2 100644 --- a/src/levels/23_damosel_orbit/L23_00422668.c +++ b/src/levels/23_damosel_orbit/L23_00422668.c @@ -46,7 +46,7 @@ extern void make_hit_descriptor(float, L23Hit *, u8 *, s32, L23Vec *); extern void QueueMobyImpact(u8 *, L23Hit *); -extern int queue_copy_record_by_index(s32); +extern int actuator_play_pattern(s32); extern void part_start_random_scale_effect(void *, s32, s32); @@ -74,7 +74,7 @@ void shot_update_hit_check(u8 *moby, void *origin) { hit.h1A = *(u16 *)(moby + 0xAA); if (g_last_ray_hit.f18 == g_hero_moby) { QueueMobyImpact(g_last_ray_hit.f18, &hit); - queue_copy_record_by_index(0x2B); + actuator_play_pattern(0x2B); } part_start_random_scale_effect(moby + 0x10, 0xA, 1); } else { diff --git a/src/levels/30_insomniac_museum/L30_003B3F70-g8.c b/src/levels/30_insomniac_museum/L30_003B3F70-g8.c index bde8b4564..838ad56b0 100644 --- a/src/levels/30_insomniac_museum/L30_003B3F70-g8.c +++ b/src/levels/30_insomniac_museum/L30_003B3F70-g8.c @@ -48,7 +48,7 @@ extern int g_vehicle_current_anim __attribute__((sda)); extern char * part_find_owned_effect_slot(void *,int,int); extern float func_002A0558(void *,void *); extern int TryClaimNotice(int,int,int); -extern s32 hero_l00_set_action(int,int); +extern s32 hero_l00_set_move_state(int,int); extern void set_hero_animation(int,int,float); extern float FastVecLength(void *); extern float FastAddRotations(float,float); @@ -149,7 +149,7 @@ void UpdateHoverVehicleMoby(HoverMoby *obj) { if(g_pad_held_flags&16) in.active=request; } if(in.active) { - hero_l00_set_action(0x31,0); + hero_l00_set_move_state(0x31,0); set_hero_animation(g_vehicle_idle_anim,0,15.0f); qcopy_nc(&g_hero_state.rotation,&obj->rotation); qcopy_nc(&g_hero_state.position,&obj->position); @@ -260,14 +260,14 @@ void UpdateHoverVehicleMoby(HoverMoby *obj) { case 4: obj->flags=obj->mclass->flags; I(g_hero_state.moby,0x9c)=0; - hero_l00_set_action(0,1); + hero_l00_set_move_state(0,1); g_hero_state.vehicle=0; obj->state=1; break; case 5: obj->flags=obj->mclass->flags; I(g_hero_state.moby,0x9c)=0; - hero_l00_set_action(0,1); + hero_l00_set_move_state(0,1); moby_transform_joint_to_world(obj,0,&frame.dir); SpawnExplosionEffects(obj,st,&frame.dir,0.0f,0.0f,10,3,16,4.0f,2.0f,9.0f,1.0f,-1,15.0f,1,1,-1,0,0x810001); moby_mark_spawned(obj); diff --git a/src/levels/30_insomniac_museum/L30_003E1E78-g8.c b/src/levels/30_insomniac_museum/L30_003E1E78-g8.c index 636f4e278..30744176c 100644 --- a/src/levels/30_insomniac_museum/L30_003E1E78-g8.c +++ b/src/levels/30_insomniac_museum/L30_003E1E78-g8.c @@ -53,7 +53,7 @@ extern int AcquireEntitySlot(void *,int,void *); extern u8 *level_get_slot_body(int,int); extern float math_random_signed_float_range(float,float), math_random_float_range(float,float); extern void vec_clear_128(void *), sheepinator_clear_records(void); -extern s32 hero_l00_set_action(int,int); +extern s32 hero_l00_set_move_state(int,int); extern int math_fast_float_d(void *), get_ammo(int); extern void hud_add_moby_marker(void *,unsigned int,float,void *,float,int,int,float,int); extern void moby_transform_joint_to_world(void *,int,void *); @@ -122,7 +122,7 @@ void UpdateMuseumChargedWeapon(MuseumWeaponMoby *obj) { g_museum_weapon_effects.reticle=-1; if (g_hero_state.selected) g_hero_state.held=g_hero_state.selected; if (!g_museum_charge_init_flag) g_museum_charge_init_flag=1; - if (g_hero_state.mode==1) hero_l00_set_action(29,1); + if (g_hero_state.mode==1) hero_l00_set_move_state(29,1); enabled=1; if (g_hero_state.mode==29) { if (!math_fast_float_d(&g_hero_state.timer)) enabled=0; diff --git a/src/levels/30_insomniac_museum/L30_0040B9D8-g8.c b/src/levels/30_insomniac_museum/L30_0040B9D8-g8.c index 1e3e656bb..19cdb8706 100644 --- a/src/levels/30_insomniac_museum/L30_0040B9D8-g8.c +++ b/src/levels/30_insomniac_museum/L30_0040B9D8-g8.c @@ -47,7 +47,7 @@ extern char *part_find_owned_effect_slot(char *,int,int); extern void gfx_start_color_fade(char *,void *), gfx_update_color_fade(char *,void *); extern float vec_length_xy(void *), func_002A0558(char *,char *), FastAddRotations(float,float), math_fast_sin_or_cos_b(float), fast_vec_dist(void *,void *); extern int TryClaimNotice(int,int,int), math_random_int_below(int), flag_set_first_pending(char *); -extern int hero_l00_set_action(int,int); +extern int hero_l00_set_move_state(int,int); extern void UpdateHoverVehicleMotion(char *,int), set_hero_animation(int,int,float), moby_mark_in_range(char *); extern void moby_set_state(char *,int,int), moby_update_ground_check(char *), gfx_add_draw_callback_third(void (*)(char *),void *); extern void moby_transform_joint_to_world(char *,int,void *); @@ -135,7 +135,7 @@ void MuseumVehicleUpdate(MuseumVehicle *obj) { if (g_pad_state.pressed&16) activate=v; } if (activate) { - hero_l00_set_action(49,0);set_hero_animation(g_vehicle_animation_id,0,15.0f); + hero_l00_set_move_state(49,0);set_hero_animation(g_vehicle_animation_id,0,15.0f); qcopy(g_hero_state.rotation,obj->rotation);qcopy(g_hero_state.position,obj->position); g_hero_state.vehicle=obj;obj->state=3;obj->flags=0;I(g_hero_state.hero,0x9C)=-1; } @@ -155,7 +155,7 @@ void MuseumVehicleUpdate(MuseumVehicle *obj) { break; case 4: if (flag_set_first_pending(obj)) { - g_hero_state.cameraX=0;g_hero_state.cameraY=-1.0f;hero_l00_set_action(11,1); + g_hero_state.cameraX=0;g_hero_state.cameraY=-1.0f;hero_l00_set_move_state(11,1); g_hero_state.vehicle=0;g_hero_state.vehicleId=-1; } obj->flags=0;I(g_hero_state.hero,0x9C)=0;UpdateHoverVehicleMotion(obj,0); @@ -165,7 +165,7 @@ void MuseumVehicleUpdate(MuseumVehicle *obj) { case 6: break; case 5: obj->flags=I(obj->classData,0x10);I(g_hero_state.hero,0x9C)=0; - hero_l00_set_action(0,1);moby_transform_joint_to_world(obj,0,pos); + hero_l00_set_move_state(0,1);moby_transform_joint_to_world(obj,0,pos); SpawnExplosionEffects(obj,s,pos,0.0f,0.0f,10,3,16,4.0f,2.0f,9.0f,1.0f,-1,15.0f,1,1,-1,0,0x810001); qcopy(obj->position,&s->spawn);g_hero_state.vehicleId=-1;g_hero_state.vehicle=0;obj->state=0; break; diff --git a/src/levels/30_insomniac_museum/L30_00417988-g8.c b/src/levels/30_insomniac_museum/L30_00417988-g8.c index 7d1c57897..2d3b8fafb 100644 --- a/src/levels/30_insomniac_museum/L30_00417988-g8.c +++ b/src/levels/30_insomniac_museum/L30_00417988-g8.c @@ -51,7 +51,7 @@ extern void museum_effect_object_spawn(char *),museum_effect_holder_update(char extern int ForceClaimNotice(int,int,int); extern int load_is_class_cached(int); extern void LoadClassIntoFreeCacheSlot(int), hero_start_loader_state(int); -extern s32 hero_l00_set_action(int,int); +extern s32 hero_l00_set_move_state(int,int); extern void matrix_mul_vec3(void *,void *,void *),FastVecAdd(void *,void *,void *),FastVecSub(void *,void *,void *); extern float FastAddRotations(float,float),mat_fast_helper_a(float,float),vec_distance_xy(void *,void *); extern void hero_start_target_state(void *,int,float); @@ -146,7 +146,7 @@ void func_L30_00417988(char *obj) { } case 3: if (flag_set_first_pending(obj)) { - hero_l00_set_action(0x6F,0);set_hero_animation(0x54,0,20.0f); + hero_l00_set_move_state(0x6F,0);set_hero_animation(0x54,0,20.0f); FastVecSub(vec,g_camera_l30_position,g_hero_state.position); matrix_mul_vec3(vec,vec,g_hero_state.matrix40); func_L30_0042BEB8(g_camera_l30_position,g_camera_l30_position,3,120,0); diff --git a/src/levels/shared/L00_002A3B80.c b/src/levels/shared/L00_002A3B80.c index 5672a7ff8..396e42ed1 100644 --- a/src/levels/shared/L00_002A3B80.c +++ b/src/levels/shared/L00_002A3B80.c @@ -153,7 +153,7 @@ void InitializeHero(void) extern char g_hero_state[]; extern int g_current_map_index; extern void hero_clear_queued_anim(void); -extern int hero_l00_set_action(int, int); +extern int hero_l00_set_move_state(int, int); extern void trail_reset_slots(void); /* Incomplete sda array: retail clears this word as `lui $at; sw` (compiler-notes.md). */ extern int g_hero_aim_speed_start[] __attribute__((sda)); @@ -173,7 +173,7 @@ void hero_reset_start_aim_speed(void) *(int *)(base + 0x2294) = 0; *(float *)(base + 0xC24) = 1.0f; hero_clear_queued_anim(); - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); trail_reset_slots(); } diff --git a/src/levels/shared/L00_002A3B88-g8.c b/src/levels/shared/L00_002A3B88-g8.c index 9f9bf408d..f25cf5e26 100644 --- a/src/levels/shared/L00_002A3B88-g8.c +++ b/src/levels/shared/L00_002A3B88-g8.c @@ -111,7 +111,7 @@ extern void menu_update_pause(void), gfx_call_engine_routine_zero(void), UpdateM extern void UpdatePurchaseMenuAndPreview(void), shop_draw_purchase_menu_scene(void), transition_draw_background(void); extern int UpdatePlaybackScene(void); extern int level_call_helper_d(void), level_call_helper_e(void); -extern void math_trap_always(void), level_decrement_counter_clamped(void), math_add_wrapping_counter(void); +extern void math_trap_always(void), level_decrement_counter_clamped(void), actuator_update(void); extern void mc_update_state(void), map_update_state_machine(void), SetupGifPaging(int); extern void VU1_addGSregister(unsigned int, unsigned long long); extern int GetIconFrame(int, int); @@ -266,7 +266,7 @@ void RunLevelLoop(void) } g_pad_hold_frame_count[0]++; level_decrement_counter_clamped(); - if (!g_game_l00_mode[0]) math_add_wrapping_counter(); + if (!g_game_l00_mode[0]) actuator_update(); mc_update_state(); map_update_state_machine(); if ((unsigned)(g_memcard_state.pressed - 15) < 2 || g_memcard_state.alternate == 15 || g_memcard_input_latch[0]) { @@ -344,7 +344,7 @@ void RunLevelLoop(void) pad_poll_ports(); cutscene_update_frame(); } - math_add_wrapping_counter(); + actuator_update(); sceGsSyncV(0); g_ring_animation_counter[0]++; } else if (g_debug_state == 3) { @@ -360,7 +360,7 @@ void RunLevelLoop(void) pad_poll_ports(); cutscene_update_frame(); } - math_add_wrapping_counter(); + actuator_update(); counter_count_calls_bump(); sceGsSyncV(0); g_ring_animation_counter[0]++; diff --git a/src/levels/shared/L00_002ACA08-flags.c b/src/levels/shared/L00_002ACA08-flags.c index 9d6f538e7..abcaf8ff0 100644 --- a/src/levels/shared/L00_002ACA08-flags.c +++ b/src/levels/shared/L00_002ACA08-flags.c @@ -8,7 +8,7 @@ extern int g_arena_l11_active_flag __attribute__((sda)); extern u8 g_hero_input_enabled __attribute__((sda)); extern void mem_fast_helper_b(void *, int); extern float math_fabs(float); -extern int hero_l00_set_action(int, int); +extern int hero_l00_set_move_state(int, int); typedef int Quadword __attribute__((mode(TI))); typedef union { Quadword word; float f[4]; } Vector; typedef struct { @@ -101,42 +101,42 @@ void hero_process_action_command(void) if (command == 12) g_hero_state.hover = 1; if (g_hero_state.attackB && active && g_hero_state.movement != 16 && g_hero_state.movement != 20 && g_hero_state.movement != 7) { - hero_l00_set_action(0x30, 1); + hero_l00_set_move_state(0x30, 1); return; } if (g_hero_state.attack) { if (active && g_hero_state.mode == 1 && g_hero_state.state != 0x7a) { - hero_l00_set_action(0x7a,1); return; + hero_l00_set_move_state(0x7a,1); return; } if (g_hero_state.attack && active && (g_hero_state.state != 0x38 || g_hero_state.animationDone)) { - if (g_hero_state.health) { hero_l00_set_action(0x38,1); return; } - if (g_current_map_index == 2 && g_arena_l11_active_flag) { hero_l00_set_action(0x7d,1); return; } - if (*(int *)(*(u8 **)(g_hero_state.object + 0x24) + 0x1f0)) { hero_l00_set_action(0x79,1); return; } - hero_l00_set_action(0x39,1); return; + if (g_hero_state.health) { hero_l00_set_move_state(0x38,1); return; } + if (g_current_map_index == 2 && g_arena_l11_active_flag) { hero_l00_set_move_state(0x7d,1); return; } + if (*(int *)(*(u8 **)(g_hero_state.object + 0x24) + 0x1f0)) { hero_l00_set_move_state(0x79,1); return; } + hero_l00_set_move_state(0x39,1); return; } } if (g_hero_state.flag149c && g_hero_state.state != 0x7c && math_fabs(g_hero_state.t330-(g_hero_state.position.f[2]+0.25f)) < 1.0f && g_hero_state.t330-g_hero_state.position.f[2] > 0.0f && (g_hero_state.motion.f[2] < 0.0f || g_hero_state.state == 0x7b)) { - hero_l00_set_action(0x7c,1); return; + hero_l00_set_move_state(0x7c,1); return; } if (g_hero_state.jump && g_hero_state.state != 0x65 && g_hero_state.state != 0x78 && math_fabs(g_hero_state.jumpTime-(g_hero_state.position.f[2]+0.25f)) < 1.0f && g_hero_state.jumpTime-g_hero_state.position.f[2] > 0.0f && (g_hero_state.state != 0x66 || g_hero_state.animationDone) && (g_hero_state.motion.f[2] < 0.0f || g_hero_state.state == 0x7b)) { - if (!g_hero_state.health) { hero_l00_set_action(0x78,1); return; } - hero_l00_set_action(0x65,1); return; + if (!g_hero_state.health) { hero_l00_set_move_state(0x78,1); return; } + hero_l00_set_move_state(0x65,1); return; } if (!g_hero_state.cancel || g_hero_state.state == 0x78 || g_hero_state.state == 0x74) return; if (!(math_fabs(g_hero_state.jumpTime-(g_hero_state.position.f[2]+0.25f)) < 1.0f)) return; if (!(g_hero_state.jumpTime-g_hero_state.position.f[2] > 0.0f)) return; if (!(g_hero_state.motion.f[2] < 0.0f) && g_hero_state.state != 0x7b) return; if (g_current_map_index == 13) { - hero_l00_set_action(0x74, 1); + hero_l00_set_move_state(0x74, 1); return; } - hero_l00_set_action(0x78, 1); + hero_l00_set_move_state(0x78, 1); } diff --git a/src/levels/shared/L00_002AFBC0.c b/src/levels/shared/L00_002AFBC0.c index b91ff6d1d..67e8d914b 100644 --- a/src/levels/shared/L00_002AFBC0.c +++ b/src/levels/shared/L00_002AFBC0.c @@ -11,7 +11,7 @@ extern void attachment_reset_all(void); extern void hero_update_collision_capsule(void); extern void hero_clear_queued_anim(void); extern void func_002A677C(char *); -extern int hero_l00_set_action(int, int); +extern int hero_l00_set_move_state(int, int); extern int level_run_slot_callback(int); extern int g_pad_pressed_flags[]; extern char g_str_timed_state_text_a[]; @@ -640,7 +640,7 @@ void SetHeroMode(int mode, int value, char *object) if (newHealth >= 5) *(int *)(heroBlock + 0x24CC) = 4; } - hero_l00_set_action(value, 2); + hero_l00_set_move_state(value, 2); } } } diff --git a/src/levels/shared/L00_002B91C0.c b/src/levels/shared/L00_002B91C0.c index 05d5b8f68..e41373fa2 100644 --- a/src/levels/shared/L00_002B91C0.c +++ b/src/levels/shared/L00_002B91C0.c @@ -368,7 +368,7 @@ extern void cancel_hero_item_animation(void); extern void attachment_reset_all(void); -extern s32 hero_l00_set_action(int a0, int a1); +extern s32 hero_l00_set_move_state(int a0, int a1); extern void anim_start_object_at_frame(int a0, int a1); @@ -426,7 +426,7 @@ void hero_reset_position_and_direction(void *position, void *direction, int soun attachment_reset_all(); if (sound != -1) - hero_l00_set_action(sound, 2); + hero_l00_set_move_state(sound, 2); anim_start_object_at_frame(*(u8 *)(res->object + 0x43), *(u8 *)(res->object + 0x41)); diff --git a/src/levels/shared/L00_002BA7D8.c b/src/levels/shared/L00_002BA7D8.c index 6b7ecb942..cd5b31def 100644 --- a/src/levels/shared/L00_002BA7D8.c +++ b/src/levels/shared/L00_002BA7D8.c @@ -157,7 +157,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -176,7 +176,7 @@ extern s32 shooter_update_ranged_attack(s32); extern s32 SelectHeroStateAnimation(s32); extern void hero_exit_vehicle_mode(s32); extern void hero_slide_along_wall(s32); -extern s32 hero_l20_set_state(s32, s32); +extern s32 hero_l20_set_move_state(s32, s32); extern s32 ref_L00_002BA7D8_00 MACRO_ADDR; extern void hero_get_offset_vector(f32 *); /* Runs the hero's state machine once per frame. It picks the code for the current state (walk, jump, @@ -728,7 +728,7 @@ void hero_l00_update_state_machine(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { value21 = ((Hero *)g_hero_state)->i[0x2440/4]; if (value21 != -1) { @@ -1471,7 +1471,7 @@ void hero_l00_update_state_machine(void) { coll_process_hit(0.4f, (s32)((TI128*)vec_a), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec_b)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l20_extra_state)->f[0x180/4] = 0.1f; diff --git a/src/levels/shared/L00_002C2DE8.c b/src/levels/shared/L00_002C2DE8.c index d08a6c366..3571bfd76 100644 --- a/src/levels/shared/L00_002C2DE8.c +++ b/src/levels/shared/L00_002C2DE8.c @@ -178,7 +178,7 @@ int hero_classify_input_direction(void) extern unsigned char g_screen_mode_flag[]; -extern s32 hero_l00_set_action(int a0, int a1); +extern s32 hero_l00_set_move_state(int a0, int a1); /* Picks the variant of the shared loader the current game state selects. */ void hero_start_loader_state(int useAlternate) @@ -187,10 +187,10 @@ void hero_start_loader_state(int useAlternate) switch (g_screen_mode_flag[0]) { case 0: - hero_l00_set_action(0, variant); + hero_l00_set_move_state(0, variant); break; case 1: - hero_l00_set_action(0x3F, variant); + hero_l00_set_move_state(0x3F, variant); break; } } @@ -215,7 +215,7 @@ int hero_try_start_transition(void) return 0; cancel_hero_item_animation(); *(int *)(hero + 0xEA4) = 2; - hero_l00_set_action(0x22, 1); + hero_l00_set_move_state(0x22, 1); return 1; } return 0; @@ -298,7 +298,7 @@ int hero_try_start_move_from_buffer(int slot, int allowFallback) offset = hero_get_step_offset_from_direction(); if ((g_pad_pressed_flags[0] & 8) && offset > 0) { if (pad_presses_within_frames(0x40, 0x1F000, slot + offset, offset) != 0) { - hero_l00_set_action(0xB, 1); + hero_l00_set_move_state(0xB, 1); return 1; } } @@ -306,14 +306,14 @@ int hero_try_start_move_from_buffer(int slot, int allowFallback) if (*(short *)(hero + 0x1454) != 0) { if (0.9f < *(float *)(hero + 0x24B8)) { if (hero_classify_input_direction() != 2) { - hero_l00_set_action(0xB, 1); + hero_l00_set_move_state(0xB, 1); return 1; } } } if (allowFallback != 0) return 0; - hero_l00_set_action(7, 1); + hero_l00_set_move_state(7, 1); return 1; } diff --git a/src/levels/shared/L00_002C8CB0.c b/src/levels/shared/L00_002C8CB0.c index 558e16f05..34d3e7550 100644 --- a/src/levels/shared/L00_002C8CB0.c +++ b/src/levels/shared/L00_002C8CB0.c @@ -11,7 +11,7 @@ typedef union { Quad q; float v[4]; } Vector; extern char g_hero_state[]; extern int g_pad_pressed_flags; extern int g_hero_ledge_move_flag; -extern s32 hero_l00_set_action(int mode, int flag); +extern s32 hero_l00_set_move_state(int mode, int flag); extern int CollLine(void *start, void *end, int flags, void *object, int mode); /* Decides which ledge-grab or climb move the hero starts when close to a ledge, if any. */ int hero_try_start_ledge_move(void) @@ -23,7 +23,7 @@ int hero_try_start_ledge_move(void) if (*(int *)(pre + 0x229c) == 0x11) { if (*(float *)(pre + 0x330) + 0.4f < *(float *)(pre + 0x88)) { g_hero_ledge_move_flag = 0; - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); return 1; } } else if (*(int *)(pre + 0x2294) != 0x67 && *(int *)(pre + 0x2294) != 0x73) { @@ -44,9 +44,9 @@ int hero_try_start_ledge_move(void) if (CollLine(&start, &end, 2, object, 0) == 0) goto fail; if (*(short *)(base + 0x24fc) == 0 && (g_pad_pressed_flags & 10) != 0) - hero_l00_set_action(0x34, 1); + hero_l00_set_move_state(0x34, 1); else - hero_l00_set_action(0x32, 1); + hero_l00_set_move_state(0x32, 1); return 1; fail: return 0; diff --git a/src/levels/shared/L00_002C8E10-g8.c b/src/levels/shared/L00_002C8E10-g8.c index 2ca560cad..a4210c356 100644 --- a/src/levels/shared/L00_002C8E10-g8.c +++ b/src/levels/shared/L00_002C8E10-g8.c @@ -7,7 +7,7 @@ extern float math_fabs(float); extern void BuildOffsetVectorPair(void *, void *, int, float, float); extern int CollLine(void *, void *, int, void *, int); extern short GetCollHitMaterial(void); -extern int hero_l00_set_action(int, int); +extern int hero_l00_set_move_state(int, int); extern int hero_play_sound(int, int); /* Decide whether the resident should transition after falling or leaving support. */ @@ -66,9 +66,9 @@ int hero_check_fall_transition(void) start[2] = *(float *)g_hero_ground_height - 0.01f; if (!CollLine(start, end, 2, *(void **)(resident + 0x2290), 0)) { if (*(int *)(resident + 0x229C) == 0x14 || *(int *)(resident + 0x24CC) == 0) - hero_l00_set_action(0x67, 1); + hero_l00_set_move_state(0x67, 1); else - hero_l00_set_action(0x33, 1); + hero_l00_set_move_state(0x33, 1); return 1; } } @@ -78,9 +78,9 @@ int hero_check_fall_transition(void) if (falling) { char *fallState = g_hero_state; if (*(int *)(fallState + 0x229C) == 0x14 || *(int *)(fallState + 0x24CC) == 0) - hero_l00_set_action(0x67, 1); + hero_l00_set_move_state(0x67, 1); else - hero_l00_set_action(0x36, 1); + hero_l00_set_move_state(0x36, 1); hero_play_sound(3, 0); } return falling; diff --git a/src/levels/shared/L00_002C9448-g8.c b/src/levels/shared/L00_002C9448-g8.c index 0047c4809..1a047fb19 100644 --- a/src/levels/shared/L00_002C9448-g8.c +++ b/src/levels/shared/L00_002C9448-g8.c @@ -105,7 +105,7 @@ extern int moby_is_class_71(unsigned char *); /* Matched helper definition takes no parameters. */ extern void hero_setup_attached_object_transform(void); extern int FloatToInt(float); -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern int get_ammo(int); extern int snd_play_from_class_bank(int, int, char *, int); extern char *SelectBestEligibleTarget(void *, int, int, float, float, float, float); @@ -165,9 +165,9 @@ int ProcessHeroEquippedItemInput(void) if ((g_hero_state.mode == 1 || g_hero_state.mode == 29) && g_hero_state.frame >= 21) hero_setup_attached_object_transform(); else - hero_l00_set_action(21, 1); + hero_l00_set_move_state(21, 1); } else { - hero_l00_set_action(19, 1); + hero_l00_set_move_state(19, 1); } goto clear_action; } @@ -194,9 +194,9 @@ int ProcessHeroEquippedItemInput(void) (g_hero_state.fast_attack && g_hero_state.movement > 0.57f) || (g_hero_state.mode == 8 && g_hero_state.movement > 0.57f)) { if (g_hero_state.attack_blocked || g_hero_state.attack_pending) goto clear_action; - hero_l00_set_action(20, 1); + hero_l00_set_move_state(20, 1); } else { - hero_l00_set_action(19, 1); + hero_l00_set_move_state(19, 1); } goto clear_action; @@ -208,7 +208,7 @@ int ProcessHeroEquippedItemInput(void) if (g_hero_state.attack_delay) goto clear_action; if ((float)range->trigger_frame <= g_hero_state.animation_frame && (g_pad_state.buttons.word.held & 8) && PadPressedWithin(mask, 15, 0)) { - hero_l00_set_action(21, 1); + hero_l00_set_move_state(21, 1); break; } } @@ -222,10 +222,10 @@ int ProcessHeroEquippedItemInput(void) action = action < 16 ? action : 15; if (PadPressedWithin(mask, action, 0)) { if (g_pad_state.buttons.word.held & 8) { - hero_l00_set_action(21, 1); + hero_l00_set_move_state(21, 1); goto clear_action; } - hero_l00_set_action(19, 1); + hero_l00_set_move_state(19, 1); } } } @@ -244,7 +244,7 @@ int ProcessHeroEquippedItemInput(void) break; if (!(g_pad_state.buttons.word.held & 32) || g_hero_state.input_window < 23) break; if (get_ammo(state)) { - hero_l00_set_action(131, 1); + hero_l00_set_move_state(131, 1); break; } if (g_pad_state.buttons.word.pressed & 32) { @@ -289,7 +289,7 @@ int ProcessHeroEquippedItemInput(void) if (g_hero_state.mode == 39 && (g_hero_state.alternate_target_ready || g_hero_state.nearby_ready)) { if (PadPressedWithin(mask, action, 0) || ((g_pad_state.buttons.word.held & mask) && g_hero_state.input_window >= 16)) { - hero_l00_set_action(40, 1); + hero_l00_set_move_state(40, 1); break; } } @@ -305,16 +305,16 @@ int ProcessHeroEquippedItemInput(void) else g_hero_state.alternate_target_ready = 0; } if (g_hero_state.alternate_target_ready && !g_hero_state.control_lock && g_hero_state.mode != 43) { - hero_l00_set_action(43, 1); + hero_l00_set_move_state(43, 1); break; } } if (g_hero_state.nearby_ready && !g_hero_state.control_lock) { - hero_l00_set_action(35, 1); + hero_l00_set_move_state(35, 1); break; } if (g_hero_state.second_target_ready) { - hero_l00_set_action(138, 1); + hero_l00_set_move_state(138, 1); break; } break; @@ -338,7 +338,7 @@ int ProcessHeroEquippedItemInput(void) if (get_ammo(-1)) { if (g_hero_state.state == 12 || g_hero_state.state == 0 || g_hero_state.mode == 3 || (g_hero_state.state == 1 && g_hero_state.transition_progress < 0.7f)) { - hero_l00_set_action(34, 1); + hero_l00_set_move_state(34, 1); break; } start_equipped_item_animation(); @@ -357,7 +357,7 @@ int ProcessHeroEquippedItemInput(void) action = action < frame_window ? 10 : frame_window; if (!PadPressedWithin(mask, action, &scratch.detach_age)) break; if (g_hero_state.object) { - hero_l00_set_action(31, 1); + hero_l00_set_move_state(31, 1); if (g_hero_state.object) PlayMobySound(0, 0, g_hero_state.object); } } @@ -373,7 +373,7 @@ int ProcessHeroEquippedItemInput(void) (g_hero_state.state < 2 || g_hero_state.state == 12 || ((g_hero_state.state == 2 || g_hero_state.state == 4) && g_hero_state.action_ready)) && (g_pad_state.buttons.both & 0x800000008ULL) == 0x800000008ULL) - hero_l00_set_action(123, 1); + hero_l00_set_move_state(123, 1); if (g_pad_state.buttons.word.pressed & 8) g_button_hold_timer = 30; } return g_hero_state.frame < previous_frame; diff --git a/src/levels/shared/L00_002CAF20.c b/src/levels/shared/L00_002CAF20.c index 2e185b1aa..adc9f65bc 100644 --- a/src/levels/shared/L00_002CAF20.c +++ b/src/levels/shared/L00_002CAF20.c @@ -32,7 +32,7 @@ extern u8 g_item_slot_to_record[]; extern Entry_2CAF20 g_weapon_l00_table[]; extern s32 hero_slot_item_id(s32); extern void cancel_hero_item_animation(void); -extern int hero_l00_set_action(int a0, int a1); +extern int hero_l00_set_move_state(int a0, int a1); extern void set_hero_animation(void *, int, f32); extern void vec_clamp_length(float *, float); @@ -50,7 +50,7 @@ int hero_try_start_grab(void) return 0; } moby = (g_weapon_l00_table + g_item_slot_to_record[idx])->moby; - if (hero_l00_set_action(0, 0) == 0) + if (hero_l00_set_move_state(0, 0) == 0) return 0; vec_clamp_length(h->v160, 0.0250000015f); if (0.0250000015f < h->f1B4) diff --git a/src/levels/shared/L00_002CB3A8-decider.c b/src/levels/shared/L00_002CB3A8-decider.c index 51720dfba..b32ada69f 100644 --- a/src/levels/shared/L00_002CB3A8-decider.c +++ b/src/levels/shared/L00_002CB3A8-decider.c @@ -95,7 +95,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l00_set_action(s32, s32); +s32 hero_l00_set_move_state(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -172,7 +172,7 @@ void hero_l00_decide_state(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l00_set_action(0x39, 1); + hero_l00_set_move_state(0x39, 1); goto end; } } @@ -207,7 +207,7 @@ void hero_l00_decide_state(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_proximity_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l00_set_action(0x74, 1); + hero_l00_set_move_state(0x74, 1); goto end; } } @@ -218,12 +218,12 @@ void hero_l00_decide_state(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_L00_002CB3A8_00() == 0)) { - hero_l00_set_action(1, 1); + hero_l00_set_move_state(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l00_set_action(0x82, 1); + hero_l00_set_move_state(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -260,7 +260,7 @@ void hero_l00_decide_state(void) { rec = g_hero_idle_choice_table + selected_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l00_set_action(0x3C, 1); + hero_l00_set_move_state(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -303,12 +303,12 @@ void hero_l00_decide_state(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l00_set_action(0x76, 1); + hero_l00_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); } break; } @@ -329,21 +329,21 @@ void hero_l00_decide_state(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_action_blocked_flag == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l00_set_action(0x6E, 1); + hero_l00_set_move_state(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l00_set_action(4, 1); + hero_l00_set_move_state(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_set_action(0x27, 1); + hero_l00_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l00_set_action(0x2E, 1); + hero_l00_set_move_state(0x2E, 1); break; } { @@ -363,28 +363,28 @@ void hero_l00_decide_state(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l00_set_action(2, 1); + hero_l00_set_move_state(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_L00_002CB3A8_00() == 0)) { - hero_l00_set_action(1, 1); + hero_l00_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_bits = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_bits & 8)) { - hero_l00_set_action(0x3D, 1); + hero_l00_set_move_state(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l00_set_action(0x3D, 1); + hero_l00_set_move_state(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); } break; case 0x3D: @@ -393,22 +393,22 @@ void hero_l00_decide_state(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_set_action(4, 1); + hero_l00_set_move_state(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l00_set_action(2, 1); + hero_l00_set_move_state(2, 1); break; } - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); break; case 0x39: case 0x43: @@ -447,25 +447,25 @@ void hero_l00_decide_state(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l00_set_action(0x33, 1); + hero_l00_set_move_state(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l00_set_action(0x34, 1); + hero_l00_set_move_state(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l00_set_action(0x32, 1); + hero_l00_set_move_state(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l00_set_action(0x33, 1); + hero_l00_set_move_state(0x33, 1); } } break; @@ -478,81 +478,81 @@ void hero_l00_decide_state(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l00_set_action(0x32, 1); + hero_l00_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l00_set_action(0x34, 1); + hero_l00_set_move_state(0x34, 1); } else { - hero_l00_set_action(0x32, 1); + hero_l00_set_move_state(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l00_set_action(0x12, 1); + hero_l00_set_move_state(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l00_set_action(0x32, 1); + hero_l00_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l00_set_action(0x34, 1); + hero_l00_set_move_state(0x34, 1); } else { - hero_l00_set_action(0x32, 1); + hero_l00_set_move_state(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l00_set_action(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l00_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l00_set_action(0x35, 1); + hero_l00_set_move_state(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l00_set_action(0x12, 1); + hero_l00_set_move_state(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l00_set_action(0x32, 1); + hero_l00_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l00_set_action(0x34, 1); + hero_l00_set_move_state(0x34, 1); } else { - hero_l00_set_action(0x32, 1); + hero_l00_set_move_state(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l00_set_action(0x70, 0); + hero_l00_set_move_state(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l00_set_action(0x36, 1); + hero_l00_set_move_state(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_set_action(0x67, 1); + hero_l00_set_move_state(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action(0x33, 1); + hero_l00_set_move_state(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l00_set_action(0x33, 0); + hero_l00_set_move_state(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_set_action(0x67, 1); + hero_l00_set_move_state(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l00_set_action(0x36, 0); + hero_l00_set_move_state(0x36, 0); } break; case 0x1: @@ -586,9 +586,9 @@ void hero_l00_decide_state(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_set_action(4, 1); + hero_l00_set_move_state(4, 1); } else { - hero_l00_set_action(0, 0); + hero_l00_set_move_state(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -600,9 +600,9 @@ void hero_l00_decide_state(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l00_set_action(0, 0); + hero_l00_set_move_state(0, 0); } else { - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); } } break; @@ -635,7 +635,7 @@ void hero_l00_decide_state(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_set_action(7, 1); + hero_l00_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -644,7 +644,7 @@ void hero_l00_decide_state(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l00_set_action(0, 0); + hero_l00_set_move_state(0, 0); } break; } @@ -666,7 +666,7 @@ void hero_l00_decide_state(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_set_action(7, 1); + hero_l00_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -679,7 +679,7 @@ void hero_l00_decide_state(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l00_set_action(2, 0); + hero_l00_set_move_state(2, 0); set_hero_animation(3, g_hero_anim_ids_by_mode[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -690,22 +690,22 @@ void hero_l00_decide_state(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l00_set_action(2, 1); + hero_l00_set_move_state(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l00_set_action(0, 0); + hero_l00_set_move_state(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action(0, 0); + hero_l00_set_move_state(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -722,7 +722,7 @@ void hero_l00_decide_state(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_set_action(7, 1); + hero_l00_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -731,7 +731,7 @@ void hero_l00_decide_state(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l00_set_action(0, 0); + hero_l00_set_move_state(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, 15.0f); break; } @@ -743,7 +743,7 @@ void hero_l00_decide_state(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); } break; case 0x2: @@ -757,11 +757,11 @@ void hero_l00_decide_state(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l00_set_action(0x76, 1); + hero_l00_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); break; } n = 9; @@ -775,12 +775,12 @@ void hero_l00_decide_state(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l00_set_action(9, 1); + hero_l00_set_move_state(9, 1); } else { - hero_l00_set_action(7, 1); + hero_l00_set_move_state(7, 1); } } else { - hero_l00_set_action(7, 1); + hero_l00_set_move_state(7, 1); } break; } @@ -788,11 +788,11 @@ void hero_l00_decide_state(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_L00_002CB3A8_00() == 0)) { - hero_l00_set_action(1, 1); + hero_l00_set_move_state(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_set_action(4, 1); + hero_l00_set_move_state(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -809,25 +809,25 @@ void hero_l00_decide_state(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l00_set_action(0x2E, 1); + hero_l00_set_move_state(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l00_set_action(2, 1); + hero_l00_set_move_state(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l00_set_action(0x70, 1); + hero_l00_set_move_state(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l00_set_action(2, 1); + hero_l00_set_move_state(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_set_action(0x27, 1); + hero_l00_set_move_state(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -838,7 +838,7 @@ void hero_l00_decide_state(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l00_set_action(0, 0) == 0) { + if (hero_l00_set_move_state(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -855,7 +855,7 @@ void hero_l00_decide_state(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l00_set_action(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l00_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } if (FLD(anim_obj, u8, 0x43) == 0x37) { @@ -876,7 +876,7 @@ void hero_l00_decide_state(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l00_set_action(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l00_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -910,17 +910,17 @@ void hero_l00_decide_state(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l00_set_action(3, 0); + hero_l00_set_move_state(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l00_set_action(0x77, 1); + hero_l00_set_move_state(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l00_set_action(0x77, 1); + hero_l00_set_move_state(0x77, 1); break; } } @@ -938,11 +938,11 @@ void hero_l00_decide_state(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l00_set_action(0x64, 1); + hero_l00_set_move_state(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l00_set_action(0x63, 1); + hero_l00_set_move_state(0x63, 1); } } else { hero_update_anim_scale(); @@ -950,21 +950,21 @@ void hero_l00_decide_state(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action(0x62, 1); + hero_l00_set_move_state(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l00_set_action(0x62, 1); + hero_l00_set_move_state(0x62, 1); } break; case 0x65: /* switch 2 */ combo_level = FLD(g_hero_state, s32, 0x18C0); if ((combo_level < 3) && (((combo_level * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 7, &scan_out) != 0)) { - hero_l00_set_action(0x66, 1); + hero_l00_set_move_state(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -1007,7 +1007,7 @@ void hero_l00_decide_state(void) { return; case 0x6D: if ((f32)g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); } break; case 0x30: @@ -1020,7 +1020,7 @@ void hero_l00_decide_state(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l00_set_action(0, 0) != 0) { + if (hero_l00_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1028,29 +1028,29 @@ void hero_l00_decide_state(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_L00_002CB3A8_00() == 0)) { - hero_l00_set_action(1, 1); + hero_l00_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l00_set_action(7, 1); + hero_l00_set_move_state(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_set_action(4, 1); + hero_l00_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_set_action(0x27, 1); + hero_l00_set_move_state(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1058,45 +1058,45 @@ void hero_l00_decide_state(void) { } if (hero_get_weapon_or_form_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l00_set_action(0, 0); + hero_l00_set_move_state(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l00_set_action(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l00_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l00_set_action(2, 1); + hero_l00_set_move_state(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_L00_002CB3A8_00() == 0)) { - hero_l00_set_action(1, 1); + hero_l00_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_set_action(0, 0); + hero_l00_set_move_state(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l00_set_action(0x76, 1); + hero_l00_set_move_state(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l00_set_action(0x15, 1); + hero_l00_set_move_state(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1104,17 +1104,17 @@ void hero_l00_decide_state(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l00_set_action(0x8B, 1); + hero_l00_set_move_state(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); } break; case 0x24: @@ -1140,14 +1140,14 @@ void hero_l00_decide_state(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l00_set_action(0, 0); + hero_l00_set_move_state(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l00_set_action(6, 0); + hero_l00_set_move_state(6, 0); } else { - hero_l00_set_action(6, 0); + hero_l00_set_move_state(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1163,9 +1163,9 @@ void hero_l00_decide_state(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); } else { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1177,7 +1177,7 @@ void hero_l00_decide_state(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l00_set_action(0x2C, 1); + hero_l00_set_move_state(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1226,11 +1226,11 @@ void hero_l00_decide_state(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.21666668f); FLD(g_hero_state, f32, 0x128) = 0.16666667f; - hero_l00_set_action(0x16, 1); + hero_l00_set_move_state(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x46; FLD(g_hero_state, s16, 0x1D0) = 0x46; } else { - hero_l00_set_action(0x3E, 1); + hero_l00_set_move_state(0x3E, 1); } break; } @@ -1243,7 +1243,7 @@ void hero_l00_decide_state(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l00_set_action(0x28, 1); + hero_l00_set_move_state(0x28, 1); } break; } @@ -1254,16 +1254,16 @@ void hero_l00_decide_state(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x46; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l00_set_action(0x74, 1); + hero_l00_set_move_state(0x74, 1); } else { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { - hero_l00_set_action(0x2A, 1); + hero_l00_set_move_state(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1280,7 +1280,7 @@ void hero_l00_decide_state(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l00_set_action(0x28, 1); + hero_l00_set_move_state(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)vec_b = 0; @@ -1297,7 +1297,7 @@ void hero_l00_decide_state(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 5, NULL) != 0) && ((f32)g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l00_set_action(0x28, 1); + hero_l00_set_move_state(0x28, 1); break; } top = 0xE; @@ -1306,19 +1306,19 @@ void hero_l00_decide_state(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l00_set_action(0x2A, 1); + hero_l00_set_move_state(0x2A, 1); } break; } if ((f32)g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l00_set_action(0x27, 1); + hero_l00_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x6C8) >= 6)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l00_set_action(0x74, 1); + hero_l00_set_move_state(0x74, 1); } else { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1327,7 +1327,7 @@ void hero_l00_decide_state(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l00_set_action(0x27, 1); + hero_l00_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0xA) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1363,7 +1363,7 @@ void hero_l00_decide_state(void) { find_nearest_path_point(new_path, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), new_path_index, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l00_set_action(0x29, 1); + hero_l00_set_move_state(0x29, 1); break; } } @@ -1411,7 +1411,7 @@ void hero_l00_decide_state(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x46; FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1419,7 +1419,7 @@ void hero_l00_decide_state(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l00_set_action(0x71, 1); + hero_l00_set_move_state(0x71, 1); break; } { @@ -1431,7 +1431,7 @@ void hero_l00_decide_state(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l00_set_action(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l00_set_move_state(0, 0) != 0)) { set_hero_animation(0xC, 4, 6.0f); } } else if (st == 0x3E) { @@ -1440,11 +1440,11 @@ void hero_l00_decide_state(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)jump_steps_low, 0.5f, -1.0f); } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action(0x27, 1); + hero_l00_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l00_set_action(0x27, 1); + hero_l00_set_move_state(0x27, 1); } } break; @@ -1460,13 +1460,13 @@ void hero_l00_decide_state(void) { } } if (FLD(g_hero_state, s32, 0x6F0) >= 6) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); FLD(g_hero_state, s16, 0x204) = 0x1E; } break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l00_set_action(0x18, 0); + hero_l00_set_move_state(0x18, 0); } break; case 0x18: @@ -1475,18 +1475,18 @@ void hero_l00_decide_state(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l00_set_action(0x1B, 1); + hero_l00_set_move_state(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1495,7 +1495,7 @@ void hero_l00_decide_state(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l00_set_action(0x19, 1); + hero_l00_set_move_state(0x19, 1); } break; } @@ -1506,7 +1506,7 @@ void hero_l00_decide_state(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l00_set_action(0x1A, 1); + hero_l00_set_move_state(0x1A, 1); } } } @@ -1525,18 +1525,18 @@ void hero_l00_decide_state(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action(0x18, 1); + hero_l00_set_move_state(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l00_set_action(0x1B, 1); + hero_l00_set_move_state(0x1B, 1); } break; } @@ -1546,9 +1546,9 @@ void hero_l00_decide_state(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); } else { - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); } } break; @@ -1572,12 +1572,12 @@ void hero_l00_decide_state(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_set_action(0x39, 1); + hero_l00_set_move_state(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l00_set_action(0, 0) != 0) { + if (hero_l00_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1585,7 +1585,7 @@ void hero_l00_decide_state(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l00_set_action(0, 0) != 0) { + if (hero_l00_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1599,36 +1599,36 @@ void hero_l00_decide_state(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l00_set_action(2, 1); + hero_l00_set_move_state(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l00_set_action(3, 0) != 0) { + if (hero_l00_set_move_state(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l00_set_action(8, 1); + hero_l00_set_move_state(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_set_action(0x17, 1); + hero_l00_set_move_state(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_set_action(0x27, 1); + hero_l00_set_move_state(0x27, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l00_set_action(0x71, 1); + hero_l00_set_move_state(0x71, 1); } } break; @@ -1659,7 +1659,7 @@ void hero_l00_decide_state(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == MOBY_CLASS_LEVITATOR_PAD)) { - if (hero_l00_set_action(0, 0) != 0) { + if (hero_l00_set_move_state(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1669,9 +1669,9 @@ void hero_l00_decide_state(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l00_set_action(0x74, 1); + hero_l00_set_move_state(0x74, 1); } else { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); } } break; @@ -1684,16 +1684,16 @@ void hero_l00_decide_state(void) { ok = 1; } if (ok != 0) { - hero_l00_set_action(0x11, 1); + hero_l00_set_move_state(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_set_action(0x17, 1); + hero_l00_set_move_state(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1704,23 +1704,23 @@ void hero_l00_decide_state(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l00_set_action(3, 0) != 0) { + if (hero_l00_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_set_action(4, 1); + hero_l00_set_move_state(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_anim_range_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l00_set_action(2, 1); + hero_l00_set_move_state(2, 1); break; } - hero_l00_set_action(2, 0); + hero_l00_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1729,21 +1729,21 @@ void hero_l00_decide_state(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_anim_range_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l00_set_action(2, 1); + hero_l00_set_move_state(2, 1); break; } - hero_l00_set_action(2, 0); + hero_l00_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_landing_anim_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l00_set_action(0, 0) != 0) { + if (hero_l00_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l00_set_action(0, 0) != 0) { + } else if (hero_l00_set_move_state(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1790,14 +1790,14 @@ void hero_l00_decide_state(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_set_action(0xB, 1); + hero_l00_set_move_state(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l00_set_action(0x82, 1); + hero_l00_set_move_state(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1806,29 +1806,29 @@ void hero_l00_decide_state(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l00_set_action(0xA, 1); + hero_l00_set_move_state(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l00_set_action(0x10, 1); + hero_l00_set_move_state(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_set_action(0x27, 1); + hero_l00_set_move_state(0x27, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l00_set_action(0x71, 1); + hero_l00_set_move_state(0x71, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l00_set_action(0x77, 1); + hero_l00_set_move_state(0x77, 1); break; } } @@ -1932,7 +1932,7 @@ void hero_l00_decide_state(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l00_set_action(3, 0) != 0) { + if (hero_l00_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1940,13 +1940,13 @@ void hero_l00_decide_state(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_anim_range_table[0][2])) { - hero_l00_set_action(7, 1); + hero_l00_set_move_state(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l00_set_action(7, 1); + hero_l00_set_move_state(7, 1); } else if (g_hero_anim_range_table[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l00_set_action(9, 1); + hero_l00_set_move_state(9, 1); } else { - hero_l00_set_action(7, 1); + hero_l00_set_move_state(7, 1); } break; } @@ -1954,10 +1954,10 @@ void hero_l00_decide_state(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); break; } { @@ -1967,7 +1967,7 @@ void hero_l00_decide_state(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &scan_out_alt) != 0) && (scan_out_alt < FLD(g_hero_state, s32, 0x1B8))) { - hero_l00_set_action(0x11, 1); + hero_l00_set_move_state(0x11, 1); break; } } @@ -1996,7 +1996,7 @@ void hero_l00_decide_state(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l00_set_action(0xE, 1); + hero_l00_set_move_state(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -2006,32 +2006,32 @@ void hero_l00_decide_state(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l00_set_action(8, 1); + hero_l00_set_move_state(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l00_set_action(0x17, 1); + hero_l00_set_move_state(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l00_set_action(6, 1); + hero_l00_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l00_set_action(0x79, 1); + hero_l00_set_move_state(0x79, 1); } else { - hero_l00_set_action(0x39, 1); + hero_l00_set_move_state(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l00_set_action(0x82, 1); + hero_l00_set_move_state(0x82, 1); } else { - hero_l00_set_action(0, 0); + hero_l00_set_move_state(0, 0); } } break; @@ -2041,8 +2041,8 @@ void hero_l00_decide_state(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_set_action(0x39, 1); - } else if (hero_l00_set_action(0, 0) != 0) { + hero_l00_set_move_state(0x39, 1); + } else if (hero_l00_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 13.0f); } } @@ -2067,28 +2067,28 @@ void hero_l00_decide_state(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l00_set_action(0x4E, 1); + hero_l00_set_move_state(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_L00_002CB3A8_00() == 0)) { - hero_l00_set_action(1, 1); + hero_l00_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l00_set_action(0x41, 1); + hero_l00_set_move_state(0x41, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l00_set_action(0x45, 1); + hero_l00_set_move_state(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l00_set_action(0x4D, 1); + hero_l00_set_move_state(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l00_set_action(0x40, 1); + hero_l00_set_move_state(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -2101,14 +2101,14 @@ void hero_l00_decide_state(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l00_set_action(0x4E, 1); + hero_l00_set_move_state(0x4E, 1); break; } rec = (u8 *)&g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l00_set_action(0x3F, 0); + hero_l00_set_move_state(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -2117,13 +2117,13 @@ void hero_l00_decide_state(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0x10) ? n : 0xF, NULL) != 0) { - hero_l00_set_action(0x4D, 1); + hero_l00_set_move_state(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l00_set_action(0x45, 1); + hero_l00_set_move_state(0x45, 1); } break; } @@ -2186,42 +2186,42 @@ void hero_l00_decide_state(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l00_set_action(0x45, 1); + hero_l00_set_move_state(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_anim_range_table[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l00_set_action(0x40, 1); + hero_l00_set_move_state(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l00_set_action(0x3F, 1); + hero_l00_set_move_state(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l00_set_action(0x41, 1); + hero_l00_set_move_state(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 5, NULL) != 0)) { - hero_l00_set_action(0x4D, 1); + hero_l00_set_move_state(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_set_action(0x46, 1); + hero_l00_set_move_state(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l00_set_action(0x4B, 1); + hero_l00_set_move_state(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l00_set_action(0x41, 1); + hero_l00_set_move_state(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_set_action(0x46, 1); + hero_l00_set_move_state(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -2231,11 +2231,11 @@ void hero_l00_decide_state(void) { FLD(g_hero_state, s16, 0x1EE) = 0xC - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l00_set_action(0x40, 1); + hero_l00_set_move_state(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l00_set_action(0x3F, 1); + hero_l00_set_move_state(0x3F, 1); } break; case 0x41: @@ -2247,29 +2247,29 @@ void hero_l00_decide_state(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_set_action(0x43, 1); + hero_l00_set_move_state(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l00_set_action(0x40, 1); + hero_l00_set_move_state(0x40, 1); } else { - hero_l00_set_action(0x3F, 1); + hero_l00_set_move_state(0x3F, 1); } } else { - hero_l00_set_action(0x3F, 1); + hero_l00_set_move_state(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_set_action(0x46, 1); + hero_l00_set_move_state(0x46, 1); break; } if ((PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l00_set_action(0x4B, 1); + hero_l00_set_move_state(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l00_set_action(0x3F, 1); + hero_l00_set_move_state(0x3F, 1); } break; case 0x4E: @@ -2278,9 +2278,9 @@ void hero_l00_decide_state(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l00_set_action(0x41, 1); + hero_l00_set_move_state(0x41, 1); } else { - hero_l00_set_action(0x3F, 1); + hero_l00_set_move_state(0x3F, 1); } } break; @@ -2290,7 +2290,7 @@ void hero_l00_decide_state(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l00_set_action(0x4E, 1); + hero_l00_set_move_state(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.025000002f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2316,55 +2316,55 @@ void hero_l00_decide_state(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l00_set_action(0x45, 1); + hero_l00_set_move_state(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l00_set_action(0x4D, 1); + hero_l00_set_move_state(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l00_set_action(0x41, 1); + hero_l00_set_move_state(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l00_set_action(0x3F, 1); + hero_l00_set_move_state(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l00_set_action(0x41, 1); + hero_l00_set_move_state(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x24) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_set_action(0x43, 1); + hero_l00_set_move_state(0x43, 1); } else { - hero_l00_set_action(0x3F, 0); + hero_l00_set_move_state(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action(0x47, 1); + hero_l00_set_move_state(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)vec_a = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l00_set_action(0x41, 1); + hero_l00_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_set_action(0x41, 1); + hero_l00_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l00_set_action(0x48, 1); + hero_l00_set_move_state(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2373,7 +2373,7 @@ void hero_l00_decide_state(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l00_set_action(0x49, 1); + hero_l00_set_move_state(0x49, 1); } break; } @@ -2384,7 +2384,7 @@ void hero_l00_decide_state(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l00_set_action(0x4A, 1); + hero_l00_set_move_state(0x4A, 1); } } } @@ -2403,17 +2403,17 @@ void hero_l00_decide_state(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action(0x47, 1); + hero_l00_set_move_state(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l00_set_action(0x41, 1); + hero_l00_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l00_set_action(0x48, 1); + hero_l00_set_move_state(0x48, 1); } break; } @@ -2428,7 +2428,7 @@ void hero_l00_decide_state(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l00_set_action(0, 0); + hero_l00_set_move_state(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -2439,7 +2439,7 @@ void hero_l00_decide_state(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l00_set_action(0, 0); + hero_l00_set_move_state(0, 0); } break; case 0x22: @@ -2449,12 +2449,12 @@ void hero_l00_decide_state(void) { hero_choose_jump_or_roll_move(); break; } - hero_l00_set_action(7, 1); + hero_l00_set_move_state(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l00_set_action(0, 0); + hero_l00_set_move_state(0, 0); } break; default: diff --git a/src/levels/shared/L00_002D3798.c b/src/levels/shared/L00_002D3798.c index 8d0c89e73..dfd8e9c31 100644 --- a/src/levels/shared/L00_002D3798.c +++ b/src/levels/shared/L00_002D3798.c @@ -481,7 +481,7 @@ int get_ammo(int slot_index) return g_weapon_ammo_counts[slot]; } -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); /* Stores a target, a mode and a time on the hero, and starts hero state 98 unless the hero is already in states 98 to 100. */ void hero_start_target_state(V4_F6a70b950 *vec, int mode, float time) @@ -496,7 +496,7 @@ void hero_start_target_state(V4_F6a70b950 *vec, int mode, float time) *(int *)(hero_base + 0x18B0) = mode; *(float *)(hero_base + 0x18AC) = time; if ((unsigned)(hero_state - 98) >= 3) - hero_l00_set_action(98, 2); + hero_l00_set_move_state(98, 2); } extern int g_game_mode; diff --git a/src/levels/shared/L00_002D67A8.c b/src/levels/shared/L00_002D67A8.c index 029fdb495..91408f303 100644 --- a/src/levels/shared/L00_002D67A8.c +++ b/src/levels/shared/L00_002D67A8.c @@ -31,48 +31,39 @@ typedef unsigned int u32; extern u32 g_game_mode; -extern u8 g_slot_entry_table[]; - -/* Measured partial layouts; original type and game roles are unknown. */ -struct Rac2Native_5f824a0e369ccf7b_src_record { - unsigned char b0; - unsigned char b1; - unsigned char b2; - unsigned char b3; - unsigned short s4; - unsigned short s6; - unsigned short s8; - unsigned short s10; - unsigned short s12; - unsigned char e; - unsigned char f; +extern u8 g_wave_l24_channels[]; + +/* The controller's vibration (the pad actuators) is made of eight wave channels, which + * LevelActuatorCalcPower (L00_002D67A8-envelope.c) mixes every frame. g_wave_l00_channels, + * g_wave_l04_channels and g_wave_l24_channels are that one array, named by the address the code + * forms in level 00, 04 and 24. The functions below start and stop waves in it. */ + +/* One wave of a vibration pattern, as the level program stores it: WaveChannel's fields, except + * that PEAK is the highest level, where WaveChannel keeps AMPLITUDE (PEAK - BIAS). A KIND of 0xFF + * ends the list. */ +struct WaveRecord { + unsigned char kind; + unsigned char permanent; + unsigned char output; + unsigned char multiply; + unsigned short delay; + unsigned short duration; + unsigned short frame; + unsigned short rise; + unsigned short fall; + unsigned char peak; + unsigned char bias; }; -struct Rac2Native_5f824a0e369ccf7b_dst_record { - unsigned char b0; - unsigned char b1; - unsigned char b2; - unsigned char b3; - unsigned short s4; - unsigned short s6; - unsigned short s8; - short s10; - short s12; - unsigned char e; - unsigned char f; -}; - -extern struct Rac2Native_5f824a0e369ccf7b_dst_record g_free_slot_records[8] __attribute__((nosda)); - +/* A wave channel, as in L00_002D67A8-envelope.c. */ typedef struct { - u8 field0; - u8 active; - u8 middle[4]; - unsigned short count; - u8 trailing[8]; -} ConditionalResetSlot; + unsigned char kind, permanent, output, multiply; + short delay, duration, frame, rise, fall; + unsigned char amplitude, bias; +} WaveChannel; -extern ConditionalResetSlot g_wave_l00_channels[8]; +extern WaveChannel g_wave_l04_channels[8] __attribute__((nosda)); +extern WaveChannel g_wave_l00_channels[8]; /* Filter primary or fallback object's class identifier by mode and signed selection */ /* Checks if the tracked object is a certain kind of object, picked by the selection number. */ @@ -114,44 +105,52 @@ u32 level_get_global_word(void) { } -extern struct Rac2Native_5f824a0e369ccf7b_src_record *g_queue_source_records[]; +/* The level's vibration patterns: 48 lists of waves (0 to 47), data in the level program. */ +extern struct WaveRecord *g_actuator_patterns[]; -int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *src); +int actuator_play_waves(struct WaveRecord *src); -/* Copies the record the INDEX selects, or reports -1 when INDEX is past the 0x62-entry table. */ -int queue_copy_record_by_index(unsigned int index) +/* Plays vibration pattern INDEX, a fixed rumble the game picks by number (18 when the hero is + * hurt, for example). Returns what actuator_play_waves returns, or -1 when INDEX is 0x62 or more. + * The table has only 48 patterns, so 48 to 0x61 would read past its end; no caller asks for one. */ +int actuator_play_pattern(unsigned int index) { if (index < 0x62) - return slot_copy_records_to_free(g_queue_source_records[index]); + return actuator_play_waves(g_actuator_patterns[index]); return -1; } -/* Clears the first byte of the eight 16-byte slots, walking from the last one down. */ -void slot_clear_active_bytes(void) +/* Stops every wave at once by clearing each channel's kind. The hero's set-action functions call + * it on every change of action unless the hero's halfword at 0x1FA is set, so a new action + * cuts off the rumble of the last one. */ +void actuator_stop_all(void) { s32 i; for (i = 7; i >= 0; --i) - g_wave_l00_channels[i].field0 = 0; + g_wave_l00_channels[i].kind = 0; } -/* tests the byte at the indexed 16-byte table entry */ -s32 slot_is_entry_nonzero(s32 index) { - return g_slot_entry_table[index*16]!=0; +/* Tells whether wave channel INDEX is playing (its kind byte is not 0). */ +s32 actuator_is_channel_active(s32 index) { + return g_wave_l24_channels[index*16]!=0; } -/* Check space among eight destination records, copy bounded input records into inactive slots, adjust copied byte and halfword fields, and return a slot index or -1. */ -int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *src) +/* Starts a list of up to eight waves, each in a free channel. Plays nothing and returns -1 when + * too few channels are free; otherwise returns the channel of the last wave, which callers keep + * as a handle. A wave with no period (rise and fall both 0) gets a rise of 1, since the mixer + * divides by it. */ +int actuator_play_waves(struct WaveRecord *src) { int n = 0; int i; int j; - while (n < 8 && src[n].b0 != 255) + while (n < 8 && src[n].kind != 255) n++; j = 0; for (i = 0; i < 8 && j < n; i++) { - if (g_free_slot_records[i].b0 == 0) + if (g_wave_l04_channels[i].kind == 0) j++; } @@ -160,35 +159,37 @@ int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *src for (j = 0; j < n; j++) { i = 0; - while (i < 8 && g_free_slot_records[i].b0 != 0) + while (i < 8 && g_wave_l04_channels[i].kind != 0) i++; if (i < 8) { - g_free_slot_records[i].b0 = src[j].b0; - g_free_slot_records[i].b1 = src[j].b1; - g_free_slot_records[i].b2 = src[j].b2; - g_free_slot_records[i].b3 = src[j].b3; - g_free_slot_records[i].s4 = src[j].s4; - g_free_slot_records[i].s6 = src[j].s6; - g_free_slot_records[i].s8 = src[j].s8; - g_free_slot_records[i].s10 = src[j].s10; - g_free_slot_records[i].s12 = src[j].s12; - g_free_slot_records[i].e = src[j].e - src[j].f; - g_free_slot_records[i].f = src[j].f; - if (g_free_slot_records[i].s10 + g_free_slot_records[i].s12 == 0) - g_free_slot_records[i].s10++; + g_wave_l04_channels[i].kind = src[j].kind; + g_wave_l04_channels[i].permanent = src[j].permanent; + g_wave_l04_channels[i].output = src[j].output; + g_wave_l04_channels[i].multiply = src[j].multiply; + g_wave_l04_channels[i].delay = src[j].delay; + g_wave_l04_channels[i].duration = src[j].duration; + g_wave_l04_channels[i].frame = src[j].frame; + g_wave_l04_channels[i].rise = src[j].rise; + g_wave_l04_channels[i].fall = src[j].fall; + g_wave_l04_channels[i].amplitude = src[j].peak - src[j].bias; + g_wave_l04_channels[i].bias = src[j].bias; + if (g_wave_l04_channels[i].rise + g_wave_l04_channels[i].fall == 0) + g_wave_l04_channels[i].rise++; } } return i; } -/* For eight16-byte records, clear active byte1 and halfword6 only when active is nonzero */ -void slot_reset_active(void) { - ConditionalResetSlot *slot = g_wave_l00_channels; +/* Ends every looping (permanent) wave: with no time left, the mixer stops it on its next frame. + * Waves with a set duration play on. Callers pass the handle actuator_play_waves gave them, but + * the function takes no argument and ends all looping waves. */ +void actuator_end_looping_waves(void) { + WaveChannel *slot = g_wave_l00_channels; s32 remaining = 7; do { - if (slot->active) { - slot->active = 0; - slot->count = 0; + if (slot->permanent) { + slot->permanent = 0; + slot->duration = 0; } --remaining; ++slot; diff --git a/src/levels/shared/L00_002D6FD8.c b/src/levels/shared/L00_002D6FD8.c index c1125240b..0f1b67c8e 100644 --- a/src/levels/shared/L00_002D6FD8.c +++ b/src/levels/shared/L00_002D6FD8.c @@ -1,35 +1,41 @@ #include "include_asm.h" #include "names.h" -/* Measured partial C views; original types and object ownership are unknown. */ +/* The first pad's state (ref_L00_002D6FD8_03 is g_pad_state in every program) as far as the + * vibration goes: the two motor bytes the pad's actuator command is built from. */ typedef struct { unsigned char prefix[0x188]; - unsigned char wrapped; - unsigned char value; -} QwenRecovery_538934d89776_WrapperCollectState132; + unsigned char small_motor; + unsigned char large_motor; +} PadMotors; +/* [2]: the motors are only set while it is non-zero (the vibration option, by its use). */ extern unsigned char ref_L00_002D6FD8_01[3]; +/* The small motor's running sum. */ extern int ref_L00_002D6FD8_00; -extern QwenRecovery_538934d89776_WrapperCollectState132 ref_L00_002D6FD8_03; +extern PadMotors ref_L00_002D6FD8_03; +/* LevelActuatorCalcPower. */ extern int ref_L00_002D6FD8_02(int words[2]); -/* Adds a value to a running counter that wraps around at 256, and notes whether it wrapped. */ -void math_add_wrapping_counter(void) +/* Mixes the vibration's wave channels (LevelActuatorCalcPower) and, with vibration on, sets the + * pad's motors: the large one to its mixed value, the small one (only on or off) on each time its + * value's running sum reaches 256, which then drops by 255, so its value says how often it is on. */ +void actuator_update(void) { int words[4]; ref_L00_002D6FD8_02(words); if (ref_L00_002D6FD8_01[2] != 0) { ref_L00_002D6FD8_00 += words[0]; if (ref_L00_002D6FD8_00 >= 256) { - ref_L00_002D6FD8_03.wrapped = 1; + ref_L00_002D6FD8_03.small_motor = 1; ref_L00_002D6FD8_00 -= 255; } else { - ref_L00_002D6FD8_03.wrapped = 0; + ref_L00_002D6FD8_03.small_motor = 0; } - ref_L00_002D6FD8_03.value = ((unsigned char *)words)[4]; + ref_L00_002D6FD8_03.large_motor = ((unsigned char *)words)[4]; } else { words[0] = 0; words[1] = 0; diff --git a/src/levels/shared/L00_0038F178-tether-g8.c b/src/levels/shared/L00_0038F178-tether-g8.c index 58df64c0c..e120f2fcd 100644 --- a/src/levels/shared/L00_0038F178-tether-g8.c +++ b/src/levels/shared/L00_0038F178-tether-g8.c @@ -30,7 +30,7 @@ extern char *moby_get_private_value_2(u8 *); extern float FastVecLength(void *); extern void level_save_and_dim_lighting(void *), func_002A0F48(void *); extern char *cam_follow_create(void *); -extern int hero_l00_set_action(int a0, int a1); +extern int hero_l00_set_move_state(int a0, int a1); extern void mem_clear(void *, int, int), AttachManipulator(u8 *, u32, u8 *); extern char *tether_create_fin_piece(char *); extern void hero_copy_field_to_moby(u8 *); @@ -79,7 +79,7 @@ char *visibomb_create_missile(char *owner, char *position, float yaw, float pitc { char *attachment = cam_follow_create(actor); state->attachment = attachment; - hero_l00_set_action(28, 1); + hero_l00_set_move_state(28, 1); } mem_clear(state->matrix24, 0, 64); mem_clear(state->matrix28, 0, 64); diff --git a/src/levels/shared/L00_0038F178.c b/src/levels/shared/L00_0038F178.c index 48c47c7a8..bfbde2bec 100644 --- a/src/levels/shared/L00_0038F178.c +++ b/src/levels/shared/L00_0038F178.c @@ -52,7 +52,7 @@ extern void func_002A0F48(char *object); extern void cam_pick_state_from_hero_turn(int value); -extern int hero_l00_set_action(int a, int b); +extern int hero_l00_set_move_state(int a, int b); extern void level_clear_second_table_entry(void); @@ -288,7 +288,7 @@ void tether_release(char *actor, char *tether) D_18C0A0 = 0; cam_pick_state_from_hero_turn(*(int *)(tetherRef + 0x14)); *(int *)(tetherRef + 0x14) = 0; - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); level_restore_lighting(actorRef, 1); level_clear_second_table_entry(); table_clear_entry_flag(*(int *)(tetherRef + 0x4C)); diff --git a/src/levels/shared/L00_003A0F30-eye.c b/src/levels/shared/L00_003A0F30-eye.c index 3316d5470..74345d04c 100644 --- a/src/levels/shared/L00_003A0F30-eye.c +++ b/src/levels/shared/L00_003A0F30-eye.c @@ -43,7 +43,7 @@ extern int AcquireEntitySlot(void *, int, void *); extern char *level_get_slot_body(int, int); extern float math_random_signed_float_range(float, float), math_random_float_range(float, float); extern void vec_clear_128(VectorBits *); -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern int get_ammo(int); extern void hud_add_moby_marker(void *, unsigned int, int, int, int, int, float, float, float); extern int vec_fast_helper_b(void *); @@ -118,7 +118,7 @@ void charged_beam_weapon_update(char *moby) g_charged_beam_init_flag = 1; } if (g_hero_state.mode == 1) - hero_l00_set_action(29, 1); + hero_l00_set_move_state(29, 1); if (g_hero_state.mode == 29) { unsigned int color; if (*(float *)state != 0.0f && get_ammo(-1)) diff --git a/src/levels/shared/L00_003A0F30-lock.c b/src/levels/shared/L00_003A0F30-lock.c index cc7ba1b9e..29dfd5a0c 100644 --- a/src/levels/shared/L00_003A0F30-lock.c +++ b/src/levels/shared/L00_003A0F30-lock.c @@ -57,11 +57,11 @@ extern Moby *g_area_hit_targets[]; extern CollisionResult g_collision_result; extern MuzzleLight g_light_table[]; extern WeaponEntry g_weapon_table_2[]; -extern u8 g_minirocket_sound_records[]; +extern u8 g_minirocket_rumble_waves[]; extern void EmitLayeredSparks(void *); extern int vec_fast_helper_b(void *); -extern int hero_l00_set_action(int, int); +extern int hero_l00_set_move_state(int, int); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern void anim_start_blended(void *, int, int, int); extern int get_ammo(int); @@ -83,8 +83,8 @@ extern void part_spawn_fragment_fan_and_smoke(Moby *); extern void weapon_spawn_muzzle_effect(Moby *); extern void set_hero_animation(int, int, float); extern void start_equipped_item_animation(void); -extern void slot_reset_active(int); -extern int slot_copy_records_to_free(void *); +extern void actuator_end_looping_waves(int); +extern int actuator_play_waves(void *); extern void moby_transform_joint_to_world(void *, int, void *); extern int part_l00_alloc_effect_slot_2(void *, float, float, float, float, float); extern void gfx_free_point_light(int); @@ -113,7 +113,7 @@ void minirocket_tube_update(Moby *moby) EmitLayeredSparks(moby); vec_fast_helper_b(vars); if (((Hero *)g_hero_state)->i[0x2294 / 4] == 1) - hero_l00_set_action(0x1D, 1); + hero_l00_set_move_state(0x1D, 1); if (moby->animation == moby->nextAnimation && (moby->flags & 2)) anim_start_blended_with_flags(moby, 1, 0, 2, 0); if (((Hero *)g_hero_state)->i[0x1450 / 4] != 0) @@ -248,7 +248,7 @@ void minirocket_tube_update(Moby *moby) else start_equipped_item_animation(); anim_start_blended(moby, 2, 0, 0); - vars->sound = slot_copy_records_to_free(g_minirocket_sound_records); + vars->sound = actuator_play_waves(g_minirocket_rumble_waves); { WeaponEntry *weapon = g_weapon_table_2 + g_item_slot_to_record[0x1B]; vars->cooldown = 1.0f / weapon->rate; @@ -259,7 +259,7 @@ void minirocket_tube_update(Moby *moby) } if (!((g_pad_state[0x1A0 / 4] & ((Hero *)g_hero_state)->u[0x1230 / 4]) && get_ammo(-1) && ((Hero *)g_hero_state)->b[0x22B8]) && vars->sound >= 0) { - slot_reset_active(vars->sound); + actuator_end_looping_waves(vars->sound); vars->sound = -1; } } diff --git a/src/levels/shared/L00_003A2EE0-g8.c b/src/levels/shared/L00_003A2EE0-g8.c index 516228daa..6e785a2a4 100644 --- a/src/levels/shared/L00_003A2EE0-g8.c +++ b/src/levels/shared/L00_003A2EE0-g8.c @@ -48,7 +48,7 @@ extern char g_camera_l00_position[]; extern char *g_hit_l00_result[]; extern MuzzleLight g_light_table[]; extern WeaponEntry g_weapon_l00_table[]; -extern TargetRecord g_target_hud_records[]; +extern TargetRecord g_scoped_weapon_rumble_waves[]; extern void cam_set_value_target(int, int, float, float, float, float); extern void hud_add_moby_marker(void *, float, u32, void *, int, float, int, float, int); @@ -71,11 +71,11 @@ extern int moby_is_in_special_class_range(void *); extern void snd_stop_voice(s32); extern int PlayMobySound(int, int, void *); extern void start_equipped_item_animation(void); -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern int weapon_spend_ammo(int, int); extern int get_ammo(int); -extern int slot_copy_records_to_free(TargetRecord *); -extern void slot_reset_active(int); +extern int actuator_play_waves(TargetRecord *); +extern void actuator_end_looping_waves(int); extern int AcquireEntitySlot(void *, int, int *); extern char *mem_round_up_to_16(char *); extern char *level_get_slot_body(int, int); @@ -197,7 +197,7 @@ void UpdateScopedWeapon(u8 *moby) case 1: { float zoom_blend; if (HERO->i[0x2294 / 4] == 1) - hero_l00_set_action(0x1D, 1); + hero_l00_set_move_state(0x1D, 1); fire = 1; if (HERO->i[0x1500 / 4] != 0) { fire = 0; @@ -263,7 +263,7 @@ void UpdateScopedWeapon(u8 *moby) if (HERO->b[0x22BC] == 0 && (GAME->i[0x1A4 / 4] & HERO->i[0x1230 / 4]) && fire) { if (weapon_spend_ammo(-1, 1) != 0) { start_equipped_item_animation(); - st->hud = slot_copy_records_to_free(g_target_hud_records); + st->hud = actuator_play_waves(g_scoped_weapon_rumble_waves); st->fire_timer = 2; moby[0x20] = 2; anim_start_blended(moby, 2, 0, 0); @@ -273,7 +273,7 @@ void UpdateScopedWeapon(u8 *moby) } if (!(GAME->i[0x1A0 / 4] & HERO->i[0x1230 / 4]) || get_ammo(-1) == 0 || HERO->b[0x22B8] == 0) { if (st->hud >= 0) { - slot_reset_active(st->hud); + actuator_end_looping_waves(st->hud); st->hud = -1; } } diff --git a/src/levels/shared/L00_003A3F30-g8.c b/src/levels/shared/L00_003A3F30-g8.c index 0aa46ba24..25ada1d81 100644 --- a/src/levels/shared/L00_003A3F30-g8.c +++ b/src/levels/shared/L00_003A3F30-g8.c @@ -16,7 +16,7 @@ typedef struct { char prefix[0x54]; float fireRate; char tail[0x88]; } WeaponEnt extern WeaponEntry g_weapon_l00_table[]; extern void anim_start_blended_with_flags(void *, int, int, int, int); extern void ReleaseDeadOrExpiredSlots(void *); -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern int get_ammo(int); extern void hud_add_moby_marker(void *, unsigned int, int, int, int, int, float, float, float); extern int math_fast_float_d(void *); @@ -42,7 +42,7 @@ void seeker_gun_update(char *moby) *(float *)(moby + 0x2C) = *(float *)(*(char **)(moby + 0x24) + 0x24) * g_seeker_gun_speed_scale; g_weapon_effect_scale = 0.1f; if (H->i[0x2294 / 4] == 1) - hero_l00_set_action(29, 1); + hero_l00_set_move_state(29, 1); if (H->i[0x2294 / 4] == 29) { unsigned int color; if (*cooldown > 0.0f && get_ammo(-1)) diff --git a/src/levels/shared/L00_003A53E8-g16.c b/src/levels/shared/L00_003A53E8-g16.c index 15ea298eb..edb5e898c 100644 --- a/src/levels/shared/L00_003A53E8-g16.c +++ b/src/levels/shared/L00_003A53E8-g16.c @@ -1,7 +1,7 @@ #include "common.h" typedef int VectorBits __attribute__((mode(TI))); struct Rac2Native_5f824a0e369ccf7b_src_record { u8 b0,b1,b2,b3; u16 s4,s6,s8,s10,s12; u8 e,f; }; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_blitz_gun_sound_records[]; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_blitz_gun_rumble_waves[]; extern u8 g_item_slot_to_record[]; extern float g_blitz_gun_euler_angles[4] __attribute__((sda)); extern unsigned int g_blitz_startup_ticks __attribute__((sda)); @@ -51,12 +51,12 @@ extern char *g_area_hit_targets[]; extern int FastDecTimer(void *),math_fast_float_d(void *),vec_fast_helper_b(void *); extern int PlayMobySound(int,int,char *); extern void anim_start_blended_with_flags(void *,int,int,int,int),anim_start_blended(void *,int,int,int); -extern int hero_l00_set_action(int,int); +extern int hero_l00_set_move_state(int,int); extern int get_ammo(int),weapon_spend_ammo(int,int); extern void hud_add_moby_marker(void *,unsigned int,void *,int,int,int,float,float,float); extern void start_equipped_item_animation(void); -extern void slot_reset_active(int); -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern void actuator_end_looping_waves(int); +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); extern float math_random_angle(void),IntToFloat(int),math_random_float_range(float,float),FastAddRotations(float,float); extern void beam_draw_ring_and_core(void *); /* The binder: func_L00_002E6EF8 in 23 programs, its twin func_L08_002F2D10 in levels 08, 09, @@ -110,7 +110,7 @@ void blitz_gun_update(char *moby) anim_start_blended_with_flags(moby,1,0,2,0); } if (g_hero_state.c0b4 == 1) - hero_l00_set_action(29,1); + hero_l00_set_move_state(29,1); vec_fast_helper_b(state); if (g_hero_state.c0b4 == 29) { unsigned int color; @@ -153,7 +153,7 @@ void blitz_gun_update(char *moby) *(int *)(state + 0x48) = 0; } start_equipped_item_animation(); - *(int *)(state + 0x4C) = slot_copy_records_to_free(g_blitz_gun_sound_records); + *(int *)(state + 0x4C) = actuator_play_waves(g_blitz_gun_rumble_waves); *(u8 *)(moby + 0x20) = 2; *(float *)(state + 0xC) = math_random_angle(); anim_start_blended(moby,2,0,0); @@ -172,7 +172,7 @@ void blitz_gun_update(char *moby) } if (!((g_pad_state.b320 & g_hero_state.b050) && get_ammo(-1) && g_hero_state.c0d8) && *(int *)(state + 0x4C) >= 0) { - slot_reset_active(*(int *)(state + 0x4C)); + actuator_end_looping_waves(*(int *)(state + 0x4C)); *(int *)(state + 0x4C) = -1; } } diff --git a/src/levels/shared/L00_003A6C30-g8.c b/src/levels/shared/L00_003A6C30-g8.c index 1e1fcec9f..46c845c7a 100644 --- a/src/levels/shared/L00_003A6C30-g8.c +++ b/src/levels/shared/L00_003A6C30-g8.c @@ -22,7 +22,7 @@ extern u8 g_item_slot_to_record[]; extern Statistics g_progress_statistics[]; extern u32 g_frame_counter; extern u32 g_current_map_index; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_lancer_sound_records_a[], g_lancer_sound_records_b[]; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_lancer_shot_rumble_waves[], g_lancer_held_rumble_waves[]; extern int g_game_l00_mode; extern float g_lancer_horizontal_arc; extern float g_lancer_range; @@ -58,7 +58,7 @@ extern float math_fabs(float); extern float IntToFloat(int); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern void anim_start_blended(void *, int, int, int); -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern void EmitParticleTrailLayers(char *); extern void part_spawn_line_at_moby(char *); extern void start_equipped_item_animation(void); @@ -66,15 +66,15 @@ extern void cancel_hero_item_animation(void); extern int gfx_add_point_light(void *, int, float, float); extern int snd_play_from_class_bank(int, int, char *, int); extern int PlayMobySound(int, int, char *); -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); -extern int slot_is_entry_nonzero(int); +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern int actuator_is_channel_active(int); extern char *CreateTargetedMovingEffect(void *, char *, char *, float); extern char *SpawnAimedShot(void *, char *, char *); extern int coll_process_hit(float, void *, int, void *, int); extern void QueueMobyImpact(void *, void *); extern void cam_compute_view_direction(void *, void *, int); extern void part_l00_spawn_spark_burst_3(void *, int, int); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern void gfx_free_point_light(int); extern void matrix_mul_vec3(void *, void *, void *); @@ -201,7 +201,7 @@ void lancer_update(char *moby) case 1: { int ready; if (HERO->i[0x2294 / 4] == 1) - hero_l00_set_action(29, 1); + hero_l00_set_move_state(29, 1); ready = 1; if (HERO->i[0x2294 / 4] == 29) { @@ -235,9 +235,9 @@ void lancer_update(char *moby) *(int *)(state + 0x28) = 10; snd_play_from_class_bank(0, 0, moby, TYPE(moby)); if (TYPE(moby) == MOBY_CLASS_LANCER) - slot_copy_records_to_free(g_lancer_sound_records_a); + actuator_play_waves(g_lancer_shot_rumble_waves); else if (*(int *)(state + 0x3C) < 0) - *(int *)(state + 0x3C) = slot_copy_records_to_free(g_lancer_sound_records_b); + *(int *)(state + 0x3C) = actuator_play_waves(g_lancer_held_rumble_waves); if (TYPE(moby) == MOBY_CLASS_LANCER) CreateTargetedMovingEffect(muzzle, moby, target, previousRange); else @@ -285,11 +285,11 @@ void lancer_update(char *moby) } if (!((g_pad_state[0x1A0 / 4] & HERO->i[0x1230 / 4]) && get_ammo(-1) && HERO->b[0x22B8])) { if (*(int *)(state + 0x3C) >= 0) { - slot_reset_active(*(int *)(state + 0x3C)); + actuator_end_looping_waves(*(int *)(state + 0x3C)); *(int *)(state + 0x3C) = -1; } } - if (*(int *)(state + 0x3C) > 0 && !slot_is_entry_nonzero(*(int *)(state + 0x3C) - 1)) + if (*(int *)(state + 0x3C) > 0 && !actuator_is_channel_active(*(int *)(state + 0x3C) - 1)) *(int *)(state + 0x3C) = -1; if (!((g_pad_state[0x1A0 / 4] & HERO->i[0x1230 / 4]) && get_ammo(-1)) && !(HERO->i[0x1D8 / 4] < 10 && HERO->b[0x22B8])) { diff --git a/src/levels/shared/L00_003B3158-lock-g8.c b/src/levels/shared/L00_003B3158-lock-g8.c index 962c0f968..b41221e61 100644 --- a/src/levels/shared/L00_003B3158-lock-g8.c +++ b/src/levels/shared/L00_003B3158-lock-g8.c @@ -88,7 +88,7 @@ extern void FastVecSub(void *,void *,void *),vec_scale_to_length(void *,void *,f extern void matrix_from_basis_rows(void *,void *),transform_vector(void *,void *,void *); extern float mat_fast_helper_a(float,float),FastAddRotations(float,float),vec_length_xy(void *); extern void moby_update_eased_node(void *,void *,int,float,float); -extern s32 hero_l00_set_action(int,int); +extern s32 hero_l00_set_move_state(int,int); extern void start_equipped_item_animation(void),cancel_hero_item_animation(void),gfx_add_draw_callback_first(void (*)(void),void *); extern void target_tether_draw_beam(void); extern int PlayMobySound(int,int,void *); @@ -200,7 +200,7 @@ void target_lock_on_update(unsigned char *object,AimState *state) } } if (state->mode==1 && g_hero_state.f2294!=28 && g_hero_state.f2294!=49) { - if (g_hero_state.f2294==1) hero_l00_set_action(29,1); + if (g_hero_state.f2294==1) hero_l00_set_move_state(29,1); if (g_hero_state.f22b4!=4) moby_update_eased_node(object,&g_target_lock_aim_angles,g_hero_state.f22b4==4?5:0,ref_L00_003B9310_02,ref_L00_003B9310_03); if (g_hero_state.f340 && !g_hero_state.f34e && !g_target_lock_disabled && !g_hero_state.f22bc && (g_pad_state.held&g_hero_state.f1230) && (g_hero_state.f1240>=16 || g_hero_state.f22b4==4)) { if (!state->held) { diff --git a/src/levels/shared/L00_003B58B8-g8.c b/src/levels/shared/L00_003B58B8-g8.c index e82cbd85d..b337b83e4 100644 --- a/src/levels/shared/L00_003B58B8-g8.c +++ b/src/levels/shared/L00_003B58B8-g8.c @@ -15,7 +15,7 @@ extern Vector g_camera_offset_vector MACRO_ADDR; extern float g_electrolyzer_turn_step __attribute__((sda)); extern void moby_set_state(unsigned char *,int,int),cam_set_mode_state(int); extern void level_start_timed_object_once(void); -extern s32 hero_l00_set_action(int,int); +extern s32 hero_l00_set_move_state(int,int); extern int ForceClaimNotice(int,int,int); extern void euler_rotation_basis(float *,float *),vec_scale_to_length(void *,void *,float),FastVecAdd(void *,void *,void *); extern float ApproachValue(float *,float,float),fast_vec_dist(void *,void *),FastVecDot(void *,void *),math_fabs(float),mat_fast_helper_a(float,float); @@ -39,7 +39,7 @@ void electrolyzer_update(unsigned char *object) case 1: break; case 2: - if(g_pad_state.pressed&0x200) {cam_set_mode_state(0);hero_l00_set_action(0,1);moby_set_state(object,1,-1);} + if(g_pad_state.pressed&0x200) {cam_set_mode_state(0);hero_l00_set_move_state(0,1);moby_set_state(object,1,-1);} level_start_timed_object_once(); object[0x31]=0;*(unsigned short *)(object+0x34)|=1; g_partial_camera_lock.active=1; diff --git a/src/levels/shared/L00_003C2FC8-g8.c b/src/levels/shared/L00_003C2FC8-g8.c index 5724b037c..66d2f60e0 100644 --- a/src/levels/shared/L00_003C2FC8-g8.c +++ b/src/levels/shared/L00_003C2FC8-g8.c @@ -17,7 +17,7 @@ struct Rac2Native_5f824a0e369ccf7b_src_record { }; extern AimQueryConfig g_nuke_l00_aim_query_config; extern AimTuning g_weapon_l00_table[]; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_mini_nuke_sound_records[]; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_mini_nuke_rumble_waves[]; extern unsigned char g_hero_state[]; extern unsigned char g_pad_state[]; extern unsigned char g_gravity_bomb_weapon_index[]; @@ -36,11 +36,11 @@ extern int coll_trace_projectile_to_impact(void *, void *, void *, void *, void extern void cancel_hero_item_animation(void); extern int weapon_spend_ammo(int, int); extern void start_equipped_item_animation(void); -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); extern int PlayMobySound(int, int, char *); extern char *mini_nuke_projectile_spawn(int, char *, char *); extern int get_ammo(int); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern int vec_fast_helper_b(void *); extern void moby_apply_active_effect(void *); extern void ref_L00_003C2FC8_00(void (*)(void *), void *); @@ -92,7 +92,7 @@ void mini_l00_nuke_update(unsigned char *object) { if (weapon_spend_ammo(-1, 1)) { g_nuke_fire_held = 1; start_equipped_item_animation(); - *(int *)(state + 0x2C) = slot_copy_records_to_free(g_mini_nuke_sound_records); + *(int *)(state + 0x2C) = actuator_play_waves(g_mini_nuke_rumble_waves); anim_start_blended_with_flags(object, 2, 0, 2, 0); mini_nuke_projectile_spawn((int)object, (char *)&position, (char *)&config); PlayMobySound(0, 0, (char *)object); @@ -106,7 +106,7 @@ void mini_l00_nuke_update(unsigned char *object) { } if (!(PAD->u[0x1A0 / 4] & H->u[0x1230 / 4]) || !get_ammo(-1) || !H->b[0x22B8]) { if (*(int *)(state + 0x2C) >= 0) { - slot_reset_active(*(int *)(state + 0x2C)); + actuator_end_looping_waves(*(int *)(state + 0x2C)); *(int *)(state + 0x2C) = -1; } } diff --git a/src/levels/shared/L00_003C3418-g16.c b/src/levels/shared/L00_003C3418-g16.c index 7618a9c6f..a9d660550 100644 --- a/src/levels/shared/L00_003C3418-g16.c +++ b/src/levels/shared/L00_003C3418-g16.c @@ -16,7 +16,7 @@ extern void moby_init_vars_once(char *); extern void moby_fire_shot(char *, void *); typedef struct { char pad00[0x54]; float rate; char pad58[0xE0 - 0x58]; } AimEntry; extern AimEntry g_weapon_l00_table[]; -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern int FastDecTimer(s16 *); extern int math_fast_float_d(int *); @@ -39,9 +39,9 @@ extern int coll_trace_projectile_to_impact(float, void *, void *, void *, void * extern void part_spawn_muzzle_spark_burst(void *, void *, void *); extern int bouncer_spawn_debris(int, int, int); struct Rac2Native_5f824a0e369ccf7b_src_record; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_sound_record; -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); -extern void slot_reset_active(void); +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_rumble_waves; +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern void actuator_end_looping_waves(void); extern void gfx_add_draw_callback_third(void (*)(void *), void *); extern void moby_draw_attached_effect(void *); @@ -60,7 +60,7 @@ void hoverbomb_gun_update(unsigned char *object) { int phase; moby_init_vars_once(object); - if (H->i[2213] == 1) hero_l00_set_action(29, 1); + if (H->i[2213] == 1) hero_l00_set_move_state(29, 1); if (H->ptr[1300] != 0) H->ptr[766] = H->ptr[1300]; if (object[0x42] == object[0x43] && (object[0x60] & 2)) anim_start_blended_with_flags(object, 1, 0, 10, 0); diff --git a/src/levels/shared/L00_003C6298-charge-g8.c b/src/levels/shared/L00_003C6298-charge-g8.c index e32f33631..07f73f4db 100644 --- a/src/levels/shared/L00_003C6298-charge-g8.c +++ b/src/levels/shared/L00_003C6298-charge-g8.c @@ -64,11 +64,11 @@ extern Moby *g_area_hit_targets[]; extern CollisionResult g_collision_result; extern WeaponEntry g_weapon_l00_table[]; extern Light g_light_table[]; -extern u8 g_charge_sound_records[]; +extern u8 g_lock_on_weapon_rumble_waves[]; extern u8 g_default_vector[] __attribute__((sda)); extern int vec_fast_helper_b(void *); -extern int hero_l00_set_action(int, int); +extern int hero_l00_set_move_state(int, int); extern int math_fast_float_d(void *); extern void FastVecScale(void *, void *, float); extern void FastVecAdd(void *, void *, void *); @@ -86,13 +86,13 @@ extern int moby_is_in_special_class_range(void *); extern int PlayMobySound(int, int, void *); extern void weapon_spawn_muzzle_burst(void *); extern void anim_start_blended_with_flags(void *, int, int, int, int); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern void matrix_mul_vec3(void *, void *, void *); extern char *pair_choose_owner_for_key(void *, void *, int, int *, int); extern void KeyOwnerTableInsert(void *, void *, int); extern Moby *SpawnAimedProjectile(void *, void *, void *, void *, float, float, float, float); extern int weapon_spend_ammo(int, int); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern void cancel_hero_item_animation(void); extern float IntToFloat(int); extern int part_l00_alloc_effect_slot_2(void *, float, float, float, float, float); @@ -127,7 +127,7 @@ void UpdateLockOnWeapon(Moby *moby) } vec_fast_helper_b(vars); if (((Hero *)g_hero_state)->i[0x2294 / 4] == 1) - hero_l00_set_action(0x1D, 1); + hero_l00_set_move_state(0x1D, 1); ready = 1; if (((Hero *)g_hero_state)->i[0x2294 / 4] == 0x1D) { if (math_fast_float_d(&((Hero *)g_hero_state)->i[0x2534 / 4]) == 0) @@ -213,7 +213,7 @@ void UpdateLockOnWeapon(Moby *moby) weapon_spawn_muzzle_burst(moby); anim_start_blended_with_flags(moby, 2, 0, 1, 0); moby->scale = 0.9f; - vars->sound = slot_copy_records_to_free(g_charge_sound_records); + vars->sound = actuator_play_waves(g_lock_on_weapon_rumble_waves); *(Quad *)offset = 0; offset[0] = 0.513000011f; offset[1] = -1.0f; @@ -248,7 +248,7 @@ void UpdateLockOnWeapon(Moby *moby) } if (!(g_pad_state[0x1A0 / 4] & ((Hero *)g_hero_state)->u[0x1230 / 4]) || ((Hero *)g_hero_state)->b[0x22B8] == 0) { if (vars->sound >= 0) { - slot_reset_active(vars->sound); + actuator_end_looping_waves(vars->sound); vars->sound = -1; cancel_hero_item_animation(); } diff --git a/src/levels/shared/L00_003C6298-gun-g8.c b/src/levels/shared/L00_003C6298-gun-g8.c index c91a06706..13cd7d63b 100644 --- a/src/levels/shared/L00_003C6298-gun-g8.c +++ b/src/levels/shared/L00_003C6298-gun-g8.c @@ -58,7 +58,7 @@ extern void anim_start_blended(void *, int, int, int); extern void start_equipped_item_animation(void); extern void cancel_hero_item_animation(void); extern void moby_transform_joint_to_world(void *, int, void *); -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern void copy_matrix3x4(void *, void *); extern void matrix_from_basis_rows(void *, void *); extern void transform_vector(void *, void *, void *); @@ -128,7 +128,7 @@ void sheepinator_update(char *owner) } if (!context->timer) context->timer = 15; moby_transform_joint_to_world(owner, 0, context); - if (g_hero_state.state == 1) hero_l00_set_action(29, 1); + if (g_hero_state.state == 1) hero_l00_set_move_state(29, 1); direction.q = 0; if (g_hero_state.state == 29 && (FIELD(g_hero_state.object, unsigned short, 0x34) & 1)) { diff --git a/src/levels/shared/L00_003D1D28-g64.c b/src/levels/shared/L00_003D1D28-g64.c index e8ca07f79..41da97341 100644 --- a/src/levels/shared/L00_003D1D28-g64.c +++ b/src/levels/shared/L00_003D1D28-g64.c @@ -46,7 +46,7 @@ extern u8 g_item_slot_to_record[]; extern u8 g_hero_weapon_id_index NOT_SDA; extern float g_strip_axis[4] NOT_SDA; extern WeaponEntry g_weapon_l00_table[]; -extern u8 g_effect_handle_records[]; +extern u8 g_spread_weapon_rumble_waves[]; extern u8 g_default_vector[] MACRO_ADDR; typedef struct { u8 pad[0x160]; float f160; int pad164; int i168; int i16C; float f170; int pad174; int i178; } Shake; extern Shake g_scalar_transition_state; @@ -72,8 +72,8 @@ extern void hud_add_moby_marker(void *, float, u32, void *, int, float, int, flo extern void cancel_hero_item_animation(void); extern void start_equipped_item_animation(void); extern void anim_start_blended_with_flags(void *, int, int, int, int); -extern int slot_copy_records_to_free(void *); -extern void slot_reset_active(int); +extern int actuator_play_waves(void *); +extern void actuator_end_looping_waves(int); extern float math_random_angle(void); extern float IntToFloat(int); extern int PlayMobySound(int, int, void *); @@ -172,7 +172,7 @@ void UpdateSpreadWeapon(u8 *self) st->t6 = 2; } start_equipped_item_animation(); - st->handle = slot_copy_records_to_free(g_effect_handle_records); + st->handle = actuator_play_waves(g_spread_weapon_rumble_waves); anim_start_blended_with_flags(self, 2, 0, 2, 0); st->t4C = g_effect_state_param; self[0x20] = 2; @@ -192,7 +192,7 @@ void UpdateSpreadWeapon(u8 *self) } if (!(((Hero *)g_pad_state)->i[0x1A0 / 4] & ((Hero *)g_hero_state)->i[0x1230 / 4]) || !get_ammo(-1) || ((Hero *)g_hero_state)->b[0x22B8] == 0) { if (st->handle >= 0) { - slot_reset_active(st->handle); + actuator_end_looping_waves(st->handle); st->handle = -1; } } diff --git a/src/levels/shared/L00_003E3A18-g8.c b/src/levels/shared/L00_003E3A18-g8.c index f3cbd67cc..f8f53efbf 100644 --- a/src/levels/shared/L00_003E3A18-g8.c +++ b/src/levels/shared/L00_003E3A18-g8.c @@ -48,7 +48,7 @@ extern unsigned char g_beam_weapon_index NOT_SDA; extern UpdateTuning g_weapon_l00_table[]; typedef struct { float red, green, blue, unused; UpdateVector position; } ScopeLight; extern ScopeLight g_light_table[]; -extern char g_vaporizer_sound_records[]; +extern char g_vaporizer_rumble_waves[]; extern void anim_start_blended_with_flags(char *, int, int, int, int); extern void cam_set_value_target(int, int, float, float, float, float); extern void gfx_free_point_light(int); @@ -67,14 +67,14 @@ extern int *level_get_slot_header(int, int); extern char *mem_round_up_to_16(char *); extern void mem_fast_helper_b(void *, int); extern void ref_L00_003E3A18_00(int); -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern int math_fast_float_d(int *); extern int weapon_spend_ammo(int, int); extern void start_equipped_item_animation(void); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern void anim_start_blended(char *, int, int, int); extern int PlayMobySound(int, int, char *); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern int FastDecTimer(short *); extern void AimAndSpawnBeamWithMuzzleFlashes(char *); extern int vec_fast_helper_b(float *); @@ -213,7 +213,7 @@ void vaporizer_update(u8 *object) if (data->resource >= 0) ref_L00_003E3A18_00(data->resource); break; case 1: - if (g_hero_state.mode == 1) hero_l00_set_action(29, 1); + if (g_hero_state.mode == 1) hero_l00_set_move_state(29, 1); if (g_hero_state.scope) { if (data->scoped == 0) g_render_state_word = 0; data->scoped = 1; @@ -247,14 +247,14 @@ void vaporizer_update(u8 *object) if (g_hero_state.blocked == 0 && (g_pad_state[0x1A4/4] & g_hero_state.input) && canFire) { if (weapon_spend_ammo(-1, 1)) { start_equipped_item_animation(); - data->sound = slot_copy_records_to_free(g_vaporizer_sound_records); + data->sound = actuator_play_waves(g_vaporizer_rumble_waves); data->firingDelay = 2; object[0x20] = 2; anim_start_blended(object, 2, 0, 0); } else PlayMobySound(1, 0, object); if ((g_pad_state[0x1A0/4] & g_hero_state.input) && get_ammo(-1) && g_hero_state.active) break; if (data->sound >= 0) { - slot_reset_active(data->sound); + actuator_end_looping_waves(data->sound); data->sound = -1; } } diff --git a/src/levels/shared/L00_003E8180-g8.c b/src/levels/shared/L00_003E8180-g8.c index c2f90c1be..6a697e9fe 100644 --- a/src/levels/shared/L00_003E8180-g8.c +++ b/src/levels/shared/L00_003E8180-g8.c @@ -55,7 +55,7 @@ extern int AcquireEntitySlot(void *,int,void *); extern u8 *level_get_slot_body(int,int); extern float math_random_signed_float_range(float,float), math_random_float_range(float,float); extern void vec_clear_128(void *), sheepinator_clear_records(void); -extern s32 hero_l00_set_action(int,int); +extern s32 hero_l00_set_move_state(int,int); extern int math_fast_float_d(void *), get_ammo(int); extern void hud_add_moby_marker(void *,unsigned int,float,void *,float,int,int,float,int); extern void moby_transform_joint_to_world(void *,int,void *); @@ -124,7 +124,7 @@ void UpdateChargedWeapon(ChargeWeaponMoby *obj) { g_charge_weapon_effects.reticle=-1; if (g_hero_state.selected) g_hero_state.held=g_hero_state.selected; if (!g_charge_weapon_initialized) g_charge_weapon_initialized=1; - if (g_hero_state.mode==1) hero_l00_set_action(29,1); + if (g_hero_state.mode==1) hero_l00_set_move_state(29,1); enabled=1; if (g_hero_state.mode==29) { if (!math_fast_float_d(&g_hero_state.timer)) enabled=0; diff --git a/src/levels/shared/L00_003EE4C0-g8.c b/src/levels/shared/L00_003EE4C0-g8.c index b12b02e7f..a0accfa27 100644 --- a/src/levels/shared/L00_003EE4C0-g8.c +++ b/src/levels/shared/L00_003EE4C0-g8.c @@ -16,7 +16,7 @@ struct Rac2Native_5f824a0e369ccf7b_src_record { }; extern AimQueryConfig g_gravity_bomb_aim_config; extern AimTuning g_weapon_l00_table[]; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_gravity_bomb_sound_records[]; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_gravity_bomb_rumble_waves[]; extern unsigned char g_hero_state[]; extern unsigned char g_pad_state[]; extern unsigned char g_gravity_bomb_weapon_index[]; @@ -35,11 +35,11 @@ extern int coll_trace_projectile_to_impact(void *, void *, void *, void *, void extern void cancel_hero_item_animation(void); extern int weapon_spend_ammo(int, int); extern void start_equipped_item_animation(void); -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); extern int PlayMobySound(int, int, char *); extern char *gravity_bomb_spawn_projectile(int, char *, char *); extern int get_ammo(int); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern int vec_fast_helper_b(void *); extern void weapon_draw_aim_effect(void *); extern void ref_L00_003EE4C0_00(void (*)(void *), void *); @@ -90,7 +90,7 @@ void gravity_bomb_launcher_update(unsigned char *object) { if (weapon_spend_ammo(-1, 1)) { g_gravity_bomb_fire_held = 1; start_equipped_item_animation(); - *(int *)(state + 0x2C) = slot_copy_records_to_free(g_gravity_bomb_sound_records); + *(int *)(state + 0x2C) = actuator_play_waves(g_gravity_bomb_rumble_waves); anim_start_blended_with_flags(object, 2, 0, 2, 0); gravity_bomb_spawn_projectile((int)object, (char *)&position, (char *)&config); PlayMobySound(0, 0, (char *)object); @@ -104,7 +104,7 @@ void gravity_bomb_launcher_update(unsigned char *object) { } if (!(PAD->u[0x1A0 / 4] & H->u[0x1230 / 4]) || !get_ammo(-1) || !H->b[0x22B8]) { if (*(int *)(state + 0x2C) >= 0) { - slot_reset_active(*(int *)(state + 0x2C)); + actuator_end_looping_waves(*(int *)(state + 0x2C)); *(int *)(state + 0x2C) = -1; } } diff --git a/src/levels/shared/L00_003F3D70-g8.c b/src/levels/shared/L00_003F3D70-g8.c index 5505ac461..5018504de 100644 --- a/src/levels/shared/L00_003F3D70-g8.c +++ b/src/levels/shared/L00_003F3D70-g8.c @@ -17,7 +17,7 @@ extern float g_hk22_speed_scale __attribute__((sda)); extern float g_weapon_effect_scale[]; extern void ReleaseDeadOrExpiredSlots(void *); extern void anim_start_blended_with_flags(void *, int, int, int, int); -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern void hud_add_moby_marker(void *, unsigned int, int, int, int, int, float, float, float); extern int math_fast_float_d(void *); extern int vec_fast_helper_b(void *); @@ -52,7 +52,7 @@ void hk22_update(unsigned char *object) { *(float *)(object + 0x2C) = *(float *)(*(char **)(object + 0x24) + 0x24) * g_hk22_speed_scale; g_weapon_effect_scale[0] = 0.1f; if (H->i[2213] == 1) - hero_l00_set_action(0x1D, 1); + hero_l00_set_move_state(0x1D, 1); if (H->i[2213] == 0x1D) { if (*(float *)state > 0.0f && get_ammo(-1)) color = 0x600000FF; diff --git a/src/levels/shared/L00_003FDE48-g8.c b/src/levels/shared/L00_003FDE48-g8.c index f88bc3c0f..3f8ee0665 100644 --- a/src/levels/shared/L00_003FDE48-g8.c +++ b/src/levels/shared/L00_003FDE48-g8.c @@ -33,7 +33,7 @@ extern int g_spread_shot_count __attribute__((sda)); typedef struct { char pad00[0x54]; float rate; char pad58[0xE0 - 0x58]; } AimEntry; extern AimEntry g_weapon_l00_table[]; extern void moby_init_private_data(char *); -extern s32 hero_l00_set_action(int a0, int a1); +extern s32 hero_l00_set_move_state(int a0, int a1); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern int FastDecTimer(s16 *); extern int math_fast_float_d(int *); @@ -58,9 +58,9 @@ extern int coll_trace_projectile_to_impact(float, void *, void *, void *, void * extern void part_spawn_muzzle_spark_burst(void *, void *, void *); extern int bouncer_spawn_debris(int, int, int); struct Rac2Native_5f824a0e369ccf7b_src_record; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_sound_record; -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); -extern void slot_reset_active(int); +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_rumble_waves; +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern void actuator_end_looping_waves(int); extern void ref_L00_003FDE48_00(void *, void *); extern void moby_draw_attached_effect(void *); @@ -85,7 +85,7 @@ void bouncer_update(unsigned char *object) { *(int *)(state + 0x2C) = 0; g_bouncer_timer = 20; } - if (g_hero_state.level == 1) hero_l00_set_action(29, 1); + if (g_hero_state.level == 1) hero_l00_set_move_state(29, 1); if (object[0x42] == object[0x43] && (object[0x60] & 2)) anim_start_blended_with_flags(object, 1, 0, 2, 0); moby_compute_offset_point(object, (char *)origin); target = 0; @@ -118,12 +118,12 @@ void bouncer_update(unsigned char *object) { bouncer_spawn_debris((int)object, (int)origin, (int)aim); start_equipped_item_animation(); *(int *)(state + 0x2C) = 16; - *(int *)(state + 0x28) = slot_copy_records_to_free(&g_bouncer_sound_record); + *(int *)(state + 0x28) = actuator_play_waves(&g_bouncer_rumble_waves); } if (!(g_pad_state.held & g_hero_state.buttons) || !get_ammo(-1) || g_hero_state.f22B8 == 0) { handle = *(int *)(state + 0x28); if (handle >= 0) { - slot_reset_active(handle); + actuator_end_looping_waves(handle); *(int *)(state + 0x28) = -1; } } diff --git a/src/levels/shared/L00_003FE4C8-g16.c b/src/levels/shared/L00_003FE4C8-g16.c index 151ae93a8..8e834b108 100644 --- a/src/levels/shared/L00_003FE4C8-g16.c +++ b/src/levels/shared/L00_003FE4C8-g16.c @@ -19,7 +19,7 @@ extern int g_spread_shot_count __attribute__((sda)); typedef struct { char pad00[0x54]; float rate; char pad58[0xE0 - 0x58]; } AimEntry; extern AimEntry g_weapon_l00_table[]; extern void moby_init_private_data(char *); -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern int FastDecTimer(s16 *); extern int math_fast_float_d(int *); @@ -44,9 +44,9 @@ extern int coll_trace_projectile_to_impact(float, void *, void *, void *, void * extern void part_spawn_muzzle_spark_burst(void *, void *, void *); extern int bouncer_spawn_debris(int, int, int); struct Rac2Native_5f824a0e369ccf7b_src_record; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_sound_record; -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); -extern void slot_reset_active(void); +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_rumble_waves; +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern void actuator_end_looping_waves(void); extern void gfx_add_draw_callback_third(void (*)(void *), void *); extern void moby_draw_attached_effect(void *); @@ -71,7 +71,7 @@ void tetrabomb_gun_update(unsigned char *object) { int phase; moby_init_private_data(object); - if (H->i[2213] == 1) hero_l00_set_action(29, 1); + if (H->i[2213] == 1) hero_l00_set_move_state(29, 1); if (H->ptr[1300] != 0) H->ptr[766] = H->ptr[1300]; if (object[0x42] == object[0x43] && (object[0x60] & 2)) anim_start_blended_with_flags(object, 1, 0, 6, 0); diff --git a/src/levels/shared/L00_003FFA70-reaction-g8.c b/src/levels/shared/L00_003FFA70-reaction-g8.c index fd25f32b9..2935792fd 100644 --- a/src/levels/shared/L00_003FFA70-reaction-g8.c +++ b/src/levels/shared/L00_003FFA70-reaction-g8.c @@ -21,7 +21,7 @@ extern void mem_fast_helper_b(void *, int); extern int math_fast_float_d(void *); extern int get_ammo(int); extern void start_equipped_item_animation(void); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern int PlayMobySound(int, int, char *); extern void vec_scale_to_length(void *, void *, float); extern char *spark_effect_spawn(void *, int, char *); @@ -58,7 +58,7 @@ extern int g_charging_weapon_initial_value __attribute__((sda)); extern unsigned char g_charging_weapon_index __attribute__((nosda)); extern RateEntry g_weapon_l00_table[]; extern float g_weapon_effect_scale __attribute__((nosda)); -extern char g_charging_weapon_sound_records[]; +extern char g_charging_weapon_rumble_waves[]; extern char g_cam_follow_matrix[]; #define I(p, n) (*(int *)((char *)(p) + (n))) @@ -97,7 +97,7 @@ void charging_weapon_update(char *object) } if (get_ammo(-1)) { start_equipped_item_animation(); - I(vars, 24) = slot_copy_records_to_free(g_charging_weapon_sound_records); + I(vars, 24) = actuator_play_waves(g_charging_weapon_rumble_waves); B(object, 32) = 2; I(vars, 4) = g_charging_weapon_initial_value; } else { diff --git a/src/levels/shared/L00_003FFBA0-g8.c b/src/levels/shared/L00_003FFBA0-g8.c index 52c8be749..bae9168a1 100644 --- a/src/levels/shared/L00_003FFBA0-g8.c +++ b/src/levels/shared/L00_003FFBA0-g8.c @@ -69,7 +69,7 @@ extern void part_steer_effect_direction(int, void *, int); extern void vec_transform_or_copy(void *, void *); extern void shop_trigger_current_state_effect(void *, void *); extern void vec_add_object_direction_scaled(void *, void *, float); -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern void part_setup_object_effect_entry(void *, void *, void *); extern void anim_start_blended(void *, int, int, int); extern int PlayMobySound(int, int, void *); @@ -179,7 +179,7 @@ void UpdateTimedGroundActor(char *obj) break; qcopy(obj + 0x10, &collision->point); ForceClaimNotice(6, 0, 1); - hero_l00_set_action(28, 1); + hero_l00_set_move_state(28, 1); part_setup_object_effect_entry(obj + 0x10, obj + 0xF0, obj); STATE(obj) = 2; anim_start_blended(obj, 1, 0, 10); @@ -281,7 +281,7 @@ void UpdateTimedGroundActor(char *obj) break; case 8: if (g_game_mode == 28) - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); if (*(short *)(g_follow_camera_object + 0x86) == 27) ref_L00_003FFBA0_00(); table_clear_entry_flag(update_handle); diff --git a/src/levels/shared/L00_00405808-g8.c b/src/levels/shared/L00_00405808-g8.c index debf8b1c4..88e1e5ceb 100644 --- a/src/levels/shared/L00_00405808-g8.c +++ b/src/levels/shared/L00_00405808-g8.c @@ -49,7 +49,7 @@ extern int FastDecTimer(void *); extern void anim_start_blended(void *,int,int,int); extern void matrix_mul_vec3(void *,void *,void *); extern void FastVecAdd(void *,void *,void *); -extern s32 hero_l00_set_action(int,int); +extern s32 hero_l00_set_move_state(int,int); extern void copy_matrix3x4(void *,void *); extern void matrix_from_basis_rows(void *,void *); extern void transform_vector(void *,void *,void *); @@ -115,7 +115,7 @@ void MorphorayUpdate(char *object) offset.x=0.15f; offset.y=-1.0f; offset.z=0.06f; offset.w=1.0f; matrix_mul_vec3(&offset,&offset,object+0xc0); FastVecAdd(state,object+0x10,&offset); - if (g_hero_state.current==1) hero_l00_set_action(29,1); + if (g_hero_state.current==1) hero_l00_set_move_state(29,1); *(Quad *)&direction=0; if (g_hero_state.current==29 && (U(g_hero_state.object,0x34)&1)) { copy_matrix3x4(matrix,g_scalar_transition_state); diff --git a/src/levels/shared/L00_0040F6A0-g16.c b/src/levels/shared/L00_0040F6A0-g16.c index a94bd4a51..bffa3090e 100644 --- a/src/levels/shared/L00_0040F6A0-g16.c +++ b/src/levels/shared/L00_0040F6A0-g16.c @@ -65,9 +65,9 @@ extern float g_camera_l00_position[]; extern Moby *g_area_hit_targets[]; extern CollisionResult g_collision_result; extern WeaponEntry g_weapon_table_2[]; -extern u8 g_megarocket_sound_records[]; +extern u8 g_megarocket_rumble_waves[]; -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern void matrix_mul_vec3(void *, void *, void *); extern void FastVecAdd(void *, void *, void *); extern void FastVecScale(void *, void *, float); @@ -96,9 +96,9 @@ extern int coll_process_hit(float, void *, int, void *, void *); extern void SpawnOrientedParticleBursts(Moby *, int); extern void charge_shot_start_effect(Moby *, Vector *, int); extern void start_equipped_item_animation(void); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern int subtitle_request_voice_line(int, int); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern void sequenced_child_spawn(Moby *, Vector *); extern void light_flash_update(Moby *, Vector *); @@ -130,7 +130,7 @@ void megarocket_cannon_update(Moby *moby) vars->chargeSound = -1; } if (HERO->i[0x2294 / 4] == 1) - hero_l00_set_action(0x1D, 1); + hero_l00_set_move_state(0x1D, 1); matrix_mul_vec3(&nozzle, &g_megarocket_nozzle_offset, &moby->right); FastVecAdd(&nozzle, &nozzle, &moby->position); if (HERO->i[0x1450 / 4] != 0) @@ -299,7 +299,7 @@ void megarocket_cannon_update(Moby *moby) charge_shot_start_effect(moby, &nozzle, charged); anim_start_blended_with_flags(moby, 2, 0, 2, 0); start_equipped_item_animation(); - vars->sound = slot_copy_records_to_free(g_megarocket_sound_records); + vars->sound = actuator_play_waves(g_megarocket_rumble_waves); if (charged) g_subtitle_history[0x3A8 / 2] = 0xFFFF; else if (g_subtitle_history[0x3A8 / 2] < 40 && ++g_subtitle_history[0x3A8 / 2] == 40) @@ -307,7 +307,7 @@ void megarocket_cannon_update(Moby *moby) } if (!((g_pad_state[0x1A0 / 4] & HERO->u[0x1230 / 4]) && get_ammo(-1) && HERO->b[0x22B8]) && vars->sound >= 0) { - slot_reset_active(vars->sound); + actuator_end_looping_waves(vars->sound); vars->sound = -1; } { diff --git a/src/levels/shared/L00_00419C98-g8.c b/src/levels/shared/L00_00419C98-g8.c index 932bc2202..e7f264daf 100644 --- a/src/levels/shared/L00_00419C98-g8.c +++ b/src/levels/shared/L00_00419C98-g8.c @@ -40,7 +40,7 @@ extern void vec_scale_to_length(void *, void *, float); extern void make_hit_descriptor(void *, char *, int, void *, float); extern void QueueMobyImpact(char *, void *); extern int StartAttachedEffect(char *, int, char *); -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern void vec_clear_128(void *); extern void matrix_mul_vec3(void *, void *, void *); extern void vec_compute_object_to_target(char *, char *, void *, float); @@ -117,7 +117,7 @@ void lava_l00_gun_update(char *object) math_spring_float_to_goal((float *)(state+0x50),(float *)(state+0x54),0,0.06f,0.01f,0.125f); *(int *)(state+0x60)=0; } - if (g_hero_state.i[0x2294/4]==1) hero_l00_set_action(29,1); + if (g_hero_state.i[0x2294/4]==1) hero_l00_set_move_state(29,1); moby_transform_joint_to_world(object,0,state); vec_clear_128(vector); vector[1]=-1; matrix_mul_vec3(vector,vector,object+0xc0); diff --git a/src/levels/shared/L00_00426340.c b/src/levels/shared/L00_00426340.c index 756e435b7..2d17db80e 100644 --- a/src/levels/shared/L00_00426340.c +++ b/src/levels/shared/L00_00426340.c @@ -8,7 +8,7 @@ typedef struct { u8 pad[0x194]; InitQuad *transform; } PathCamera; extern PathCamera g_scalar_transition_state; extern float mat_fast_helper_a(float x, float y); extern void vec_clear_128(InitQuad *v); -extern int hero_l00_set_action(int event, int value); +extern int hero_l00_set_move_state(int event, int value); /* Partial records follow only the fields used by the two path walks. * Retail reserves eight weight/index slots and assumes at most eight accepted * entries; it does not add a bounds check to the path scan. */ @@ -730,7 +730,7 @@ void InitPathMotion(u8 *object) qcopy(object + 0x10, transform + 1); qcopy(object + 0x20, transform + 2); if (data->eventGate == 0) - hero_l00_set_action(0x6f, 1); + hero_l00_set_move_state(0x6f, 1); data->initialized = 1; } diff --git a/src/levels/shared/L00_00429568-g.c b/src/levels/shared/L00_00429568-g.c index d0fbfca3e..1f952539e 100644 --- a/src/levels/shared/L00_00429568-g.c +++ b/src/levels/shared/L00_00429568-g.c @@ -23,7 +23,7 @@ void FastVecCross(void *,void *,void *); float math_fast_sin_or_cos_b(float); float math_fast_sin_or_cos_a(float); void UpdateViewContext(void); -s32 hero_l00_set_action(int,int); +s32 hero_l00_set_move_state(int,int); int Spline_AdvanceByDistance(void *,void *,int *,float *,float,int); int FastDecTimer(void *); float math_cosine_blend(float,float,float); @@ -107,7 +107,7 @@ void cam_path_update_cinematic(char *moby) { *(short *)(moby + 0x7E) = 4; g_cam_path_cinematic_flag = 0; if (*(int *)(desc + 0x4C) == 0) { - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); } } if (*(int *)(desc + 0x40) == 0) { diff --git a/src/levels/shared/L02_002B5F50-reset.c b/src/levels/shared/L02_002B5F50-reset.c index 9293e888d..7dbba2d82 100644 --- a/src/levels/shared/L02_002B5F50-reset.c +++ b/src/levels/shared/L02_002B5F50-reset.c @@ -32,7 +32,7 @@ extern void hero_clear_queued_anim(void); extern int anim_copy_entry_data(char *a0, int a1, int a2, char *a3); -extern s32 hero_l00_set_action(int a0, int a1); +extern s32 hero_l00_set_move_state(int a0, int a1); /* Clears the hero's carried objects and state, then restores the normal setup. */ void hero_reset_carried_objects(void) { @@ -85,5 +85,5 @@ void hero_reset_carried_objects(void) { *(int *)(*(char **)(hero + 0x2290) + 0x5C) = handle; if (*(int *)(hero + 0x2294) != 0x61 || (g_area_start_mode != 2 && g_area_start_mode != 6)) - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); } diff --git a/src/levels/shared/L02_003C26F0-g16.c b/src/levels/shared/L02_003C26F0-g16.c index c990c23cd..95b85b927 100644 --- a/src/levels/shared/L02_003C26F0-g16.c +++ b/src/levels/shared/L02_003C26F0-g16.c @@ -116,7 +116,7 @@ extern void LoadClassIntoFreeCacheSlot(int); extern int ForceClaimNotice(int, int, int); extern void object_copy_vector_to_selected(const void *), cam_set_state_rotation(const void *); extern void SetCamera5Pose(const void *, const void *, int, int, int); -extern int hero_l00_set_action(int, int); +extern int hero_l00_set_move_state(int, int); extern void set_hero_animation(int, int, float); extern void script_queue_keyed_request(int, int); extern void AdvancePathFollower(char *, int); @@ -256,7 +256,7 @@ void challenge_controller_update(u8 *object) g_hero_state.controlMode = 3; status = hero_get_target_state_kind(); if (status == 2 && g_hero_state.object[0x42] == g_hero_state.object[0x43]) { - hero_l00_set_action(0x6F, 0); + hero_l00_set_move_state(0x6F, 0); set_hero_animation(0x54, 0, 7.0f); position.f[0] = math_fast_sin_or_cos_a(*(float *)(object + 0xF8)) * 3.0f; position.f[1] = math_fast_sin_or_cos_b(*(float *)(object + 0xF8)) * 3.0f; @@ -361,7 +361,7 @@ void challenge_controller_update(u8 *object) char *actors; u16 *list; ForceClaimNotice(1, 0, 1); - hero_l00_set_action(0x6F, 1); + hero_l00_set_move_state(0x6F, 1); record = g_matrix_l02_record_table + state->record * 0x80; if (fast_vec_dist(&g_camera_l02_position.from, record + 0x30) <= 1.0f) { if (g_arena_state_words == 7) { @@ -383,7 +383,7 @@ void challenge_controller_update(u8 *object) break; cam_set_mode_state(3); g_hero_state.cameraRequest = state->savedCamera; - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); g_hero_state.cameraRequest = state->savedCamera; if (state->restoreMode != -1) cam_reset_entry(state->restoreMode); @@ -408,7 +408,7 @@ void challenge_controller_update(u8 *object) g_hero_state.cameraRequest = state->savedCamera; cam_set_mode_state(3); g_hero_state.cameraRequest = state->savedCamera; - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -480,7 +480,7 @@ void challenge_controller_update(u8 *object) break; cam_set_mode_state(3); g_hero_state.cameraRequest = state->savedCamera; - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -527,7 +527,7 @@ void challenge_controller_update(u8 *object) } cam_set_mode_state(3); g_hero_state.cameraRequest = state->savedCamera; - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -559,7 +559,7 @@ void challenge_controller_update(u8 *object) } cam_set_mode_state(3); g_hero_state.cameraRequest = state->savedCamera; - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -584,7 +584,7 @@ void challenge_controller_update(u8 *object) } else if (g_pad_state.buttons.word.high & 0x10) { cam_set_mode_state(3); g_hero_state.cameraRequest = state->savedCamera; - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -631,7 +631,7 @@ void challenge_controller_update(u8 *object) break; cam_set_mode_state(3); g_hero_state.cameraRequest = state->savedCamera; - hero_l00_set_action(0, 1); + hero_l00_set_move_state(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); diff --git a/src/levels/shared/L02_00410450-controller-g8.c b/src/levels/shared/L02_00410450-controller-g8.c index d72769f54..ff3caf316 100644 --- a/src/levels/shared/L02_00410450-controller-g8.c +++ b/src/levels/shared/L02_00410450-controller-g8.c @@ -22,7 +22,7 @@ extern int PlayMobySound(int,int,char *); extern void hero_start_target_state(Quad *,int,float); extern int coll_sweep_from_object(void *,float,float *,int,float,float,int,int,int); extern int hero_get_target_state_kind(void); -extern int hero_l00_set_action(int,int); +extern int hero_l00_set_move_state(int,int); extern void gfx_add_draw_callback_first(DrawCallback,void *); extern void gfx_add_draw_callback_third(DrawCallback,void *); extern float ApproachValue(float *,float,float); @@ -110,7 +110,7 @@ void teleporter_l02_update(u8 *object) } else if(state->orbitB<1.0f) { math_step_value_toward_target(&state->orbitB,&state->rateB,1.0f,g_teleporter_orbit_speed*0.00027777778f,g_teleporter_orbit_accel*0.00027777778f,g_teleporter_orbit_rate_limit*0.016666668f); } else if(g_teleporter_state!=11 || !(state->orbitA>0.25f)) { - if(answer==2) {hero_l00_set_action(0x6F,1);state->timer=1.95f;object[0x20]=3;} + if(answer==2) {hero_l00_set_move_state(0x6F,1);state->timer=1.95f;object[0x20]=3;} else if(answer==0) object[0x20]=4; } teleporter_update_orbiting_children(object); diff --git a/src/levels/shared/L03_003E4680-g8.c b/src/levels/shared/L03_003E4680-g8.c index 909c7e779..ee13d9b4e 100644 --- a/src/levels/shared/L03_003E4680-g8.c +++ b/src/levels/shared/L03_003E4680-g8.c @@ -50,7 +50,7 @@ extern void infiltrator_ball_spawn_for_moby(char *),moby_update_attached_child(c extern int ForceClaimNotice(int,int,int); extern int load_is_class_cached(int); extern void LoadClassIntoFreeCacheSlot(int),hero_start_loader_state(int); -extern int hero_l03_enter_state(int,int); +extern int hero_l03_set_move_state(int,int); extern void matrix_mul_vec3(void *,void *,void *),FastVecAdd(void *,void *,void *),FastVecSub(void *,void *,void *); extern float FastAddRotations(float,float),mat_fast_helper_a(float,float),vec_distance_xy(void *,void *); extern void hero_start_target_state(void *,int,float); @@ -152,7 +152,7 @@ void infiltrator_lock_update(char *obj) { case 3: if (flag_set_first_pending(obj)) { PlayMobySound(0,0,obj); - hero_l03_enter_state(0x6F,0);set_hero_animation(0x54,0,20.0f); + hero_l03_set_move_state(0x6F,0);set_hero_animation(0x54,0,20.0f); FastVecSub(vec,g_camera_pose_buffer,g_hero_state.position); matrix_mul_vec3(vec,vec,g_hero_state.matrix40); SetCamera5Pose(g_camera_pose_buffer,g_camera_pose_buffer,3,120,0); diff --git a/src/levels/shared/L04_002CC748.c b/src/levels/shared/L04_002CC748.c index 9e2862cf4..76409663e 100644 --- a/src/levels/shared/L04_002CC748.c +++ b/src/levels/shared/L04_002CC748.c @@ -23,7 +23,7 @@ extern float fade_reduce_value(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(f32 *,f32 *,f32 *); extern void hero_build_relative_point(void *,int,float,float,float); -extern s32 hero_l04_enter_state(int,int); +extern s32 hero_l04_set_move_state(int,int); extern char *part_find_owned_effect_slot(void *,int,int); extern void AdjustPlayerHealth(int); extern int hero_play_sound(int,int); @@ -267,7 +267,7 @@ int hero_check_surface_contact(int update) { if (!GROUND_HERO.b[0x22B4]) { char *surface_moby = GROUND_HERO.p[0x249C / 4]; if (surface_moby && (AH(surface_moby, 0xAA) == 0x4EB /* moby class 1259 */ || AH(surface_moby, 0xAA) == 0x558 /* moby class 1368 */)) { - hero_l04_enter_state(0x7D, 1); + hero_l04_set_move_state(0x7D, 1); return 1; } if ((GROUND_HERO.i[0x2294 / 4] == 1 || @@ -275,16 +275,16 @@ int hero_check_surface_contact(int update) { !(AI(surface_entry, 0x24) & 8)) { char *surface_moby = part_find_owned_effect_slot(GROUND_HERO.p[0x2290 / 4], 1, 0); if (surface_moby) AdjustPlayerHealth(FloatToInt(AF(surface_moby, 0x2C))); - if (!GROUND_HERO.i[0x24CC / 4]) hero_l04_enter_state(0x16, 1); + if (!GROUND_HERO.i[0x24CC / 4]) hero_l04_set_move_state(0x16, 1); GROUND_HERO.h[0x1DC / 2] = 0x4D; if (!GROUND_HERO.h[0x21C / 2]) GROUND_HERO.h[0x21C / 2] = 0x12; hero_play_sound(20, 0); return 0; } - if (GROUND_HERO.i[0x229C / 4] == 0x12) hero_l04_enter_state(0x72, 1); - else if (GROUND_HERO.i[0x229C / 4] == 0x11) hero_l04_enter_state(0x73, 1); - else if (AI(surface_entry, 0x24) & 8) hero_l04_enter_state(0x8C, 1); - else hero_l04_enter_state(0x16, 1); + if (GROUND_HERO.i[0x229C / 4] == 0x12) hero_l04_set_move_state(0x72, 1); + else if (GROUND_HERO.i[0x229C / 4] == 0x11) hero_l04_set_move_state(0x73, 1); + else if (AI(surface_entry, 0x24) & 8) hero_l04_set_move_state(0x8C, 1); + else hero_l04_set_move_state(0x16, 1); if (GROUND_HERO.i[0x2294 / 4] == 0x8C) { qzero(&delta); } else { diff --git a/src/levels/shared/L04_003EE7C0-g8.c b/src/levels/shared/L04_003EE7C0-g8.c index 0031be2f6..45a2f96e1 100644 --- a/src/levels/shared/L04_003EE7C0-g8.c +++ b/src/levels/shared/L04_003EE7C0-g8.c @@ -16,7 +16,7 @@ struct Rac2Native_5f824a0e369ccf7b_src_record { }; extern AimQueryConfig g_nuke_l04_aim_query_config; extern AimTuning g_item_l04_record_table[]; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_nuke_src_records[]; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_mini_nuke_l04_rumble_waves[]; extern unsigned char g_hero_state[]; extern unsigned char g_pad_state[]; extern unsigned char g_gravity_bomb_weapon_index[]; @@ -35,11 +35,11 @@ extern int coll_trace_projectile_to_impact(void *, void *, void *, void *, void extern void cancel_hero_item_animation(void); extern int weapon_spend_ammo(int, int); extern void start_equipped_item_animation(void); -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); extern int PlayMobySound(int, int, char *); extern char *mini_nuke_projectile_spawn(int, char *, char *); extern int get_ammo(int); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern int vec_fast_helper_b(void *); extern void moby_apply_active_effect(void *); extern void gfx_add_draw_callback_third(void (*)(void *), void *); @@ -91,7 +91,7 @@ void mini_l04_nuke_update(unsigned char *moby) { if (weapon_spend_ammo(-1, 1)) { g_nuke_pressed_flag = 1; start_equipped_item_animation(); - *(int *)(vars + 0x2C) = slot_copy_records_to_free(g_nuke_src_records); + *(int *)(vars + 0x2C) = actuator_play_waves(g_mini_nuke_l04_rumble_waves); anim_start_blended_with_flags(moby, 2, 0, 2, 0); mini_nuke_projectile_spawn((int)moby, (char *)&position, (char *)&config); PlayMobySound(0, 0, (char *)moby); @@ -105,7 +105,7 @@ void mini_l04_nuke_update(unsigned char *moby) { } if (!(PAD->u[0x1A0 / 4] & H->u[0x1230 / 4]) || !get_ammo(-1) || !H->b[0x22B8]) { if (*(int *)(vars + 0x2C) >= 0) { - slot_reset_active(*(int *)(vars + 0x2C)); + actuator_end_looping_waves(*(int *)(vars + 0x2C)); *(int *)(vars + 0x2C) = -1; } } diff --git a/src/levels/shared/L04_00402D90-g8.c b/src/levels/shared/L04_00402D90-g8.c index 1065850fe..369a2bd4c 100644 --- a/src/levels/shared/L04_00402D90-g8.c +++ b/src/levels/shared/L04_00402D90-g8.c @@ -169,7 +169,7 @@ extern void add_vectors(void *,void *,void *); extern unsigned char *SpawnHomingShot(void *,void *,void *,int); extern int PlayMobySound(int,int,void *); extern unsigned char *bike_find_aim_target(void *,void *,void *,void *,void *,void *,float,float); -extern int queue_copy_record_by_index(int); +extern int actuator_play_pattern(int); extern void * homing_rocket_spawn(void *,void *,void *,float,float,float,float,float); extern void * shield_dome_spawn(void *,void *); /* Lets the racer pick up item boxes and fire its chosen weapon: shots, homing rockets or a dome blast. */ @@ -233,7 +233,7 @@ void racer_update_item_use(unsigned char *racer) FastVecSub(delta,origin,target+16); if(func_L00_002EE290(delta)<25) {pitch=aimPitch;yaw=aimYaw;} } else {aimPitch=pitch;aimYaw=yaw;extra=0.2f;} - queue_copy_record_by_index(47);add_vectors(temp,origin,dir); + actuator_play_pattern(47);add_vectors(temp,origin,dir); homing_rocket_spawn(racer,origin,target,aimPitch,aimYaw,extra,pitch,yaw);PlayMobySound(8,0,racer); if(math_fast_float_d(&racerState->duration))racerState->state=0; }return; } diff --git a/src/levels/shared/L04_00402D90-select-g8.c b/src/levels/shared/L04_00402D90-select-g8.c index 0af7d4331..9edf2e14f 100644 --- a/src/levels/shared/L04_00402D90-select-g8.c +++ b/src/levels/shared/L04_00402D90-select-g8.c @@ -19,7 +19,7 @@ extern void snd_send_cmd22(int), snd_send_cmd23(int); extern int snd_Pump(void); extern void music_Pause(int), music_Unpause(void); extern void racer_reset_state(char *, int); -extern int hero_l04_enter_state(int,int); +extern int hero_l04_set_move_state(int,int); extern void racer_release_sound_handles(char *, char *), racer_release_link_state(char *,char *); extern int snd_play_from_global_bank(int,int,void *); extern int race_get_course_win_count(int); @@ -40,7 +40,7 @@ void UpdateRaceSelectionMenu(char *controller, char *vars) g_selected_race_index = g_current_race_index; g_race_select_initialized = 1; } - if (S32_AT(g_hero_state,0x2294) != 0x31) hero_l04_enter_state(0x31,1); + if (S32_AT(g_hero_state,0x2294) != 0x31) hero_l04_set_move_state(0x31,1); U16_AT(controller,0x34) |= 0x41; if (S32_AT(vars,0x1dc) != -1) { obj = g_moby_l04_pool + (S32_AT(vars,0x1dc) << 8); diff --git a/src/levels/shared/L04_00414698-g8.c b/src/levels/shared/L04_00414698-g8.c index 38c6d5d7c..a23c22168 100644 --- a/src/levels/shared/L04_00414698-g8.c +++ b/src/levels/shared/L04_00414698-g8.c @@ -74,7 +74,7 @@ extern int ResolveVehicleMovementCollisions(u8 *, u8 *, u8 *, u8 *, Vec *, Vec * float, float, float, float, float); extern void anim_start_blended(void *, int, int, int); extern void racer_release_sound_handles(u8 *, u8 *); -extern int queue_copy_record_by_index(int); +extern int actuator_play_pattern(int); extern void * SpawnExplosion(void *, int, int, int, int, int, int, int, float, float, int, int, int, int); extern void level_release_slot_list(void *); extern float math_random_angle(void); @@ -389,7 +389,7 @@ void hoverboard_update_rider_physics(u8 *object, u8 *st) CFG->f180 = 0.1f; tag = g_effect_default_params; CFG->f16C = 0; - queue_copy_record_by_index(0x1C); + actuator_play_pattern(0x1C); SpawnExplosion((object + 0x10), 1, 0x19, 0x14, 0x14, 0x14, 0x2D, 1, 0.666f, 20.0f, 1, 1, 0, 0); level_release_slot_list(st + 0x4E0); PlayMobySound(3, 0, object); diff --git a/src/levels/shared/L04_00419918-g8.c b/src/levels/shared/L04_00419918-g8.c index 4335b0014..a2610d729 100644 --- a/src/levels/shared/L04_00419918-g8.c +++ b/src/levels/shared/L04_00419918-g8.c @@ -59,7 +59,7 @@ extern Quad g_collision_quad; extern float g_projection_scale_float NOT_SDA; extern void hero_record_play_counters(void); extern void hero_reset_position_and_direction(void *, void *, int, int); -extern int hero_l04_enter_state(int, int); +extern int hero_l04_set_move_state(int, int); extern void cam_set_transition_frames(float); extern int coll_test_point(void *, int, void *, float); extern void UpdateViewContext(void); @@ -306,7 +306,7 @@ void UpdateHoverbikeRace(u8 *self) I(s, 0x330) = -1; } if (g_current_map_index == 0xCE) { - hero_l04_enter_state(0x86, 1); + hero_l04_set_move_state(0x86, 1); } else { if (I(s, 0x198) != -1) { if (I(s, 0x19C) != -1) { @@ -319,7 +319,7 @@ void UpdateHoverbikeRace(u8 *self) Q(self, 0x10) = Q(NODE(I(s, 0x198)), 0x30); Q(self, 0xF0) = Q(NODE(I(s, 0x198)), 0x70); } - hero_l04_enter_state(0x31, 1); + hero_l04_set_move_state(0x31, 1); load_scene_chunk(1, I(s, 0x488)); I(s, 0x58) |= 1; I(s, 0x340) = 0; diff --git a/src/levels/shared/L05_00441F30-g8.c b/src/levels/shared/L05_00441F30-g8.c index bc6730a46..5723306f2 100644 --- a/src/levels/shared/L05_00441F30-g8.c +++ b/src/levels/shared/L05_00441F30-g8.c @@ -27,7 +27,7 @@ extern char g_ship_saved_position[] __attribute__((sda)); extern char g_ship_saved_matrix_row0[] __attribute__((sda)); extern char g_ship_saved_matrix_row1[] __attribute__((sda)); extern char g_ship_saved_matrix_row2[] __attribute__((sda)); -extern char g_slot_record_source[]; +extern char g_ship_l05_rumble_waves[]; extern void hero_set_objects_flag_bit(void); extern void UpdateSteeringInput(void *, void *, void *); @@ -37,7 +37,7 @@ extern void UpdateDrivenMobyTransform(void *); extern void euler_rotation_basis(void *, void *); extern void hero_record_play_counters(void); extern void ship_update_record_transform(void *, float); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern void ship_respawn_at_best_saved_slot(void *); extern float hero_get_clamped_stat(void); extern int hero_get_state_value_c(void); @@ -139,7 +139,7 @@ void UpdateTimedTransformState(char *obj) if (g_current_map_index == 20) reset_speed = 0.26666668f; ship_update_record_transform(obj, reset_speed); if (g_ship_crash_recovery_time - 20 < g_ship_transition_timer) { - slot_copy_records_to_free(g_slot_record_source); + actuator_play_waves(g_ship_l05_rumble_waves); } } break; diff --git a/src/levels/shared/L05_00443740-g8.c b/src/levels/shared/L05_00443740-g8.c index 0d12cbf1d..24ae59734 100644 --- a/src/levels/shared/L05_00443740-g8.c +++ b/src/levels/shared/L05_00443740-g8.c @@ -6,7 +6,7 @@ typedef struct { int timer, flag; } DriverState; extern DriverState g_feltzin_challenge_state; -extern char g_slot_record_source[]; +extern char g_ship_l05_rumble_waves[]; extern float g_ship_moby_scale_factor __attribute__((sda)); extern float g_ship_forward_offset __attribute__((sda)); extern float g_ship_lift_offset_scale __attribute__((sda)); @@ -31,7 +31,7 @@ extern float math_fabs(float); extern void math_build_axis_angle_quat(void *, void *, float); extern void vec_rotate_by_quaternion(void *, void *, void *); extern int math_fast_float_d(void *); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern void ResolveLinkedMobyMovementCollisions(void *, void *); extern void ship_update_aim_point(void *, void *); extern void moby_sync_equipment_parts(void *); @@ -89,7 +89,7 @@ void UpdateDrivenMobyTransform(char *obj) FastVecAdd(moby + 0x10, moby + 0x10, lift_offset); if (g_feltzin_challenge_state.flag) { if (!math_fast_float_d(&g_feltzin_challenge_state.timer)) { - slot_copy_records_to_free(g_slot_record_source); + actuator_play_waves(g_ship_l05_rumble_waves); } else { g_feltzin_challenge_state.flag = 0; g_feltzin_challenge_state.timer = 7; diff --git a/src/levels/shared/L05_00443D08-g8.c b/src/levels/shared/L05_00443D08-g8.c index 7c4cea21f..d2d105727 100644 --- a/src/levels/shared/L05_00443D08-g8.c +++ b/src/levels/shared/L05_00443D08-g8.c @@ -4,7 +4,7 @@ typedef union { ShotQuad q; float f[4]; } ShotVector; extern int g_feltzin_mission_index, g_pad_pressed_flags[], g_ship_mode_words[]; typedef struct { int upgrade; char pad[12]; int maximum, ammo; char tail[16]; } WeaponSlot; extern WeaponSlot g_spawn_entry_table[]; -extern char g_sound_state[],g_slot_record_source[]; +extern char g_sound_state[],g_ship_l05_rumble_waves[]; extern float g_ship_aim_length __attribute__((sda)), g_ship_muzzle_speed __attribute__((sda)); extern unsigned short g_ship_shot_var_half_a __attribute__((sda)),g_ship_shot_var_half_b __attribute__((sda)),g_ship_shot_var_half_c __attribute__((sda)); extern int g_ship_shot_var_word_a __attribute__((sda)),g_ship_shot_var_word_b __attribute__((sda)),g_ship_shot_voice_id __attribute__((sda)); @@ -18,7 +18,7 @@ extern int PlayMobySound(int,int,void *); extern void slot_subtract_value_clamped(int,int); extern char *moby_spawn_shot_effect(void *,void *,float,void *,int,int,int,int,int); extern char *func_L05_003D0960(void *,void *,int,void *,int),*func_L05_003979B0(void *,void *,int,void *,int),*projectile_spawn_with_target(void *,void *,int,void *,int,int),*projectile_l05_spawn(void *,void *,int,void *,int); -extern int snd_play_from_class_bank(int,int,void *,int),slot_copy_records_to_free(void *); +extern int snd_play_from_class_bank(int,int,void *,int),actuator_play_waves(void *); extern void snd_stop_voice(int); #define F(p,o) (*(float *)((char *)(p)+(o))) #define I(p,o) (*(int *)((char *)(p)+(o))) @@ -192,5 +192,5 @@ void UpdateShipWeapons(char *moby, char *driver) } if (!math_fast_float_d(vars + 0x218)) - I(vars, 0x214) = slot_copy_records_to_free(g_slot_record_source); + I(vars, 0x214) = actuator_play_waves(g_ship_l05_rumble_waves); } diff --git a/src/levels/shared/L05_00445338-g8.c b/src/levels/shared/L05_00445338-g8.c index e77d9381d..e173399a8 100644 --- a/src/levels/shared/L05_00445338-g8.c +++ b/src/levels/shared/L05_00445338-g8.c @@ -39,7 +39,7 @@ extern char *g_path_l05_entry_table; extern Moby *g_feltzin_target_mobys; extern int g_current_map_index MACRO_ADDR; extern Collision g_collision_l05_result; -extern char g_slot_record_source[]; +extern char g_ship_l05_rumble_waves[]; extern int g_feltzin_mission_index; extern float g_ship_hit_value __attribute__((sda)); extern float g_ship_hit_event_amount __attribute__((sda)); @@ -65,7 +65,7 @@ extern int FloatToInt(float); extern int GetCollHitMaterial(void); extern int level_has_pending_inner_flag(void *); extern int hero_is_state_flag_set(void); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern void euler_rotation_basis(void *, void *); extern void QueueMobyImpact(void *, void *); extern void gfx_add_draw_callback_third(void (*)(void *), void *); @@ -176,7 +176,7 @@ void ResolveLinkedMobyMovementCollisions(char *obj, void *target) hero_apply_damage(g_ship_hit_damage); *(int *)(record + 0x58) = g_ship_record_word; } - slot_copy_records_to_free(g_slot_record_source); + actuator_play_waves(g_ship_l05_rumble_waves); qcopy(moby->state + 0x90, g_collision_l05_result.hit); gfx_add_draw_callback_third(part_spawn_impact_trail, moby); continue; @@ -196,7 +196,7 @@ void ResolveLinkedMobyMovementCollisions(char *obj, void *target) FastVecAdd(moby->position, moby->position, move); FastVecAdd(obj + 0x30, obj + 0x30, move); qcopy(pos, g_collision_l05_result.position); - slot_copy_records_to_free(g_slot_record_source); + actuator_play_waves(g_ship_l05_rumble_waves); if (!(g_feltzin_mission_index & 3)) { float value = g_ship_hit_value; diff --git a/src/levels/shared/L05_00445F90.c b/src/levels/shared/L05_00445F90.c index 9f73704b3..1af544514 100644 --- a/src/levels/shared/L05_00445F90.c +++ b/src/levels/shared/L05_00445F90.c @@ -5,7 +5,7 @@ typedef struct { char *row; } TableEntry; -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern void hero_set_objects_flag_bit(void); extern int g_ship_encounter_flag; extern int g_current_map_index MACRO_ADDR; @@ -24,7 +24,7 @@ int ship_try_start_encounter(char *object) if (g_ship_encounter_flag != 0 || (*(unsigned char *)(*(char **)(row + 0x5C) + (g_current_map_index << 4) + (int)g_moby_group_flags) & 0x80) != 0) return 0; - hero_l00_set_action(0x31, 1); + hero_l00_set_move_state(0x31, 1); base = g_hero_state; *(int *)(*(char **)(base + 0x2290) + 0x98) = 0; hero_set_objects_flag_bit(); diff --git a/src/levels/shared/L07_00416510-g8.c b/src/levels/shared/L07_00416510-g8.c index 581bec46a..fb04ea0fb 100644 --- a/src/levels/shared/L07_00416510-g8.c +++ b/src/levels/shared/L07_00416510-g8.c @@ -59,7 +59,7 @@ extern void vec_scale_to_length(void *, void *, float); extern void make_hit_descriptor(void *, void *, int, float, void *); extern void QueueMobyImpact(void *, void *); extern int StartAttachedEffect(void *, int, void *); -extern s32 hero_l07_enter_state(int, int); +extern s32 hero_l07_set_move_state(int, int); extern void vec_clear_128(void *); extern void matrix_mul_vec3(void *, void *, void *); extern void vec_compute_object_to_target(void *, void *, void *, float); @@ -185,7 +185,7 @@ void UpdateHeldBeamWeapon(unsigned char *object) math_spring_float_to_goal((float *)(data + 0x50), (float *)(data + 0x54), 0.0f, 0.06f, 0.01f, 0.125f); UI(data, 0x60) = 0; } - if (g_hero_state.weapon == 1) hero_l07_enter_state(0x1D, 1); + if (g_hero_state.weapon == 1) hero_l07_set_move_state(0x1D, 1); moby_transform_joint_to_world(object, 0, data); vec_clear_128(&vector); vector.f[1] = -1.0f; diff --git a/src/levels/shared/L08_003C6AB0-g8.c b/src/levels/shared/L08_003C6AB0-g8.c index cc802d0a0..4c38789bf 100644 --- a/src/levels/shared/L08_003C6AB0-g8.c +++ b/src/levels/shared/L08_003C6AB0-g8.c @@ -103,7 +103,7 @@ extern void gfx_start_color_fade(void *, void *); extern void gfx_update_color_fade(void *, void *); extern f32 func_002A0558(void *, void *); extern s32 TryClaimNotice(s32, s32, s32); -extern s32 hero_l08_enter_state(s32, s32); +extern s32 hero_l08_set_move_state(s32, s32); extern void set_hero_animation(int, int, f32); extern int FastDecTimer(void *); extern int math_fast_float_d(void *); @@ -357,7 +357,7 @@ void RideableMobyUpdate(RideMoby *moby) } } if (fire != 0) { - hero_l08_enter_state(0x31, 0); + hero_l08_set_move_state(0x31, 0); set_hero_animation(g_hover_anim_next, 0, 15.0f); *(TI128 *)(g_hero_state + 0x90) = moby->rot.q; *(TI128 *)(g_hero_state + 0x80) = moby->pos.q; @@ -612,7 +612,7 @@ void RideableMobyUpdate(RideMoby *moby) case 4: moby->x98 = *(s32 *)(moby->x24 + 0x10); *(s32 *)(((Hero *)g_hero_state)->ptr[0x2290 / 4] + 0x9C) = 0; - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); ((Hero *)g_hero_state)->h[0x1834 / 2] = -1; ((Hero *)g_hero_state)->f[0x108 / 4] = 0.16666667f; ((Hero *)g_hero_state)->ptr[0x1830 / 4] = 0; @@ -628,7 +628,7 @@ void RideableMobyUpdate(RideMoby *moby) case 5: moby->x98 = *(s32 *)(moby->x24 + 0x10); *(s32 *)(((Hero *)g_hero_state)->ptr[0x2290 / 4] + 0x9C) = 0; - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); moby_transform_joint_to_world(moby, 0, dir); SpawnExplosionEffects(moby, vars, dir, 0.0f, 0.0f, 10, 3, 16, 4.0f, 2.0f, 9.0f, 1.0f, -1, 15.0f, 1, 1, -1, 0, 0x810001); moby->pos.q = vars->x30; diff --git a/src/levels/shared/L08_003CDB78-g8.c b/src/levels/shared/L08_003CDB78-g8.c index 0d4a72c1c..ee9f727a3 100644 --- a/src/levels/shared/L08_003CDB78-g8.c +++ b/src/levels/shared/L08_003CDB78-g8.c @@ -21,7 +21,7 @@ extern void FastVecSub(void *,void *,void *),vec_fast_normalize(void *,void *,vo extern void FastVecScale(void *,void *,float); extern void SpawnExplosionEffects(void *,void *,void *,float,float,int,int,int,float,float,float,float,int,float,int,int,int,int,int); extern int snd_play_from_class_bank(int,int,void *,int),GetCollHitMaterial(void); -extern int hero_l08_enter_state(int,int); +extern int hero_l08_set_move_state(int,int); extern void anim_start_blended(void *,int,int,int),moby_set_state(void *,int,int); extern void moby_place_at_stored_transform(void *),set_hero_animation(int,int,float); @@ -73,7 +73,7 @@ int vehicle_handle_collision(char *object, void *prev_pos) g_vehicle_collision_x=g_vehicle_saved_x; g_vehicle_collision_y=g_vehicle_saved_y; *(int *)(vars+0x50)=0; - hero_l08_enter_state(0,1); + hero_l08_set_move_state(0,1); if (*(unsigned char *)(object+0x43)) anim_start_blended(object,0,0,10); checkpoint_index=*(int *)(vars+0x6C); if (checkpoint_index>0) { diff --git a/src/levels/shared/L08_003CDF98-g8.c b/src/levels/shared/L08_003CDF98-g8.c index 494230b44..cc2155bb1 100644 --- a/src/levels/shared/L08_003CDF98-g8.c +++ b/src/levels/shared/L08_003CDF98-g8.c @@ -117,7 +117,7 @@ extern void hero_reset_speeds_and_vectors(void); extern void hero_record_play_counters(void); extern void set_hero_animation(int, int, float); extern void script_queue_keyed_request(int, int); -extern int hero_l08_enter_state(int, int); +extern int hero_l08_set_move_state(int, int); extern void cam_update_aim_values(void *, void *); extern void hero_move_with_mount_to_transform(void *, void *); extern void hero_save_transform_snap_object(void *, void *); @@ -230,7 +230,7 @@ void UpdateHeroNpc(u8 *obj) if (can_grab && g_hero_state.target == g_moby_array[DI(0x6C)].bytes && g_hero_state.unk340 != 0 && g_hero_state.unk34E == 0) { u8 *q; - hero_l08_enter_state(0x31, 0); + hero_l08_set_move_state(0x31, 0); set_hero_animation(0x87, 0, 3.0f); ((s32 *)g_hero_state.unk2290)[0x9C / 4] = -1; q = g_moby_array[DI(0x6C)].bytes; @@ -278,7 +278,7 @@ void UpdateHeroNpc(u8 *obj) snd_play_from_class_bank(0, 0, obj, 0x988); } DI(0x50) = g_vehicle_timer_start; - hero_l08_enter_state(0x31, 0); + hero_l08_set_move_state(0x31, 0); set_hero_animation(0x81, 0, 15.0f); ((s32 *)g_hero_state.unk2290)[0x9C / 4] = -1; if (g_vehicle_active_flag != 0) @@ -580,7 +580,7 @@ void UpdateHeroNpc(u8 *obj) g_vehicle_collision_x = g_vehicle_saved_x; g_vehicle_collision_y = g_vehicle_saved_y; DI(0x50) = 0; - hero_l08_enter_state(0, 1); + hero_l08_set_move_state(0, 1); hero_reset_speeds_and_vectors(); if (OB(0x43) != 0) anim_start_blended(obj, 0, 0, 0xA); diff --git a/src/levels/shared/L08_0041EBF8-g8.c b/src/levels/shared/L08_0041EBF8-g8.c index 80293423b..10315180b 100644 --- a/src/levels/shared/L08_0041EBF8-g8.c +++ b/src/levels/shared/L08_0041EBF8-g8.c @@ -241,7 +241,7 @@ extern float func_002A0558(void *, void *); extern s32 TryClaimNotice(s32, s32, s32); extern s32 level_set_game_state_pair(s32, void *, s32); extern void script_queue_keyed_request(s32, s32); -extern s32 hero_l08_enter_state(s32, s32); +extern s32 hero_l08_set_move_state(s32, s32); extern void set_hero_animation(s32, s32, float); extern void snd_stop_voice(s32); extern s32 snd_play_from_class_bank(s32, s32, void *, s32); @@ -401,7 +401,7 @@ void mining_vehicle_update(VehicleMoby *moby) fresh = 1; level_set_game_state_pair(0, ref_L08_0041EBF8_00, 1); script_queue_keyed_request(p->f194, p->f19c); - hero_l08_enter_state(49, 0); + hero_l08_set_move_state(49, 0); set_hero_animation(g_mining_vehicle_hero_animation, 0, 15.0f); qcopy(PLAYER.rotation, moby->rot); qcopy(PLAYER.position, moby->pos); diff --git a/src/levels/shared/L11_003CF250-trigger.c b/src/levels/shared/L11_003CF250-trigger.c index 84e85fe2a..df5117bd7 100644 --- a/src/levels/shared/L11_003CF250-trigger.c +++ b/src/levels/shared/L11_003CF250-trigger.c @@ -11,7 +11,7 @@ extern int IsPointInCuboid(void *, int); extern int flag_set_first_pending(char *); extern void cam_lock_entry(int); extern int ForceClaimNotice(int, int, int); -extern int hero_l11_enter_state(int, int); +extern int hero_l11_set_move_state(int, int); extern float FastAddRotations(float, float); /* Per-frame update of the Levitator Pad (moby class 2274). */ @@ -51,7 +51,7 @@ void levitator_l11_pad_update(char *obj) if (*(int *)(other + 0x2294) == 0x82) { level = *(int *)(rig + 8); if (level >= 0 && IsPointInCuboid(other + 0x80, level) != 0) - hero_l11_enter_state(6, 1); + hero_l11_set_move_state(6, 1); } } break; diff --git a/src/levels/shared/L13_002C5760.c b/src/levels/shared/L13_002C5760.c index e08f990f4..1155c5ef0 100644 --- a/src/levels/shared/L13_002C5760.c +++ b/src/levels/shared/L13_002C5760.c @@ -157,7 +157,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -176,7 +176,7 @@ extern s32 shooter_update_ranged_attack(s32); extern s32 SelectHeroStateAnimation(s32); extern void hero_exit_vehicle_mode(s32); extern void hero_slide_along_wall(s32); -extern s32 hero_l20_set_state(s32, s32); +extern s32 hero_l20_set_move_state(s32, s32); /* Per-frame update of the hero (Ratchet): reads the controller and runs the hero's state machine (walking, jumping, swimming, weapons and so on) for this level. */ void hero_l13_update_state_machine(void) { @@ -719,7 +719,7 @@ void hero_l13_update_state_machine(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { i_temp17 = ((Hero *)g_hero_state)->i[0x2440/4]; if (i_temp17 != -1) { @@ -1462,7 +1462,7 @@ void hero_l13_update_state_machine(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l20_extra_state)->f[0x180/4] = 0.1f; diff --git a/src/levels/shared/L13_002D5ED8-decider.c b/src/levels/shared/L13_002D5ED8-decider.c index c9aa9a3ff..00306de6a 100644 --- a/src/levels/shared/L13_002D5ED8-decider.c +++ b/src/levels/shared/L13_002D5ED8-decider.c @@ -85,7 +85,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_change_action(s32, s32); +s32 hero_l13_set_move_state(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -162,7 +162,7 @@ void hero_l13_decide_state(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_change_action(0x39, 1); + hero_l13_set_move_state(0x39, 1); goto end; } } @@ -197,7 +197,7 @@ void hero_l13_decide_state(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l13_height_limit) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_change_action(0x74, 1); + hero_l13_set_move_state(0x74, 1); goto end; } } @@ -208,12 +208,12 @@ void hero_l13_decide_state(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_change_action(1, 1); + hero_l13_set_move_state(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_change_action(0x82, 1); + hero_l13_set_move_state(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -250,7 +250,7 @@ void hero_l13_decide_state(void) { rec = g_hero_l13_state_records + selected_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_change_action(0x3C, 1); + hero_l13_set_move_state(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -293,12 +293,12 @@ void hero_l13_decide_state(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_change_action(0x76, 1); + hero_l13_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); } break; } @@ -319,21 +319,21 @@ void hero_l13_decide_state(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_aim_blocked == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_change_action(0x6E, 1); + hero_l13_set_move_state(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_change_action(4, 1); + hero_l13_set_move_state(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_change_action(0x27, 1); + hero_l13_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_change_action(0x2E, 1); + hero_l13_set_move_state(0x2E, 1); break; } { @@ -353,28 +353,28 @@ void hero_l13_decide_state(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_change_action(2, 1); + hero_l13_set_move_state(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_change_action(1, 1); + hero_l13_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_buttons = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_buttons & 8)) { - hero_change_action(0x3D, 1); + hero_l13_set_move_state(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_change_action(0x3D, 1); + hero_l13_set_move_state(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_change_action(0, 1); + hero_l13_set_move_state(0, 1); } break; case 0x3D: @@ -383,22 +383,22 @@ void hero_l13_decide_state(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_change_action(4, 1); + hero_l13_set_move_state(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_change_action(2, 1); + hero_l13_set_move_state(2, 1); break; } - hero_change_action(0, 1); + hero_l13_set_move_state(0, 1); break; case 0x39: case 0x43: @@ -437,25 +437,25 @@ void hero_l13_decide_state(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_change_action(0x33, 1); + hero_l13_set_move_state(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_change_action(0x34, 1); + hero_l13_set_move_state(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_change_action(0x32, 1); + hero_l13_set_move_state(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_change_action(0x33, 1); + hero_l13_set_move_state(0x33, 1); } } break; @@ -468,81 +468,81 @@ void hero_l13_decide_state(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_change_action(0x32, 1); + hero_l13_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_change_action(0x34, 1); + hero_l13_set_move_state(0x34, 1); } else { - hero_change_action(0x32, 1); + hero_l13_set_move_state(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_change_action(0x12, 1); + hero_l13_set_move_state(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_change_action(0x32, 1); + hero_l13_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_change_action(0x34, 1); + hero_l13_set_move_state(0x34, 1); } else { - hero_change_action(0x32, 1); + hero_l13_set_move_state(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_change_action(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l13_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_change_action(0x35, 1); + hero_l13_set_move_state(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_change_action(0x12, 1); + hero_l13_set_move_state(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_change_action(0x32, 1); + hero_l13_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_change_action(0x34, 1); + hero_l13_set_move_state(0x34, 1); } else { - hero_change_action(0x32, 1); + hero_l13_set_move_state(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_change_action(0x70, 0); + hero_l13_set_move_state(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_change_action(0x36, 1); + hero_l13_set_move_state(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_change_action(0x67, 1); + hero_l13_set_move_state(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_change_action(0x33, 1); + hero_l13_set_move_state(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_change_action(0x33, 0); + hero_l13_set_move_state(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_change_action(0x67, 1); + hero_l13_set_move_state(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_change_action(0x36, 0); + hero_l13_set_move_state(0x36, 0); } break; case 0x1: @@ -576,9 +576,9 @@ void hero_l13_decide_state(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_change_action(4, 1); + hero_l13_set_move_state(4, 1); } else { - hero_change_action(0, 0); + hero_l13_set_move_state(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -590,9 +590,9 @@ void hero_l13_decide_state(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_change_action(0, 0); + hero_l13_set_move_state(0, 0); } else { - hero_change_action(0, 1); + hero_l13_set_move_state(0, 1); } } break; @@ -625,7 +625,7 @@ void hero_l13_decide_state(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_change_action(7, 1); + hero_l13_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -634,7 +634,7 @@ void hero_l13_decide_state(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_change_action(0, 0); + hero_l13_set_move_state(0, 0); } break; } @@ -656,7 +656,7 @@ void hero_l13_decide_state(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_change_action(7, 1); + hero_l13_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -669,7 +669,7 @@ void hero_l13_decide_state(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_change_action(2, 0); + hero_l13_set_move_state(2, 0); set_hero_animation(3, g_hero_action_anim_table[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -680,22 +680,22 @@ void hero_l13_decide_state(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_change_action(2, 1); + hero_l13_set_move_state(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_change_action(0, 0); + hero_l13_set_move_state(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_change_action(0, 0); + hero_l13_set_move_state(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_change_action(0, 1); + hero_l13_set_move_state(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -712,7 +712,7 @@ void hero_l13_decide_state(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_change_action(7, 1); + hero_l13_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -721,7 +721,7 @@ void hero_l13_decide_state(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_change_action(0, 0); + hero_l13_set_move_state(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, 15.0f); break; } @@ -733,7 +733,7 @@ void hero_l13_decide_state(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_change_action(0, 1); + hero_l13_set_move_state(0, 1); } break; case 0x2: @@ -747,11 +747,11 @@ void hero_l13_decide_state(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_change_action(0x76, 1); + hero_l13_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); break; } n = 9; @@ -765,12 +765,12 @@ void hero_l13_decide_state(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_change_action(9, 1); + hero_l13_set_move_state(9, 1); } else { - hero_change_action(7, 1); + hero_l13_set_move_state(7, 1); } } else { - hero_change_action(7, 1); + hero_l13_set_move_state(7, 1); } break; } @@ -778,11 +778,11 @@ void hero_l13_decide_state(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_change_action(1, 1); + hero_l13_set_move_state(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_change_action(4, 1); + hero_l13_set_move_state(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -799,25 +799,25 @@ void hero_l13_decide_state(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_change_action(0x2E, 1); + hero_l13_set_move_state(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_change_action(2, 1); + hero_l13_set_move_state(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_change_action(0x70, 1); + hero_l13_set_move_state(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_change_action(2, 1); + hero_l13_set_move_state(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_change_action(0x27, 1); + hero_l13_set_move_state(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -828,7 +828,7 @@ void hero_l13_decide_state(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_change_action(0, 0) == 0) { + if (hero_l13_set_move_state(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -845,7 +845,7 @@ void hero_l13_decide_state(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_change_action(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l13_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } if (FLD(anim_info, u8, 0x43) == 0x37) { @@ -866,7 +866,7 @@ void hero_l13_decide_state(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_change_action(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l13_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -900,17 +900,17 @@ void hero_l13_decide_state(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_change_action(3, 0); + hero_l13_set_move_state(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_change_action(0x77, 1); + hero_l13_set_move_state(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_change_action(0x77, 1); + hero_l13_set_move_state(0x77, 1); break; } } @@ -928,11 +928,11 @@ void hero_l13_decide_state(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_change_action(0x64, 1); + hero_l13_set_move_state(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_change_action(0x63, 1); + hero_l13_set_move_state(0x63, 1); } } else { hero_update_anim_scale(); @@ -940,21 +940,21 @@ void hero_l13_decide_state(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_change_action(0x62, 1); + hero_l13_set_move_state(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_change_action(0, 1); + hero_l13_set_move_state(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_change_action(0x62, 1); + hero_l13_set_move_state(0x62, 1); } break; case 0x65: /* switch 2 */ jump_count = FLD(g_hero_state, s32, 0x18C0); if ((jump_count < 3) && (((jump_count * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 7, &out_value_a) != 0)) { - hero_change_action(0x66, 1); + hero_l13_set_move_state(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -997,7 +997,7 @@ void hero_l13_decide_state(void) { return; case 0x6D: if ((f32)g_hero_l13_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_change_action(0, 1); + hero_l13_set_move_state(0, 1); } break; case 0x30: @@ -1010,7 +1010,7 @@ void hero_l13_decide_state(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_change_action(0, 0) != 0) { + if (hero_l13_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1018,29 +1018,29 @@ void hero_l13_decide_state(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_change_action(1, 1); + hero_l13_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_change_action(7, 1); + hero_l13_set_move_state(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_change_action(4, 1); + hero_l13_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_change_action(0, 1); + hero_l13_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_change_action(0x27, 1); + hero_l13_set_move_state(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1048,45 +1048,45 @@ void hero_l13_decide_state(void) { } if (hero_get_weapon_or_form_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_change_action(0, 0); + hero_l13_set_move_state(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_change_action(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l13_set_move_state(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_change_action(2, 1); + hero_l13_set_move_state(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_change_action(1, 1); + hero_l13_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_change_action(0, 0); + hero_l13_set_move_state(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_change_action(0x76, 1); + hero_l13_set_move_state(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_change_action(0x15, 1); + hero_l13_set_move_state(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_change_action(0, 1); + hero_l13_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1094,17 +1094,17 @@ void hero_l13_decide_state(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_change_action(0x8B, 1); + hero_l13_set_move_state(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_change_action(0, 1); + hero_l13_set_move_state(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_change_action(0, 1); + hero_l13_set_move_state(0, 1); } break; case 0x24: @@ -1130,14 +1130,14 @@ void hero_l13_decide_state(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_change_action(0, 0); + hero_l13_set_move_state(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_change_action(6, 0); + hero_l13_set_move_state(6, 0); } else { - hero_change_action(6, 0); + hero_l13_set_move_state(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1153,9 +1153,9 @@ void hero_l13_decide_state(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_change_action(0, 1); + hero_l13_set_move_state(0, 1); } else { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1167,7 +1167,7 @@ void hero_l13_decide_state(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_change_action(0x2C, 1); + hero_l13_set_move_state(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1216,11 +1216,11 @@ void hero_l13_decide_state(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.21666668f); FLD(g_hero_state, f32, 0x128) = 0.16666667f; - hero_change_action(0x16, 1); + hero_l13_set_move_state(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x46; FLD(g_hero_state, s16, 0x1D0) = 0x46; } else { - hero_change_action(0x3E, 1); + hero_l13_set_move_state(0x3E, 1); } break; } @@ -1233,7 +1233,7 @@ void hero_l13_decide_state(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_change_action(0x28, 1); + hero_l13_set_move_state(0x28, 1); } break; } @@ -1244,16 +1244,16 @@ void hero_l13_decide_state(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x46; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_change_action(0x74, 1); + hero_l13_set_move_state(0x74, 1); } else { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { - hero_change_action(0x2A, 1); + hero_l13_set_move_state(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1270,7 +1270,7 @@ void hero_l13_decide_state(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_change_action(0x28, 1); + hero_l13_set_move_state(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)vec_b = 0; @@ -1287,7 +1287,7 @@ void hero_l13_decide_state(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 5, NULL) != 0) && ((f32)g_hero_l13_action_table[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_change_action(0x28, 1); + hero_l13_set_move_state(0x28, 1); break; } top = 0xE; @@ -1296,19 +1296,19 @@ void hero_l13_decide_state(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_change_action(0x2A, 1); + hero_l13_set_move_state(0x2A, 1); } break; } if ((f32)g_hero_l13_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_change_action(0x27, 1); + hero_l13_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x6C8) >= 6)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_change_action(0x74, 1); + hero_l13_set_move_state(0x74, 1); } else { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1317,7 +1317,7 @@ void hero_l13_decide_state(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_change_action(0x27, 1); + hero_l13_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0xA) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1353,7 +1353,7 @@ void hero_l13_decide_state(void) { find_nearest_path_point(new_path, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), new_path_flags, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_change_action(0x29, 1); + hero_l13_set_move_state(0x29, 1); break; } } @@ -1401,7 +1401,7 @@ void hero_l13_decide_state(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x46; FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1409,7 +1409,7 @@ void hero_l13_decide_state(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_change_action(0x71, 1); + hero_l13_set_move_state(0x71, 1); break; } { @@ -1421,7 +1421,7 @@ void hero_l13_decide_state(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_change_action(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l13_set_move_state(0, 0) != 0)) { set_hero_animation(0xC, 4, 6.0f); } } else if (st == 0x3E) { @@ -1430,18 +1430,18 @@ void hero_l13_decide_state(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)angle_b, 0.5f, -1.0f); } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_change_action(0x27, 1); + hero_l13_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_change_action(0x27, 1); + hero_l13_set_move_state(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_change_action(0x18, 0); + hero_l13_set_move_state(0x18, 0); } break; case 0x18: @@ -1450,18 +1450,18 @@ void hero_l13_decide_state(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_change_action(0x1B, 1); + hero_l13_set_move_state(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1470,7 +1470,7 @@ void hero_l13_decide_state(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_change_action(0x19, 1); + hero_l13_set_move_state(0x19, 1); } break; } @@ -1481,7 +1481,7 @@ void hero_l13_decide_state(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_change_action(0x1A, 1); + hero_l13_set_move_state(0x1A, 1); } } } @@ -1500,18 +1500,18 @@ void hero_l13_decide_state(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_change_action(0x18, 1); + hero_l13_set_move_state(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_change_action(0x1B, 1); + hero_l13_set_move_state(0x1B, 1); } break; } @@ -1521,9 +1521,9 @@ void hero_l13_decide_state(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); } else { - hero_change_action(0, 1); + hero_l13_set_move_state(0, 1); } } break; @@ -1547,12 +1547,12 @@ void hero_l13_decide_state(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_change_action(0x39, 1); + hero_l13_set_move_state(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_change_action(0, 0) != 0) { + if (hero_l13_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1560,7 +1560,7 @@ void hero_l13_decide_state(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_change_action(0, 0) != 0) { + if (hero_l13_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1574,32 +1574,32 @@ void hero_l13_decide_state(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_change_action(2, 1); + hero_l13_set_move_state(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_change_action(3, 0) != 0) { + if (hero_l13_set_move_state(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_change_action(0, 1); + hero_l13_set_move_state(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_change_action(8, 1); + hero_l13_set_move_state(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_change_action(0x17, 1); + hero_l13_set_move_state(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_change_action(0x27, 1); + hero_l13_set_move_state(0x27, 1); break; } } @@ -1631,7 +1631,7 @@ void hero_l13_decide_state(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_change_action(0, 0) != 0) { + if (hero_l13_set_move_state(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1641,9 +1641,9 @@ void hero_l13_decide_state(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_change_action(0x74, 1); + hero_l13_set_move_state(0x74, 1); } else { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); } } break; @@ -1656,16 +1656,16 @@ void hero_l13_decide_state(void) { ok = 1; } if (ok != 0) { - hero_change_action(0x11, 1); + hero_l13_set_move_state(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_change_action(0x17, 1); + hero_l13_set_move_state(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1676,23 +1676,23 @@ void hero_l13_decide_state(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_change_action(3, 0) != 0) { + if (hero_l13_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_change_action(4, 1); + hero_l13_set_move_state(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_state_threshold_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_change_action(2, 1); + hero_l13_set_move_state(2, 1); break; } - hero_change_action(2, 0); + hero_l13_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1701,21 +1701,21 @@ void hero_l13_decide_state(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_state_threshold_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_change_action(2, 1); + hero_l13_set_move_state(2, 1); break; } - hero_change_action(2, 0); + hero_l13_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_action_anim_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_change_action(0, 0) != 0) { + if (hero_l13_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_change_action(0, 0) != 0) { + } else if (hero_l13_set_move_state(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1762,14 +1762,14 @@ void hero_l13_decide_state(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_change_action(0xB, 1); + hero_l13_set_move_state(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_change_action(0x82, 1); + hero_l13_set_move_state(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1778,25 +1778,25 @@ void hero_l13_decide_state(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_change_action(0xA, 1); + hero_l13_set_move_state(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_change_action(0x10, 1); + hero_l13_set_move_state(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_change_action(0x27, 1); + hero_l13_set_move_state(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_change_action(0x77, 1); + hero_l13_set_move_state(0x77, 1); break; } } @@ -1900,7 +1900,7 @@ void hero_l13_decide_state(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_change_action(3, 0) != 0) { + if (hero_l13_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1908,13 +1908,13 @@ void hero_l13_decide_state(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_state_threshold_table[0][2])) { - hero_change_action(7, 1); + hero_l13_set_move_state(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_change_action(7, 1); + hero_l13_set_move_state(7, 1); } else if (g_hero_state_threshold_table[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_change_action(9, 1); + hero_l13_set_move_state(9, 1); } else { - hero_change_action(7, 1); + hero_l13_set_move_state(7, 1); } break; } @@ -1922,10 +1922,10 @@ void hero_l13_decide_state(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); break; } { @@ -1935,7 +1935,7 @@ void hero_l13_decide_state(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &out_value_b) != 0) && (out_value_b < FLD(g_hero_state, s32, 0x1B8))) { - hero_change_action(0x11, 1); + hero_l13_set_move_state(0x11, 1); break; } } @@ -1964,7 +1964,7 @@ void hero_l13_decide_state(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_change_action(0xE, 1); + hero_l13_set_move_state(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1974,32 +1974,32 @@ void hero_l13_decide_state(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_change_action(8, 1); + hero_l13_set_move_state(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_change_action(0x17, 1); + hero_l13_set_move_state(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_change_action(6, 1); + hero_l13_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_change_action(0x79, 1); + hero_l13_set_move_state(0x79, 1); } else { - hero_change_action(0x39, 1); + hero_l13_set_move_state(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_change_action(0x82, 1); + hero_l13_set_move_state(0x82, 1); } else { - hero_change_action(0, 0); + hero_l13_set_move_state(0, 0); } } break; @@ -2009,8 +2009,8 @@ void hero_l13_decide_state(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_change_action(0x39, 1); - } else if (hero_change_action(0, 0) != 0) { + hero_l13_set_move_state(0x39, 1); + } else if (hero_l13_set_move_state(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 13.0f); } } @@ -2035,28 +2035,28 @@ void hero_l13_decide_state(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_change_action(0x4E, 1); + hero_l13_set_move_state(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_change_action(1, 1); + hero_l13_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_change_action(0x41, 1); + hero_l13_set_move_state(0x41, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_change_action(0x45, 1); + hero_l13_set_move_state(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_change_action(0x4D, 1); + hero_l13_set_move_state(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_change_action(0x40, 1); + hero_l13_set_move_state(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -2069,14 +2069,14 @@ void hero_l13_decide_state(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_change_action(0x4E, 1); + hero_l13_set_move_state(0x4E, 1); break; } rec = (u8 *)&g_hero_l13_action_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_change_action(0x3F, 0); + hero_l13_set_move_state(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -2085,13 +2085,13 @@ void hero_l13_decide_state(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0x10) ? n : 0xF, NULL) != 0) { - hero_change_action(0x4D, 1); + hero_l13_set_move_state(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_change_action(0x45, 1); + hero_l13_set_move_state(0x45, 1); } break; } @@ -2154,42 +2154,42 @@ void hero_l13_decide_state(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_change_action(0x45, 1); + hero_l13_set_move_state(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_state_threshold_table[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_change_action(0x40, 1); + hero_l13_set_move_state(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_change_action(0x3F, 1); + hero_l13_set_move_state(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_change_action(0x41, 1); + hero_l13_set_move_state(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 5, NULL) != 0)) { - hero_change_action(0x4D, 1); + hero_l13_set_move_state(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_change_action(0x46, 1); + hero_l13_set_move_state(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_change_action(0x4B, 1); + hero_l13_set_move_state(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_change_action(0x41, 1); + hero_l13_set_move_state(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_change_action(0x46, 1); + hero_l13_set_move_state(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -2199,11 +2199,11 @@ void hero_l13_decide_state(void) { FLD(g_hero_state, s16, 0x1EE) = 0xC - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_change_action(0x40, 1); + hero_l13_set_move_state(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_change_action(0x3F, 1); + hero_l13_set_move_state(0x3F, 1); } break; case 0x41: @@ -2215,29 +2215,29 @@ void hero_l13_decide_state(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_change_action(0x43, 1); + hero_l13_set_move_state(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_change_action(0x40, 1); + hero_l13_set_move_state(0x40, 1); } else { - hero_change_action(0x3F, 1); + hero_l13_set_move_state(0x3F, 1); } } else { - hero_change_action(0x3F, 1); + hero_l13_set_move_state(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_change_action(0x46, 1); + hero_l13_set_move_state(0x46, 1); break; } if ((PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_change_action(0x4B, 1); + hero_l13_set_move_state(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_change_action(0x3F, 1); + hero_l13_set_move_state(0x3F, 1); } break; case 0x4E: @@ -2246,9 +2246,9 @@ void hero_l13_decide_state(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_change_action(0x41, 1); + hero_l13_set_move_state(0x41, 1); } else { - hero_change_action(0x3F, 1); + hero_l13_set_move_state(0x3F, 1); } } break; @@ -2258,7 +2258,7 @@ void hero_l13_decide_state(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_change_action(0x4E, 1); + hero_l13_set_move_state(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.025000002f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2284,55 +2284,55 @@ void hero_l13_decide_state(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_change_action(0x45, 1); + hero_l13_set_move_state(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_change_action(0x4D, 1); + hero_l13_set_move_state(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_change_action(0x41, 1); + hero_l13_set_move_state(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_change_action(0x3F, 1); + hero_l13_set_move_state(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_change_action(0x41, 1); + hero_l13_set_move_state(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x24) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_change_action(0x43, 1); + hero_l13_set_move_state(0x43, 1); } else { - hero_change_action(0x3F, 0); + hero_l13_set_move_state(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_change_action(0x47, 1); + hero_l13_set_move_state(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)vec_a = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_change_action(0x41, 1); + hero_l13_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_change_action(0x41, 1); + hero_l13_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_change_action(0x48, 1); + hero_l13_set_move_state(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2341,7 +2341,7 @@ void hero_l13_decide_state(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_change_action(0x49, 1); + hero_l13_set_move_state(0x49, 1); } break; } @@ -2352,7 +2352,7 @@ void hero_l13_decide_state(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_change_action(0x4A, 1); + hero_l13_set_move_state(0x4A, 1); } } } @@ -2371,17 +2371,17 @@ void hero_l13_decide_state(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_change_action(0x47, 1); + hero_l13_set_move_state(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_change_action(0x41, 1); + hero_l13_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_change_action(0x48, 1); + hero_l13_set_move_state(0x48, 1); } break; } @@ -2396,7 +2396,7 @@ void hero_l13_decide_state(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_change_action(0, 0); + hero_l13_set_move_state(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -2407,7 +2407,7 @@ void hero_l13_decide_state(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_change_action(0, 0); + hero_l13_set_move_state(0, 0); } break; case 0x22: @@ -2417,12 +2417,12 @@ void hero_l13_decide_state(void) { hero_choose_jump_or_roll_move(); break; } - hero_change_action(7, 1); + hero_l13_set_move_state(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_change_action(0, 0); + hero_l13_set_move_state(0, 0); } break; default: diff --git a/src/levels/shared/L16_002B5EE0-motion-g8.c b/src/levels/shared/L16_002B5EE0-motion-g8.c index 94d9edc66..021d4c55c 100644 --- a/src/levels/shared/L16_002B5EE0-motion-g8.c +++ b/src/levels/shared/L16_002B5EE0-motion-g8.c @@ -39,7 +39,7 @@ extern int moby_is_spot_free_of_blockers(char *); extern void vec_transform_by_object_or_given(char *,char *,char *,char *); extern void FastVecSub(void *,void *,void *); extern float FastVecDot(void *,void *); -extern s32 hero_l16_enter_state(int,int); +extern s32 hero_l16_set_move_state(int,int); extern void cam_start_blend_to_target(char *); extern float math_fabs(float); extern void cam_set_mode_state(int); @@ -95,7 +95,7 @@ void follow_player_update(u8 *object) direction[2]=zero; vec_scale_to_length(direction,direction,1.0f); vec_scale_to_length(forward,forward,1.0f); - if (FastVecDot(direction,forward)<0.2f) { hero_l16_enter_state(0x37,1); cam_start_blend_to_target((char *)object); } + if (FastVecDot(direction,forward)<0.2f) { hero_l16_set_move_state(0x37,1); cam_start_blend_to_target((char *)object); } moby_set_state(object,2,-1); } } @@ -115,7 +115,7 @@ void follow_player_update(u8 *object) if (F(state,0x34)>=1.0f) goto leaveActive; if (g_hero_state.field2294==0x37) goto active; leaveActive: - if (g_hero_state.field2294==0x37) hero_l16_enter_state(0,1); + if (g_hero_state.field2294==0x37) hero_l16_set_move_state(0,1); cam_set_mode_state(1); I(state,0x3C)=20; I(state,0x58)++; diff --git a/src/levels/shared/L18_002C4000-timers-g8.c b/src/levels/shared/L18_002C4000-timers-g8.c index 016224006..adeebaeb1 100644 --- a/src/levels/shared/L18_002C4000-timers-g8.c +++ b/src/levels/shared/L18_002C4000-timers-g8.c @@ -91,7 +91,7 @@ extern float g_hero_l18_reach_timer_b, g_hero_l18_reach_timer_a; /* The equipment flag at 0x1A7AFF: a small-data object at a nonzero offset, length 2 for reorg. */ extern unsigned char g_hero_event_flags[] __attribute__((sda)); extern void hero_ease_lean_to_upright(void), hero_queue_glow_draw_routine(void), hero_update_landing_slide(void), hero_record_play_counters(void); -extern s32 hero_l18_set_action(int, int); +extern s32 hero_l18_set_move_state(int, int); extern int FastDecTimer(void *), math_fast_float_d(void *); extern void vec_clear_128(void *); extern int moby_is_in_special_class_range(void *), math_random_int_below(int); @@ -173,7 +173,7 @@ void hero_update_timers_reach(void) { if (g_hero_state.field_24CC && !D_L18_001A8F00_abs && g_hero_state.mode == 4 && g_hero_state.field_2294 != 0x6F && (g_pad_state.pressed&0x10)) { g_hero_state.field_1E0 = 0; g_hero_state.field_24CC = 0; - hero_l18_set_action(0x91, 1); + hero_l18_set_move_state(0x91, 1); } if (!D_L18_001A8F00_abs) { if (g_hero_l18_reach_timer_b>0) g_hero_state.field_22A++; diff --git a/src/levels/shared/L18_002CFD68-qcopy.c b/src/levels/shared/L18_002CFD68-qcopy.c index 30bbbe66a..dc5fa32c7 100644 --- a/src/levels/shared/L18_002CFD68-qcopy.c +++ b/src/levels/shared/L18_002CFD68-qcopy.c @@ -12,7 +12,7 @@ extern void attachment_reset_all(void); extern void hero_l18_update_speed_targets(void); extern void hero_clear_queued_anim(void); extern void func_002A677C(void *); -extern s32 hero_l18_set_action(s32, s32); +extern s32 hero_l18_set_move_state(s32, s32); extern void set_hero_animation(s32, s32, float); extern u8 g_hero_state[]; /* Puts the hero under control of another object (for example a vehicle) and saves the hero position. */ @@ -49,7 +49,7 @@ void hero_attach_to_object(s32 mode, s32 index, u8 *object) *(s16 *)(g_hero_state + 0x24D4) = *(u16 *)(g_hero_state + 0x24CC); *(s32 *)(g_hero_state + 0x24CC) = 3; } - hero_l18_set_action(index, 2); + hero_l18_set_move_state(index, 2); if (mode == 4) set_hero_animation(15, 0, 5.0f); } @@ -124,7 +124,7 @@ void hero_detach_from_object(s32 keep) goto done; } reset: - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); done: if (g_hero_state[0x22B4] == 4) cam_reset_default(); } diff --git a/src/levels/shared/L18_002E42F8-flags-g8.c b/src/levels/shared/L18_002E42F8-flags-g8.c index 3e4da2256..4ae617704 100644 --- a/src/levels/shared/L18_002E42F8-flags-g8.c +++ b/src/levels/shared/L18_002E42F8-flags-g8.c @@ -8,7 +8,7 @@ extern float math_fabs(float); extern void BuildOffsetVectorPair(void *, void *, int, float, float); extern int CollLine(void *, void *, int, void *, int); extern short GetCollHitMaterial(void); -extern int hero_l18_set_action(int, int); +extern int hero_l18_set_move_state(int, int); extern int hero_play_sound(int, int); /* Same body as func_L00_002C8E10 plus a mode-4 early exit before the resident checks. */ @@ -59,7 +59,7 @@ int hero_check_ledge_fall(void) if (*(unsigned char *)(g + 0x22B4) == 4) { if (falling) { *(int *)(g + 0x24CC) = 0; - hero_l18_set_action(0x91, 1); + hero_l18_set_move_state(0x91, 1); return 1; } return 0; @@ -80,9 +80,9 @@ int hero_check_ledge_fall(void) start[2] = *(float *)ref_L18_002E42F8_01 - 0.01f; if (!CollLine(start, end, 2, *(void **)(resident + 0x2290), 0)) { if (*(int *)(resident + 0x229C) == 0x14 || *(int *)(resident + 0x24CC) == 0) - hero_l18_set_action(0x67, 1); + hero_l18_set_move_state(0x67, 1); else - hero_l18_set_action(0x33, 1); + hero_l18_set_move_state(0x33, 1); return 1; } } @@ -92,9 +92,9 @@ int hero_check_ledge_fall(void) if (falling) { char *fallState = g_hero_state; if (*(int *)(fallState + 0x229C) == 0x14 || *(int *)(fallState + 0x24CC) == 0) - hero_l18_set_action(0x67, 1); + hero_l18_set_move_state(0x67, 1); else - hero_l18_set_action(0x36, 1); + hero_l18_set_move_state(0x36, 1); hero_play_sound(3, 0); } return falling; diff --git a/src/levels/shared/L18_003F9E50-g8.c b/src/levels/shared/L18_003F9E50-g8.c index 00ca9d30b..ac428dcd4 100644 --- a/src/levels/shared/L18_003F9E50-g8.c +++ b/src/levels/shared/L18_003F9E50-g8.c @@ -13,7 +13,7 @@ extern void SetCamera5Pose(char *moby, char *a1, s32 a2, s32 a3, s32 t0); extern void SetCamera5Mode(s32 moby, s32 a1); extern void object_copy_vector_to_selected(char *moby); extern void cam_set_state_rotation(char *moby); -extern s32 hero_l18_set_action(s32 moby, s32 a1); +extern s32 hero_l18_set_move_state(s32 moby, s32 a1); /* Starts a timed effect sequence for the chosen entry and sets its frame counter to 1. */ void part_start_timed_sequence(char *moby) { @@ -24,6 +24,6 @@ void part_start_timed_sequence(char *moby) { SetCamera5Mode(2, *(s32 *)((char *)&g_camera_mode_table + (*(s16 *)(vars + 0xAE) << 2))); object_copy_vector_to_selected((char *)&g_selected_object_vec_table + (*(s16 *)(vars + 0xAE) << 4)); cam_set_state_rotation((char *)&g_camera_rotation_table + (*(s16 *)(vars + 0xAE) << 4)); - hero_l18_set_action(0x6F, 1); + hero_l18_set_move_state(0x6F, 1); *(s16 *)(vars + 0xAC) = 1; } diff --git a/src/levels/shared/L18_00427BE0-update-g8.c b/src/levels/shared/L18_00427BE0-update-g8.c index dd2f4775f..f94d65eb2 100644 --- a/src/levels/shared/L18_00427BE0-update-g8.c +++ b/src/levels/shared/L18_00427BE0-update-g8.c @@ -53,7 +53,7 @@ extern void level_store_value_pair(int,int); extern void SetCamera5Pose(void *,void *,int,int,int); extern void object_copy_vector_to_selected(void *); extern void cam_set_state_rotation(void *); -extern s32 hero_l18_set_action(int,int); +extern s32 hero_l18_set_move_state(int,int); extern float vec_distance_xy(void *,void *); extern void moby_set_flag_bit(void *,int); extern void moby_start_or_forward_anim(void *,int,int,float); @@ -105,7 +105,7 @@ void receiver_bot_update_targeting(u8 *moby) { object_copy_vector_to_selected(&g_camera_l18_position); cam_set_state_rotation(g_camera_l18_position.b+0x10); if (g_hero_state.i[0x2294/4] == 1 || g_hero_state.i[0x2294/4] == 29) - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); g_hero_state.h[0x1E0/2] = 20; state->f[0x3B8/4] = (vec_distance_xy(moby+0x10,&g_camera_l18_position)-g_receiver_targeting_distance) / g_receiver_targeting_frames; if (g_statistics_table.uh[0x294/2] < 65535) diff --git a/src/levels/shared/L19_003DFD68.c b/src/levels/shared/L19_003DFD68.c index db7006dbb..d4caeccc5 100644 --- a/src/levels/shared/L19_003DFD68.c +++ b/src/levels/shared/L19_003DFD68.c @@ -124,7 +124,7 @@ extern void gfx_queue_draw_callback(void *, void *); extern void protopet_start_enter_anim(char *, int); extern void part_spawn_upward(char *); extern void part_spawn_spray(char *); -extern s32 hero_l19_set_state(int, int); +extern s32 hero_l19_set_move_state(int, int); /* Updates a Train moby: it follows its path or linked object, gets launched or fades in and out in several states, pushes the hero and objects it hits, and spawns sparks. */ void train_l19_update(char *moby) @@ -258,7 +258,7 @@ void train_l19_update(char *moby) FastVecScale(vecs[1], moby + 0xC0, -g_train_scale_neg); vecs[1][2] = g_train_scale_neg * 4.0f; vecs[1][3] = 5627.9248f; - hero_l19_set_state(0, 1); + hero_l19_set_move_state(0, 1); force = (f32)g_player_stats[0] * 30.0f; part_queue_impact_effect(target, moby, 0x10001, g_hero_state + 0x80, vecs[1], force > 100.0f ? force : 100.0f); vars->iE0 = g_train_state_value; diff --git a/src/levels/shared/L22_002A8B98-init.c b/src/levels/shared/L22_002A8B98-init.c index 0ca24598a..5c9b0e3cc 100644 --- a/src/levels/shared/L22_002A8B98-init.c +++ b/src/levels/shared/L22_002A8B98-init.c @@ -21,7 +21,7 @@ extern s32 g_current_map_index[] __attribute__((sda)); extern s32 g_hero_aim_speed_start[] __attribute__((sda)); extern char g_pickup_entry_table[]; extern void hero_clear_queued_anim(void); -extern s32 hero_l22_set_action(s32, s32); +extern s32 hero_l22_set_move_state(s32, s32); extern void trail_reset_slots(void); /* Install this level's player parameters and start the shared subsystems. */ @@ -40,7 +40,7 @@ void level_init_player_params(void) g_hero_aim_speed_start[0] = 0; state->state = 0; hero_clear_queued_anim(); - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); trail_reset_slots(); state->entry_table = g_pickup_entry_table; } diff --git a/src/levels/shared/L22_002A8B98-qcopy.c b/src/levels/shared/L22_002A8B98-qcopy.c index 8a07e0ad4..33fbbfed5 100644 --- a/src/levels/shared/L22_002A8B98-qcopy.c +++ b/src/levels/shared/L22_002A8B98-qcopy.c @@ -11,7 +11,7 @@ extern int level_run_slot_callback(s32); extern void hero_clear_tracked_slots(void); extern void hero_clear_queued_anim(void); extern s32 anim_copy_entry_data(char *, s32, s32, char *); -extern int hero_l22_set_action(s32, s32); +extern int hero_l22_set_move_state(s32, s32); extern char g_str_hud_slot_text_c[]; extern char g_str_hud_slot_text_b[]; extern char g_str_hud_slot_text_a[]; @@ -65,5 +65,5 @@ void hero_reset_for_restart(void) *(s32 *)(*(char **)(hero3 + 0x2290) + 0x58) = anim_copy_entry_data(*(char **)(hero3 + 0x2290), *(unsigned char *)(*(char **)(hero3 + 0x2290) + 0x42), *(unsigned char *)(*(char **)(hero3 + 0x2290) + 0x40), g_hero_anim_buffer_upper); *(s32 *)(*(char **)(hero3 + 0x2290) + 0x5C) = anim_copy_entry_data(*(char **)(hero3 + 0x2290), *(unsigned char *)(*(char **)(hero3 + 0x2290) + 0x43), *(unsigned char *)(*(char **)(hero3 + 0x2290) + 0x41), g_hero_anim_buffer_lower); if (*(s32 *)(hero3 + 0x2294) != 0x61 || ((mode = g_hero_mode_state[0]) != 2 && mode != 6)) - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); } diff --git a/src/levels/shared/L22_002A8B98.c b/src/levels/shared/L22_002A8B98.c index fc7f2bae5..18a39d83d 100644 --- a/src/levels/shared/L22_002A8B98.c +++ b/src/levels/shared/L22_002A8B98.c @@ -15,7 +15,7 @@ extern char g_pickup_entry_table[]; extern void hero_clear_queued_anim(void); -extern int hero_l22_set_action(int mode, int flag); +extern int hero_l22_set_move_state(int mode, int flag); extern void trail_reset_slots(void); @@ -258,7 +258,7 @@ void hero_restart_in_mode(int mode, int entryId, void *mobyArg) { break; } } - hero_l22_set_action(entryId, 2); + hero_l22_set_move_state(entryId, 2); } @@ -328,7 +328,7 @@ void hero_l22_update_speed_targets(void) { extern unsigned char g_screen_mode_flag; -extern int hero_l22_set_action(int a0, int a1); +extern int hero_l22_set_move_state(int a0, int a1); /* plays one of three resident messages, picked by the type byte; the second argument is 1 or 2 depending on the caller's flag */ @@ -340,13 +340,13 @@ void text_play_mode_message(int slow) { mode = 2; switch (type) { case 0: - hero_l22_set_action(0, mode); + hero_l22_set_move_state(0, mode); break; case 1: - hero_l22_set_action(0x3F, mode); + hero_l22_set_move_state(0x3F, mode); break; case 2: - hero_l22_set_action(0x56, mode); + hero_l22_set_move_state(0x56, mode); break; } } diff --git a/src/levels/shared/L22_002C9898-g8.c b/src/levels/shared/L22_002C9898-g8.c index 13d67ef7a..6f7197098 100644 --- a/src/levels/shared/L22_002C9898-g8.c +++ b/src/levels/shared/L22_002C9898-g8.c @@ -77,8 +77,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -151,7 +151,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l22_set_action(s32 action, s32 animate) { +s32 hero_l22_set_move_state(s32 action, s32 animate) { f32 dir[4]; f32 pos[4]; u8 *objectSnapshot; @@ -200,7 +200,9 @@ s32 hero_l22_set_action(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -213,8 +215,8 @@ s32 hero_l22_set_action(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { text_play_mode_message(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l22_set_action(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_action(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l22_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (shop_get_entry_for_state(0) == 0x51) set_hero_animation(shop_get_entry_for_state(0), 0, 18.0f); else set_hero_animation(shop_get_entry_for_state(0), 0, -1.0f); @@ -361,7 +363,7 @@ s32 hero_l22_set_action(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l22_set_action(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l22_set_move_state(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -407,12 +409,12 @@ s32 hero_l22_set_action(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l22_set_action(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_action(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l22_set_move_state(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (shop_get_entry_for_state(0) == 0x51) { if (!animate) goto finish; - if (hero_l22_set_action(0, 0)) set_hero_animation(shop_get_entry_for_state(0), 0, 18.0f); + if (hero_l22_set_move_state(0, 0)) set_hero_animation(shop_get_entry_for_state(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -437,7 +439,7 @@ s32 hero_l22_set_action(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_action(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -616,13 +618,13 @@ s32 hero_l22_set_action(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l22_set_action(0x81, 1); return 0; + hero_l22_set_move_state(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_flag_b) { hero_l22_set_action(0x6E, 1); return 0; } + action != 0x38 && !g_hero_flag_b) { hero_l22_set_move_state(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l22_set_action(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l22_set_move_state(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -697,9 +699,9 @@ s32 hero_l22_set_action(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_map_event_flag) hero_l22_set_action(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l22_set_action(0x79, 1); - else hero_l22_set_action(0x39, 1); + if (g_current_map_index == 2 && g_hero_map_event_flag) hero_l22_set_move_state(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l22_set_move_state(0x79, 1); + else hero_l22_set_move_state(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -754,7 +756,7 @@ s32 hero_l22_set_action(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -783,7 +785,7 @@ s32 hero_l22_set_action(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -792,7 +794,7 @@ s32 hero_l22_set_action(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -935,7 +937,7 @@ s32 hero_l22_set_action(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -1026,7 +1028,7 @@ s32 hero_l22_set_action(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -1038,7 +1040,7 @@ s32 hero_l22_set_action(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth(1); @@ -1073,7 +1075,7 @@ s32 hero_l22_set_action(s32 action, s32 animate) { set_hero_animation(0x11, 0, 8.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_action(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation(0, 0, 9.0f); goto finish; case 0x4B: @@ -1107,7 +1109,7 @@ s32 hero_l22_set_action(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l22_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_action(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1192,7 +1194,7 @@ s32 hero_l22_set_action(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l22_set_action(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l22_set_move_state(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/levels/shared/L22_002D0C98-decider.c b/src/levels/shared/L22_002D0C98-decider.c index ebc0f7aef..2eddd8591 100644 --- a/src/levels/shared/L22_002D0C98-decider.c +++ b/src/levels/shared/L22_002D0C98-decider.c @@ -84,7 +84,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l22_set_action(s32, s32); +s32 hero_l22_set_move_state(s32, s32); void text_play_mode_message(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -167,7 +167,7 @@ void hero_update_actions(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l22_set_action(0x39, 1); + hero_l22_set_move_state(0x39, 1); goto end; } } @@ -202,7 +202,7 @@ void hero_update_actions(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l22_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l22_set_action(0x74, 1); + hero_l22_set_move_state(0x74, 1); goto end; } } @@ -213,12 +213,12 @@ void hero_update_actions(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l22_set_action(1, 1); + hero_l22_set_move_state(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l22_set_action(0x82, 1); + hero_l22_set_move_state(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -255,7 +255,7 @@ void hero_update_actions(void) { rec = g_hero_action_records + sp40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l22_set_action(0x3C, 1); + hero_l22_set_move_state(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -298,12 +298,12 @@ void hero_update_actions(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l22_set_action(0x76, 1); + hero_l22_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); } break; } @@ -324,21 +324,21 @@ void hero_update_actions(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_flag_b == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l22_set_action(0x6E, 1); + hero_l22_set_move_state(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l22_set_action(4, 1); + hero_l22_set_move_state(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l22_set_action(0x27, 1); + hero_l22_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l22_set_action(0x2E, 1); + hero_l22_set_move_state(0x2E, 1); break; } { @@ -358,28 +358,28 @@ void hero_update_actions(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l22_set_action(2, 1); + hero_l22_set_move_state(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l22_set_action(1, 1); + hero_l22_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l22_set_action(0x3D, 1); + hero_l22_set_move_state(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l22_set_action(0x3D, 1); + hero_l22_set_move_state(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); } break; case 0x3D: @@ -388,22 +388,22 @@ void hero_update_actions(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l22_set_action(4, 1); + hero_l22_set_move_state(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l22_set_action(2, 1); + hero_l22_set_move_state(2, 1); break; } - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); break; case 0x39: case 0x43: @@ -442,25 +442,25 @@ void hero_update_actions(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l22_set_action(0x33, 1); + hero_l22_set_move_state(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l22_set_action(0x34, 1); + hero_l22_set_move_state(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l22_set_action(0x32, 1); + hero_l22_set_move_state(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l22_set_action(0x33, 1); + hero_l22_set_move_state(0x33, 1); } } break; @@ -473,81 +473,81 @@ void hero_update_actions(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l22_set_action(0x32, 1); + hero_l22_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l22_set_action(0x34, 1); + hero_l22_set_move_state(0x34, 1); } else { - hero_l22_set_action(0x32, 1); + hero_l22_set_move_state(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l22_set_action(0x12, 1); + hero_l22_set_move_state(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l22_set_action(0x32, 1); + hero_l22_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l22_set_action(0x34, 1); + hero_l22_set_move_state(0x34, 1); } else { - hero_l22_set_action(0x32, 1); + hero_l22_set_move_state(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l22_set_action(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l22_set_move_state(0, 0) != 0)) { set_hero_animation(shop_get_entry_for_state(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l22_set_action(0x35, 1); + hero_l22_set_move_state(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l22_set_action(0x12, 1); + hero_l22_set_move_state(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l22_set_action(0x32, 1); + hero_l22_set_move_state(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l22_set_action(0x34, 1); + hero_l22_set_move_state(0x34, 1); } else { - hero_l22_set_action(0x32, 1); + hero_l22_set_move_state(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l22_set_action(0x70, 0); + hero_l22_set_move_state(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l22_set_action(0x36, 1); + hero_l22_set_move_state(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l22_set_action(0x67, 1); + hero_l22_set_move_state(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action(0x33, 1); + hero_l22_set_move_state(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l22_set_action(0x33, 0); + hero_l22_set_move_state(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l22_set_action(0x67, 1); + hero_l22_set_move_state(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l22_set_action(0x36, 0); + hero_l22_set_move_state(0x36, 0); } break; case 0x1: @@ -581,9 +581,9 @@ void hero_update_actions(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { text_play_mode_message(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l22_set_action(4, 1); + hero_l22_set_move_state(4, 1); } else { - hero_l22_set_action(0, 0); + hero_l22_set_move_state(0, 0); anim = shop_get_entry_for_state(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -595,9 +595,9 @@ void hero_update_actions(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l22_set_action(0, 0); + hero_l22_set_move_state(0, 0); } else { - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); } } break; @@ -630,7 +630,7 @@ void hero_update_actions(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l22_set_action(7, 1); + hero_l22_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -639,7 +639,7 @@ void hero_update_actions(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l22_set_action(0, 0); + hero_l22_set_move_state(0, 0); } break; } @@ -661,7 +661,7 @@ void hero_update_actions(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l22_set_action(7, 1); + hero_l22_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -674,7 +674,7 @@ void hero_update_actions(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l22_set_action(2, 0); + hero_l22_set_move_state(2, 0); set_hero_animation(3, g_hero_l22_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -685,22 +685,22 @@ void hero_update_actions(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l22_set_action(2, 1); + hero_l22_set_move_state(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l22_set_action(0, 0); + hero_l22_set_move_state(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action(0, 0); + hero_l22_set_move_state(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -717,7 +717,7 @@ void hero_update_actions(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l22_set_action(7, 1); + hero_l22_set_move_state(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -726,7 +726,7 @@ void hero_update_actions(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l22_set_action(0, 0); + hero_l22_set_move_state(0, 0); set_hero_animation(shop_get_entry_for_state(0), 0, 15.0f); break; } @@ -738,7 +738,7 @@ void hero_update_actions(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); } break; case 0x2: @@ -752,11 +752,11 @@ void hero_update_actions(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l22_set_action(0x76, 1); + hero_l22_set_move_state(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); break; } n = 9; @@ -770,12 +770,12 @@ void hero_update_actions(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l22_set_action(9, 1); + hero_l22_set_move_state(9, 1); } else { - hero_l22_set_action(7, 1); + hero_l22_set_move_state(7, 1); } } else { - hero_l22_set_action(7, 1); + hero_l22_set_move_state(7, 1); } break; } @@ -783,11 +783,11 @@ void hero_update_actions(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l22_set_action(1, 1); + hero_l22_set_move_state(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l22_set_action(4, 1); + hero_l22_set_move_state(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -804,25 +804,25 @@ void hero_update_actions(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l22_set_action(0x2E, 1); + hero_l22_set_move_state(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l22_set_action(2, 1); + hero_l22_set_move_state(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l22_set_action(0x70, 1); + hero_l22_set_move_state(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l22_set_action(2, 1); + hero_l22_set_move_state(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l22_set_action(0x27, 1); + hero_l22_set_move_state(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -833,7 +833,7 @@ void hero_update_actions(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l22_set_action(0, 0) == 0) { + if (hero_l22_set_move_state(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -850,7 +850,7 @@ void hero_update_actions(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l22_set_action(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l22_set_move_state(0, 0) != 0)) { set_hero_animation(shop_get_entry_for_state(0), 0, 17.0f); } if (FLD(hero_moby, u8, 0x43) == 0x37) { @@ -871,7 +871,7 @@ void hero_update_actions(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l22_set_action(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l22_set_move_state(0, 0) != 0)) { set_hero_animation(shop_get_entry_for_state(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -905,17 +905,17 @@ void hero_update_actions(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l22_set_action(3, 0); + hero_l22_set_move_state(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l22_set_action(0x77, 1); + hero_l22_set_move_state(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l22_set_action(0x77, 1); + hero_l22_set_move_state(0x77, 1); break; } } @@ -933,11 +933,11 @@ void hero_update_actions(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l22_set_action(0x64, 1); + hero_l22_set_move_state(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l22_set_action(0x63, 1); + hero_l22_set_move_state(0x63, 1); } } else { hero_update_anim_scale(); @@ -945,21 +945,21 @@ void hero_update_actions(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action(0x62, 1); + hero_l22_set_move_state(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l22_set_action(0x62, 1); + hero_l22_set_move_state(0x62, 1); } break; case 0x65: /* switch 2 */ temp_a0_11 = FLD(g_hero_state, s32, 0x18C0); if ((temp_a0_11 < 3) && (((temp_a0_11 * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 7, &sp44) != 0)) { - hero_l22_set_action(0x66, 1); + hero_l22_set_move_state(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -1002,7 +1002,7 @@ void hero_update_actions(void) { return; case 0x6D: if ((f32)g_hero_anim_records[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); } break; case 0x30: @@ -1015,7 +1015,7 @@ void hero_update_actions(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l22_set_action(0, 0) != 0) { + if (hero_l22_set_move_state(0, 0) != 0) { set_hero_animation(shop_get_entry_for_state(0), 0, 17.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1023,29 +1023,29 @@ void hero_update_actions(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l22_set_action(1, 1); + hero_l22_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l22_set_action(7, 1); + hero_l22_set_move_state(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l22_set_action(4, 1); + hero_l22_set_move_state(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l22_set_action(0x27, 1); + hero_l22_set_move_state(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1053,45 +1053,45 @@ void hero_update_actions(void) { } if (shop_get_entry_for_state(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l22_set_action(0, 0); + hero_l22_set_move_state(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l22_set_action(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l22_set_move_state(0, 0) != 0)) { set_hero_animation(shop_get_entry_for_state(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l22_set_action(2, 1); + hero_l22_set_move_state(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l22_set_action(1, 1); + hero_l22_set_move_state(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l22_set_action(0, 0); + hero_l22_set_move_state(0, 0); set_hero_animation(shop_get_entry_for_state(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l22_set_action(0x76, 1); + hero_l22_set_move_state(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l22_set_action(0x15, 1); + hero_l22_set_move_state(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1099,17 +1099,17 @@ void hero_update_actions(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l22_set_action(0x8B, 1); + hero_l22_set_move_state(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); } break; case 0x24: @@ -1135,14 +1135,14 @@ void hero_update_actions(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l22_set_action(0, 0); + hero_l22_set_move_state(0, 0); set_hero_animation(shop_get_entry_for_state(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l22_set_action(6, 0); + hero_l22_set_move_state(6, 0); } else { - hero_l22_set_action(6, 0); + hero_l22_set_move_state(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1158,9 +1158,9 @@ void hero_update_actions(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); } else { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1172,7 +1172,7 @@ void hero_update_actions(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l22_set_action(0x2C, 1); + hero_l22_set_move_state(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1221,11 +1221,11 @@ void hero_update_actions(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.21666668f); FLD(g_hero_state, f32, 0x128) = 0.16666667f; - hero_l22_set_action(0x16, 1); + hero_l22_set_move_state(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x46; FLD(g_hero_state, s16, 0x1D0) = 0x46; } else { - hero_l22_set_action(0x3E, 1); + hero_l22_set_move_state(0x3E, 1); } break; } @@ -1238,7 +1238,7 @@ void hero_update_actions(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l22_set_action(0x28, 1); + hero_l22_set_move_state(0x28, 1); } break; } @@ -1249,16 +1249,16 @@ void hero_update_actions(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x46; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l22_set_action(0x74, 1); + hero_l22_set_move_state(0x74, 1); } else { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { - hero_l22_set_action(0x2A, 1); + hero_l22_set_move_state(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1275,7 +1275,7 @@ void hero_update_actions(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l22_set_action(0x28, 1); + hero_l22_set_move_state(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)v20 = 0; @@ -1292,7 +1292,7 @@ void hero_update_actions(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 5, NULL) != 0) && ((f32)g_hero_anim_records[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l22_set_action(0x28, 1); + hero_l22_set_move_state(0x28, 1); break; } top = 0xE; @@ -1301,19 +1301,19 @@ void hero_update_actions(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l22_set_action(0x2A, 1); + hero_l22_set_move_state(0x2A, 1); } break; } if ((f32)g_hero_anim_records[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l22_set_action(0x27, 1); + hero_l22_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x6C8) >= 6)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l22_set_action(0x74, 1); + hero_l22_set_move_state(0x74, 1); } else { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1322,7 +1322,7 @@ void hero_update_actions(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l22_set_action(0x27, 1); + hero_l22_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0xA) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1358,7 +1358,7 @@ void hero_update_actions(void) { find_nearest_path_point(sp50, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), sp5C, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l22_set_action(0x29, 1); + hero_l22_set_move_state(0x29, 1); break; } } @@ -1406,7 +1406,7 @@ void hero_update_actions(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x46; FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1414,7 +1414,7 @@ void hero_update_actions(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l22_set_action(0x71, 1); + hero_l22_set_move_state(0x71, 1); break; } { @@ -1426,7 +1426,7 @@ void hero_update_actions(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l22_set_action(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l22_set_move_state(0, 0) != 0)) { set_hero_animation(0xC, 4, 6.0f); } } else if (st == 0x3E) { @@ -1435,11 +1435,11 @@ void hero_update_actions(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)sp64, 0.5f, -1.0f); } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action(0x27, 1); + hero_l22_set_move_state(0x27, 1); break; } if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l22_set_action(0x27, 1); + hero_l22_set_move_state(0x27, 1); } } break; @@ -1455,13 +1455,13 @@ void hero_update_actions(void) { } } if (FLD(g_hero_state, s32, 0x6F0) >= 6) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); FLD(g_hero_state, s16, 0x204) = 0x1E; } break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l22_set_action(0x18, 0); + hero_l22_set_move_state(0x18, 0); } break; case 0x18: @@ -1470,18 +1470,18 @@ void hero_update_actions(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l22_set_action(0x1B, 1); + hero_l22_set_move_state(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1490,7 +1490,7 @@ void hero_update_actions(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l22_set_action(0x19, 1); + hero_l22_set_move_state(0x19, 1); } break; } @@ -1501,7 +1501,7 @@ void hero_update_actions(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l22_set_action(0x1A, 1); + hero_l22_set_move_state(0x1A, 1); } } } @@ -1520,18 +1520,18 @@ void hero_update_actions(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action(0x18, 1); + hero_l22_set_move_state(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l22_set_action(0x1B, 1); + hero_l22_set_move_state(0x1B, 1); } break; } @@ -1541,9 +1541,9 @@ void hero_update_actions(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); } else { - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); } } break; @@ -1567,12 +1567,12 @@ void hero_update_actions(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l22_set_action(0x39, 1); + hero_l22_set_move_state(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l22_set_action(0, 0) != 0) { + if (hero_l22_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1580,7 +1580,7 @@ void hero_update_actions(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l22_set_action(0, 0) != 0) { + if (hero_l22_set_move_state(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1594,36 +1594,36 @@ void hero_update_actions(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l22_set_action(2, 1); + hero_l22_set_move_state(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.0500000045f) { - if (hero_l22_set_action(3, 0) != 0) { + if (hero_l22_set_move_state(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l22_set_action(8, 1); + hero_l22_set_move_state(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l22_set_action(0x17, 1); + hero_l22_set_move_state(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l22_set_action(0x27, 1); + hero_l22_set_move_state(0x27, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l22_set_action(0x71, 1); + hero_l22_set_move_state(0x71, 1); } } break; @@ -1654,7 +1654,7 @@ void hero_update_actions(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l22_set_action(0, 0) != 0) { + if (hero_l22_set_move_state(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1664,9 +1664,9 @@ void hero_update_actions(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l22_set_action(0x74, 1); + hero_l22_set_move_state(0x74, 1); } else { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); } } break; @@ -1679,16 +1679,16 @@ void hero_update_actions(void) { ok = 1; } if (ok != 0) { - hero_l22_set_action(0x11, 1); + hero_l22_set_move_state(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l22_set_action(0x17, 1); + hero_l22_set_move_state(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1699,23 +1699,23 @@ void hero_update_actions(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l22_set_action(3, 0) != 0) { + if (hero_l22_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l22_set_action(4, 1); + hero_l22_set_move_state(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_distance_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l22_set_action(2, 1); + hero_l22_set_move_state(2, 1); break; } - hero_l22_set_action(2, 0); + hero_l22_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1724,21 +1724,21 @@ void hero_update_actions(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_distance_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l22_set_action(2, 1); + hero_l22_set_move_state(2, 1); break; } - hero_l22_set_action(2, 0); + hero_l22_set_move_state(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l22_extra_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l22_set_action(0, 0) != 0) { + if (hero_l22_set_move_state(0, 0) != 0) { set_hero_animation(shop_get_entry_for_state(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l22_set_action(0, 0) != 0) { + } else if (hero_l22_set_move_state(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1786,14 +1786,14 @@ void hero_update_actions(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l22_set_action(0xB, 1); + hero_l22_set_move_state(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l22_set_action(0x82, 1); + hero_l22_set_move_state(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1802,29 +1802,29 @@ void hero_update_actions(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l22_set_action(0xA, 1); + hero_l22_set_move_state(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l22_set_action(0x10, 1); + hero_l22_set_move_state(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l22_set_action(0x27, 1); + hero_l22_set_move_state(0x27, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l22_set_action(0x71, 1); + hero_l22_set_move_state(0x71, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l22_set_action(0x77, 1); + hero_l22_set_move_state(0x77, 1); break; } } @@ -1928,7 +1928,7 @@ void hero_update_actions(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l22_set_action(3, 0) != 0) { + if (hero_l22_set_move_state(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1936,13 +1936,13 @@ void hero_update_actions(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_distance_params[0][2])) { - hero_l22_set_action(7, 1); + hero_l22_set_move_state(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l22_set_action(7, 1); + hero_l22_set_move_state(7, 1); } else if (g_hero_distance_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l22_set_action(9, 1); + hero_l22_set_move_state(9, 1); } else { - hero_l22_set_action(7, 1); + hero_l22_set_move_state(7, 1); } break; } @@ -1950,10 +1950,10 @@ void hero_update_actions(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); break; } { @@ -1963,7 +1963,7 @@ void hero_update_actions(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l22_set_action(0x11, 1); + hero_l22_set_move_state(0x11, 1); break; } } @@ -1992,7 +1992,7 @@ void hero_update_actions(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l22_set_action(0xE, 1); + hero_l22_set_move_state(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -2002,32 +2002,32 @@ void hero_update_actions(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l22_set_action(8, 1); + hero_l22_set_move_state(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l22_set_action(0x17, 1); + hero_l22_set_move_state(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l22_set_action(6, 1); + hero_l22_set_move_state(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l22_set_action(0x79, 1); + hero_l22_set_move_state(0x79, 1); } else { - hero_l22_set_action(0x39, 1); + hero_l22_set_move_state(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l22_set_action(0x82, 1); + hero_l22_set_move_state(0x82, 1); } else { - hero_l22_set_action(0, 0); + hero_l22_set_move_state(0, 0); } } break; @@ -2037,8 +2037,8 @@ void hero_update_actions(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l22_set_action(0x39, 1); - } else if (hero_l22_set_action(0, 0) != 0) { + hero_l22_set_move_state(0x39, 1); + } else if (hero_l22_set_move_state(0, 0) != 0) { set_hero_animation(shop_get_entry_for_state(0), 0, 13.0f); } } @@ -2063,28 +2063,28 @@ void hero_update_actions(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l22_set_action(0x4E, 1); + hero_l22_set_move_state(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l22_set_action(1, 1); + hero_l22_set_move_state(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l22_set_action(0x41, 1); + hero_l22_set_move_state(0x41, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l22_set_action(0x45, 1); + hero_l22_set_move_state(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l22_set_action(0x4D, 1); + hero_l22_set_move_state(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l22_set_action(0x40, 1); + hero_l22_set_move_state(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -2097,14 +2097,14 @@ void hero_update_actions(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l22_set_action(0x4E, 1); + hero_l22_set_move_state(0x4E, 1); break; } rec = (u8 *)&g_hero_anim_records[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l22_set_action(0x3F, 0); + hero_l22_set_move_state(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -2113,13 +2113,13 @@ void hero_update_actions(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0x10) ? n : 0xF, NULL) != 0) { - hero_l22_set_action(0x4D, 1); + hero_l22_set_move_state(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l22_set_action(0x45, 1); + hero_l22_set_move_state(0x45, 1); } break; } @@ -2182,42 +2182,42 @@ void hero_update_actions(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l22_set_action(0x45, 1); + hero_l22_set_move_state(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_distance_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l22_set_action(0x40, 1); + hero_l22_set_move_state(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l22_set_action(0x3F, 1); + hero_l22_set_move_state(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l22_set_action(0x41, 1); + hero_l22_set_move_state(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 5, NULL) != 0)) { - hero_l22_set_action(0x4D, 1); + hero_l22_set_move_state(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l22_set_action(0x46, 1); + hero_l22_set_move_state(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l22_set_action(0x4B, 1); + hero_l22_set_move_state(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l22_set_action(0x41, 1); + hero_l22_set_move_state(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l22_set_action(0x46, 1); + hero_l22_set_move_state(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -2227,11 +2227,11 @@ void hero_update_actions(void) { FLD(g_hero_state, s16, 0x1EE) = 0xC - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l22_set_action(0x40, 1); + hero_l22_set_move_state(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l22_set_action(0x3F, 1); + hero_l22_set_move_state(0x3F, 1); } break; case 0x41: @@ -2243,29 +2243,29 @@ void hero_update_actions(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l22_set_action(0x43, 1); + hero_l22_set_move_state(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l22_set_action(0x40, 1); + hero_l22_set_move_state(0x40, 1); } else { - hero_l22_set_action(0x3F, 1); + hero_l22_set_move_state(0x3F, 1); } } else { - hero_l22_set_action(0x3F, 1); + hero_l22_set_move_state(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l22_set_action(0x46, 1); + hero_l22_set_move_state(0x46, 1); break; } if ((PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l22_set_action(0x4B, 1); + hero_l22_set_move_state(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l22_set_action(0x3F, 1); + hero_l22_set_move_state(0x3F, 1); } break; case 0x4E: @@ -2274,9 +2274,9 @@ void hero_update_actions(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l22_set_action(0x41, 1); + hero_l22_set_move_state(0x41, 1); } else { - hero_l22_set_action(0x3F, 1); + hero_l22_set_move_state(0x3F, 1); } } break; @@ -2286,7 +2286,7 @@ void hero_update_actions(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l22_set_action(0x4E, 1); + hero_l22_set_move_state(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.025000002f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2312,55 +2312,55 @@ void hero_update_actions(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l22_set_action(0x45, 1); + hero_l22_set_move_state(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l22_set_action(0x4D, 1); + hero_l22_set_move_state(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l22_set_action(0x41, 1); + hero_l22_set_move_state(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l22_set_action(0x3F, 1); + hero_l22_set_move_state(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l22_set_action(0x41, 1); + hero_l22_set_move_state(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x24) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l22_set_action(0x43, 1); + hero_l22_set_move_state(0x43, 1); } else { - hero_l22_set_action(0x3F, 0); + hero_l22_set_move_state(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action(0x47, 1); + hero_l22_set_move_state(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)v10 = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l22_set_action(0x41, 1); + hero_l22_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l22_set_action(0x41, 1); + hero_l22_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l22_set_action(0x48, 1); + hero_l22_set_move_state(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2369,7 +2369,7 @@ void hero_update_actions(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l22_set_action(0x49, 1); + hero_l22_set_move_state(0x49, 1); } break; } @@ -2380,7 +2380,7 @@ void hero_update_actions(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l22_set_action(0x4A, 1); + hero_l22_set_move_state(0x4A, 1); } } } @@ -2399,17 +2399,17 @@ void hero_update_actions(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action(0x47, 1); + hero_l22_set_move_state(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l22_set_action(0x41, 1); + hero_l22_set_move_state(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l22_set_action(0x48, 1); + hero_l22_set_move_state(0x48, 1); } break; } @@ -2430,31 +2430,31 @@ void hero_update_actions(void) { } } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l22_set_action(1, 1); + hero_l22_set_move_state(1, 1); break; } if (PadPressedWithin(0x40, 0xF, NULL) != 0) { - hero_l22_set_action(0x5B, 1); + hero_l22_set_move_state(0x5B, 1); break; } if (PadPressedWithin(0x80, 0xF, NULL) != 0) { - hero_l22_set_action(0x5D, 1); + hero_l22_set_move_state(0x5D, 1); break; } if ((PadPressedWithin(0x10, 8, NULL) != 0) && (player_slot_has_object(FLD(g_hero_state, u32, 0x2290)) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x1888), s32, 0xC) != 0) { - hero_l22_set_action(0x5E, 1); + hero_l22_set_move_state(0x5E, 1); FLD(FLD(g_hero_state, u8 *, 0x1888), s32, 0xC)--; } break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 2.0f)) { - hero_l22_set_action(0x58, 1); + hero_l22_set_move_state(0x58, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.22f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l22_set_action(0x57, 1); + hero_l22_set_move_state(0x57, 1); break; } break; @@ -2526,18 +2526,18 @@ void hero_update_actions(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 0xF)) { hero_resolve_stick_direction(0, 1.0f); - hero_l22_set_action(0x5B, 1); + hero_l22_set_move_state(0x5B, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 0xB) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, u8, 0x49C) >= 0xF)) { - hero_l22_set_action(0x56, 1); + hero_l22_set_move_state(0x56, 1); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_distance_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l22_set_action(0x57, 1); + hero_l22_set_move_state(0x57, 1); break; } } @@ -2550,7 +2550,7 @@ void hero_update_actions(void) { coll_sweep_from_object(FLD(g_hero_state, char *, 0x2290), (char *)v10, 0x30000, 0, 3.5f, 2.0f, 1.0f, 1, 0); } if ((FLD(g_hero_state, s16, 0x202) != 0) && (PadPressedWithin(0x40, 0xA, NULL) != 0)) { - hero_l22_set_action(0x5B, 1); + hero_l22_set_move_state(0x5B, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { @@ -2566,13 +2566,13 @@ void hero_update_actions(void) { FLD(g_hero_l22_state_block, s32, 0x168) = 0x1E; FLD(g_hero_l22_state_block, s32, 0x16C) = 0; if (FLD(g_hero_state, s32, 0x1874) <= 0) { - hero_l22_set_action(0x5F, 1); + hero_l22_set_move_state(0x5F, 1); break; } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l22_set_action(0x57, 1); + hero_l22_set_move_state(0x57, 1); } else { - hero_l22_set_action(0x56, 1); + hero_l22_set_move_state(0x56, 1); } break; case 0x5D: @@ -2582,28 +2582,28 @@ void hero_update_actions(void) { lim = 25.5f; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > lim) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (PadPressedWithin(0x80, 0x11, NULL) != 0)) { - hero_l22_set_action(0x5D, 1); + hero_l22_set_move_state(0x5D, 1); } if (((FLD(g_hero_state, f32, 0xC38) > 28.5f) && (FLD(g_hero_state, s32, 0xC2C) == 0)) || (FLD(g_hero_state, s32, 0xC28) & 2)) { - hero_l22_set_action(0x56, 0); + hero_l22_set_move_state(0x56, 0); break; } if ((FLD(g_hero_state, f32, 0xC38) > 19.0f) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.75f)) { - hero_l22_set_action(0x57, 0); + hero_l22_set_move_state(0x57, 0); set_hero_animation(3, 0x12, 11.0f); } break; } case 0x5E: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action(0x56, 1); + hero_l22_set_move_state(0x56, 1); break; } if (FLD(g_hero_state, s32, 0xC2C) != 0) { break; } if (FLD(g_hero_state, f32, 0xC38) > 32.0f) { - hero_l22_set_action(0x56, 1); + hero_l22_set_move_state(0x56, 1); } break; case 0x57: @@ -2612,40 +2612,40 @@ void hero_update_actions(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if (PadPressedWithin(0x40, 0xF, NULL) != 0) { - hero_l22_set_action(0x5B, 1); + hero_l22_set_move_state(0x5B, 1); break; } if (PadPressedWithin(0x80, 8, NULL) != 0) { - hero_l22_set_action(0x5D, 1); + hero_l22_set_move_state(0x5D, 1); break; } if (PadPressedWithin(0x10, 8, NULL) != 0) { if (FLD(FLD(g_hero_state, u8 *, 0x1888), s32, 0xC) != 0) { - hero_l22_set_action(0x5E, 1); + hero_l22_set_move_state(0x5E, 1); FLD(FLD(g_hero_state, u8 *, 0x1888), s32, 0xC)--; } break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 1.5f) && ((FLD(g_hero_state, f32, 0x31C) > 1.5f) || (FLD(g_hero_state, f32, 0x320) > 0.87266469f))) { - hero_l22_set_action(0x58, 1); + hero_l22_set_move_state(0x58, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { break; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.17f) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l22_set_action(0x56, 1); + hero_l22_set_move_state(0x56, 1); } break; case 0x59: case 0x5A: if ((FLD(g_hero_state, s32, 0x340) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33)) { - hero_l22_set_action(0x56, 1); + hero_l22_set_move_state(0x56, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x29) || (FLD(g_hero_state, s32, 0xC28) & 2)) { if (FLD(g_hero_state, s32, 0x1874) <= 0) { - hero_l22_set_action(0x5F, 1); + hero_l22_set_move_state(0x5F, 1); break; } set_hero_animation(0xE, 0, 11.0f); @@ -2662,7 +2662,7 @@ void hero_update_actions(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l22_set_action(0, 0); + hero_l22_set_move_state(0, 0); anim = shop_get_entry_for_state(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -2673,7 +2673,7 @@ void hero_update_actions(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l22_set_action(0, 0); + hero_l22_set_move_state(0, 0); } break; case 0x22: @@ -2683,12 +2683,12 @@ void hero_update_actions(void) { hero_choose_jump_or_roll_move(); break; } - hero_l22_set_action(7, 1); + hero_l22_set_move_state(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l22_set_action(0, 0); + hero_l22_set_move_state(0, 0); } break; default: diff --git a/src/levels/shared/L22_0039D708-main-g8.c b/src/levels/shared/L22_0039D708-main-g8.c index 6d7691786..62396c952 100644 --- a/src/levels/shared/L22_0039D708-main-g8.c +++ b/src/levels/shared/L22_0039D708-main-g8.c @@ -105,7 +105,7 @@ extern void object_copy_vector_to_selected(void *); extern void cam_set_state_rotation(void *); extern void SetCamera5Pose(void *, void *, int, int, int); extern void cancel_hero_item_animation(void); -extern int queue_copy_record_by_index(int); +extern int actuator_play_pattern(int); extern void release_moby_animation_slot(void *, void *); extern void moby_set_flag_bit(void *, int); extern int snd_start_in_slot(int, int, int); @@ -120,7 +120,7 @@ extern int moby_call_helper_with_blocks(void *); extern int joba_enemy_apply_source_damage(void *); extern int tribesman_turn_toward_point(void *, void *, float, float, float, float); extern void tribesman_rearm_guard_nodes(void *); -extern int hero_l22_set_action(int, int); +extern int hero_l22_set_move_state(int, int); extern void math_steer_along_direction(void *, void *, void *, void *, float, float, float); extern void moby_update_timed(void *); extern void arena_push_point_out(void *, float); @@ -465,7 +465,7 @@ void space_ship_update(s8 *moby) { cancel_hero_item_animation(); release_moby_animation_slot(M2C_FIELD(game, void **, 0x2290), game + 0x1870); M2C_FIELD(game, s32 *, 0x187C) = 0; - hero_l22_set_action(0, 1); + hero_l22_set_move_state(0, 1); M2C_FIELD(vars, s32 *, 0x344) = 0; } val43 = M2C_FIELD(vars, u16 *, 0x41E); @@ -1016,7 +1016,7 @@ void space_ship_update(s8 *moby) { } if (fast_vec_dist(&scratch[2].q, &scratch[3].q) < g_space_ship_trigger_distance) { - queue_copy_record_by_index(0x2B); + actuator_play_pattern(0x2B); g_space_ship_boost_timer = g_space_ship_state_default; } } diff --git a/src/levels/shared/L22_003A15D0-g8.c b/src/levels/shared/L22_003A15D0-g8.c index da3f39257..194f9c22f 100644 --- a/src/levels/shared/L22_003A15D0-g8.c +++ b/src/levels/shared/L22_003A15D0-g8.c @@ -189,7 +189,7 @@ extern void moby_update_ground_check(void *),func_002A0F48(void *); extern void cam_compute_view_direction(void *,void *,int), vec_negate_and_forward(void *,void *,int); extern int moby_apply_damage_to_object(void *,void *,int); extern void moby_set_state(void *,int,int), cancel_hero_item_animation(void), release_moby_animation_slot(void *,void *); -extern s32 hero_l22_set_action(int,int); +extern s32 hero_l22_set_move_state(int,int); /* Sets the record up on the first update (health scaled by difficulty, the object table scan, then the tuning block) and keeps the three child objects in step. The tuning @@ -330,7 +330,7 @@ void space_ship_init_and_update(Obj_15D0 *obj) { } else if(g_space_ship_timer<30) { g_hero_state.field2294=0; cancel_hero_item_animation(); release_moby_animation_slot(g_hero_state.field2290,&g_hero_state.field1870); - g_hero_state.field187C=0; hero_l22_set_action(0,1); + g_hero_state.field187C=0; hero_l22_set_move_state(0,1); } } else if(g_hero_state.health<=0 && obj->f95!=1) { p->f350=0; p->f3E4=p->f3E8=0.0f; diff --git a/src/pal/levels/01_oozla/L01_002B72D0-hero.c b/src/pal/levels/01_oozla/L01_002B72D0-hero.c index 65cc097ca..a55fcb032 100644 --- a/src/pal/levels/01_oozla/L01_002B72D0-hero.c +++ b/src/pal/levels/01_oozla/L01_002B72D0-hero.c @@ -133,7 +133,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -724,7 +724,7 @@ void hero_l01_update_state_machine_pal(void) { coll_process_hit(0.4f, (s32)((TI128*)work_vec0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)work_vec2)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x2a; if (g_hero_override_flag != 0) { ((Hero *)g_drive_settings)->f[0x180/4] = 0.1f; diff --git a/src/pal/levels/01_oozla/L01_002BEC60-sw.c b/src/pal/levels/01_oozla/L01_002BEC60-sw.c index fb8092e1a..80e829fdf 100644 --- a/src/pal/levels/01_oozla/L01_002BEC60-sw.c +++ b/src/pal/levels/01_oozla/L01_002BEC60-sw.c @@ -55,8 +55,8 @@ extern int hero_play_sound(int, int); extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -165,7 +165,9 @@ s32 SetHeroMoveState_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -459,7 +461,7 @@ s32 SetHeroMoveState_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -485,7 +487,7 @@ s32 SetHeroMoveState_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -494,7 +496,7 @@ s32 SetHeroMoveState_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -626,7 +628,7 @@ s32 SetHeroMoveState_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -696,7 +698,7 @@ s32 SetHeroMoveState_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -708,7 +710,7 @@ s32 SetHeroMoveState_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); diff --git a/src/pal/levels/01_oozla/L01_003BDAC0-sw.c b/src/pal/levels/01_oozla/L01_003BDAC0-sw.c index 32b8b2f98..ec019412f 100644 --- a/src/pal/levels/01_oozla/L01_003BDAC0-sw.c +++ b/src/pal/levels/01_oozla/L01_003BDAC0-sw.c @@ -41,9 +41,9 @@ extern char *g_path_l01_table[]; extern char *g_moby_l01_table __attribute__((sda)); extern float g_water_l01_height[] __attribute__((sda)); extern float g_ferry_height_offsets_alt[], g_ferry_height_offsets[]; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_ferry_src_record_a; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_ferry_src_record_b; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_ferry_src_record_c; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_ferry_rumble_waves_a; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_ferry_rumble_waves_b; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_ferry_rumble_waves_c; extern float level_get_water_height_pal(void); extern int func_001163B0(void); extern void anim_start_blended_pal(unsigned char *, int, int, int); @@ -75,8 +75,8 @@ extern void moby_scale_owner_words_by_angles(float *, float *, float *, float, f extern void value_set_and_smooth_pal(void *, float *, float, int, int); extern char *part_spawn_drifting(void *, float, float, void *, int); extern void path_sample_position(void *, int, void *, void *, int, float); -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); -extern void slot_reset_active(int); +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern void actuator_end_looping_waves(int); extern PoolRecord64 *cam_alloc_override_slot_pal(int); extern void cam_end_override(unsigned char *); #define I(p,o) (*(int *)((char *)(p)+(o))) @@ -156,7 +156,7 @@ void ferry_update_pal(unsigned char *moby) int i; hit = part_find_owned_effect_slot(moby, 0x10000, 0); if (hit && (!P(hit, 0x20) || H(P(hit, 0x20), 0xAA) != 0xCE7)) { - if (g_hero_state.interaction == (char *)moby && g_hero_state.active) slot_copy_records_to_free(&g_ferry_src_record_a); + if (g_hero_state.interaction == (char *)moby && g_hero_state.active) actuator_play_waves(&g_ferry_rumble_waves_a); if (moby[0x43] != 2) anim_start_blended_pal(moby, 2, 5, 3); moby_set_state(moby, 3, -1); } else { @@ -183,7 +183,7 @@ void ferry_update_pal(unsigned char *moby) F(moby, 0x48) = math_random_float_range(0.8f, 1.2f); } if (g_hero_state.interaction == (char *)moby && g_hero_state.active) { - slot_copy_records_to_free(&g_ferry_src_record_a); + actuator_play_waves(&g_ferry_rumble_waves_a); if (moby[0x43] != 2) anim_start_blended_pal(moby, 2, 5, 3); moby_set_state(moby, 3, -1); } @@ -193,7 +193,7 @@ void ferry_update_pal(unsigned char *moby) } case 3: if (moby[0x60] & 2) { - if (g_hero_state.interaction == (char *)moby && g_hero_state.active) I(context, 0x2F0) = slot_copy_records_to_free(&g_ferry_src_record_b); + if (g_hero_state.interaction == (char *)moby && g_hero_state.active) I(context, 0x2F0) = actuator_play_waves(&g_ferry_rumble_waves_b); if (moby[0x43] != 3) anim_start_blended_pal(moby, 3, 0, 6); F(context, 0x2CC) = F(context, 0x2D0) = 10.0f; moby_set_state(moby, 4, -1); @@ -248,9 +248,9 @@ void ferry_update_pal(unsigned char *moby) if (child) child[9] = FloatToInt(16.0f)+32; } if ((float)(I(outbound, 0)-1) <= F(context, 0x2B0)) { - slot_reset_active(I(context, 0x2F0)); + actuator_end_looping_waves(I(context, 0x2F0)); I(context, 0x2F0) = -1; - if (g_hero_state.interaction == (char *)moby && g_hero_state.active) slot_copy_records_to_free(&g_ferry_src_record_c); + if (g_hero_state.interaction == (char *)moby && g_hero_state.active) actuator_play_waves(&g_ferry_rumble_waves_c); if (moby[0x43] != 6) anim_start_blended_pal(moby, 6, 0, 10); U(moby, 0x96) = 0; moby[0x20] = 5; diff --git a/src/pal/levels/01_oozla/L01_003BFAF4-g8.c b/src/pal/levels/01_oozla/L01_003BFAF4-g8.c index 7ac95ddf1..4d7cf5e8f 100644 --- a/src/pal/levels/01_oozla/L01_003BFAF4-g8.c +++ b/src/pal/levels/01_oozla/L01_003BFAF4-g8.c @@ -29,8 +29,8 @@ extern float moby_get_anim_value(void *); extern void moby_set_state(void *, int, int); extern void anim_start_blended_pal(void *, int, int, int); extern int FloatToInt(float); -extern int queue_copy_record_by_index(int); -extern void slot_reset_active(int); +extern int actuator_play_pattern(int); +extern void actuator_end_looping_waves(int); extern int math_fast_float_d(void *); extern int PlayMobySound(int, int, void *); extern int math_random_int_below(int); @@ -66,27 +66,27 @@ void hero_grabber_update_pal(char *moby) if (g_hero_state.obj == moby && g_hero_state.active) { moby_set_state(moby, 2, -1); *(int *)(state + 0x60) = FloatToInt((*(float *)(state + 0x50) * 300.0f + 2.0f) * 0.16666667f); - *(int *)(state + 0x78) = queue_copy_record_by_index(7); + *(int *)(state + 0x78) = actuator_play_pattern(7); if (*(unsigned char *)(moby + 0x43) != 1) anim_start_blended_pal(moby, 1, 0, 8); } break; case 2: if (g_hero_state.obj == moby && g_hero_state.active) { - *(int *)(state + 0x78) = queue_copy_record_by_index(4); + *(int *)(state + 0x78) = actuator_play_pattern(4); } else if (*(int *)(state + 0x78) != -1) { - slot_reset_active(*(int *)(state + 0x78)); + actuator_end_looping_waves(*(int *)(state + 0x78)); *(int *)(state + 0x78) = -1; } if (math_fast_float_d(state + 0x70) && math_fast_float_d(state + 0x60)) { if (*(int *)(state + 0x78) != -1) { - slot_reset_active(*(int *)(state + 0x78)); + actuator_end_looping_waves(*(int *)(state + 0x78)); *(int *)(state + 0x78) = -1; } moby_set_state(moby, 3, -1); PlayMobySound(0, 0, moby); if (*(unsigned char *)(moby + 0x43) != 2) anim_start_blended_pal(moby, 2, 0, 5); if (g_hero_state.obj == moby && g_hero_state.active) - *(int *)(state + 0x78) = queue_copy_record_by_index(5); + *(int *)(state + 0x78) = actuator_play_pattern(5); *(float *)(moby + 0x48) = g_grabber_field_value; } break; @@ -95,12 +95,12 @@ void hero_grabber_update_pal(char *moby) *(unsigned short *)(moby + 0x34) |= 0x1000; *(int *)(state + 0x64) = 500; if (g_hero_state.obj == moby && g_hero_state.f31C < 0.5f) { - *(int *)(state + 0x78) = queue_copy_record_by_index(5); + *(int *)(state + 0x78) = actuator_play_pattern(5); *(int *)(state + 0x68) = 1; *(int *)(moby + 0x9C) = -1; } else { if (*(int *)(state + 0x78) != -1) { - slot_reset_active(*(int *)(state + 0x78)); + actuator_end_looping_waves(*(int *)(state + 0x78)); *(int *)(state + 0x78) = -1; } *(int *)(moby + 0x9C) = 0x80000000; @@ -109,7 +109,7 @@ void hero_grabber_update_pal(char *moby) } break; case 4: - if (*(int *)(state + 0x68) && !math_random_int_below(11)) *(int *)(state + 0x78) = queue_copy_record_by_index(5); + if (*(int *)(state + 0x68) && !math_random_int_below(11)) *(int *)(state + 0x78) = actuator_play_pattern(5); if (*(float *)(state + 0x74) < 46.0f && frame > 46.0f) { if (*(int *)(state + 0x68)) { if (g_hero_state.f24CC < 2) hero_record_play_counters_pal(); @@ -127,7 +127,7 @@ void hero_grabber_update_pal(char *moby) } if (*(unsigned char *)(moby + 0x60) & 2) { if (*(int *)(state + 0x78) != -1) { - slot_reset_active(*(int *)(state + 0x78)); + actuator_end_looping_waves(*(int *)(state + 0x78)); *(int *)(state + 0x78) = -1; } moby_set_state(moby, 1, -1); diff --git a/src/pal/levels/02_maktar_nebula/L02_00402030-g8.c b/src/pal/levels/02_maktar_nebula/L02_00402030-g8.c index 228efde07..7bc83004b 100644 --- a/src/pal/levels/02_maktar_nebula/L02_00402030-g8.c +++ b/src/pal/levels/02_maktar_nebula/L02_00402030-g8.c @@ -7,7 +7,7 @@ extern int mode_get_stack_top(void); extern int flag_is_byte_set(void); extern int arena_get_challenge_save_index(unsigned int); -extern int hero_l00_set_action_pal(int, int); +extern int hero_l00_set_move_state_pal(int, int); extern int snd_play_from_global_bank(int, int, void *); extern int FastDecTimer(short *); extern void moby_set_state(u8 *, int, int); @@ -49,7 +49,7 @@ void arena_update_challenge_menu_pal(u8 *object) int i, found; InputView *input; if (mode_get_stack_top()==5) return; - if (g_game_mode[0]!=0x6f) hero_l00_set_action_pal(0x6f,1); + if (g_game_mode[0]!=0x6f) hero_l00_set_move_state_pal(0x6f,1); if (H(0x11a)==0) { if ((((InputView *)g_pad_state)->field1c4&0x2000) && H(0x118)<13) { for (i=H(0x118)+1;i<14;i++) { diff --git a/src/pal/levels/02_maktar_nebula/L02_00403FF0-g8.c b/src/pal/levels/02_maktar_nebula/L02_00403FF0-g8.c index 2d846b819..d4c640ede 100644 --- a/src/pal/levels/02_maktar_nebula/L02_00403FF0-g8.c +++ b/src/pal/levels/02_maktar_nebula/L02_00403FF0-g8.c @@ -125,7 +125,7 @@ typedef struct { char pad1[0xDB]; } L02_003FF9A0_Rec; extern L02_003FF9A0_Rec g_material_l02_table[]; -extern s32 hero_l00_set_action_pal(s32, s32); +extern s32 hero_l00_set_move_state_pal(s32, s32); extern s32 PadPressedWithin(s32, s32, s32 *); extern s32 arena_get_challenge_save_index(s32); extern s32 flag_is_byte_set(void); @@ -151,7 +151,7 @@ void menu_select_next_usable_pal(char *moby) { L02_003FF9A0_Rec *r; if (g_game_mode != 0x6F) - hero_l00_set_action_pal(0x6F, 1); + hero_l00_set_move_state_pal(0x6F, 1); if (PadPressedWithin(0x40, 0x32, 0) != 0) { moby_set_state(moby, 7, -1); for (i = *(s16 *)(state + 0x118) + 1; i < 0xE; i++) { diff --git a/src/pal/levels/02_maktar_nebula/L02_00417A48-cc.c b/src/pal/levels/02_maktar_nebula/L02_00417A48-cc.c index 038c1e005..ef5ba4014 100644 --- a/src/pal/levels/02_maktar_nebula/L02_00417A48-cc.c +++ b/src/pal/levels/02_maktar_nebula/L02_00417A48-cc.c @@ -62,7 +62,7 @@ extern float vec_length_xy(void *); extern void vec_transform_by_object_or_given(char *, char *, char *, char *); extern double __extendsfdf2(float); extern void STUB_printf(const char *, ...); -extern int hero_l00_set_action_pal(s32, s32); +extern int hero_l00_set_move_state_pal(s32, s32); extern float vec_distance_xy(void *, void *); extern void cam_set_mode_state(s32); extern s32 flag_set_first_pending(u8 *); @@ -170,7 +170,7 @@ void lift_l02_update_pal(u8 *object) vec_transform_by_object_or_given((char *)object, (char *)&delta, (char *)&delta, 0); if (delta.f[2] < -0.6f) { STUB_printf(g_str_lift_distance, __extendsfdf2(distance)); - hero_l00_set_action_pal(0x6F, 1); + hero_l00_set_move_state_pal(0x6F, 1); moby_set_state(object, 2, -1); } } else if ((g_frame_l02_counter[0] & 0x3F) == 0) { @@ -251,7 +251,7 @@ void lift_l02_update_pal(u8 *object) s32 slot; u8 *sound_record; if ((u16)ticks == 37) - hero_l00_set_action_pal(0x6F, 1); + hero_l00_set_move_state_pal(0x6F, 1); slot = state->sound; sound_record = (u8 *)&g_sound_state[slot]; if (*(u8 **)(sound_record + 0x88) != object || !sound_record[0x74]) @@ -260,7 +260,7 @@ void lift_l02_update_pal(u8 *object) } if (g_grab_highlight_level[0] >= 1.0f) { s32 slot; - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); slot = state->sound; if (slot != -1) { u8 *sound_record = (u8 *)&g_sound_state[slot]; diff --git a/src/pal/levels/03_endako/L03_002B8620.c b/src/pal/levels/03_endako/L03_002B8620.c index 04714d1fe..4e3137a0d 100644 --- a/src/pal/levels/03_endako/L03_002B8620.c +++ b/src/pal/levels/03_endako/L03_002B8620.c @@ -62,7 +62,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l03_enter_state_pal(s32, s32); +extern s32 hero_l03_set_move_state_pal(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_pal(s32); extern int hero_play_sound(s32, s32); @@ -138,7 +138,7 @@ s32 hero_l03_apply_contact_push_pal(s32 do_push) { case 0: other_moby = g_hero_state.f249C; if (other_moby != 0 && (*(s16 *)(other_moby + 0xAA) == 0x4EB || *(s16 *)(other_moby + 0xAA) == 0x558)) { - hero_l03_enter_state_pal(0x7D, 1); + hero_l03_set_move_state_pal(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -149,7 +149,7 @@ s32 hero_l03_apply_contact_push_pal(s32 do_push) { AdjustPlayerHealth_pal(FloatToInt(*(float *)(effect + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l03_enter_state_pal(0x16, 1); + hero_l03_set_move_state_pal(0x16, 1); } g_hero_state.f1DC = 0x40; if (g_hero_state.f21C == 0) { @@ -159,9 +159,9 @@ s32 hero_l03_apply_contact_push_pal(s32 do_push) { return 0; } if (entry->f24 & 8) { - hero_l03_enter_state_pal(0x8C, 1); + hero_l03_set_move_state_pal(0x8C, 1); } else { - hero_l03_enter_state_pal(0x16, 1); + hero_l03_set_move_state_pal(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&push); @@ -173,7 +173,7 @@ s32 hero_l03_apply_contact_push_pal(s32 do_push) { } break; case 1: - hero_l03_enter_state_pal(0x42, 1); + hero_l03_set_move_state_pal(0x42, 1); hero_flatten_push_vector(&push, flag, 0.10000001f, 0.060000002f); break; } diff --git a/src/pal/levels/03_endako/L03_002BF860-hero.c b/src/pal/levels/03_endako/L03_002BF860-hero.c index 424fb653f..f7238de89 100644 --- a/src/pal/levels/03_endako/L03_002BF860-hero.c +++ b/src/pal/levels/03_endako/L03_002BF860-hero.c @@ -141,7 +141,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -980,7 +980,7 @@ void hero_l03_update_state_machine_pal(void) { coll_process_hit(0.4f, (s32)((TI128*)tmp_vec_00), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)tmp_vec_10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x2a; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l03_state_alias)->f[0x180/4] = 0.1f; diff --git a/src/pal/levels/03_endako/L03_002BF860-sw.c b/src/pal/levels/03_endako/L03_002BF860-sw.c index e864bbdfb..752004c59 100644 --- a/src/pal/levels/03_endako/L03_002BF860-sw.c +++ b/src/pal/levels/03_endako/L03_002BF860-sw.c @@ -76,7 +76,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_refresh_speed_from_timer_pal(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction_pal(void); -s32 hero_l03_enter_state_pal(s32, s32); +s32 hero_l03_set_move_state_pal(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition_pal(void); s32 hero_try_start_ledge_move(void); @@ -154,7 +154,7 @@ void hero_l03_decide_state_pal(void) { UpdateHeroHeldTarget_pal(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l03_enter_state_pal(0x39, 1); + hero_l03_set_move_state_pal(0x39, 1); goto end; } } @@ -189,7 +189,7 @@ void hero_l03_decide_state_pal(void) { hero_apply_pending_change_pal(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l03_decide_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l03_enter_state_pal(0x74, 1); + hero_l03_set_move_state_pal(0x74, 1); goto end; } } @@ -199,16 +199,16 @@ void hero_l03_decide_state_pal(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state_pal(1, 1); + hero_l03_set_move_state_pal(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l03_enter_state_pal(0x82, 1); + hero_l03_set_move_state_pal(0x82, 1); break; } if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l03_enter_state_pal(0x82, 1); + hero_l03_set_move_state_pal(0x82, 1); break; } { @@ -244,7 +244,7 @@ void hero_l03_decide_state_pal(void) { rec = g_hero_decide_records + local_40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 5e+01f; if (FLD(rec, s32, 0x44) != 0) { - hero_l03_enter_state_pal(0x3C, 1); + hero_l03_set_move_state_pal(0x3C, 1); } else { set_hero_animation_pal(FLD(rec, s32, 0x48), 0, 1e+01f); } @@ -287,12 +287,12 @@ void hero_l03_decide_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l03_enter_state_pal(0x76, 1); + hero_l03_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); } break; } @@ -313,17 +313,17 @@ void hero_l03_decide_state_pal(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l03_lock_flag == 0) && (PadPressedWithin(0x40, 6, NULL) != 0)) { - hero_l03_enter_state_pal(0x6E, 1); + hero_l03_set_move_state_pal(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l03_enter_state_pal(4, 1); + hero_l03_set_move_state_pal(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state_pal(0x27, 1); + hero_l03_set_move_state_pal(0x27, 1); break; } { @@ -343,28 +343,28 @@ void hero_l03_decide_state_pal(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust_pal(side, 0, 0, 0x1E); hero_play_footstep_sound_dust_pal(side, 1, 0, 0x1E); - hero_l03_enter_state_pal(2, 1); + hero_l03_set_move_state_pal(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state_pal(1, 1); + hero_l03_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l03_enter_state_pal(0x3D, 1); + hero_l03_set_move_state_pal(0x3D, 1); break; } hero_refresh_speed_from_timer_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l03_enter_state_pal(0x3D, 1); + hero_l03_set_move_state_pal(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l03_enter_state_pal(0, 1); + hero_l03_set_move_state_pal(0, 1); } break; case 0x3D: @@ -373,22 +373,22 @@ void hero_l03_decide_state_pal(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); break; } if (hero_try_start_move_from_buffer_pal(6, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state_pal(4, 1); + hero_l03_set_move_state_pal(4, 1); break; } hero_refresh_speed_from_timer_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l03_enter_state_pal(2, 1); + hero_l03_set_move_state_pal(2, 1); break; } - hero_l03_enter_state_pal(0, 1); + hero_l03_set_move_state_pal(0, 1); break; case 0x39: case 0x43: @@ -438,9 +438,9 @@ void hero_l03_decide_state_pal(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state_pal(4, 1); + hero_l03_set_move_state_pal(4, 1); } else { - hero_l03_enter_state_pal(0, 0); + hero_l03_set_move_state_pal(0, 0); anim = hero_get_gadget_value(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -452,9 +452,9 @@ void hero_l03_decide_state_pal(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l03_enter_state_pal(0, 0); + hero_l03_set_move_state_pal(0, 0); } else { - hero_l03_enter_state_pal(0, 1); + hero_l03_set_move_state_pal(0, 1); } } break; @@ -487,7 +487,7 @@ void hero_l03_decide_state_pal(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state_pal(7, 1); + hero_l03_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -496,7 +496,7 @@ void hero_l03_decide_state_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l03_enter_state_pal(0, 0); + hero_l03_set_move_state_pal(0, 0); } break; } @@ -518,7 +518,7 @@ void hero_l03_decide_state_pal(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state_pal(7, 1); + hero_l03_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -531,7 +531,7 @@ void hero_l03_decide_state_pal(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l03_enter_state_pal(2, 0); + hero_l03_set_move_state_pal(2, 0); set_hero_animation_pal(3, g_hero_l03_animation_table[FLD(g_hero_state, s32, 0x2298)], 11.0f); break; } @@ -542,22 +542,22 @@ void hero_l03_decide_state_pal(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l03_enter_state_pal(2, 1); + hero_l03_set_move_state_pal(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l03_enter_state_pal(0, 0); + hero_l03_set_move_state_pal(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_pal(0, 0); + hero_l03_set_move_state_pal(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l03_enter_state_pal(0, 1); + hero_l03_set_move_state_pal(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x54) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -574,7 +574,7 @@ void hero_l03_decide_state_pal(void) { } if (PadPressedWithin(0x40, 6, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state_pal(7, 1); + hero_l03_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -583,7 +583,7 @@ void hero_l03_decide_state_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l03_enter_state_pal(0, 0); + hero_l03_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_gadget_value(0), 0, 12.0f); break; } @@ -595,7 +595,7 @@ void hero_l03_decide_state_pal(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_pal(0, 1); + hero_l03_set_move_state_pal(0, 1); } break; case 0x2: @@ -609,11 +609,11 @@ void hero_l03_decide_state_pal(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l03_enter_state_pal(0x76, 1); + hero_l03_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead_pal() == 0)) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); break; } n = 7; @@ -627,12 +627,12 @@ void hero_l03_decide_state_pal(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l03_enter_state_pal(9, 1); + hero_l03_set_move_state_pal(9, 1); } else { - hero_l03_enter_state_pal(7, 1); + hero_l03_set_move_state_pal(7, 1); } } else { - hero_l03_enter_state_pal(7, 1); + hero_l03_set_move_state_pal(7, 1); } break; } @@ -640,15 +640,15 @@ void hero_l03_decide_state_pal(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.040000003f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state_pal(1, 1); + hero_l03_set_move_state_pal(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state_pal(4, 1); + hero_l03_set_move_state_pal(4, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state_pal(0x27, 1); + hero_l03_set_move_state_pal(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -659,7 +659,7 @@ void hero_l03_decide_state_pal(void) { if (hero_try_start_grab_pal() != 0) { break; } - if (hero_l03_enter_state_pal(0, 0) == 0) { + if (hero_l03_set_move_state_pal(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.030000001f); @@ -699,17 +699,17 @@ void hero_l03_decide_state_pal(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x19; - hero_l03_enter_state_pal(3, 0); + hero_l03_set_move_state_pal(3, 0); set_hero_animation_pal(6, 4, 9.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l03_enter_state_pal(0x77, 1); + hero_l03_set_move_state_pal(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l03_enter_state_pal(0x77, 1); + hero_l03_set_move_state_pal(0x77, 1); break; } } @@ -727,11 +727,11 @@ void hero_l03_decide_state_pal(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.054000005f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l03_enter_state_pal(0x64, 1); + hero_l03_set_move_state_pal(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.054000005f)) { - hero_l03_enter_state_pal(0x63, 1); + hero_l03_set_move_state_pal(0x63, 1); } } else { hero_update_anim_scale_pal(); @@ -739,15 +739,15 @@ void hero_l03_decide_state_pal(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_pal(0x62, 1); + hero_l03_set_move_state_pal(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l03_enter_state_pal(0, 1); + hero_l03_set_move_state_pal(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l03_enter_state_pal(0x62, 1); + hero_l03_set_move_state_pal(0x62, 1); } break; case 0x79: /* switch 2 */ @@ -772,29 +772,29 @@ void hero_l03_decide_state_pal(void) { return; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state_pal(1, 1); + hero_l03_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l03_enter_state_pal(7, 1); + hero_l03_set_move_state_pal(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state_pal(4, 1); + hero_l03_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 8) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_pal(0, 1); + hero_l03_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state_pal(0x27, 1); + hero_l03_set_move_state_pal(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -802,45 +802,45 @@ void hero_l03_decide_state_pal(void) { } if (hero_get_gadget_value(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l03_enter_state_pal(0, 0); + hero_l03_set_move_state_pal(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l03_enter_state_pal(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l03_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_gadget_value(0), 0, 14.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l03_enter_state_pal(2, 1); + hero_l03_set_move_state_pal(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state_pal(1, 1); + hero_l03_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xA) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state_pal(0, 0); + hero_l03_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_gadget_value(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l03_enter_state_pal(0x76, 1); + hero_l03_set_move_state_pal(0x76, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { break; } if ((PadPressedWithin(0x80, 0xC, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l03_enter_state_pal(0x15, 1); + hero_l03_set_move_state_pal(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 8) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l03_enter_state_pal(0, 1); + hero_l03_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -848,17 +848,17 @@ void hero_l03_decide_state_pal(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l03_enter_state_pal(0x8B, 1); + hero_l03_set_move_state_pal(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x4C) { - hero_l03_enter_state_pal(0, 1); + hero_l03_set_move_state_pal(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l03_enter_state_pal(0, 1); + hero_l03_set_move_state_pal(0, 1); } break; case 0x24: @@ -884,14 +884,14 @@ void hero_l03_decide_state_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l03_enter_state_pal(0, 0); + hero_l03_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_gadget_value(0), 0, 25.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l03_enter_state_pal(6, 0); + hero_l03_set_move_state_pal(6, 0); } else { - hero_l03_enter_state_pal(6, 0); + hero_l03_set_move_state_pal(6, 0); set_hero_animation_pal(0xA, 0, 14.0f); } FLD(g_hero_state, f32, 0xA84) = 0.016800001f; @@ -907,9 +907,9 @@ void hero_l03_decide_state_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l03_enter_state_pal(0, 1); + hero_l03_set_move_state_pal(0, 1); } else { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -921,7 +921,7 @@ void hero_l03_decide_state_pal(void) { if (t < 0x21) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l03_enter_state_pal(0x2C, 1); + hero_l03_set_move_state_pal(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0028000001f; FLD(g_hero_state, f32, 0xA80) = 0.0108f; } @@ -985,11 +985,11 @@ void hero_l03_decide_state_pal(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.26000002f); FLD(g_hero_state, f32, 0x128) = 0.20000002f; - hero_l03_enter_state_pal(0x16, 1); + hero_l03_set_move_state_pal(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x3A; FLD(g_hero_state, s16, 0x1D0) = 0x3A; } else { - hero_l03_enter_state_pal(0x3E, 1); + hero_l03_set_move_state_pal(0x3E, 1); } break; } @@ -1002,7 +1002,7 @@ void hero_l03_decide_state_pal(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l03_enter_state_pal(0x28, 1); + hero_l03_set_move_state_pal(0x28, 1); } break; } @@ -1013,16 +1013,16 @@ void hero_l03_decide_state_pal(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x3A; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l03_enter_state_pal(0x74, 1); + hero_l03_set_move_state_pal(0x74, 1); } else { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0x8, NULL) != 0)) { - hero_l03_enter_state_pal(0x2A, 1); + hero_l03_set_move_state_pal(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1039,7 +1039,7 @@ void hero_l03_decide_state_pal(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l03_enter_state_pal(0x28, 1); + hero_l03_set_move_state_pal(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)tmp_vec_20 = 0; @@ -1056,7 +1056,7 @@ void hero_l03_decide_state_pal(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 4, NULL) != 0) && ((f32)g_hero_state_params[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l03_enter_state_pal(0x28, 1); + hero_l03_set_move_state_pal(0x28, 1); break; } top = 0xE; @@ -1065,19 +1065,19 @@ void hero_l03_decide_state_pal(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0x8, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l03_enter_state_pal(0x2A, 1); + hero_l03_set_move_state_pal(0x2A, 1); } break; } if ((f32)g_hero_state_params[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l03_enter_state_pal(0x27, 1); + hero_l03_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 5) || (FLD(g_hero_state, s32, 0x6C8) >= 5)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l03_enter_state_pal(0x74, 1); + hero_l03_set_move_state_pal(0x74, 1); } else { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; @@ -1086,11 +1086,11 @@ void hero_l03_decide_state_pal(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 5) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l03_enter_state_pal(0x27, 1); + hero_l03_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 5) && (g_current_map_index == 0x14)) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0x8) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1126,7 +1126,7 @@ void hero_l03_decide_state_pal(void) { find_nearest_path_point(local_50, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), local_5c, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l03_enter_state_pal(0x29, 1); + hero_l03_set_move_state_pal(0x29, 1); break; } } @@ -1174,7 +1174,7 @@ void hero_l03_decide_state_pal(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x3A; FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; @@ -1182,7 +1182,7 @@ void hero_l03_decide_state_pal(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l03_enter_state_pal(0x71, 1); + hero_l03_set_move_state_pal(0x71, 1); break; } { @@ -1194,7 +1194,7 @@ void hero_l03_decide_state_pal(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l03_enter_state_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l03_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(0xC, 4, 5.0f); } } else if (st == 0x3E) { @@ -1203,24 +1203,24 @@ void hero_l03_decide_state_pal(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)local_64, 0.5f, -1.0f); } if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s32, 0x340) != 0)) { - if (hero_l03_enter_state_pal(0, 0) != 0) { + if (hero_l03_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_pal(0x27, 1); + hero_l03_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xD) && (FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l03_enter_state_pal(0x27, 1); + hero_l03_set_move_state_pal(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l03_enter_state_pal(0x18, 0); + hero_l03_set_move_state_pal(0x18, 0); } break; case 0x18: @@ -1229,18 +1229,18 @@ void hero_l03_decide_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab_pal((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 0xE, NULL) != 0) { - hero_l03_enter_state_pal(0x1B, 1); + hero_l03_set_move_state_pal(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1249,7 +1249,7 @@ void hero_l03_decide_state_pal(void) { tmp_vec_10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x97), 1.5707965f)) * 0.3f; tmp_vec_10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x97), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)tmp_vec_10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l03_enter_state_pal(0x19, 1); + hero_l03_set_move_state_pal(0x19, 1); } break; } @@ -1260,7 +1260,7 @@ void hero_l03_decide_state_pal(void) { tmp_vec_10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; tmp_vec_10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)tmp_vec_10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l03_enter_state_pal(0x1A, 1); + hero_l03_set_move_state_pal(0x1A, 1); } } } @@ -1279,18 +1279,18 @@ void hero_l03_decide_state_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab_pal((s8 *)tmp_vec_10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_pal(0x18, 1); + hero_l03_set_move_state_pal(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l03_enter_state_pal(0x1B, 1); + hero_l03_set_move_state_pal(0x1B, 1); } break; } @@ -1300,9 +1300,9 @@ void hero_l03_decide_state_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); } else { - hero_l03_enter_state_pal(0, 1); + hero_l03_set_move_state_pal(0, 1); } } break; @@ -1326,12 +1326,12 @@ void hero_l03_decide_state_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l03_enter_state_pal(0x39, 1); + hero_l03_set_move_state_pal(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x4B) { - if (hero_l03_enter_state_pal(0, 0) != 0) { + if (hero_l03_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } if (low != 0) { @@ -1339,7 +1339,7 @@ void hero_l03_decide_state_pal(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l03_enter_state_pal(0, 0) != 0) { + if (hero_l03_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1353,32 +1353,32 @@ void hero_l03_decide_state_pal(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l03_enter_state_pal(2, 1); + hero_l03_set_move_state_pal(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.060000002f) { - if (hero_l03_enter_state_pal(3, 0) != 0) { + if (hero_l03_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(6, 0, 1e+01f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.15400001f); } } else { - hero_l03_enter_state_pal(0, 1); + hero_l03_set_move_state_pal(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l03_enter_state_pal(8, 1); + hero_l03_set_move_state_pal(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x12) && (hero_try_start_move_from_buffer_pal((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 5, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state_pal(0x17, 1); + hero_l03_set_move_state_pal(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state_pal(0x27, 1); + hero_l03_set_move_state_pal(0x27, 1); break; } } @@ -1410,7 +1410,7 @@ void hero_l03_decide_state_pal(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l03_enter_state_pal(0, 0) != 0) { + if (hero_l03_set_move_state_pal(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1420,9 +1420,9 @@ void hero_l03_decide_state_pal(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l03_enter_state_pal(0x74, 1); + hero_l03_set_move_state_pal(0x74, 1); } else { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); } } break; @@ -1435,16 +1435,16 @@ void hero_l03_decide_state_pal(void) { ok = 1; } if (ok != 0) { - hero_l03_enter_state_pal(0x11, 1); + hero_l03_set_move_state_pal(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state_pal(0x17, 1); + hero_l03_set_move_state_pal(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1455,23 +1455,23 @@ void hero_l03_decide_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 3)) { - if (hero_l03_enter_state_pal(3, 0) != 0) { + if (hero_l03_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x1C; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state_pal(4, 1); + hero_l03_set_move_state_pal(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_l03_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l03_enter_state_pal(2, 1); + hero_l03_set_move_state_pal(2, 1); break; } - hero_l03_enter_state_pal(2, 0); + hero_l03_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, 2, 7.0f); @@ -1480,21 +1480,21 @@ void hero_l03_decide_state_pal(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_l03_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l03_enter_state_pal(2, 1); + hero_l03_set_move_state_pal(2, 1); break; } - hero_l03_enter_state_pal(2, 0); + hero_l03_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, g_hero_l03_animation_id, 1e+01f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l03_enter_state_pal(0, 0) != 0) { + if (hero_l03_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_gadget_value(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l03_enter_state_pal(0, 0) != 0) { + } else if (hero_l03_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1541,14 +1541,14 @@ void hero_l03_decide_state_pal(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 4, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state_pal(0xB, 1); + hero_l03_set_move_state_pal(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x11)) { - hero_l03_enter_state_pal(0x82, 1); + hero_l03_set_move_state_pal(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1557,25 +1557,25 @@ void hero_l03_decide_state_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 6) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f)) { - hero_l03_enter_state_pal(0xA, 1); + hero_l03_set_move_state_pal(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l03_enter_state_pal(0x10, 1); + hero_l03_set_move_state_pal(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state_pal(0x27, 1); + hero_l03_set_move_state_pal(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.14000002f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l03_enter_state_pal(0x77, 1); + hero_l03_set_move_state_pal(0x77, 1); break; } } @@ -1679,7 +1679,7 @@ void hero_l03_decide_state_pal(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l03_enter_state_pal(3, 0) != 0) { + if (hero_l03_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1687,13 +1687,13 @@ void hero_l03_decide_state_pal(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l03_speed_params[0][2])) { - hero_l03_enter_state_pal(7, 1); + hero_l03_set_move_state_pal(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l03_enter_state_pal(7, 1); + hero_l03_set_move_state_pal(7, 1); } else if (g_hero_l03_speed_params[1][1] * 0.017f < FLD(g_hero_state, f32, 0x174)) { - hero_l03_enter_state_pal(9, 1); + hero_l03_set_move_state_pal(9, 1); } else { - hero_l03_enter_state_pal(7, 1); + hero_l03_set_move_state_pal(7, 1); } break; } @@ -1701,10 +1701,10 @@ void hero_l03_decide_state_pal(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_l01_choose_next_move_after_landing_pal(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); break; } { @@ -1714,7 +1714,7 @@ void hero_l03_decide_state_pal(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x16)) && (PadPressedWithin(0x40, 6, &local_6c) != 0) && (local_6c < FLD(g_hero_state, s32, 0x1B8))) { - hero_l03_enter_state_pal(0x11, 1); + hero_l03_set_move_state_pal(0x11, 1); break; } } @@ -1743,7 +1743,7 @@ void hero_l03_decide_state_pal(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xD) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.11600001f)))) { - hero_l03_enter_state_pal(0xE, 1); + hero_l03_set_move_state_pal(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1753,32 +1753,32 @@ void hero_l03_decide_state_pal(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l03_enter_state_pal(8, 1); + hero_l03_set_move_state_pal(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x576) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l03_enter_state_pal(0x17, 1); + hero_l03_set_move_state_pal(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l03_enter_state_pal(6, 1); + hero_l03_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x17) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l03_enter_state_pal(0x79, 1); + hero_l03_set_move_state_pal(0x79, 1); } else { - hero_l03_enter_state_pal(0x39, 1); + hero_l03_set_move_state_pal(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l03_enter_state_pal(0x82, 1); + hero_l03_set_move_state_pal(0x82, 1); } else { - hero_l03_enter_state_pal(0, 0); + hero_l03_set_move_state_pal(0, 0); } } break; @@ -1788,8 +1788,8 @@ void hero_l03_decide_state_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x2B) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l03_enter_state_pal(0x39, 1); - } else if (hero_l03_enter_state_pal(0, 0) != 0) { + hero_l03_set_move_state_pal(0x39, 1); + } else if (hero_l03_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_gadget_value(0), 0, 11.0f); } } @@ -1814,28 +1814,28 @@ void hero_l03_decide_state_pal(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l03_enter_state_pal(0x4E, 1); + hero_l03_set_move_state_pal(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state_pal(1, 1); + hero_l03_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l03_enter_state_pal(0x41, 1); + hero_l03_set_move_state_pal(0x41, 1); break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l03_enter_state_pal(0x45, 1); + hero_l03_set_move_state_pal(0x45, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l03_enter_state_pal(0x4D, 1); + hero_l03_set_move_state_pal(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l03_enter_state_pal(0x40, 1); + hero_l03_set_move_state_pal(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -1848,14 +1848,14 @@ void hero_l03_decide_state_pal(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l03_enter_state_pal(0x4E, 1); + hero_l03_set_move_state_pal(0x4E, 1); break; } rec = (u8 *)&g_hero_state_params[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l03_enter_state_pal(0x3F, 0); + hero_l03_set_move_state_pal(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -1864,13 +1864,13 @@ void hero_l03_decide_state_pal(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0xD) ? n : 0xC, NULL) != 0) { - hero_l03_enter_state_pal(0x4D, 1); + hero_l03_set_move_state_pal(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l03_enter_state_pal(0x45, 1); + hero_l03_set_move_state_pal(0x45, 1); } break; } @@ -1933,42 +1933,42 @@ void hero_l03_decide_state_pal(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 3, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { hero_resolve_stick_direction(0, 1.0f); - hero_l03_enter_state_pal(0x45, 1); + hero_l03_set_move_state_pal(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l03_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x97)) < 1.5707964f)) { - hero_l03_enter_state_pal(0x40, 1); + hero_l03_set_move_state_pal(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xB) { - hero_l03_enter_state_pal(0x3F, 1); + hero_l03_set_move_state_pal(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x22)) { - hero_l03_enter_state_pal(0x41, 1); + hero_l03_set_move_state_pal(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 4, NULL) != 0)) { - hero_l03_enter_state_pal(0x4D, 1); + hero_l03_set_move_state_pal(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state_pal(0x46, 1); + hero_l03_set_move_state_pal(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l03_enter_state_pal(0x4B, 1); + hero_l03_set_move_state_pal(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l03_enter_state_pal(0x41, 1); + hero_l03_set_move_state_pal(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state_pal(0x46, 1); + hero_l03_set_move_state_pal(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -1978,11 +1978,11 @@ void hero_l03_decide_state_pal(void) { FLD(g_hero_state, s16, 0x1EE) = 0xA - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l03_enter_state_pal(0x40, 1); + hero_l03_set_move_state_pal(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l03_enter_state_pal(0x3F, 1); + hero_l03_set_move_state_pal(0x3F, 1); } break; case 0x41: @@ -1994,29 +1994,29 @@ void hero_l03_decide_state_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l03_enter_state_pal(0x43, 1); + hero_l03_set_move_state_pal(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l03_enter_state_pal(0x40, 1); + hero_l03_set_move_state_pal(0x40, 1); } else { - hero_l03_enter_state_pal(0x3F, 1); + hero_l03_set_move_state_pal(0x3F, 1); } } else { - hero_l03_enter_state_pal(0x3F, 1); + hero_l03_set_move_state_pal(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state_pal(0x46, 1); + hero_l03_set_move_state_pal(0x46, 1); break; } if ((PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l03_enter_state_pal(0x4B, 1); + hero_l03_set_move_state_pal(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l03_enter_state_pal(0x3F, 1); + hero_l03_set_move_state_pal(0x3F, 1); } break; case 0x4E: @@ -2025,9 +2025,9 @@ void hero_l03_decide_state_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l03_enter_state_pal(0x41, 1); + hero_l03_set_move_state_pal(0x41, 1); } else { - hero_l03_enter_state_pal(0x3F, 1); + hero_l03_set_move_state_pal(0x3F, 1); } } break; @@ -2037,7 +2037,7 @@ void hero_l03_decide_state_pal(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l03_enter_state_pal(0x4E, 1); + hero_l03_set_move_state_pal(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.030000001f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2063,55 +2063,55 @@ void hero_l03_decide_state_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l03_enter_state_pal(0x45, 1); + hero_l03_set_move_state_pal(0x45, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l03_enter_state_pal(0x4D, 1); + hero_l03_set_move_state_pal(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l03_enter_state_pal(0x41, 1); + hero_l03_set_move_state_pal(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l03_enter_state_pal(0x3F, 1); + hero_l03_set_move_state_pal(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1B) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l03_enter_state_pal(0x41, 1); + hero_l03_set_move_state_pal(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1E) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l03_enter_state_pal(0x43, 1); + hero_l03_set_move_state_pal(0x43, 1); } else { - hero_l03_enter_state_pal(0x3F, 0); + hero_l03_set_move_state_pal(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_pal(0x47, 1); + hero_l03_set_move_state_pal(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)tmp_vec_10 = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab_pal((s8 *)tmp_vec_10, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l03_enter_state_pal(0x41, 1); + hero_l03_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state_pal(0x41, 1); + hero_l03_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l03_enter_state_pal(0x48, 1); + hero_l03_set_move_state_pal(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2120,7 +2120,7 @@ void hero_l03_decide_state_pal(void) { tmp_vec_20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; tmp_vec_20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)tmp_vec_20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l03_enter_state_pal(0x49, 1); + hero_l03_set_move_state_pal(0x49, 1); } break; } @@ -2131,7 +2131,7 @@ void hero_l03_decide_state_pal(void) { tmp_vec_20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; tmp_vec_20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)tmp_vec_20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l03_enter_state_pal(0x4A, 1); + hero_l03_set_move_state_pal(0x4A, 1); } } } @@ -2150,17 +2150,17 @@ void hero_l03_decide_state_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab_pal((s8 *)tmp_vec_10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_pal(0x47, 1); + hero_l03_set_move_state_pal(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l03_enter_state_pal(0x41, 1); + hero_l03_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l03_enter_state_pal(0x48, 1); + hero_l03_set_move_state_pal(0x48, 1); } break; } @@ -2175,7 +2175,7 @@ void hero_l03_decide_state_pal(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l03_enter_state_pal(0, 0); + hero_l03_set_move_state_pal(0, 0); anim = hero_get_gadget_value(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -2186,7 +2186,7 @@ void hero_l03_decide_state_pal(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l03_enter_state_pal(0, 0); + hero_l03_set_move_state_pal(0, 0); } break; case 0x22: @@ -2196,12 +2196,12 @@ void hero_l03_decide_state_pal(void) { hero_choose_jump_or_roll_move_pal(); break; } - hero_l03_enter_state_pal(7, 1); + hero_l03_set_move_state_pal(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l03_enter_state_pal(0, 0); + hero_l03_set_move_state_pal(0, 0); } break; default: diff --git a/src/pal/levels/03_endako/L03_002BF860-sw2.c b/src/pal/levels/03_endako/L03_002BF860-sw2.c index 5f7003b79..631df9fdd 100644 --- a/src/pal/levels/03_endako/L03_002BF860-sw2.c +++ b/src/pal/levels/03_endako/L03_002BF860-sw2.c @@ -60,8 +60,8 @@ extern int hero_play_sound(int, int); extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -128,7 +128,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l03_enter_state_pal(s32 action, s32 animate) { +s32 hero_l03_set_move_state_pal(s32 action, s32 animate) { f32 dir[4]; u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -176,7 +176,9 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -189,7 +191,7 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_gadget_value(0) == 0x51) set_hero_animation_pal(hero_get_gadget_value(0), 0, 15.0f); else set_hero_animation_pal(hero_get_gadget_value(0), 0, -1.0f); @@ -240,7 +242,7 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l03_enter_state_pal(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l03_set_move_state_pal(0x76, 1); return 0; } } WORD(0x2298) = 0; BYTE(0x40C) = 0; BYTE(0x40E) = 0; @@ -270,11 +272,11 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state_pal(0x76, 1); return 0; } if (hero_try_start_grab_pal()) return 0; if (hero_get_gadget_value(0) == 0x51) { if (!animate) goto finish; - if (hero_l03_enter_state_pal(0, 0)) set_hero_animation_pal(hero_get_gadget_value(0), 0, 15.0f); + if (hero_l03_set_move_state_pal(0, 0)) set_hero_animation_pal(hero_get_gadget_value(0), 0, 15.0f); return 0; } if (!animate) goto finish; @@ -299,7 +301,7 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.14000002f) REAL(0x1B4) = 0.14000002f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.14000002f); @@ -464,13 +466,13 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l03_enter_state_pal(0x81, 1); return 0; + hero_l03_set_move_state_pal(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l03_lock_flag) { hero_l03_enter_state_pal(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l03_lock_flag) { hero_l03_set_move_state_pal(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l03_enter_state_pal(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l03_set_move_state_pal(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -529,9 +531,9 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_special_flag) hero_l03_enter_state_pal(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l03_enter_state_pal(0x79, 1); - else hero_l03_enter_state_pal(0x39, 1); + if (g_current_map_index == 2 && g_hero_special_flag) hero_l03_set_move_state_pal(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l03_set_move_state_pal(0x79, 1); + else hero_l03_set_move_state_pal(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -576,7 +578,7 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -605,7 +607,7 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -614,7 +616,7 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4B8) = 0.6f; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -754,7 +756,7 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -830,7 +832,7 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -842,7 +844,7 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); @@ -865,7 +867,7 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { set_hero_animation_pal(0x11, 0, 7.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state_pal(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state_pal(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation_pal(0, 0, 7.0f); goto finish; case 0x4B: @@ -899,7 +901,7 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l03_float_sequences[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state_pal(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state_pal(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -943,7 +945,7 @@ s32 hero_l03_enter_state_pal(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.09f; if (WORD(0x640) > 12 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l03_enter_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; + PTR(0x2290)[0xA8] = 255; hero_l03_set_move_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; return 0; } HALF(0x1DC) = 64; REAL(0x69C) = 0.050000004f; diff --git a/src/pal/levels/03_endako/L03_003CF460-cc-g8.c b/src/pal/levels/03_endako/L03_003CF460-cc-g8.c index b4df18b39..f480c2b99 100644 --- a/src/pal/levels/03_endako/L03_003CF460-cc-g8.c +++ b/src/pal/levels/03_endako/L03_003CF460-cc-g8.c @@ -15,7 +15,7 @@ extern void hero_start_target_state(void *, int, float); extern int coll_sweep_from_object(void *, void *, int, int, int, int, float, float, float); extern int flag_is_third_pending_set(void *); extern int hero_get_target_state_kind(void); -extern s32 hero_l03_enter_state(int, int); +extern s32 hero_l03_set_move_state(int, int); extern void FastVecSub(void *, void *, void *); extern float FastVecDot(void *, void *); extern void hero_start_loader_state(int); @@ -124,7 +124,7 @@ void tube_start_update_pal(char *actor) g_hero_state.interaction_lock=1; if (hero_get_target_state_kind()==2) { moby_set_state(actor,3,-1); - hero_l03_enter_state(0x6F,1); + hero_l03_set_move_state(0x6F,1); } else { timer = H(actor,0x96); old_timer = timer++; diff --git a/src/pal/levels/04_barlow/L04_002E04A0-hero.c b/src/pal/levels/04_barlow/L04_002E04A0-hero.c index 075072204..d5922ae39 100644 --- a/src/pal/levels/04_barlow/L04_002E04A0-hero.c +++ b/src/pal/levels/04_barlow/L04_002E04A0-hero.c @@ -138,7 +138,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -695,7 +695,7 @@ void hero_l04_update_state_machine_pal(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { val_32 = ((Hero *)g_hero_state)->i[0x2440/4]; if (val_32 != -1) { @@ -1419,7 +1419,7 @@ void hero_l04_update_state_machine_pal(void) { coll_process_hit(0.4f, (s32)((TI128*)vec_00), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec_10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x2a; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l04_state)->f[0x180/4] = 0.1f; diff --git a/src/pal/levels/04_barlow/L04_002E04A0-sw.c b/src/pal/levels/04_barlow/L04_002E04A0-sw.c index 5bb575916..cd0ddbd27 100644 --- a/src/pal/levels/04_barlow/L04_002E04A0-sw.c +++ b/src/pal/levels/04_barlow/L04_002E04A0-sw.c @@ -70,7 +70,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed_pal(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction_pal(void); -s32 hero_l04_enter_state_pal(s32, s32); +s32 hero_l04_set_move_state_pal(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition_pal(void); s32 hero_try_start_ledge_move(void); @@ -145,7 +145,7 @@ void hero_l04_decide_state_transition_pal(void) { UpdateHeroHeldTarget_pal(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l04_enter_state_pal(0x39, 1); + hero_l04_set_move_state_pal(0x39, 1); goto end; } } @@ -174,7 +174,7 @@ void hero_l04_decide_state_transition_pal(void) { hero_apply_pending_change_pal(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l04_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l04_enter_state_pal(0x74, 1); + hero_l04_set_move_state_pal(0x74, 1); goto end; } } @@ -185,12 +185,12 @@ void hero_l04_decide_state_transition_pal(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state_pal(1, 1); + hero_l04_set_move_state_pal(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l04_enter_state_pal(0x82, 1); + hero_l04_set_move_state_pal(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -227,7 +227,7 @@ void hero_l04_decide_state_transition_pal(void) { rec = g_hero_transition_records + transition_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 5e+01f; if (FLD(rec, s32, 0x44) != 0) { - hero_l04_enter_state_pal(0x3C, 1); + hero_l04_set_move_state_pal(0x3C, 1); } else { set_hero_animation_pal(FLD(rec, s32, 0x48), 0, 1e+01f); } @@ -270,12 +270,12 @@ void hero_l04_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l04_enter_state_pal(0x76, 1); + hero_l04_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); } break; } @@ -296,17 +296,17 @@ void hero_l04_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l04_lock_flag_b == 0) && (PadPressedWithin(0x40, 6, NULL) != 0)) { - hero_l04_enter_state_pal(0x6E, 1); + hero_l04_set_move_state_pal(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l04_enter_state_pal(4, 1); + hero_l04_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l04_enter_state_pal(0x2E, 1); + hero_l04_set_move_state_pal(0x2E, 1); break; } { @@ -326,28 +326,28 @@ void hero_l04_decide_state_transition_pal(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust_pal(side, 0, 0, 0x1E); hero_play_footstep_sound_dust_pal(side, 1, 0, 0x1E); - hero_l04_enter_state_pal(2, 1); + hero_l04_set_move_state_pal(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state_pal(1, 1); + hero_l04_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_3c = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_3c & 8)) { - hero_l04_enter_state_pal(0x3D, 1); + hero_l04_set_move_state_pal(0x3D, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l04_enter_state_pal(0x3D, 1); + hero_l04_set_move_state_pal(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l04_enter_state_pal(0, 1); + hero_l04_set_move_state_pal(0, 1); } break; case 0x3D: @@ -356,22 +356,22 @@ void hero_l04_decide_state_transition_pal(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); break; } if (hero_try_start_move_from_buffer_pal(6, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state_pal(4, 1); + hero_l04_set_move_state_pal(4, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l04_enter_state_pal(2, 1); + hero_l04_set_move_state_pal(2, 1); break; } - hero_l04_enter_state_pal(0, 1); + hero_l04_set_move_state_pal(0, 1); break; case 0x39: case 0x43: @@ -410,25 +410,25 @@ void hero_l04_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.040000003f)) { - hero_l04_enter_state_pal(0x33, 1); + hero_l04_set_move_state_pal(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12)) { - hero_l04_enter_state_pal(0x34, 1); + hero_l04_set_move_state_pal(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l04_enter_state_pal(0x32, 1); + hero_l04_set_move_state_pal(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l04_enter_state_pal(0x33, 1); + hero_l04_set_move_state_pal(0x33, 1); } } break; @@ -441,81 +441,81 @@ void hero_l04_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l04_enter_state_pal(0x32, 1); + hero_l04_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l04_enter_state_pal(0x34, 1); + hero_l04_set_move_state_pal(0x34, 1); } else { - hero_l04_enter_state_pal(0x32, 1); + hero_l04_set_move_state_pal(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l04_enter_state_pal(0x12, 1); + hero_l04_set_move_state_pal(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 6, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 6, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l04_enter_state_pal(0x32, 1); + hero_l04_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l04_enter_state_pal(0x34, 1); + hero_l04_set_move_state_pal(0x34, 1); } else { - hero_l04_enter_state_pal(0x32, 1); + hero_l04_set_move_state_pal(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l04_enter_state_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l04_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 15.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l04_enter_state_pal(0x35, 1); + hero_l04_set_move_state_pal(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l04_enter_state_pal(0x12, 1); + hero_l04_set_move_state_pal(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 6, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l04_enter_state_pal(0x32, 1); + hero_l04_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l04_enter_state_pal(0x34, 1); + hero_l04_set_move_state_pal(0x34, 1); } else { - hero_l04_enter_state_pal(0x32, 1); + hero_l04_set_move_state_pal(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l04_enter_state_pal(0x70, 0); + hero_l04_set_move_state_pal(0x70, 0); set_hero_animation_pal(0x59, 0, 14.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l04_enter_state_pal(0x36, 1); + hero_l04_set_move_state_pal(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state_pal(0x67, 1); + hero_l04_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x28, 15.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state_pal(0x33, 1); + hero_l04_set_move_state_pal(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l04_enter_state_pal(0x33, 0); + hero_l04_set_move_state_pal(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state_pal(0x67, 1); + hero_l04_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x25, 15.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l04_enter_state_pal(0x36, 0); + hero_l04_set_move_state_pal(0x36, 0); } break; case 0x1: @@ -549,9 +549,9 @@ void hero_l04_decide_state_transition_pal(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state_pal(4, 1); + hero_l04_set_move_state_pal(4, 1); } else { - hero_l04_enter_state_pal(0, 0); + hero_l04_set_move_state_pal(0, 0); anim = hero_get_weapon_animation_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -563,9 +563,9 @@ void hero_l04_decide_state_transition_pal(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l04_enter_state_pal(0, 0); + hero_l04_set_move_state_pal(0, 0); } else { - hero_l04_enter_state_pal(0, 1); + hero_l04_set_move_state_pal(0, 1); } } break; @@ -598,7 +598,7 @@ void hero_l04_decide_state_transition_pal(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state_pal(7, 1); + hero_l04_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -607,7 +607,7 @@ void hero_l04_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l04_enter_state_pal(0, 0); + hero_l04_set_move_state_pal(0, 0); } break; } @@ -629,7 +629,7 @@ void hero_l04_decide_state_transition_pal(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state_pal(7, 1); + hero_l04_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -642,7 +642,7 @@ void hero_l04_decide_state_transition_pal(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l04_enter_state_pal(2, 0); + hero_l04_set_move_state_pal(2, 0); set_hero_animation_pal(3, g_hero_l04_animation_ids[FLD(g_hero_state, s32, 0x2298)], 11.0f); break; } @@ -653,22 +653,22 @@ void hero_l04_decide_state_transition_pal(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l04_enter_state_pal(2, 1); + hero_l04_set_move_state_pal(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l04_enter_state_pal(0, 0); + hero_l04_set_move_state_pal(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state_pal(0, 0); + hero_l04_set_move_state_pal(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l04_enter_state_pal(0, 1); + hero_l04_set_move_state_pal(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x54) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -685,7 +685,7 @@ void hero_l04_decide_state_transition_pal(void) { } if (PadPressedWithin(0x40, 6, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state_pal(7, 1); + hero_l04_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -694,7 +694,7 @@ void hero_l04_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l04_enter_state_pal(0, 0); + hero_l04_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 12.0f); break; } @@ -706,7 +706,7 @@ void hero_l04_decide_state_transition_pal(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state_pal(0, 1); + hero_l04_set_move_state_pal(0, 1); } break; case 0x2: @@ -720,11 +720,11 @@ void hero_l04_decide_state_transition_pal(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l04_enter_state_pal(0x76, 1); + hero_l04_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead_pal() == 0)) { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); break; } n = 7; @@ -738,12 +738,12 @@ void hero_l04_decide_state_transition_pal(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l04_enter_state_pal(9, 1); + hero_l04_set_move_state_pal(9, 1); } else { - hero_l04_enter_state_pal(7, 1); + hero_l04_set_move_state_pal(7, 1); } } else { - hero_l04_enter_state_pal(7, 1); + hero_l04_set_move_state_pal(7, 1); } break; } @@ -751,11 +751,11 @@ void hero_l04_decide_state_transition_pal(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.040000003f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state_pal(1, 1); + hero_l04_set_move_state_pal(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state_pal(4, 1); + hero_l04_set_move_state_pal(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -772,21 +772,21 @@ void hero_l04_decide_state_transition_pal(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l04_enter_state_pal(0x2E, 1); + hero_l04_set_move_state_pal(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l04_enter_state_pal(2, 1); + hero_l04_set_move_state_pal(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l04_enter_state_pal(0x70, 1); + hero_l04_set_move_state_pal(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l04_enter_state_pal(2, 1); + hero_l04_set_move_state_pal(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -797,7 +797,7 @@ void hero_l04_decide_state_transition_pal(void) { if (hero_try_start_grab_pal() != 0) { break; } - if (hero_l04_enter_state_pal(0, 0) == 0) { + if (hero_l04_set_move_state_pal(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.030000001f); @@ -814,7 +814,7 @@ void hero_l04_decide_state_transition_pal(void) { hero_update_anim_scale_pal(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l04_enter_state_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l04_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 14.0f); } if (FLD(hero_target, u8, 0x43) == 0x37) { @@ -835,7 +835,7 @@ void hero_l04_decide_state_transition_pal(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l04_enter_state_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l04_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 14.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 29.166668f; @@ -869,17 +869,17 @@ void hero_l04_decide_state_transition_pal(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x19; - hero_l04_enter_state_pal(3, 0); + hero_l04_set_move_state_pal(3, 0); set_hero_animation_pal(6, 4, 9.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l04_enter_state_pal(0x77, 1); + hero_l04_set_move_state_pal(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l04_enter_state_pal(0x77, 1); + hero_l04_set_move_state_pal(0x77, 1); break; } } @@ -897,11 +897,11 @@ void hero_l04_decide_state_transition_pal(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.054000005f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l04_enter_state_pal(0x64, 1); + hero_l04_set_move_state_pal(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.054000005f)) { - hero_l04_enter_state_pal(0x63, 1); + hero_l04_set_move_state_pal(0x63, 1); } } else { hero_update_anim_scale_pal(); @@ -909,38 +909,38 @@ void hero_l04_decide_state_transition_pal(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state_pal(0x62, 1); + hero_l04_set_move_state_pal(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l04_enter_state_pal(0, 1); + hero_l04_set_move_state_pal(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l04_enter_state_pal(0x62, 1); + hero_l04_set_move_state_pal(0x62, 1); } break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state_pal(1, 1); + hero_l04_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l04_enter_state_pal(7, 1); + hero_l04_set_move_state_pal(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state_pal(4, 1); + hero_l04_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 8) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state_pal(0, 1); + hero_l04_set_move_state_pal(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -948,45 +948,45 @@ void hero_l04_decide_state_transition_pal(void) { } if (hero_get_weapon_animation_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l04_enter_state_pal(0, 0); + hero_l04_set_move_state_pal(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l04_enter_state_pal(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l04_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 14.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l04_enter_state_pal(2, 1); + hero_l04_set_move_state_pal(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state_pal(1, 1); + hero_l04_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xA) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state_pal(0, 0); + hero_l04_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l04_enter_state_pal(0x76, 1); + hero_l04_set_move_state_pal(0x76, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { break; } if ((PadPressedWithin(0x80, 0xC, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l04_enter_state_pal(0x15, 1); + hero_l04_set_move_state_pal(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 8) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l04_enter_state_pal(0, 1); + hero_l04_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -994,17 +994,17 @@ void hero_l04_decide_state_transition_pal(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l04_enter_state_pal(0x8B, 1); + hero_l04_set_move_state_pal(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x4C) { - hero_l04_enter_state_pal(0, 1); + hero_l04_set_move_state_pal(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l04_enter_state_pal(0, 1); + hero_l04_set_move_state_pal(0, 1); } break; case 0x24: @@ -1030,14 +1030,14 @@ void hero_l04_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l04_enter_state_pal(0, 0); + hero_l04_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 25.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l04_enter_state_pal(6, 0); + hero_l04_set_move_state_pal(6, 0); } else { - hero_l04_enter_state_pal(6, 0); + hero_l04_set_move_state_pal(6, 0); set_hero_animation_pal(0xA, 0, 14.0f); } FLD(g_hero_state, f32, 0xA84) = 0.016800001f; @@ -1053,9 +1053,9 @@ void hero_l04_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l04_enter_state_pal(0, 1); + hero_l04_set_move_state_pal(0, 1); } else { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1067,7 +1067,7 @@ void hero_l04_decide_state_transition_pal(void) { if (t < 0x21) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l04_enter_state_pal(0x2C, 1); + hero_l04_set_move_state_pal(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0028000001f; FLD(g_hero_state, f32, 0xA80) = 0.0108f; } @@ -1075,7 +1075,7 @@ void hero_l04_decide_state_transition_pal(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l04_enter_state_pal(0x18, 0); + hero_l04_set_move_state_pal(0x18, 0); } break; case 0x18: @@ -1084,18 +1084,18 @@ void hero_l04_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab_pal((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 0xE, NULL) != 0) { - hero_l04_enter_state_pal(0x1B, 1); + hero_l04_set_move_state_pal(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1104,7 +1104,7 @@ void hero_l04_decide_state_transition_pal(void) { vec_10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab_pal((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l04_enter_state_pal(0x19, 1); + hero_l04_set_move_state_pal(0x19, 1); } break; } @@ -1115,7 +1115,7 @@ void hero_l04_decide_state_transition_pal(void) { vec_10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab_pal((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l04_enter_state_pal(0x1A, 1); + hero_l04_set_move_state_pal(0x1A, 1); } } } @@ -1134,18 +1134,18 @@ void hero_l04_decide_state_transition_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab_pal((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state_pal(0x18, 1); + hero_l04_set_move_state_pal(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l04_enter_state_pal(0x1B, 1); + hero_l04_set_move_state_pal(0x1B, 1); } break; } @@ -1155,9 +1155,9 @@ void hero_l04_decide_state_transition_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); } else { - hero_l04_enter_state_pal(0, 1); + hero_l04_set_move_state_pal(0, 1); } } break; @@ -1181,12 +1181,12 @@ void hero_l04_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state_pal(0x39, 1); + hero_l04_set_move_state_pal(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x4B) { - if (hero_l04_enter_state_pal(0, 0) != 0) { + if (hero_l04_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } if (low != 0) { @@ -1194,7 +1194,7 @@ void hero_l04_decide_state_transition_pal(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l04_enter_state_pal(0, 0) != 0) { + if (hero_l04_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1208,28 +1208,28 @@ void hero_l04_decide_state_transition_pal(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l04_enter_state_pal(2, 1); + hero_l04_set_move_state_pal(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.060000002f) { - if (hero_l04_enter_state_pal(3, 0) != 0) { + if (hero_l04_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(6, 0, 1e+01f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.15400001f); } } else { - hero_l04_enter_state_pal(0, 1); + hero_l04_set_move_state_pal(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l04_enter_state_pal(8, 1); + hero_l04_set_move_state_pal(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x12) && (hero_try_start_move_from_buffer_pal((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 5, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l04_enter_state_pal(0x17, 1); + hero_l04_set_move_state_pal(0x17, 1); break; } } @@ -1261,7 +1261,7 @@ void hero_l04_decide_state_transition_pal(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l04_enter_state_pal(0, 0) != 0) { + if (hero_l04_set_move_state_pal(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1272,12 +1272,12 @@ void hero_l04_decide_state_transition_pal(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l04_enter_state_pal(0x74, 1); + hero_l04_set_move_state_pal(0x74, 1); } else { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); } } else { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); } } break; @@ -1290,16 +1290,16 @@ void hero_l04_decide_state_transition_pal(void) { ok = 1; } if (ok != 0) { - hero_l04_enter_state_pal(0x11, 1); + hero_l04_set_move_state_pal(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l04_enter_state_pal(0x17, 1); + hero_l04_set_move_state_pal(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1310,23 +1310,23 @@ void hero_l04_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 3)) { - if (hero_l04_enter_state_pal(3, 0) != 0) { + if (hero_l04_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x1C; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state_pal(4, 1); + hero_l04_set_move_state_pal(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l04_speed_params[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l04_enter_state_pal(2, 1); + hero_l04_set_move_state_pal(2, 1); break; } - hero_l04_enter_state_pal(2, 0); + hero_l04_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, 2, 7.0f); @@ -1335,21 +1335,21 @@ void hero_l04_decide_state_transition_pal(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l04_speed_params[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l04_enter_state_pal(2, 1); + hero_l04_set_move_state_pal(2, 1); break; } - hero_l04_enter_state_pal(2, 0); + hero_l04_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, g_hero_l04_animation_id, 1e+01f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l04_enter_state_pal(0, 0) != 0) { + if (hero_l04_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l04_enter_state_pal(0, 0) != 0) { + } else if (hero_l04_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1395,14 +1395,14 @@ void hero_l04_decide_state_transition_pal(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 4, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state_pal(0xB, 1); + hero_l04_set_move_state_pal(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x11)) { - hero_l04_enter_state_pal(0x82, 1); + hero_l04_set_move_state_pal(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1411,21 +1411,21 @@ void hero_l04_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 6) && (PadPressedWithin(8, 2, NULL) != 0) && ((old_action = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (old_action != 0xA) && (old_action != 0x12) && (old_action != 0x38) && (old_action != 0x11) && (old_action != 0xE) && (old_action != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f)) { - hero_l04_enter_state_pal(0xA, 1); + hero_l04_set_move_state_pal(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l04_enter_state_pal(0x10, 1); + hero_l04_set_move_state_pal(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.14000002f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l04_enter_state_pal(0x77, 1); + hero_l04_set_move_state_pal(0x77, 1); break; } } @@ -1529,7 +1529,7 @@ void hero_l04_decide_state_transition_pal(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l04_enter_state_pal(3, 0) != 0) { + if (hero_l04_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1537,13 +1537,13 @@ void hero_l04_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l04_speed_params[0][2])) { - hero_l04_enter_state_pal(7, 1); + hero_l04_set_move_state_pal(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l04_enter_state_pal(7, 1); + hero_l04_set_move_state_pal(7, 1); } else if (g_hero_l04_speed_params[1][1] * 0.017f < FLD(g_hero_state, f32, 0x174)) { - hero_l04_enter_state_pal(9, 1); + hero_l04_set_move_state_pal(9, 1); } else { - hero_l04_enter_state_pal(7, 1); + hero_l04_set_move_state_pal(7, 1); } break; } @@ -1551,10 +1551,10 @@ void hero_l04_decide_state_transition_pal(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_l00_choose_next_move_after_landing_pal(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); break; } { @@ -1564,7 +1564,7 @@ void hero_l04_decide_state_transition_pal(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x16)) && (PadPressedWithin(0x40, 6, &val_7) != 0) && (val_7 < FLD(g_hero_state, s32, 0x1B8))) { - hero_l04_enter_state_pal(0x11, 1); + hero_l04_set_move_state_pal(0x11, 1); break; } } @@ -1593,7 +1593,7 @@ void hero_l04_decide_state_transition_pal(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xD) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.11600001f)))) { - hero_l04_enter_state_pal(0xE, 1); + hero_l04_set_move_state_pal(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1603,28 +1603,28 @@ void hero_l04_decide_state_transition_pal(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l04_enter_state_pal(8, 1); + hero_l04_set_move_state_pal(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x576) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l04_enter_state_pal(0x17, 1); + hero_l04_set_move_state_pal(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l04_enter_state_pal(6, 1); + hero_l04_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x17) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state_pal(0x39, 1); + hero_l04_set_move_state_pal(0x39, 1); } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l04_enter_state_pal(0x82, 1); + hero_l04_set_move_state_pal(0x82, 1); } else { - hero_l04_enter_state_pal(0, 0); + hero_l04_set_move_state_pal(0, 0); } } break; @@ -1634,8 +1634,8 @@ void hero_l04_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x2B) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state_pal(0x39, 1); - } else if (hero_l04_enter_state_pal(0, 0) != 0) { + hero_l04_set_move_state_pal(0x39, 1); + } else if (hero_l04_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 11.0f); } } @@ -1656,7 +1656,7 @@ void hero_l04_decide_state_transition_pal(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l04_enter_state_pal(0, 0); + hero_l04_set_move_state_pal(0, 0); anim = hero_get_weapon_animation_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -1667,7 +1667,7 @@ void hero_l04_decide_state_transition_pal(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l04_enter_state_pal(0, 0); + hero_l04_set_move_state_pal(0, 0); } break; case 0x22: @@ -1677,12 +1677,12 @@ void hero_l04_decide_state_transition_pal(void) { hero_choose_jump_or_roll_move_pal(); break; } - hero_l04_enter_state_pal(7, 1); + hero_l04_set_move_state_pal(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l04_enter_state_pal(0, 0); + hero_l04_set_move_state_pal(0, 0); } break; default: diff --git a/src/pal/levels/04_barlow/L04_002E04A0-sw2.c b/src/pal/levels/04_barlow/L04_002E04A0-sw2.c index 1527db339..75651bf0c 100644 --- a/src/pal/levels/04_barlow/L04_002E04A0-sw2.c +++ b/src/pal/levels/04_barlow/L04_002E04A0-sw2.c @@ -55,8 +55,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -122,7 +122,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l04_enter_state_pal(s32 action, s32 animate) { +s32 hero_l04_set_move_state_pal(s32 action, s32 animate) { u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 old_step; @@ -169,7 +169,9 @@ s32 hero_l04_enter_state_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -182,8 +184,8 @@ s32 hero_l04_enter_state_pal(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l04_enter_state_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l04_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_animation_id(0) == 0x51) set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 15.0f); else set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, -1.0f); @@ -321,7 +323,7 @@ s32 hero_l04_enter_state_pal(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l04_enter_state_pal(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l04_set_move_state_pal(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.15400001f) REAL(0x1B4) = 0.15400001f; @@ -361,12 +363,12 @@ s32 hero_l04_enter_state_pal(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l04_enter_state_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l04_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_set_move_state_pal(0x76, 1); return 0; } if (hero_try_start_grab_pal()) return 0; if (hero_get_weapon_animation_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l04_enter_state_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 15.0f); + if (hero_l04_set_move_state_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 15.0f); return 0; } if (!animate) goto finish; @@ -391,7 +393,7 @@ s32 hero_l04_enter_state_pal(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.14000002f) REAL(0x1B4) = 0.14000002f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.14000002f); @@ -533,13 +535,13 @@ s32 hero_l04_enter_state_pal(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l04_enter_state_pal(0x81, 1); return 0; + hero_l04_set_move_state_pal(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l04_lock_flag_b) { hero_l04_enter_state_pal(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l04_lock_flag_b) { hero_l04_set_move_state_pal(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l04_enter_state_pal(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l04_set_move_state_pal(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -624,7 +626,7 @@ s32 hero_l04_enter_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -650,7 +652,7 @@ s32 hero_l04_enter_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -659,7 +661,7 @@ s32 hero_l04_enter_state_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -791,7 +793,7 @@ s32 hero_l04_enter_state_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -846,7 +848,7 @@ s32 hero_l04_enter_state_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -858,7 +860,7 @@ s32 hero_l04_enter_state_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); @@ -880,7 +882,7 @@ s32 hero_l04_enter_state_pal(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.09f; if (WORD(0x640) > 12 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l04_enter_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; + PTR(0x2290)[0xA8] = 255; hero_l04_set_move_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; return 0; } HALF(0x1DC) = 64; REAL(0x69C) = 0.050000004f; diff --git a/src/pal/levels/05_feltzin_system/L05_004227F0-g8.c b/src/pal/levels/05_feltzin_system/L05_004227F0-g8.c index 42be59917..7ef2a679e 100644 --- a/src/pal/levels/05_feltzin_system/L05_004227F0-g8.c +++ b/src/pal/levels/05_feltzin_system/L05_004227F0-g8.c @@ -30,7 +30,7 @@ extern float g_screen_l05_scale[] __attribute__((sda)); extern char *g_feltzin_target_mobys[] __attribute__((sda)); extern void hero_set_state_value_a(int), hero_set_state_value_b(int), level_select_random_object(void); extern void level_store_pair_with_increment(int, int), moby_set_flag_bit(void *, int); -extern int hero_l00_set_action_pal(int, int); +extern int hero_l00_set_move_state_pal(int, int); extern void hero_set_state_value_c(int); extern int LockedEntryMenuInput_pal(void); extern void ship_save_transform_state_pal(void); @@ -146,7 +146,7 @@ void feltzin_challenge_controller_update_pal(char *object) g_feltzin_frame_counter = 0; } if (g_feltzin_frame_counter++ < 5 || g_game_mode_a[0] == 2) break; - hero_l00_set_action_pal(0x31,0); + hero_l00_set_move_state_pal(0x31,0); if (g_feltzin_needs_reset) { hero_set_state_value_c(1); g_feltzin_menu_mode = LockedEntryMenuInput_pal(); diff --git a/src/pal/levels/06_notak/L06_0041DED0-sw.c b/src/pal/levels/06_notak/L06_0041DED0-sw.c index e2d4cc71a..51ac88c37 100644 --- a/src/pal/levels/06_notak/L06_0041DED0-sw.c +++ b/src/pal/levels/06_notak/L06_0041DED0-sw.c @@ -58,7 +58,7 @@ extern float mat_fast_helper_a(float,float); extern float math_fabs(float); extern int PadPressedWithin(int,int,int); extern float fast_vec_dist(void *,void *); -extern int hero_l00_set_action_pal(int,int); +extern int hero_l00_set_move_state_pal(int,int); extern void SetCamera5Pose(void *,void *,int,int,int); extern void cam_set_state_rotation(void *); extern void object_copy_vector_to_selected(void *); @@ -126,7 +126,7 @@ void bolt_crank_update_pal(char *obj) if(fast_vec_dist(obj+0x10,nearby+0x10)<3.25f) {clear=0;break;} } if(clear) { - hero_l00_set_action_pal(0x37,1); + hero_l00_set_move_state_pal(0x37,1); SetCamera5Pose(g_hero_l06_position.position,g_hero_l06_position.rotation,3,0x96,0); cam_set_state_rotation(g_region_table+(I(ctx,0x20)<<7)+0x70); object_copy_vector_to_selected(g_region_table+(I(ctx,0x20)<<7)+0x30); @@ -154,7 +154,7 @@ void bolt_crank_update_pal(char *obj) temp.q=0; temp.f[2]=g_hero_l06_position.rotation[2]; axis.q=temp.q; angle=mat_fast_helper_a(g_hero_state.position[0]-F(obj,0x10),g_hero_state.position[1]-F(obj,0x14)); if((PadPressedWithin(0x80,6,0) && g_hero_state.modeTimer>=51) || F(ctx,0)==1.0f) { - hero_l00_set_action_pal(0,1); + hero_l00_set_move_state_pal(0,1); if(I(ctx,0x38)) {U(obj,0x20)=1;} else if(F(ctx,0)==1.0f) { diff --git a/src/pal/levels/06_notak/L06_0045F6D0-sw.c b/src/pal/levels/06_notak/L06_0045F6D0-sw.c index 107601aa9..9d967b16d 100644 --- a/src/pal/levels/06_notak/L06_0045F6D0-sw.c +++ b/src/pal/levels/06_notak/L06_0045F6D0-sw.c @@ -45,7 +45,7 @@ extern int IsPointInCuboid(void *, int); extern void *part_spawn_drifting(void *, void *, int, float, float); extern int PlayMobySound(int, int, void *); extern void RippleDisturb(int, int, int, float, float, float, float); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern void moby_update_empty_alt(void *, void *, void *); extern float math_turn_angle_toward_target(void *, float, float, float, float, float); extern int math_blend_scaled_count(void *, void *, int, int, float, float); @@ -331,7 +331,7 @@ void UpdateMoby4070_pal(u8 *self) { FastVecSub(vars + 0xC0, self_pos_c, &vec_prev_pos); if (F(vars, 0x13C) >= 1.0f) { ((Hero *)g_hero_state)->i[0x24CC / 4] = 0; - hero_l00_set_action_pal(0x39, 1); + hero_l00_set_move_state_pal(0x39, 1); W(((Hero *)g_hero_state)->ptr[0x2290 / 4], 0x9C) = -1; ((Hero *)g_hero_state)->b[0x22B5] = 1; B(self, 0x20) = 6; diff --git a/src/pal/levels/07_siberius/L07_002B8608-hero.c b/src/pal/levels/07_siberius/L07_002B8608-hero.c index 4e0663e2f..8d05465a8 100644 --- a/src/pal/levels/07_siberius/L07_002B8608-hero.c +++ b/src/pal/levels/07_siberius/L07_002B8608-hero.c @@ -138,7 +138,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -1011,7 +1011,7 @@ void hero_l07_update_state_machine_pal(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x2a; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l07_state_block)->f[0x180/4] = 0.1f; diff --git a/src/pal/levels/07_siberius/L07_002B8608-sw.c b/src/pal/levels/07_siberius/L07_002B8608-sw.c index c1fe70096..4b53980f8 100644 --- a/src/pal/levels/07_siberius/L07_002B8608-sw.c +++ b/src/pal/levels/07_siberius/L07_002B8608-sw.c @@ -72,7 +72,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_refresh_speed_from_timer_pal(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction_pal(void); -s32 hero_l07_enter_state_pal(s32, s32); +s32 hero_l07_set_move_state_pal(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition_pal(void); s32 hero_try_start_ledge_move(void); @@ -148,7 +148,7 @@ void hero_l07_decide_state_transition_pal(void) { UpdateHeroHeldTarget_pal(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l07_enter_state_pal(0x39, 1); + hero_l07_set_move_state_pal(0x39, 1); goto end; } } @@ -177,7 +177,7 @@ void hero_l07_decide_state_transition_pal(void) { hero_apply_pending_change_pal(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l07_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l07_enter_state_pal(0x74, 1); + hero_l07_set_move_state_pal(0x74, 1); goto end; } } @@ -187,12 +187,12 @@ void hero_l07_decide_state_transition_pal(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state_pal(1, 1); + hero_l07_set_move_state_pal(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l07_enter_state_pal(0x82, 1); + hero_l07_set_move_state_pal(0x82, 1); break; } { @@ -228,7 +228,7 @@ void hero_l07_decide_state_transition_pal(void) { rec = g_hero_move_table + selected_move * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 5e+01f; if (FLD(rec, s32, 0x44) != 0) { - hero_l07_enter_state_pal(0x3C, 1); + hero_l07_set_move_state_pal(0x3C, 1); } else { set_hero_animation_pal(FLD(rec, s32, 0x48), 0, 1e+01f); } @@ -271,12 +271,12 @@ void hero_l07_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l07_enter_state_pal(0x76, 1); + hero_l07_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); } break; } @@ -297,12 +297,12 @@ void hero_l07_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l07_busy_flag == 0) && (PadPressedWithin(0x40, 6, NULL) != 0)) { - hero_l07_enter_state_pal(0x6E, 1); + hero_l07_set_move_state_pal(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l07_enter_state_pal(4, 1); + hero_l07_set_move_state_pal(4, 1); break; } } @@ -323,28 +323,28 @@ void hero_l07_decide_state_transition_pal(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust_pal(side, 0, 0, 0x1E); hero_play_footstep_sound_dust_pal(side, 1, 0, 0x1E); - hero_l07_enter_state_pal(2, 1); + hero_l07_set_move_state_pal(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state_pal(1, 1); + hero_l07_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_buttons = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_buttons & 8)) { - hero_l07_enter_state_pal(0x3D, 1); + hero_l07_set_move_state_pal(0x3D, 1); break; } hero_refresh_speed_from_timer_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l07_enter_state_pal(0x3D, 1); + hero_l07_set_move_state_pal(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l07_enter_state_pal(0, 1); + hero_l07_set_move_state_pal(0, 1); } break; case 0x3D: @@ -353,22 +353,22 @@ void hero_l07_decide_state_transition_pal(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); break; } if (hero_try_start_move_from_buffer_pal(6, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state_pal(4, 1); + hero_l07_set_move_state_pal(4, 1); break; } hero_refresh_speed_from_timer_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l07_enter_state_pal(2, 1); + hero_l07_set_move_state_pal(2, 1); break; } - hero_l07_enter_state_pal(0, 1); + hero_l07_set_move_state_pal(0, 1); break; case 0x39: case 0x43: @@ -424,9 +424,9 @@ void hero_l07_decide_state_transition_pal(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state_pal(4, 1); + hero_l07_set_move_state_pal(4, 1); } else { - hero_l07_enter_state_pal(0, 0); + hero_l07_set_move_state_pal(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -438,9 +438,9 @@ void hero_l07_decide_state_transition_pal(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l07_enter_state_pal(0, 0); + hero_l07_set_move_state_pal(0, 0); } else { - hero_l07_enter_state_pal(0, 1); + hero_l07_set_move_state_pal(0, 1); } } break; @@ -473,7 +473,7 @@ void hero_l07_decide_state_transition_pal(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state_pal(7, 1); + hero_l07_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -482,7 +482,7 @@ void hero_l07_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l07_enter_state_pal(0, 0); + hero_l07_set_move_state_pal(0, 0); } break; } @@ -504,7 +504,7 @@ void hero_l07_decide_state_transition_pal(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state_pal(7, 1); + hero_l07_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -517,7 +517,7 @@ void hero_l07_decide_state_transition_pal(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l07_enter_state_pal(2, 0); + hero_l07_set_move_state_pal(2, 0); set_hero_animation_pal(3, g_hero_l07_animation_ids[FLD(g_hero_state, s32, 0x2298)], 11.0f); break; } @@ -528,22 +528,22 @@ void hero_l07_decide_state_transition_pal(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l07_enter_state_pal(2, 1); + hero_l07_set_move_state_pal(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l07_enter_state_pal(0, 0); + hero_l07_set_move_state_pal(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state_pal(0, 0); + hero_l07_set_move_state_pal(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l07_enter_state_pal(0, 1); + hero_l07_set_move_state_pal(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x54) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -560,7 +560,7 @@ void hero_l07_decide_state_transition_pal(void) { } if (PadPressedWithin(0x40, 6, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state_pal(7, 1); + hero_l07_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -569,7 +569,7 @@ void hero_l07_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l07_enter_state_pal(0, 0); + hero_l07_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 12.0f); break; } @@ -581,7 +581,7 @@ void hero_l07_decide_state_transition_pal(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state_pal(0, 1); + hero_l07_set_move_state_pal(0, 1); } break; case 0x2: @@ -595,11 +595,11 @@ void hero_l07_decide_state_transition_pal(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l07_enter_state_pal(0x76, 1); + hero_l07_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead_pal() == 0)) { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); break; } n = 7; @@ -613,12 +613,12 @@ void hero_l07_decide_state_transition_pal(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l07_enter_state_pal(9, 1); + hero_l07_set_move_state_pal(9, 1); } else { - hero_l07_enter_state_pal(7, 1); + hero_l07_set_move_state_pal(7, 1); } } else { - hero_l07_enter_state_pal(7, 1); + hero_l07_set_move_state_pal(7, 1); } break; } @@ -626,11 +626,11 @@ void hero_l07_decide_state_transition_pal(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.040000003f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state_pal(1, 1); + hero_l07_set_move_state_pal(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state_pal(4, 1); + hero_l07_set_move_state_pal(4, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -641,7 +641,7 @@ void hero_l07_decide_state_transition_pal(void) { if (hero_try_start_grab_pal() != 0) { break; } - if (hero_l07_enter_state_pal(0, 0) == 0) { + if (hero_l07_set_move_state_pal(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.030000001f); @@ -681,17 +681,17 @@ void hero_l07_decide_state_transition_pal(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x19; - hero_l07_enter_state_pal(3, 0); + hero_l07_set_move_state_pal(3, 0); set_hero_animation_pal(6, 4, 9.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l07_enter_state_pal(0x77, 1); + hero_l07_set_move_state_pal(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l07_enter_state_pal(0x77, 1); + hero_l07_set_move_state_pal(0x77, 1); break; } } @@ -709,11 +709,11 @@ void hero_l07_decide_state_transition_pal(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.054000005f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l07_enter_state_pal(0x64, 1); + hero_l07_set_move_state_pal(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.054000005f)) { - hero_l07_enter_state_pal(0x63, 1); + hero_l07_set_move_state_pal(0x63, 1); } } else { hero_update_anim_scale_pal(); @@ -721,22 +721,22 @@ void hero_l07_decide_state_transition_pal(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state_pal(0x62, 1); + hero_l07_set_move_state_pal(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l07_enter_state_pal(0, 1); + hero_l07_set_move_state_pal(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l07_enter_state_pal(0x62, 1); + hero_l07_set_move_state_pal(0x62, 1); } break; case 0x65: { s32 n = FLD(g_hero_state, s32, 0x18C0); if ((n < 3) && (((n * 6) + 0x8) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40, 6, &special_cost) != 0)) { - hero_l07_enter_state_pal(0x66, 1); + hero_l07_set_move_state_pal(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters_pal(); @@ -764,7 +764,7 @@ void hero_l07_decide_state_transition_pal(void) { s32 off = FLD(g_hero_state, s16, 0xBFC) * 0x2C; rec -= -off; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l07_enter_state_pal(0, 1); + hero_l07_set_move_state_pal(0, 1); } break; } @@ -778,7 +778,7 @@ void hero_l07_decide_state_transition_pal(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l07_enter_state_pal(0, 0) != 0) { + if (hero_l07_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 14.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -786,25 +786,25 @@ void hero_l07_decide_state_transition_pal(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state_pal(1, 1); + hero_l07_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l07_enter_state_pal(7, 1); + hero_l07_set_move_state_pal(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state_pal(4, 1); + hero_l07_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 8) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state_pal(0, 1); + hero_l07_set_move_state_pal(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -812,45 +812,45 @@ void hero_l07_decide_state_transition_pal(void) { } if (hero_get_weapon_anim_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l07_enter_state_pal(0, 0); + hero_l07_set_move_state_pal(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l07_enter_state_pal(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l07_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 14.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l07_enter_state_pal(2, 1); + hero_l07_set_move_state_pal(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state_pal(1, 1); + hero_l07_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xA) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state_pal(0, 0); + hero_l07_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l07_enter_state_pal(0x76, 1); + hero_l07_set_move_state_pal(0x76, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { break; } if ((PadPressedWithin(0x80, 0xC, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l07_enter_state_pal(0x15, 1); + hero_l07_set_move_state_pal(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 8) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l07_enter_state_pal(0, 1); + hero_l07_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -858,17 +858,17 @@ void hero_l07_decide_state_transition_pal(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l07_enter_state_pal(0x8B, 1); + hero_l07_set_move_state_pal(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x4C) { - hero_l07_enter_state_pal(0, 1); + hero_l07_set_move_state_pal(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l07_enter_state_pal(0, 1); + hero_l07_set_move_state_pal(0, 1); } break; case 0x24: @@ -894,14 +894,14 @@ void hero_l07_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l07_enter_state_pal(0, 0); + hero_l07_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 25.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l07_enter_state_pal(6, 0); + hero_l07_set_move_state_pal(6, 0); } else { - hero_l07_enter_state_pal(6, 0); + hero_l07_set_move_state_pal(6, 0); set_hero_animation_pal(0xA, 0, 14.0f); } FLD(g_hero_state, f32, 0xA84) = 0.016800001f; @@ -917,9 +917,9 @@ void hero_l07_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l07_enter_state_pal(0, 1); + hero_l07_set_move_state_pal(0, 1); } else { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -931,7 +931,7 @@ void hero_l07_decide_state_transition_pal(void) { if (t < 0x21) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l07_enter_state_pal(0x2C, 1); + hero_l07_set_move_state_pal(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0028000001f; FLD(g_hero_state, f32, 0xA80) = 0.0108f; } @@ -939,7 +939,7 @@ void hero_l07_decide_state_transition_pal(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l07_enter_state_pal(0x18, 0); + hero_l07_set_move_state_pal(0x18, 0); } break; case 0x18: @@ -948,18 +948,18 @@ void hero_l07_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab_pal((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 0xE, NULL) != 0) { - hero_l07_enter_state_pal(0x1B, 1); + hero_l07_set_move_state_pal(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -968,7 +968,7 @@ void hero_l07_decide_state_transition_pal(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l07_enter_state_pal(0x19, 1); + hero_l07_set_move_state_pal(0x19, 1); } break; } @@ -979,7 +979,7 @@ void hero_l07_decide_state_transition_pal(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l07_enter_state_pal(0x1A, 1); + hero_l07_set_move_state_pal(0x1A, 1); } } } @@ -998,18 +998,18 @@ void hero_l07_decide_state_transition_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state_pal(0x18, 1); + hero_l07_set_move_state_pal(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l07_enter_state_pal(0x1B, 1); + hero_l07_set_move_state_pal(0x1B, 1); } break; } @@ -1019,9 +1019,9 @@ void hero_l07_decide_state_transition_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); } else { - hero_l07_enter_state_pal(0, 1); + hero_l07_set_move_state_pal(0, 1); } } break; @@ -1045,12 +1045,12 @@ void hero_l07_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l07_enter_state_pal(0x39, 1); + hero_l07_set_move_state_pal(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x4B) { - if (hero_l07_enter_state_pal(0, 0) != 0) { + if (hero_l07_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } if (low != 0) { @@ -1058,7 +1058,7 @@ void hero_l07_decide_state_transition_pal(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l07_enter_state_pal(0, 0) != 0) { + if (hero_l07_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1072,28 +1072,28 @@ void hero_l07_decide_state_transition_pal(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l07_enter_state_pal(2, 1); + hero_l07_set_move_state_pal(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.060000002f) { - if (hero_l07_enter_state_pal(3, 0) != 0) { + if (hero_l07_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(6, 0, 1e+01f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.15400001f); } } else { - hero_l07_enter_state_pal(0, 1); + hero_l07_set_move_state_pal(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l07_enter_state_pal(8, 1); + hero_l07_set_move_state_pal(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x12) && (hero_try_start_move_from_buffer_pal((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 5, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l07_enter_state_pal(0x17, 1); + hero_l07_set_move_state_pal(0x17, 1); break; } } @@ -1125,7 +1125,7 @@ void hero_l07_decide_state_transition_pal(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l07_enter_state_pal(0, 0) != 0) { + if (hero_l07_set_move_state_pal(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1136,12 +1136,12 @@ void hero_l07_decide_state_transition_pal(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l07_enter_state_pal(0x74, 1); + hero_l07_set_move_state_pal(0x74, 1); } else { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); } } else { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); } } break; @@ -1154,16 +1154,16 @@ void hero_l07_decide_state_transition_pal(void) { ok = 1; } if (ok != 0) { - hero_l07_enter_state_pal(0x11, 1); + hero_l07_set_move_state_pal(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l07_enter_state_pal(0x17, 1); + hero_l07_set_move_state_pal(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1174,23 +1174,23 @@ void hero_l07_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 3)) { - if (hero_l07_enter_state_pal(3, 0) != 0) { + if (hero_l07_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x1C; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state_pal(4, 1); + hero_l07_set_move_state_pal(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l07_speed_thresholds[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l07_enter_state_pal(2, 1); + hero_l07_set_move_state_pal(2, 1); break; } - hero_l07_enter_state_pal(2, 0); + hero_l07_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, 2, 7.0f); @@ -1199,21 +1199,21 @@ void hero_l07_decide_state_transition_pal(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l07_speed_thresholds[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l07_enter_state_pal(2, 1); + hero_l07_set_move_state_pal(2, 1); break; } - hero_l07_enter_state_pal(2, 0); + hero_l07_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, g_hero_l07_extra_animation_id, 1e+01f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l07_enter_state_pal(0, 0) != 0) { + if (hero_l07_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l07_enter_state_pal(0, 0) != 0) { + } else if (hero_l07_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1259,14 +1259,14 @@ void hero_l07_decide_state_transition_pal(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 4, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state_pal(0xB, 1); + hero_l07_set_move_state_pal(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x11)) { - hero_l07_enter_state_pal(0x82, 1); + hero_l07_set_move_state_pal(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1275,21 +1275,21 @@ void hero_l07_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 6) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f)) { - hero_l07_enter_state_pal(0xA, 1); + hero_l07_set_move_state_pal(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l07_enter_state_pal(0x10, 1); + hero_l07_set_move_state_pal(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.14000002f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l07_enter_state_pal(0x77, 1); + hero_l07_set_move_state_pal(0x77, 1); break; } } @@ -1393,7 +1393,7 @@ void hero_l07_decide_state_transition_pal(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l07_enter_state_pal(3, 0) != 0) { + if (hero_l07_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1401,13 +1401,13 @@ void hero_l07_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l07_speed_thresholds[0][2])) { - hero_l07_enter_state_pal(7, 1); + hero_l07_set_move_state_pal(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l07_enter_state_pal(7, 1); + hero_l07_set_move_state_pal(7, 1); } else if (g_hero_l07_speed_thresholds[1][1] * 0.017f < FLD(g_hero_state, f32, 0x174)) { - hero_l07_enter_state_pal(9, 1); + hero_l07_set_move_state_pal(9, 1); } else { - hero_l07_enter_state_pal(7, 1); + hero_l07_set_move_state_pal(7, 1); } break; } @@ -1415,10 +1415,10 @@ void hero_l07_decide_state_transition_pal(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_l01_choose_next_move_after_landing_pal(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); break; } { @@ -1428,7 +1428,7 @@ void hero_l07_decide_state_transition_pal(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x16)) && (PadPressedWithin(0x40, 6, &special_cost_limit) != 0) && (special_cost_limit < FLD(g_hero_state, s32, 0x1B8))) { - hero_l07_enter_state_pal(0x11, 1); + hero_l07_set_move_state_pal(0x11, 1); break; } } @@ -1457,7 +1457,7 @@ void hero_l07_decide_state_transition_pal(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xD) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.11600001f)))) { - hero_l07_enter_state_pal(0xE, 1); + hero_l07_set_move_state_pal(0xE, 1); } else if ((g_hero_item_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1467,28 +1467,28 @@ void hero_l07_decide_state_transition_pal(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l07_enter_state_pal(8, 1); + hero_l07_set_move_state_pal(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l07_enter_state_pal(0x17, 1); + hero_l07_set_move_state_pal(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l07_enter_state_pal(6, 1); + hero_l07_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x17) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l07_enter_state_pal(0x39, 1); + hero_l07_set_move_state_pal(0x39, 1); } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l07_enter_state_pal(0x82, 1); + hero_l07_set_move_state_pal(0x82, 1); } else { - hero_l07_enter_state_pal(0, 0); + hero_l07_set_move_state_pal(0, 0); } } break; @@ -1498,8 +1498,8 @@ void hero_l07_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x2B) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l07_enter_state_pal(0x39, 1); - } else if (hero_l07_enter_state_pal(0, 0) != 0) { + hero_l07_set_move_state_pal(0x39, 1); + } else if (hero_l07_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 11.0f); } } @@ -1520,7 +1520,7 @@ void hero_l07_decide_state_transition_pal(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l07_enter_state_pal(0, 0); + hero_l07_set_move_state_pal(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -1531,7 +1531,7 @@ void hero_l07_decide_state_transition_pal(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l07_enter_state_pal(0, 0); + hero_l07_set_move_state_pal(0, 0); } break; case 0x22: @@ -1541,12 +1541,12 @@ void hero_l07_decide_state_transition_pal(void) { hero_choose_jump_or_roll_move_pal(); break; } - hero_l07_enter_state_pal(7, 1); + hero_l07_set_move_state_pal(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l07_enter_state_pal(0, 0); + hero_l07_set_move_state_pal(0, 0); } break; default: diff --git a/src/pal/levels/07_siberius/L07_002B8608-sw2.c b/src/pal/levels/07_siberius/L07_002B8608-sw2.c index ba69439a4..21450384e 100644 --- a/src/pal/levels/07_siberius/L07_002B8608-sw2.c +++ b/src/pal/levels/07_siberius/L07_002B8608-sw2.c @@ -55,8 +55,8 @@ extern int hero_play_sound(int, int); extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -118,7 +118,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l07_enter_state_pal(s32 action, s32 animate) { +s32 hero_l07_set_move_state_pal(s32 action, s32 animate) { u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 old_step; @@ -165,7 +165,9 @@ s32 hero_l07_enter_state_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -178,7 +180,7 @@ s32 hero_l07_enter_state_pal(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_anim_id(0) == 0x51) set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 15.0f); else set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, -1.0f); @@ -237,7 +239,7 @@ s32 hero_l07_enter_state_pal(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l07_enter_state_pal(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l07_set_move_state_pal(0x76, 1); return 0; } } WORD(0x2298) = 0; BYTE(0x40C) = 0; BYTE(0x40E) = 0; @@ -273,11 +275,11 @@ s32 hero_l07_enter_state_pal(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_set_move_state_pal(0x76, 1); return 0; } if (hero_try_start_grab_pal()) return 0; if (hero_get_weapon_anim_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l07_enter_state_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 15.0f); + if (hero_l07_set_move_state_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 15.0f); return 0; } if (!animate) goto finish; @@ -302,7 +304,7 @@ s32 hero_l07_enter_state_pal(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.14000002f) REAL(0x1B4) = 0.14000002f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.14000002f); @@ -444,13 +446,13 @@ s32 hero_l07_enter_state_pal(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l07_enter_state_pal(0x81, 1); return 0; + hero_l07_set_move_state_pal(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l07_busy_flag) { hero_l07_enter_state_pal(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l07_busy_flag) { hero_l07_set_move_state_pal(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l07_enter_state_pal(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l07_set_move_state_pal(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -527,7 +529,7 @@ s32 hero_l07_enter_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -553,7 +555,7 @@ s32 hero_l07_enter_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -562,7 +564,7 @@ s32 hero_l07_enter_state_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -694,7 +696,7 @@ s32 hero_l07_enter_state_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -764,7 +766,7 @@ s32 hero_l07_enter_state_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -776,7 +778,7 @@ s32 hero_l07_enter_state_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); @@ -810,7 +812,7 @@ s32 hero_l07_enter_state_pal(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.09f; if (WORD(0x640) > 12 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l07_enter_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; + PTR(0x2290)[0xA8] = 255; hero_l07_set_move_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; return 0; } HALF(0x1DC) = 64; REAL(0x69C) = 0.050000004f; diff --git a/src/pal/levels/08_tabora/L08_002CB6E0-deck.c b/src/pal/levels/08_tabora/L08_002CB6E0-deck.c index 40c163f7f..173fe9d79 100644 --- a/src/pal/levels/08_tabora/L08_002CB6E0-deck.c +++ b/src/pal/levels/08_tabora/L08_002CB6E0-deck.c @@ -70,7 +70,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed_pal(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction_pal(void); -s32 hero_l08_enter_state_pal(s32, s32); +s32 hero_l08_set_move_state_pal(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition_pal(void); s32 hero_try_start_ledge_move(void); @@ -145,7 +145,7 @@ void hero_l08_update_state_transitions_pal(void) { UpdateHeroHeldTarget_pal(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l08_enter_state_pal(0x39, 1); + hero_l08_set_move_state_pal(0x39, 1); goto end; } } @@ -174,7 +174,7 @@ void hero_l08_update_state_transitions_pal(void) { hero_apply_pending_change_pal(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l08_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l08_enter_state_pal(0x74, 1); + hero_l08_set_move_state_pal(0x74, 1); goto end; } } @@ -185,12 +185,12 @@ void hero_l08_update_state_transitions_pal(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state_pal(1, 1); + hero_l08_set_move_state_pal(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l08_enter_state_pal(0x82, 1); + hero_l08_set_move_state_pal(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -227,7 +227,7 @@ void hero_l08_update_state_transitions_pal(void) { rec = g_hero_item_records + selected_item * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 5e+01f; if (FLD(rec, s32, 0x44) != 0) { - hero_l08_enter_state_pal(0x3C, 1); + hero_l08_set_move_state_pal(0x3C, 1); } else { set_hero_animation_pal(FLD(rec, s32, 0x48), 0, 1e+01f); } @@ -270,12 +270,12 @@ void hero_l08_update_state_transitions_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l08_enter_state_pal(0x76, 1); + hero_l08_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); } break; } @@ -296,17 +296,17 @@ void hero_l08_update_state_transitions_pal(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_action_blocked == 0) && (PadPressedWithin(0x40, 6, NULL) != 0)) { - hero_l08_enter_state_pal(0x6E, 1); + hero_l08_set_move_state_pal(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l08_enter_state_pal(4, 1); + hero_l08_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l08_enter_state_pal(0x2E, 1); + hero_l08_set_move_state_pal(0x2E, 1); break; } { @@ -326,28 +326,28 @@ void hero_l08_update_state_transitions_pal(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust_pal(side, 0, 0, 0x1E); hero_play_footstep_sound_dust_pal(side, 1, 0, 0x1E); - hero_l08_enter_state_pal(2, 1); + hero_l08_set_move_state_pal(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state_pal(1, 1); + hero_l08_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_buttons = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_buttons & 8)) { - hero_l08_enter_state_pal(0x3D, 1); + hero_l08_set_move_state_pal(0x3D, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l08_enter_state_pal(0x3D, 1); + hero_l08_set_move_state_pal(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); } break; case 0x3D: @@ -356,22 +356,22 @@ void hero_l08_update_state_transitions_pal(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); break; } if (hero_try_start_move_from_buffer_pal(6, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state_pal(4, 1); + hero_l08_set_move_state_pal(4, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l08_enter_state_pal(2, 1); + hero_l08_set_move_state_pal(2, 1); break; } - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); break; case 0x39: case 0x43: @@ -410,25 +410,25 @@ void hero_l08_update_state_transitions_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.040000003f)) { - hero_l08_enter_state_pal(0x33, 1); + hero_l08_set_move_state_pal(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12)) { - hero_l08_enter_state_pal(0x34, 1); + hero_l08_set_move_state_pal(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l08_enter_state_pal(0x32, 1); + hero_l08_set_move_state_pal(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l08_enter_state_pal(0x33, 1); + hero_l08_set_move_state_pal(0x33, 1); } } break; @@ -441,81 +441,81 @@ void hero_l08_update_state_transitions_pal(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l08_enter_state_pal(0x32, 1); + hero_l08_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l08_enter_state_pal(0x34, 1); + hero_l08_set_move_state_pal(0x34, 1); } else { - hero_l08_enter_state_pal(0x32, 1); + hero_l08_set_move_state_pal(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l08_enter_state_pal(0x12, 1); + hero_l08_set_move_state_pal(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 6, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 6, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l08_enter_state_pal(0x32, 1); + hero_l08_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l08_enter_state_pal(0x34, 1); + hero_l08_set_move_state_pal(0x34, 1); } else { - hero_l08_enter_state_pal(0x32, 1); + hero_l08_set_move_state_pal(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l08_enter_state_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l08_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 15.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l08_enter_state_pal(0x35, 1); + hero_l08_set_move_state_pal(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l08_enter_state_pal(0x12, 1); + hero_l08_set_move_state_pal(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 6, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l08_enter_state_pal(0x32, 1); + hero_l08_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l08_enter_state_pal(0x34, 1); + hero_l08_set_move_state_pal(0x34, 1); } else { - hero_l08_enter_state_pal(0x32, 1); + hero_l08_set_move_state_pal(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l08_enter_state_pal(0x70, 0); + hero_l08_set_move_state_pal(0x70, 0); set_hero_animation_pal(0x59, 0, 14.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l08_enter_state_pal(0x36, 1); + hero_l08_set_move_state_pal(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state_pal(0x67, 1); + hero_l08_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x28, 15.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state_pal(0x33, 1); + hero_l08_set_move_state_pal(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l08_enter_state_pal(0x33, 0); + hero_l08_set_move_state_pal(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state_pal(0x67, 1); + hero_l08_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x25, 15.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l08_enter_state_pal(0x36, 0); + hero_l08_set_move_state_pal(0x36, 0); } break; case 0x1: @@ -549,9 +549,9 @@ void hero_l08_update_state_transitions_pal(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state_pal(4, 1); + hero_l08_set_move_state_pal(4, 1); } else { - hero_l08_enter_state_pal(0, 0); + hero_l08_set_move_state_pal(0, 0); anim = hero_get_weapon_animation_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -563,9 +563,9 @@ void hero_l08_update_state_transitions_pal(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l08_enter_state_pal(0, 0); + hero_l08_set_move_state_pal(0, 0); } else { - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); } } break; @@ -598,7 +598,7 @@ void hero_l08_update_state_transitions_pal(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state_pal(7, 1); + hero_l08_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -607,7 +607,7 @@ void hero_l08_update_state_transitions_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l08_enter_state_pal(0, 0); + hero_l08_set_move_state_pal(0, 0); } break; } @@ -629,7 +629,7 @@ void hero_l08_update_state_transitions_pal(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state_pal(7, 1); + hero_l08_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -642,7 +642,7 @@ void hero_l08_update_state_transitions_pal(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l08_enter_state_pal(2, 0); + hero_l08_set_move_state_pal(2, 0); set_hero_animation_pal(3, g_hero_l08_animation_ids[FLD(g_hero_state, s32, 0x2298)], 11.0f); break; } @@ -653,22 +653,22 @@ void hero_l08_update_state_transitions_pal(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l08_enter_state_pal(2, 1); + hero_l08_set_move_state_pal(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l08_enter_state_pal(0, 0); + hero_l08_set_move_state_pal(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state_pal(0, 0); + hero_l08_set_move_state_pal(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x54) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -685,7 +685,7 @@ void hero_l08_update_state_transitions_pal(void) { } if (PadPressedWithin(0x40, 6, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state_pal(7, 1); + hero_l08_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -694,7 +694,7 @@ void hero_l08_update_state_transitions_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l08_enter_state_pal(0, 0); + hero_l08_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 12.0f); break; } @@ -706,7 +706,7 @@ void hero_l08_update_state_transitions_pal(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); } break; case 0x2: @@ -720,11 +720,11 @@ void hero_l08_update_state_transitions_pal(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l08_enter_state_pal(0x76, 1); + hero_l08_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead_pal() == 0)) { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); break; } n = 7; @@ -738,12 +738,12 @@ void hero_l08_update_state_transitions_pal(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l08_enter_state_pal(9, 1); + hero_l08_set_move_state_pal(9, 1); } else { - hero_l08_enter_state_pal(7, 1); + hero_l08_set_move_state_pal(7, 1); } } else { - hero_l08_enter_state_pal(7, 1); + hero_l08_set_move_state_pal(7, 1); } break; } @@ -751,11 +751,11 @@ void hero_l08_update_state_transitions_pal(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.040000003f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state_pal(1, 1); + hero_l08_set_move_state_pal(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state_pal(4, 1); + hero_l08_set_move_state_pal(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -772,21 +772,21 @@ void hero_l08_update_state_transitions_pal(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l08_enter_state_pal(0x2E, 1); + hero_l08_set_move_state_pal(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l08_enter_state_pal(2, 1); + hero_l08_set_move_state_pal(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l08_enter_state_pal(0x70, 1); + hero_l08_set_move_state_pal(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l08_enter_state_pal(2, 1); + hero_l08_set_move_state_pal(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -797,7 +797,7 @@ void hero_l08_update_state_transitions_pal(void) { if (hero_try_start_grab_pal() != 0) { break; } - if (hero_l08_enter_state_pal(0, 0) == 0) { + if (hero_l08_set_move_state_pal(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.030000001f); @@ -814,7 +814,7 @@ void hero_l08_update_state_transitions_pal(void) { hero_update_anim_scale_pal(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l08_enter_state_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l08_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 14.0f); } if (FLD(hero_moby, u8, 0x43) == 0x37) { @@ -835,7 +835,7 @@ void hero_l08_update_state_transitions_pal(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l08_enter_state_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l08_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 14.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 29.166668f; @@ -869,17 +869,17 @@ void hero_l08_update_state_transitions_pal(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x19; - hero_l08_enter_state_pal(3, 0); + hero_l08_set_move_state_pal(3, 0); set_hero_animation_pal(6, 4, 9.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l08_enter_state_pal(0x77, 1); + hero_l08_set_move_state_pal(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l08_enter_state_pal(0x77, 1); + hero_l08_set_move_state_pal(0x77, 1); break; } } @@ -897,11 +897,11 @@ void hero_l08_update_state_transitions_pal(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.054000005f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l08_enter_state_pal(0x64, 1); + hero_l08_set_move_state_pal(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.054000005f)) { - hero_l08_enter_state_pal(0x63, 1); + hero_l08_set_move_state_pal(0x63, 1); } } else { hero_update_anim_scale_pal(); @@ -909,22 +909,22 @@ void hero_l08_update_state_transitions_pal(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state_pal(0x62, 1); + hero_l08_set_move_state_pal(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l08_enter_state_pal(0x62, 1); + hero_l08_set_move_state_pal(0x62, 1); } break; case 0x65: { s32 n = FLD(g_hero_state, s32, 0x18C0); if ((n < 3) && (((n * 6) + 0x8) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40, 6, &press_frames_a) != 0)) { - hero_l08_enter_state_pal(0x66, 1); + hero_l08_set_move_state_pal(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters_pal(); @@ -952,31 +952,31 @@ void hero_l08_update_state_transitions_pal(void) { s32 off = FLD(g_hero_state, s16, 0xBFC) * 0x2C; rec -= -off; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); } break; } case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state_pal(1, 1); + hero_l08_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l08_enter_state_pal(7, 1); + hero_l08_set_move_state_pal(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state_pal(4, 1); + hero_l08_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 8) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -984,45 +984,45 @@ void hero_l08_update_state_transitions_pal(void) { } if (hero_get_weapon_animation_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l08_enter_state_pal(0, 0); + hero_l08_set_move_state_pal(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l08_enter_state_pal(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l08_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 14.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l08_enter_state_pal(2, 1); + hero_l08_set_move_state_pal(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state_pal(1, 1); + hero_l08_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xA) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state_pal(0, 0); + hero_l08_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l08_enter_state_pal(0x76, 1); + hero_l08_set_move_state_pal(0x76, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { break; } if ((PadPressedWithin(0x80, 0xC, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l08_enter_state_pal(0x15, 1); + hero_l08_set_move_state_pal(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 8) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1030,17 +1030,17 @@ void hero_l08_update_state_transitions_pal(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l08_enter_state_pal(0x8B, 1); + hero_l08_set_move_state_pal(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x4C) { - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); } break; case 0x24: @@ -1066,14 +1066,14 @@ void hero_l08_update_state_transitions_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l08_enter_state_pal(0, 0); + hero_l08_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 25.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l08_enter_state_pal(6, 0); + hero_l08_set_move_state_pal(6, 0); } else { - hero_l08_enter_state_pal(6, 0); + hero_l08_set_move_state_pal(6, 0); set_hero_animation_pal(0xA, 0, 14.0f); } FLD(g_hero_state, f32, 0xA84) = 0.016800001f; @@ -1089,9 +1089,9 @@ void hero_l08_update_state_transitions_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); } else { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1103,7 +1103,7 @@ void hero_l08_update_state_transitions_pal(void) { if (t < 0x21) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l08_enter_state_pal(0x2C, 1); + hero_l08_set_move_state_pal(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0028000001f; FLD(g_hero_state, f32, 0xA80) = 0.0108f; } @@ -1111,7 +1111,7 @@ void hero_l08_update_state_transitions_pal(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l08_enter_state_pal(0x18, 0); + hero_l08_set_move_state_pal(0x18, 0); } break; case 0x18: @@ -1120,18 +1120,18 @@ void hero_l08_update_state_transitions_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab_pal((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 0xE, NULL) != 0) { - hero_l08_enter_state_pal(0x1B, 1); + hero_l08_set_move_state_pal(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1140,7 +1140,7 @@ void hero_l08_update_state_transitions_pal(void) { vec_10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab_pal((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l08_enter_state_pal(0x19, 1); + hero_l08_set_move_state_pal(0x19, 1); } break; } @@ -1151,7 +1151,7 @@ void hero_l08_update_state_transitions_pal(void) { vec_10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab_pal((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l08_enter_state_pal(0x1A, 1); + hero_l08_set_move_state_pal(0x1A, 1); } } } @@ -1170,18 +1170,18 @@ void hero_l08_update_state_transitions_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab_pal((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state_pal(0x18, 1); + hero_l08_set_move_state_pal(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l08_enter_state_pal(0x1B, 1); + hero_l08_set_move_state_pal(0x1B, 1); } break; } @@ -1191,9 +1191,9 @@ void hero_l08_update_state_transitions_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); } else { - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); } } break; @@ -1217,12 +1217,12 @@ void hero_l08_update_state_transitions_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state_pal(0x39, 1); + hero_l08_set_move_state_pal(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x4B) { - if (hero_l08_enter_state_pal(0, 0) != 0) { + if (hero_l08_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } if (low != 0) { @@ -1230,7 +1230,7 @@ void hero_l08_update_state_transitions_pal(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l08_enter_state_pal(0, 0) != 0) { + if (hero_l08_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1244,28 +1244,28 @@ void hero_l08_update_state_transitions_pal(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l08_enter_state_pal(2, 1); + hero_l08_set_move_state_pal(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.060000002f) { - if (hero_l08_enter_state_pal(3, 0) != 0) { + if (hero_l08_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(6, 0, 1e+01f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.15400001f); } } else { - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l08_enter_state_pal(8, 1); + hero_l08_set_move_state_pal(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x12) && (hero_try_start_move_from_buffer_pal((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 5, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l08_enter_state_pal(0x17, 1); + hero_l08_set_move_state_pal(0x17, 1); break; } } @@ -1297,7 +1297,7 @@ void hero_l08_update_state_transitions_pal(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l08_enter_state_pal(0, 0) != 0) { + if (hero_l08_set_move_state_pal(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1308,12 +1308,12 @@ void hero_l08_update_state_transitions_pal(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l08_enter_state_pal(0x74, 1); + hero_l08_set_move_state_pal(0x74, 1); } else { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); } } else { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); } } break; @@ -1326,16 +1326,16 @@ void hero_l08_update_state_transitions_pal(void) { ok = 1; } if (ok != 0) { - hero_l08_enter_state_pal(0x11, 1); + hero_l08_set_move_state_pal(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l08_enter_state_pal(0x17, 1); + hero_l08_set_move_state_pal(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1346,23 +1346,23 @@ void hero_l08_update_state_transitions_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 3)) { - if (hero_l08_enter_state_pal(3, 0) != 0) { + if (hero_l08_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x1C; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state_pal(4, 1); + hero_l08_set_move_state_pal(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l08_speed_params[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l08_enter_state_pal(2, 1); + hero_l08_set_move_state_pal(2, 1); break; } - hero_l08_enter_state_pal(2, 0); + hero_l08_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, 2, 7.0f); @@ -1371,21 +1371,21 @@ void hero_l08_update_state_transitions_pal(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l08_speed_params[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l08_enter_state_pal(2, 1); + hero_l08_set_move_state_pal(2, 1); break; } - hero_l08_enter_state_pal(2, 0); + hero_l08_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, g_hero_l08_animation_id_extra, 1e+01f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l08_enter_state_pal(0, 0) != 0) { + if (hero_l08_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l08_enter_state_pal(0, 0) != 0) { + } else if (hero_l08_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1431,14 +1431,14 @@ void hero_l08_update_state_transitions_pal(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 4, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state_pal(0xB, 1); + hero_l08_set_move_state_pal(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x11)) { - hero_l08_enter_state_pal(0x82, 1); + hero_l08_set_move_state_pal(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1447,21 +1447,21 @@ void hero_l08_update_state_transitions_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 6) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f)) { - hero_l08_enter_state_pal(0xA, 1); + hero_l08_set_move_state_pal(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l08_enter_state_pal(0x10, 1); + hero_l08_set_move_state_pal(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.14000002f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l08_enter_state_pal(0x77, 1); + hero_l08_set_move_state_pal(0x77, 1); break; } } @@ -1565,7 +1565,7 @@ void hero_l08_update_state_transitions_pal(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l08_enter_state_pal(3, 0) != 0) { + if (hero_l08_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1573,13 +1573,13 @@ void hero_l08_update_state_transitions_pal(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l08_speed_params[0][2])) { - hero_l08_enter_state_pal(7, 1); + hero_l08_set_move_state_pal(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l08_enter_state_pal(7, 1); + hero_l08_set_move_state_pal(7, 1); } else if (g_hero_l08_speed_params[1][1] * 0.017f < FLD(g_hero_state, f32, 0x174)) { - hero_l08_enter_state_pal(9, 1); + hero_l08_set_move_state_pal(9, 1); } else { - hero_l08_enter_state_pal(7, 1); + hero_l08_set_move_state_pal(7, 1); } break; } @@ -1587,10 +1587,10 @@ void hero_l08_update_state_transitions_pal(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_l00_choose_next_move_after_landing_pal(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); break; } { @@ -1600,7 +1600,7 @@ void hero_l08_update_state_transitions_pal(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x16)) && (PadPressedWithin(0x40, 6, &press_frames_b) != 0) && (press_frames_b < FLD(g_hero_state, s32, 0x1B8))) { - hero_l08_enter_state_pal(0x11, 1); + hero_l08_set_move_state_pal(0x11, 1); break; } } @@ -1629,7 +1629,7 @@ void hero_l08_update_state_transitions_pal(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xD) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.11600001f)))) { - hero_l08_enter_state_pal(0xE, 1); + hero_l08_set_move_state_pal(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1639,28 +1639,28 @@ void hero_l08_update_state_transitions_pal(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l08_enter_state_pal(8, 1); + hero_l08_set_move_state_pal(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x576) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l08_enter_state_pal(0x17, 1); + hero_l08_set_move_state_pal(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l08_enter_state_pal(6, 1); + hero_l08_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x17) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state_pal(0x39, 1); + hero_l08_set_move_state_pal(0x39, 1); } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l08_enter_state_pal(0x82, 1); + hero_l08_set_move_state_pal(0x82, 1); } else { - hero_l08_enter_state_pal(0, 0); + hero_l08_set_move_state_pal(0, 0); } } break; @@ -1670,8 +1670,8 @@ void hero_l08_update_state_transitions_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x2B) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state_pal(0x39, 1); - } else if (hero_l08_enter_state_pal(0, 0) != 0) { + hero_l08_set_move_state_pal(0x39, 1); + } else if (hero_l08_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 11.0f); } } @@ -1692,7 +1692,7 @@ void hero_l08_update_state_transitions_pal(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l08_enter_state_pal(0, 0); + hero_l08_set_move_state_pal(0, 0); anim = hero_get_weapon_animation_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -1703,7 +1703,7 @@ void hero_l08_update_state_transitions_pal(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l08_enter_state_pal(0, 0); + hero_l08_set_move_state_pal(0, 0); } break; case 0x22: @@ -1713,12 +1713,12 @@ void hero_l08_update_state_transitions_pal(void) { hero_choose_jump_or_roll_move_pal(); break; } - hero_l08_enter_state_pal(7, 1); + hero_l08_set_move_state_pal(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l08_enter_state_pal(0, 0); + hero_l08_set_move_state_pal(0, 0); } break; default: diff --git a/src/pal/levels/08_tabora/L08_002CB6E0-hero.c b/src/pal/levels/08_tabora/L08_002CB6E0-hero.c index 8d7e41e6c..901b62a92 100644 --- a/src/pal/levels/08_tabora/L08_002CB6E0-hero.c +++ b/src/pal/levels/08_tabora/L08_002CB6E0-hero.c @@ -138,7 +138,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -695,7 +695,7 @@ void hero_l08_update_state_machine_pal(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { ival_26 = ((Hero *)g_hero_state)->i[0x2440/4]; if (ival_26 != -1) { @@ -1419,7 +1419,7 @@ void hero_l08_update_state_machine_pal(void) { coll_process_hit(0.4f, (s32)((TI128*)vec_0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec_10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x2a; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l08_extra_state)->f[0x180/4] = 0.1f; diff --git a/src/pal/levels/08_tabora/L08_002CB6E0-sw.c b/src/pal/levels/08_tabora/L08_002CB6E0-sw.c index 5b222c933..c1eeab892 100644 --- a/src/pal/levels/08_tabora/L08_002CB6E0-sw.c +++ b/src/pal/levels/08_tabora/L08_002CB6E0-sw.c @@ -55,8 +55,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -122,7 +122,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l08_enter_state_pal(s32 action, s32 animate) { +s32 hero_l08_set_move_state_pal(s32 action, s32 animate) { u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 old_step; @@ -169,7 +169,9 @@ s32 hero_l08_enter_state_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -182,8 +184,8 @@ s32 hero_l08_enter_state_pal(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l08_enter_state_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l08_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_animation_id(0) == 0x51) set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 15.0f); else set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, -1.0f); @@ -321,7 +323,7 @@ s32 hero_l08_enter_state_pal(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l08_enter_state_pal(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l08_set_move_state_pal(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.15400001f) REAL(0x1B4) = 0.15400001f; @@ -361,12 +363,12 @@ s32 hero_l08_enter_state_pal(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l08_enter_state_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l08_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_set_move_state_pal(0x76, 1); return 0; } if (hero_try_start_grab_pal()) return 0; if (hero_get_weapon_animation_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l08_enter_state_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 15.0f); + if (hero_l08_set_move_state_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_animation_id(0), 0, 15.0f); return 0; } if (!animate) goto finish; @@ -391,7 +393,7 @@ s32 hero_l08_enter_state_pal(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.14000002f) REAL(0x1B4) = 0.14000002f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.14000002f); @@ -533,13 +535,13 @@ s32 hero_l08_enter_state_pal(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l08_enter_state_pal(0x81, 1); return 0; + hero_l08_set_move_state_pal(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_action_blocked) { hero_l08_enter_state_pal(0x6E, 1); return 0; } + action != 0x38 && !g_hero_action_blocked) { hero_l08_set_move_state_pal(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l08_enter_state_pal(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l08_set_move_state_pal(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -631,7 +633,7 @@ s32 hero_l08_enter_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -657,7 +659,7 @@ s32 hero_l08_enter_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -666,7 +668,7 @@ s32 hero_l08_enter_state_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4B8) = 0.6f; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -799,7 +801,7 @@ s32 hero_l08_enter_state_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -869,7 +871,7 @@ s32 hero_l08_enter_state_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -881,7 +883,7 @@ s32 hero_l08_enter_state_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); @@ -915,7 +917,7 @@ s32 hero_l08_enter_state_pal(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.09f; if (WORD(0x640) > 12 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l08_enter_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; + PTR(0x2290)[0xA8] = 255; hero_l08_set_move_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; return 0; } HALF(0x1DC) = 64; REAL(0x69C) = 0.050000004f; diff --git a/src/pal/levels/08_tabora/L08_00414BDC-sw-g8.c b/src/pal/levels/08_tabora/L08_00414BDC-sw-g8.c index e3b691f96..260a9322c 100644 --- a/src/pal/levels/08_tabora/L08_00414BDC-sw-g8.c +++ b/src/pal/levels/08_tabora/L08_00414BDC-sw-g8.c @@ -67,7 +67,7 @@ extern void part_steer_effect_direction(int, void *, int); extern void vec_transform_or_copy(void *, void *); extern void shop_trigger_current_state_effect(void *, void *); extern void vec_add_object_direction_scaled(void *, void *, float); -extern s32 hero_l08_enter_state_pal(int, int); +extern s32 hero_l08_set_move_state_pal(int, int); extern void part_setup_object_effect_entry(void *, void *, void *); extern void anim_start_blended_pal(void *, int, int, int); extern int PlayMobySound(int, int, void *); @@ -176,7 +176,7 @@ void update_timed_ground_actor_l08_pal(char *obj) break; qcopy(obj + 0x10, &collision->point); ForceClaimNotice(6, 0, 1); - hero_l08_enter_state_pal(28, 1); + hero_l08_set_move_state_pal(28, 1); part_setup_object_effect_entry(obj + 0x10, obj + 0xF0, obj); STATE(obj) = 2; anim_start_blended_pal(obj, 1, 0, 10); @@ -278,7 +278,7 @@ void update_timed_ground_actor_l08_pal(char *obj) break; case 8: if (g_game_mode == 28) - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); if (*(short *)(g_follow_camera_object + 0x86) == 27) ref_L00_003FFBA0_00(); table_clear_entry_flag(update_handle); diff --git a/src/pal/levels/09_dobbo/L09_002BC480-hero.c b/src/pal/levels/09_dobbo/L09_002BC480-hero.c index e8dc4231d..01a1a5608 100644 --- a/src/pal/levels/09_dobbo/L09_002BC480-hero.c +++ b/src/pal/levels/09_dobbo/L09_002BC480-hero.c @@ -135,7 +135,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -651,7 +651,7 @@ void hero_l09_update_state_machine_pal(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { temp_a2 = ((Hero *)g_hero_state)->i[0x2440/4]; if (temp_a2 != -1) { @@ -1354,7 +1354,7 @@ void hero_l09_update_state_machine_pal(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x2a; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l09_aux_state)->f[0x180/4] = 0.1f; diff --git a/src/pal/levels/09_dobbo/L09_002BC480-sw.c b/src/pal/levels/09_dobbo/L09_002BC480-sw.c index ea2cccbfc..c868712eb 100644 --- a/src/pal/levels/09_dobbo/L09_002BC480-sw.c +++ b/src/pal/levels/09_dobbo/L09_002BC480-sw.c @@ -70,7 +70,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed_pal(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction_pal(void); -s32 hero_l09_set_state_pal(s32, s32); +s32 hero_l09_set_move_state_pal(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition_pal(void); s32 hero_try_start_ledge_move(void); @@ -147,7 +147,7 @@ void hero_l09_decide_state_transition_pal(void) { UpdateHeroHeldTarget_pal(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l09_set_state_pal(0x39, 1); + hero_l09_set_move_state_pal(0x39, 1); goto end; } } @@ -176,7 +176,7 @@ void hero_l09_decide_state_transition_pal(void) { hero_apply_pending_change_pal(); if (FLD(g_hero_state, f32, 0x88) < g_hero_height_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l09_set_state_pal(0x74, 1); + hero_l09_set_move_state_pal(0x74, 1); goto end; } } @@ -186,12 +186,12 @@ void hero_l09_decide_state_transition_pal(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state_pal(1, 1); + hero_l09_set_move_state_pal(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l09_set_state_pal(0x82, 1); + hero_l09_set_move_state_pal(0x82, 1); break; } { @@ -227,7 +227,7 @@ void hero_l09_decide_state_transition_pal(void) { rec = g_hero_l09_state_records + sp40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 5e+01f; if (FLD(rec, s32, 0x44) != 0) { - hero_l09_set_state_pal(0x3C, 1); + hero_l09_set_move_state_pal(0x3C, 1); } else { set_hero_animation_pal(FLD(rec, s32, 0x48), 0, 1e+01f); } @@ -270,12 +270,12 @@ void hero_l09_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l09_set_state_pal(0x76, 1); + hero_l09_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); } break; } @@ -296,12 +296,12 @@ void hero_l09_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l09_lock_flag_b == 0) && (PadPressedWithin(0x40, 6, NULL) != 0)) { - hero_l09_set_state_pal(0x6E, 1); + hero_l09_set_move_state_pal(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l09_set_state_pal(4, 1); + hero_l09_set_move_state_pal(4, 1); break; } } @@ -322,28 +322,28 @@ void hero_l09_decide_state_transition_pal(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust_pal(side, 0, 0, 0x1E); hero_play_footstep_sound_dust_pal(side, 1, 0, 0x1E); - hero_l09_set_state_pal(2, 1); + hero_l09_set_move_state_pal(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state_pal(1, 1); + hero_l09_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l09_set_state_pal(0x3D, 1); + hero_l09_set_move_state_pal(0x3D, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l09_set_state_pal(0x3D, 1); + hero_l09_set_move_state_pal(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l09_set_state_pal(0, 1); + hero_l09_set_move_state_pal(0, 1); } break; case 0x3D: @@ -352,22 +352,22 @@ void hero_l09_decide_state_transition_pal(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); break; } if (hero_try_start_move_from_buffer_pal(6, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state_pal(4, 1); + hero_l09_set_move_state_pal(4, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l09_set_state_pal(2, 1); + hero_l09_set_move_state_pal(2, 1); break; } - hero_l09_set_state_pal(0, 1); + hero_l09_set_move_state_pal(0, 1); break; case 0x39: case 0x43: @@ -400,25 +400,25 @@ void hero_l09_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.040000003f)) { - hero_l09_set_state_pal(0x33, 1); + hero_l09_set_move_state_pal(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12)) { - hero_l09_set_state_pal(0x34, 1); + hero_l09_set_move_state_pal(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l09_set_state_pal(0x32, 1); + hero_l09_set_move_state_pal(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l09_set_state_pal(0x33, 1); + hero_l09_set_move_state_pal(0x33, 1); } } break; @@ -431,81 +431,81 @@ void hero_l09_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l09_set_state_pal(0x32, 1); + hero_l09_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l09_set_state_pal(0x34, 1); + hero_l09_set_move_state_pal(0x34, 1); } else { - hero_l09_set_state_pal(0x32, 1); + hero_l09_set_move_state_pal(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l09_set_state_pal(0x12, 1); + hero_l09_set_move_state_pal(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 6, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 6, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l09_set_state_pal(0x32, 1); + hero_l09_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l09_set_state_pal(0x34, 1); + hero_l09_set_move_state_pal(0x34, 1); } else { - hero_l09_set_state_pal(0x32, 1); + hero_l09_set_move_state_pal(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l09_set_state_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l09_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 15.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l09_set_state_pal(0x35, 1); + hero_l09_set_move_state_pal(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l09_set_state_pal(0x12, 1); + hero_l09_set_move_state_pal(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 6, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l09_set_state_pal(0x32, 1); + hero_l09_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l09_set_state_pal(0x34, 1); + hero_l09_set_move_state_pal(0x34, 1); } else { - hero_l09_set_state_pal(0x32, 1); + hero_l09_set_move_state_pal(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l09_set_state_pal(0x70, 0); + hero_l09_set_move_state_pal(0x70, 0); set_hero_animation_pal(0x59, 0, 14.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l09_set_state_pal(0x36, 1); + hero_l09_set_move_state_pal(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l09_set_state_pal(0x67, 1); + hero_l09_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x28, 15.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state_pal(0x33, 1); + hero_l09_set_move_state_pal(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l09_set_state_pal(0x33, 0); + hero_l09_set_move_state_pal(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l09_set_state_pal(0x67, 1); + hero_l09_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x25, 15.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l09_set_state_pal(0x36, 0); + hero_l09_set_move_state_pal(0x36, 0); } break; case 0x1: @@ -539,9 +539,9 @@ void hero_l09_decide_state_transition_pal(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state_pal(4, 1); + hero_l09_set_move_state_pal(4, 1); } else { - hero_l09_set_state_pal(0, 0); + hero_l09_set_move_state_pal(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -553,9 +553,9 @@ void hero_l09_decide_state_transition_pal(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l09_set_state_pal(0, 0); + hero_l09_set_move_state_pal(0, 0); } else { - hero_l09_set_state_pal(0, 1); + hero_l09_set_move_state_pal(0, 1); } } break; @@ -588,7 +588,7 @@ void hero_l09_decide_state_transition_pal(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state_pal(7, 1); + hero_l09_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -597,7 +597,7 @@ void hero_l09_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l09_set_state_pal(0, 0); + hero_l09_set_move_state_pal(0, 0); } break; } @@ -619,7 +619,7 @@ void hero_l09_decide_state_transition_pal(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state_pal(7, 1); + hero_l09_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -632,7 +632,7 @@ void hero_l09_decide_state_transition_pal(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l09_set_state_pal(2, 0); + hero_l09_set_move_state_pal(2, 0); set_hero_animation_pal(3, g_hero_l09_animation_ids[FLD(g_hero_state, s32, 0x2298)], 11.0f); break; } @@ -643,22 +643,22 @@ void hero_l09_decide_state_transition_pal(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l09_set_state_pal(2, 1); + hero_l09_set_move_state_pal(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l09_set_state_pal(0, 0); + hero_l09_set_move_state_pal(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state_pal(0, 0); + hero_l09_set_move_state_pal(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l09_set_state_pal(0, 1); + hero_l09_set_move_state_pal(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x54) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -675,7 +675,7 @@ void hero_l09_decide_state_transition_pal(void) { } if (PadPressedWithin(0x40, 6, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state_pal(7, 1); + hero_l09_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -684,7 +684,7 @@ void hero_l09_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l09_set_state_pal(0, 0); + hero_l09_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 12.0f); break; } @@ -696,7 +696,7 @@ void hero_l09_decide_state_transition_pal(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state_pal(0, 1); + hero_l09_set_move_state_pal(0, 1); } break; case 0x2: @@ -710,11 +710,11 @@ void hero_l09_decide_state_transition_pal(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l09_set_state_pal(0x76, 1); + hero_l09_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead_pal() == 0)) { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); break; } n = 7; @@ -728,12 +728,12 @@ void hero_l09_decide_state_transition_pal(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l09_set_state_pal(9, 1); + hero_l09_set_move_state_pal(9, 1); } else { - hero_l09_set_state_pal(7, 1); + hero_l09_set_move_state_pal(7, 1); } } else { - hero_l09_set_state_pal(7, 1); + hero_l09_set_move_state_pal(7, 1); } break; } @@ -741,21 +741,21 @@ void hero_l09_decide_state_transition_pal(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.040000003f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state_pal(1, 1); + hero_l09_set_move_state_pal(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state_pal(4, 1); + hero_l09_set_move_state_pal(4, 1); break; } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l09_set_state_pal(0x70, 1); + hero_l09_set_move_state_pal(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l09_set_state_pal(2, 1); + hero_l09_set_move_state_pal(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -766,7 +766,7 @@ void hero_l09_decide_state_transition_pal(void) { if (hero_try_start_grab_pal() != 0) { break; } - if (hero_l09_set_state_pal(0, 0) == 0) { + if (hero_l09_set_move_state_pal(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.030000001f); @@ -783,7 +783,7 @@ void hero_l09_decide_state_transition_pal(void) { hero_update_anim_scale_pal(); } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l09_set_state_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l09_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 14.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 29.166668f; @@ -817,17 +817,17 @@ void hero_l09_decide_state_transition_pal(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x19; - hero_l09_set_state_pal(3, 0); + hero_l09_set_move_state_pal(3, 0); set_hero_animation_pal(6, 4, 9.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l09_set_state_pal(0x77, 1); + hero_l09_set_move_state_pal(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l09_set_state_pal(0x77, 1); + hero_l09_set_move_state_pal(0x77, 1); break; } } @@ -845,11 +845,11 @@ void hero_l09_decide_state_transition_pal(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.054000005f) && (FastDiffRots(FLD(g_hero_state, f32, 0x97), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l09_set_state_pal(0x64, 1); + hero_l09_set_move_state_pal(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.054000005f)) { - hero_l09_set_state_pal(0x63, 1); + hero_l09_set_move_state_pal(0x63, 1); } } else { hero_update_anim_scale_pal(); @@ -857,22 +857,22 @@ void hero_l09_decide_state_transition_pal(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state_pal(0x62, 1); + hero_l09_set_move_state_pal(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l09_set_state_pal(0, 1); + hero_l09_set_move_state_pal(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l09_set_state_pal(0x62, 1); + hero_l09_set_move_state_pal(0x62, 1); } break; case 0x65: { s32 n = FLD(g_hero_state, s32, 0x18C0); if ((n < 3) && (((n * 6) + 0x8) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40, 6, &sp44) != 0)) { - hero_l09_set_state_pal(0x66, 1); + hero_l09_set_move_state_pal(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters_pal(); @@ -906,25 +906,25 @@ void hero_l09_decide_state_transition_pal(void) { return; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state_pal(1, 1); + hero_l09_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l09_set_state_pal(7, 1); + hero_l09_set_move_state_pal(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state_pal(4, 1); + hero_l09_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 8) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state_pal(0, 1); + hero_l09_set_move_state_pal(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -932,45 +932,45 @@ void hero_l09_decide_state_transition_pal(void) { } if (hero_get_weapon_anim_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l09_set_state_pal(0, 0); + hero_l09_set_move_state_pal(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l09_set_state_pal(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l09_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 14.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l09_set_state_pal(2, 1); + hero_l09_set_move_state_pal(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state_pal(1, 1); + hero_l09_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xA) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state_pal(0, 0); + hero_l09_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l09_set_state_pal(0x76, 1); + hero_l09_set_move_state_pal(0x76, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { break; } if ((PadPressedWithin(0x80, 0xC, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l09_set_state_pal(0x15, 1); + hero_l09_set_move_state_pal(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 8) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l09_set_state_pal(0, 1); + hero_l09_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -978,17 +978,17 @@ void hero_l09_decide_state_transition_pal(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l09_set_state_pal(0x8B, 1); + hero_l09_set_move_state_pal(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x4C) { - hero_l09_set_state_pal(0, 1); + hero_l09_set_move_state_pal(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l09_set_state_pal(0, 1); + hero_l09_set_move_state_pal(0, 1); } break; case 0x24: @@ -1014,14 +1014,14 @@ void hero_l09_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l09_set_state_pal(0, 0); + hero_l09_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 25.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l09_set_state_pal(6, 0); + hero_l09_set_move_state_pal(6, 0); } else { - hero_l09_set_state_pal(6, 0); + hero_l09_set_move_state_pal(6, 0); set_hero_animation_pal(0xA, 0, 14.0f); } FLD(g_hero_state, f32, 0xA84) = 0.016800001f; @@ -1037,9 +1037,9 @@ void hero_l09_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l09_set_state_pal(0, 1); + hero_l09_set_move_state_pal(0, 1); } else { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1051,7 +1051,7 @@ void hero_l09_decide_state_transition_pal(void) { if (t < 0x21) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l09_set_state_pal(0x2C, 1); + hero_l09_set_move_state_pal(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0028000001f; FLD(g_hero_state, f32, 0xA80) = 0.0108f; } @@ -1059,7 +1059,7 @@ void hero_l09_decide_state_transition_pal(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l09_set_state_pal(0x18, 0); + hero_l09_set_move_state_pal(0x18, 0); } break; case 0x18: @@ -1068,18 +1068,18 @@ void hero_l09_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab_pal((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 0xE, NULL) != 0) { - hero_l09_set_state_pal(0x1B, 1); + hero_l09_set_move_state_pal(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1088,7 +1088,7 @@ void hero_l09_decide_state_transition_pal(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l09_set_state_pal(0x19, 1); + hero_l09_set_move_state_pal(0x19, 1); } break; } @@ -1099,7 +1099,7 @@ void hero_l09_decide_state_transition_pal(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l09_set_state_pal(0x1A, 1); + hero_l09_set_move_state_pal(0x1A, 1); } } } @@ -1118,18 +1118,18 @@ void hero_l09_decide_state_transition_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state_pal(0x18, 1); + hero_l09_set_move_state_pal(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l09_set_state_pal(0x1B, 1); + hero_l09_set_move_state_pal(0x1B, 1); } break; } @@ -1139,9 +1139,9 @@ void hero_l09_decide_state_transition_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); } else { - hero_l09_set_state_pal(0, 1); + hero_l09_set_move_state_pal(0, 1); } } break; @@ -1165,12 +1165,12 @@ void hero_l09_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l09_set_state_pal(0x39, 1); + hero_l09_set_move_state_pal(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x4B) { - if (hero_l09_set_state_pal(0, 0) != 0) { + if (hero_l09_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } if (low != 0) { @@ -1178,7 +1178,7 @@ void hero_l09_decide_state_transition_pal(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l09_set_state_pal(0, 0) != 0) { + if (hero_l09_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1192,28 +1192,28 @@ void hero_l09_decide_state_transition_pal(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l09_set_state_pal(2, 1); + hero_l09_set_move_state_pal(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.060000002f) { - if (hero_l09_set_state_pal(3, 0) != 0) { + if (hero_l09_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(6, 0, 1e+01f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.15400001f); } } else { - hero_l09_set_state_pal(0, 1); + hero_l09_set_move_state_pal(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_hero_item_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l09_set_state_pal(8, 1); + hero_l09_set_move_state_pal(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x12) && (hero_try_start_move_from_buffer_pal((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 5, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l09_set_state_pal(0x17, 1); + hero_l09_set_move_state_pal(0x17, 1); break; } } @@ -1245,7 +1245,7 @@ void hero_l09_decide_state_transition_pal(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l09_set_state_pal(0, 0) != 0) { + if (hero_l09_set_move_state_pal(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1256,12 +1256,12 @@ void hero_l09_decide_state_transition_pal(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l09_set_state_pal(0x74, 1); + hero_l09_set_move_state_pal(0x74, 1); } else { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); } } else { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); } } break; @@ -1274,16 +1274,16 @@ void hero_l09_decide_state_transition_pal(void) { ok = 1; } if (ok != 0) { - hero_l09_set_state_pal(0x11, 1); + hero_l09_set_move_state_pal(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l09_set_state_pal(0x17, 1); + hero_l09_set_move_state_pal(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1294,23 +1294,23 @@ void hero_l09_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 3)) { - if (hero_l09_set_state_pal(3, 0) != 0) { + if (hero_l09_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x1C; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state_pal(4, 1); + hero_l09_set_move_state_pal(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l09_speed_thresholds[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l09_set_state_pal(2, 1); + hero_l09_set_move_state_pal(2, 1); break; } - hero_l09_set_state_pal(2, 0); + hero_l09_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, 2, 7.0f); @@ -1319,21 +1319,21 @@ void hero_l09_decide_state_transition_pal(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l09_speed_thresholds[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l09_set_state_pal(2, 1); + hero_l09_set_move_state_pal(2, 1); break; } - hero_l09_set_state_pal(2, 0); + hero_l09_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, g_hero_l09_animation_id, 1e+01f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l09_set_state_pal(0, 0) != 0) { + if (hero_l09_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l09_set_state_pal(0, 0) != 0) { + } else if (hero_l09_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1379,14 +1379,14 @@ void hero_l09_decide_state_transition_pal(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 4, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state_pal(0xB, 1); + hero_l09_set_move_state_pal(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x11)) { - hero_l09_set_state_pal(0x82, 1); + hero_l09_set_move_state_pal(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1395,21 +1395,21 @@ void hero_l09_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 6) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f)) { - hero_l09_set_state_pal(0xA, 1); + hero_l09_set_move_state_pal(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l09_set_state_pal(0x10, 1); + hero_l09_set_move_state_pal(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.14000002f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l09_set_state_pal(0x77, 1); + hero_l09_set_move_state_pal(0x77, 1); break; } } @@ -1513,7 +1513,7 @@ void hero_l09_decide_state_transition_pal(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l09_set_state_pal(3, 0) != 0) { + if (hero_l09_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1521,13 +1521,13 @@ void hero_l09_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l09_speed_thresholds[0][2])) { - hero_l09_set_state_pal(7, 1); + hero_l09_set_move_state_pal(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l09_set_state_pal(7, 1); + hero_l09_set_move_state_pal(7, 1); } else if (g_hero_l09_speed_thresholds[1][1] * 0.017f < FLD(g_hero_state, f32, 0x174)) { - hero_l09_set_state_pal(9, 1); + hero_l09_set_move_state_pal(9, 1); } else { - hero_l09_set_state_pal(7, 1); + hero_l09_set_move_state_pal(7, 1); } break; } @@ -1535,10 +1535,10 @@ void hero_l09_decide_state_transition_pal(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_l01_choose_next_move_after_landing_pal(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); break; } { @@ -1548,7 +1548,7 @@ void hero_l09_decide_state_transition_pal(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x16)) && (PadPressedWithin(0x40, 6, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l09_set_state_pal(0x11, 1); + hero_l09_set_move_state_pal(0x11, 1); break; } } @@ -1577,7 +1577,7 @@ void hero_l09_decide_state_transition_pal(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xD) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.11600001f)))) { - hero_l09_set_state_pal(0xE, 1); + hero_l09_set_move_state_pal(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1587,32 +1587,32 @@ void hero_l09_decide_state_transition_pal(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l09_set_state_pal(8, 1); + hero_l09_set_move_state_pal(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l09_set_state_pal(0x17, 1); + hero_l09_set_move_state_pal(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l09_set_state_pal(6, 1); + hero_l09_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x17) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l09_set_state_pal(0x79, 1); + hero_l09_set_move_state_pal(0x79, 1); } else { - hero_l09_set_state_pal(0x39, 1); + hero_l09_set_move_state_pal(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l09_set_state_pal(0x82, 1); + hero_l09_set_move_state_pal(0x82, 1); } else { - hero_l09_set_state_pal(0, 0); + hero_l09_set_move_state_pal(0, 0); } } break; @@ -1622,8 +1622,8 @@ void hero_l09_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x2B) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l09_set_state_pal(0x39, 1); - } else if (hero_l09_set_state_pal(0, 0) != 0) { + hero_l09_set_move_state_pal(0x39, 1); + } else if (hero_l09_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 11.0f); } } @@ -1644,7 +1644,7 @@ void hero_l09_decide_state_transition_pal(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l09_set_state_pal(0, 0); + hero_l09_set_move_state_pal(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -1655,7 +1655,7 @@ void hero_l09_decide_state_transition_pal(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l09_set_state_pal(0, 0); + hero_l09_set_move_state_pal(0, 0); } break; case 0x22: @@ -1665,12 +1665,12 @@ void hero_l09_decide_state_transition_pal(void) { hero_choose_jump_or_roll_move_pal(); break; } - hero_l09_set_state_pal(7, 1); + hero_l09_set_move_state_pal(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l09_set_state_pal(0, 0); + hero_l09_set_move_state_pal(0, 0); } break; default: diff --git a/src/pal/levels/09_dobbo/L09_002BC480-sw2.c b/src/pal/levels/09_dobbo/L09_002BC480-sw2.c index 432b6313a..a2ecba612 100644 --- a/src/pal/levels/09_dobbo/L09_002BC480-sw2.c +++ b/src/pal/levels/09_dobbo/L09_002BC480-sw2.c @@ -55,8 +55,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -123,7 +123,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l09_set_state_pal(s32 action, s32 animate) { +s32 hero_l09_set_move_state_pal(s32 action, s32 animate) { u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 oldStep; @@ -170,7 +170,9 @@ s32 hero_l09_set_state_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -183,7 +185,7 @@ s32 hero_l09_set_state_pal(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_anim_id(0) == 0x51) set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 15.0f); else set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, -1.0f); @@ -318,7 +320,7 @@ s32 hero_l09_set_state_pal(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l09_set_state_pal(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l09_set_move_state_pal(0x76, 1); return 0; } } if (BYTE(0x22B9) || WORD(0x2294) == 0x70) { WORD(0x2294) = 0x70; set_hero_animation_pal(0x59, 0, 7.0f); goto finish; @@ -351,11 +353,11 @@ s32 hero_l09_set_state_pal(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_move_state_pal(0x76, 1); return 0; } if (hero_try_start_grab_pal()) return 0; if (hero_get_weapon_anim_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l09_set_state_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 15.0f); + if (hero_l09_set_move_state_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 15.0f); return 0; } if (!animate) goto finish; @@ -380,7 +382,7 @@ s32 hero_l09_set_state_pal(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.14000002f) REAL(0x1B4) = 0.14000002f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.14000002f); @@ -522,13 +524,13 @@ s32 hero_l09_set_state_pal(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l09_set_state_pal(0x81, 1); return 0; + hero_l09_set_move_state_pal(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l09_lock_flag_b) { hero_l09_set_state_pal(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l09_lock_flag_b) { hero_l09_set_move_state_pal(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l09_set_state_pal(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l09_set_move_state_pal(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -603,9 +605,9 @@ s32 hero_l09_set_state_pal(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_l09_special_state_flag) hero_l09_set_state_pal(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l09_set_state_pal(0x79, 1); - else hero_l09_set_state_pal(0x39, 1); + if (g_current_map_index == 2 && g_hero_l09_special_state_flag) hero_l09_set_move_state_pal(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l09_set_move_state_pal(0x79, 1); + else hero_l09_set_move_state_pal(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -639,7 +641,7 @@ s32 hero_l09_set_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -665,7 +667,7 @@ s32 hero_l09_set_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -674,7 +676,7 @@ s32 hero_l09_set_state_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4B8) = 0.6f; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -808,7 +810,7 @@ s32 hero_l09_set_state_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -863,7 +865,7 @@ s32 hero_l09_set_state_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -875,7 +877,7 @@ s32 hero_l09_set_state_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); @@ -914,7 +916,7 @@ s32 hero_l09_set_state_pal(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.09f; if (WORD(0x640) > 12 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l09_set_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; + PTR(0x2290)[0xA8] = 255; hero_l09_set_move_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; return 0; } HALF(0x1DC) = 64; REAL(0x69C) = 0.050000004f; diff --git a/src/pal/levels/10_hrugis_cloud/L10_00426194-g8.c b/src/pal/levels/10_hrugis_cloud/L10_00426194-g8.c index 7fa6abaf9..5cae4d955 100644 --- a/src/pal/levels/10_hrugis_cloud/L10_00426194-g8.c +++ b/src/pal/levels/10_hrugis_cloud/L10_00426194-g8.c @@ -107,7 +107,7 @@ extern void hero_set_state_value_b(s32 value); extern void level_select_random_object(void); extern void level_store_pair_with_increment(s32 a0, s32 a1); extern void moby_set_flag_bit(Moby *moby, s32 enabled); -extern s32 hero_l00_set_action(s32 action, s32 animate); +extern s32 hero_l00_set_move_state(s32 action, s32 animate); extern void hero_set_state_value_c(s32 value); extern s32 LockedEntryMenuInput(void); extern void ship_save_transform_state(void); @@ -218,7 +218,7 @@ void UpdateHrugisController_pal(Moby *moby) if (g_state_frame_count++ < 5 || g_mission_reward_state == 2) break; - hero_l00_set_action(0x31, 0); + hero_l00_set_move_state(0x31, 0); if (g_kind_choosing_flag) { hero_set_state_value_c(on); g_selected_mission_kind = LockedEntryMenuInput(); diff --git a/src/pal/levels/11_joba/L11_002CB0C8-flags.c b/src/pal/levels/11_joba/L11_002CB0C8-flags.c index b069fe2cb..1d75649fd 100644 --- a/src/pal/levels/11_joba/L11_002CB0C8-flags.c +++ b/src/pal/levels/11_joba/L11_002CB0C8-flags.c @@ -62,7 +62,7 @@ extern int g_arena_state __attribute__((sda)); extern u8 g_hero_input_enabled __attribute__((sda)); extern u8 g_bolt_multiplier __attribute__((sda)); extern u8 g_contact_hit_flag __attribute__((sda)); -extern int hero_l11_enter_state_pal(int, int); +extern int hero_l11_set_move_state_pal(int, int); extern float fade_get_value(void); extern float fade_reduce_value_pal(float); extern void hero_clear_tracked_slots(void); @@ -115,18 +115,18 @@ int hero_handle_contact_hit_pal(long apply) case 0: contact = g_hero_state.contact; if (contact && (*(short *)(contact+0xaa) == 0x4eb || *(short *)(contact+0xaa) == 0x558)) { - hero_l11_enter_state_pal(0x7d, 1); return 1; + hero_l11_set_move_state_pal(0x7d, 1); return 1; } if ((g_hero_state.state == 1 || g_hero_state.state == 0x1d || g_hero_state.interrupted) && !(entry->flags & 8)) { u8 *hit = part_find_owned_effect_slot(g_hero_state.object, 1, 0); if (hit) AdjustPlayerHealth_pal(FloatToInt(*(float *)(hit+0x2c))); - if (!g_hero_state.health) hero_l11_enter_state_pal(0x16, 1); + if (!g_hero_state.health) hero_l11_set_move_state_pal(0x16, 1); g_hero_state.timer = 0x40; if (!g_hero_state.soundTimer) g_hero_state.soundTimer = 0xF; hero_play_sound(0x14, 0); return 0; } - if (entry->flags & 8) hero_l11_enter_state_pal(0x8c, 1); - else hero_l11_enter_state_pal(0x16, 1); + if (entry->flags & 8) hero_l11_set_move_state_pal(0x8c, 1); + else hero_l11_set_move_state_pal(0x16, 1); if (g_hero_state.state == 0x8c) qzero(&direction); else { hero_flatten_push_vector((int)&direction, special, g_hero_state.jumpPressed ? 0.0f : 0.06600001f, 0.034f); @@ -134,7 +134,7 @@ int hero_handle_contact_hit_pal(long apply) } break; case 1: - hero_l11_enter_state_pal(0x42, 1); + hero_l11_set_move_state_pal(0x42, 1); hero_flatten_push_vector((int)&direction, special, 0.10000001f, 0.060000002f); break; } diff --git a/src/pal/levels/11_joba/L11_002D22B8-hero.c b/src/pal/levels/11_joba/L11_002D22B8-hero.c index 6c6a72a1a..7a5217418 100644 --- a/src/pal/levels/11_joba/L11_002D22B8-hero.c +++ b/src/pal/levels/11_joba/L11_002D22B8-hero.c @@ -136,7 +136,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -999,7 +999,7 @@ void hero_l11_update_state_machine_pal(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x2a; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l11_state_block)->f[0x180/4] = 0.1f; diff --git a/src/pal/levels/11_joba/L11_002D22B8-sw.c b/src/pal/levels/11_joba/L11_002D22B8-sw.c index 3fac71d63..43825ad83 100644 --- a/src/pal/levels/11_joba/L11_002D22B8-sw.c +++ b/src/pal/levels/11_joba/L11_002D22B8-sw.c @@ -74,7 +74,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_refresh_speed_from_timer_pal(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction_pal(void); -s32 hero_l11_enter_state_pal(s32, s32); +s32 hero_l11_set_move_state_pal(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition_pal(void); s32 hero_try_start_ledge_move(void); @@ -151,7 +151,7 @@ void hero_decide_next_state_pal(void) { UpdateHeroHeldTarget_pal(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l11_enter_state_pal(0x39, 1); + hero_l11_set_move_state_pal(0x39, 1); goto end; } } @@ -186,7 +186,7 @@ void hero_decide_next_state_pal(void) { hero_apply_pending_change_pal(); if (FLD(g_hero_state, f32, 0x88) < g_hero_proximity_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l11_enter_state_pal(0x74, 1); + hero_l11_set_move_state_pal(0x74, 1); goto end; } } @@ -196,12 +196,12 @@ void hero_decide_next_state_pal(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state_pal(1, 1); + hero_l11_set_move_state_pal(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l11_enter_state_pal(0x82, 1); + hero_l11_set_move_state_pal(0x82, 1); break; } { @@ -237,7 +237,7 @@ void hero_decide_next_state_pal(void) { rec = g_hero_idle_choice_table + sp40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 5e+01f; if (FLD(rec, s32, 0x44) != 0) { - hero_l11_enter_state_pal(0x3C, 1); + hero_l11_set_move_state_pal(0x3C, 1); } else { set_hero_animation_pal(FLD(rec, s32, 0x48), 0, 1e+01f); } @@ -280,12 +280,12 @@ void hero_decide_next_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l11_enter_state_pal(0x76, 1); + hero_l11_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); } break; } @@ -306,12 +306,12 @@ void hero_decide_next_state_pal(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_action_blocked_flag == 0) && (PadPressedWithin(0x40, 6, NULL) != 0)) { - hero_l11_enter_state_pal(0x6E, 1); + hero_l11_set_move_state_pal(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l11_enter_state_pal(4, 1); + hero_l11_set_move_state_pal(4, 1); break; } } @@ -332,28 +332,28 @@ void hero_decide_next_state_pal(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust_pal(side, 0, 0, 0x1E); hero_play_footstep_sound_dust_pal(side, 1, 0, 0x1E); - hero_l11_enter_state_pal(2, 1); + hero_l11_set_move_state_pal(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state_pal(1, 1); + hero_l11_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l11_enter_state_pal(0x3D, 1); + hero_l11_set_move_state_pal(0x3D, 1); break; } hero_refresh_speed_from_timer_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l11_enter_state_pal(0x3D, 1); + hero_l11_set_move_state_pal(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l11_enter_state_pal(0, 1); + hero_l11_set_move_state_pal(0, 1); } break; case 0x3D: @@ -362,22 +362,22 @@ void hero_decide_next_state_pal(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); break; } if (hero_try_start_move_from_buffer_pal(6, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state_pal(4, 1); + hero_l11_set_move_state_pal(4, 1); break; } hero_refresh_speed_from_timer_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l11_enter_state_pal(2, 1); + hero_l11_set_move_state_pal(2, 1); break; } - hero_l11_enter_state_pal(0, 1); + hero_l11_set_move_state_pal(0, 1); break; case 0x39: case 0x43: @@ -427,9 +427,9 @@ void hero_decide_next_state_pal(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state_pal(4, 1); + hero_l11_set_move_state_pal(4, 1); } else { - hero_l11_enter_state_pal(0, 0); + hero_l11_set_move_state_pal(0, 0); anim = hero_get_gadget_value(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -441,9 +441,9 @@ void hero_decide_next_state_pal(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l11_enter_state_pal(0, 0); + hero_l11_set_move_state_pal(0, 0); } else { - hero_l11_enter_state_pal(0, 1); + hero_l11_set_move_state_pal(0, 1); } } break; @@ -476,7 +476,7 @@ void hero_decide_next_state_pal(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state_pal(7, 1); + hero_l11_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -485,7 +485,7 @@ void hero_decide_next_state_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l11_enter_state_pal(0, 0); + hero_l11_set_move_state_pal(0, 0); } break; } @@ -507,7 +507,7 @@ void hero_decide_next_state_pal(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state_pal(7, 1); + hero_l11_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -520,7 +520,7 @@ void hero_decide_next_state_pal(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l11_enter_state_pal(2, 0); + hero_l11_set_move_state_pal(2, 0); set_hero_animation_pal(3, g_hero_anim_ids_by_mode[FLD(g_hero_state, s32, 0x2298)], 11.0f); break; } @@ -531,22 +531,22 @@ void hero_decide_next_state_pal(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l11_enter_state_pal(2, 1); + hero_l11_set_move_state_pal(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l11_enter_state_pal(0, 0); + hero_l11_set_move_state_pal(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state_pal(0, 0); + hero_l11_set_move_state_pal(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l11_enter_state_pal(0, 1); + hero_l11_set_move_state_pal(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x54) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -563,7 +563,7 @@ void hero_decide_next_state_pal(void) { } if (PadPressedWithin(0x40, 6, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state_pal(7, 1); + hero_l11_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -572,7 +572,7 @@ void hero_decide_next_state_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l11_enter_state_pal(0, 0); + hero_l11_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_gadget_value(0), 0, 12.0f); break; } @@ -584,7 +584,7 @@ void hero_decide_next_state_pal(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state_pal(0, 1); + hero_l11_set_move_state_pal(0, 1); } break; case 0x2: @@ -598,11 +598,11 @@ void hero_decide_next_state_pal(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l11_enter_state_pal(0x76, 1); + hero_l11_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead_pal() == 0)) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); break; } n = 7; @@ -616,12 +616,12 @@ void hero_decide_next_state_pal(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l11_enter_state_pal(9, 1); + hero_l11_set_move_state_pal(9, 1); } else { - hero_l11_enter_state_pal(7, 1); + hero_l11_set_move_state_pal(7, 1); } } else { - hero_l11_enter_state_pal(7, 1); + hero_l11_set_move_state_pal(7, 1); } break; } @@ -629,11 +629,11 @@ void hero_decide_next_state_pal(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.040000003f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state_pal(1, 1); + hero_l11_set_move_state_pal(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state_pal(4, 1); + hero_l11_set_move_state_pal(4, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -644,7 +644,7 @@ void hero_decide_next_state_pal(void) { if (hero_try_start_grab_pal() != 0) { break; } - if (hero_l11_enter_state_pal(0, 0) == 0) { + if (hero_l11_set_move_state_pal(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.030000001f); @@ -684,17 +684,17 @@ void hero_decide_next_state_pal(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x19; - hero_l11_enter_state_pal(3, 0); + hero_l11_set_move_state_pal(3, 0); set_hero_animation_pal(6, 4, 9.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l11_enter_state_pal(0x77, 1); + hero_l11_set_move_state_pal(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l11_enter_state_pal(0x77, 1); + hero_l11_set_move_state_pal(0x77, 1); break; } } @@ -712,11 +712,11 @@ void hero_decide_next_state_pal(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.054000005f) && (FastDiffRots(FLD(g_hero_state, f32, 0x97), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l11_enter_state_pal(0x64, 1); + hero_l11_set_move_state_pal(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.054000005f)) { - hero_l11_enter_state_pal(0x63, 1); + hero_l11_set_move_state_pal(0x63, 1); } } else { hero_update_anim_scale_pal(); @@ -724,21 +724,21 @@ void hero_decide_next_state_pal(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state_pal(0x62, 1); + hero_l11_set_move_state_pal(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l11_enter_state_pal(0, 1); + hero_l11_set_move_state_pal(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l11_enter_state_pal(0x62, 1); + hero_l11_set_move_state_pal(0x62, 1); } break; case 0x65: /* switch 2 */ temp_a0_11 = FLD(g_hero_state, s32, 0x18C0); if ((temp_a0_11 < 3) && (((temp_a0_11 * 6) + 0x8) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 6, &sp44) != 0)) { - hero_l11_enter_state_pal(0x66, 1); + hero_l11_set_move_state_pal(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters_pal(); @@ -781,30 +781,30 @@ void hero_decide_next_state_pal(void) { return; case 0x6D: if ((f32)g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l11_enter_state_pal(0, 1); + hero_l11_set_move_state_pal(0, 1); } break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state_pal(1, 1); + hero_l11_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l11_enter_state_pal(7, 1); + hero_l11_set_move_state_pal(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state_pal(4, 1); + hero_l11_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 8) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state_pal(0, 1); + hero_l11_set_move_state_pal(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -812,45 +812,45 @@ void hero_decide_next_state_pal(void) { } if (hero_get_gadget_value(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l11_enter_state_pal(0, 0); + hero_l11_set_move_state_pal(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l11_enter_state_pal(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l11_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_gadget_value(0), 0, 14.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l11_enter_state_pal(2, 1); + hero_l11_set_move_state_pal(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state_pal(1, 1); + hero_l11_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xA) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state_pal(0, 0); + hero_l11_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_gadget_value(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l11_enter_state_pal(0x76, 1); + hero_l11_set_move_state_pal(0x76, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { break; } if ((PadPressedWithin(0x80, 0xC, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l11_enter_state_pal(0x15, 1); + hero_l11_set_move_state_pal(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 8) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l11_enter_state_pal(0, 1); + hero_l11_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -858,17 +858,17 @@ void hero_decide_next_state_pal(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l11_enter_state_pal(0x8B, 1); + hero_l11_set_move_state_pal(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x4C) { - hero_l11_enter_state_pal(0, 1); + hero_l11_set_move_state_pal(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l11_enter_state_pal(0, 1); + hero_l11_set_move_state_pal(0, 1); } break; case 0x24: @@ -894,14 +894,14 @@ void hero_decide_next_state_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l11_enter_state_pal(0, 0); + hero_l11_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_gadget_value(0), 0, 25.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l11_enter_state_pal(6, 0); + hero_l11_set_move_state_pal(6, 0); } else { - hero_l11_enter_state_pal(6, 0); + hero_l11_set_move_state_pal(6, 0); set_hero_animation_pal(0xA, 0, 14.0f); } FLD(g_hero_state, f32, 0xA84) = 0.016800001f; @@ -917,9 +917,9 @@ void hero_decide_next_state_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l11_enter_state_pal(0, 1); + hero_l11_set_move_state_pal(0, 1); } else { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -931,7 +931,7 @@ void hero_decide_next_state_pal(void) { if (t < 0x21) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l11_enter_state_pal(0x2C, 1); + hero_l11_set_move_state_pal(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0028000001f; FLD(g_hero_state, f32, 0xA80) = 0.0108f; } @@ -948,13 +948,13 @@ void hero_decide_next_state_pal(void) { } } if (FLD(g_hero_state, s32, 0x6F0) >= 5) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x204) = 0x19; } break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l11_enter_state_pal(0x18, 0); + hero_l11_set_move_state_pal(0x18, 0); } break; case 0x18: @@ -963,18 +963,18 @@ void hero_decide_next_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab_pal((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 0xE, NULL) != 0) { - hero_l11_enter_state_pal(0x1B, 1); + hero_l11_set_move_state_pal(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -983,7 +983,7 @@ void hero_decide_next_state_pal(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l11_enter_state_pal(0x19, 1); + hero_l11_set_move_state_pal(0x19, 1); } break; } @@ -994,7 +994,7 @@ void hero_decide_next_state_pal(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l11_enter_state_pal(0x1A, 1); + hero_l11_set_move_state_pal(0x1A, 1); } } } @@ -1013,18 +1013,18 @@ void hero_decide_next_state_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state_pal(0x18, 1); + hero_l11_set_move_state_pal(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l11_enter_state_pal(0x1B, 1); + hero_l11_set_move_state_pal(0x1B, 1); } break; } @@ -1034,9 +1034,9 @@ void hero_decide_next_state_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); } else { - hero_l11_enter_state_pal(0, 1); + hero_l11_set_move_state_pal(0, 1); } } break; @@ -1060,12 +1060,12 @@ void hero_decide_next_state_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l11_enter_state_pal(0x39, 1); + hero_l11_set_move_state_pal(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x4B) { - if (hero_l11_enter_state_pal(0, 0) != 0) { + if (hero_l11_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } if (low != 0) { @@ -1073,7 +1073,7 @@ void hero_decide_next_state_pal(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l11_enter_state_pal(0, 0) != 0) { + if (hero_l11_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1087,32 +1087,32 @@ void hero_decide_next_state_pal(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l11_enter_state_pal(2, 1); + hero_l11_set_move_state_pal(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.060000002f) { - if (hero_l11_enter_state_pal(3, 0) != 0) { + if (hero_l11_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(6, 0, 1e+01f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.15400001f); } } else { - hero_l11_enter_state_pal(0, 1); + hero_l11_set_move_state_pal(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l11_enter_state_pal(8, 1); + hero_l11_set_move_state_pal(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x12) && (hero_try_start_move_from_buffer_pal((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 5, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state_pal(0x17, 1); + hero_l11_set_move_state_pal(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l11_enter_state_pal(0x71, 1); + hero_l11_set_move_state_pal(0x71, 1); } } break; @@ -1143,7 +1143,7 @@ void hero_decide_next_state_pal(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l11_enter_state_pal(0, 0) != 0) { + if (hero_l11_set_move_state_pal(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1153,9 +1153,9 @@ void hero_decide_next_state_pal(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l11_enter_state_pal(0x74, 1); + hero_l11_set_move_state_pal(0x74, 1); } else { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); } } break; @@ -1168,16 +1168,16 @@ void hero_decide_next_state_pal(void) { ok = 1; } if (ok != 0) { - hero_l11_enter_state_pal(0x11, 1); + hero_l11_set_move_state_pal(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state_pal(0x17, 1); + hero_l11_set_move_state_pal(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1188,23 +1188,23 @@ void hero_decide_next_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 3)) { - if (hero_l11_enter_state_pal(3, 0) != 0) { + if (hero_l11_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x1C; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state_pal(4, 1); + hero_l11_set_move_state_pal(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_anim_range_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l11_enter_state_pal(2, 1); + hero_l11_set_move_state_pal(2, 1); break; } - hero_l11_enter_state_pal(2, 0); + hero_l11_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, 2, 7.0f); @@ -1213,21 +1213,21 @@ void hero_decide_next_state_pal(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_anim_range_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l11_enter_state_pal(2, 1); + hero_l11_set_move_state_pal(2, 1); break; } - hero_l11_enter_state_pal(2, 0); + hero_l11_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, g_hero_landing_anim_id, 1e+01f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l11_enter_state_pal(0, 0) != 0) { + if (hero_l11_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_gadget_value(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l11_enter_state_pal(0, 0) != 0) { + } else if (hero_l11_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1275,14 +1275,14 @@ void hero_decide_next_state_pal(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 4, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state_pal(0xB, 1); + hero_l11_set_move_state_pal(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x11)) { - hero_l11_enter_state_pal(0x82, 1); + hero_l11_set_move_state_pal(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1291,25 +1291,25 @@ void hero_decide_next_state_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 6) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f)) { - hero_l11_enter_state_pal(0xA, 1); + hero_l11_set_move_state_pal(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l11_enter_state_pal(0x10, 1); + hero_l11_set_move_state_pal(0x10, 1); } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l11_enter_state_pal(0x71, 1); + hero_l11_set_move_state_pal(0x71, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.14000002f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l11_enter_state_pal(0x77, 1); + hero_l11_set_move_state_pal(0x77, 1); break; } } @@ -1413,7 +1413,7 @@ void hero_decide_next_state_pal(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l11_enter_state_pal(3, 0) != 0) { + if (hero_l11_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1421,13 +1421,13 @@ void hero_decide_next_state_pal(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_anim_range_table[0][2])) { - hero_l11_enter_state_pal(7, 1); + hero_l11_set_move_state_pal(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l11_enter_state_pal(7, 1); + hero_l11_set_move_state_pal(7, 1); } else if (g_hero_anim_range_table[1][1] * 0.017f < FLD(g_hero_state, f32, 0x174)) { - hero_l11_enter_state_pal(9, 1); + hero_l11_set_move_state_pal(9, 1); } else { - hero_l11_enter_state_pal(7, 1); + hero_l11_set_move_state_pal(7, 1); } break; } @@ -1435,10 +1435,10 @@ void hero_decide_next_state_pal(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_l01_choose_next_move_after_landing_pal(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); break; } { @@ -1448,7 +1448,7 @@ void hero_decide_next_state_pal(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x16)) && (PadPressedWithin(0x40, 6, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l11_enter_state_pal(0x11, 1); + hero_l11_set_move_state_pal(0x11, 1); break; } } @@ -1477,7 +1477,7 @@ void hero_decide_next_state_pal(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xD) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.11600001f)))) { - hero_l11_enter_state_pal(0xE, 1); + hero_l11_set_move_state_pal(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1487,32 +1487,32 @@ void hero_decide_next_state_pal(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l11_enter_state_pal(8, 1); + hero_l11_set_move_state_pal(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x576) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l11_enter_state_pal(0x17, 1); + hero_l11_set_move_state_pal(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x17) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l11_enter_state_pal(0x79, 1); + hero_l11_set_move_state_pal(0x79, 1); } else { - hero_l11_enter_state_pal(0x39, 1); + hero_l11_set_move_state_pal(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l11_enter_state_pal(0x82, 1); + hero_l11_set_move_state_pal(0x82, 1); } else { - hero_l11_enter_state_pal(0, 0); + hero_l11_set_move_state_pal(0, 0); } } break; @@ -1522,8 +1522,8 @@ void hero_decide_next_state_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x2B) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l11_enter_state_pal(0x39, 1); - } else if (hero_l11_enter_state_pal(0, 0) != 0) { + hero_l11_set_move_state_pal(0x39, 1); + } else if (hero_l11_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_gadget_value(0), 0, 11.0f); } } @@ -1548,28 +1548,28 @@ void hero_decide_next_state_pal(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l11_enter_state_pal(0x4E, 1); + hero_l11_set_move_state_pal(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state_pal(1, 1); + hero_l11_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l11_enter_state_pal(0x41, 1); + hero_l11_set_move_state_pal(0x41, 1); break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l11_enter_state_pal(0x45, 1); + hero_l11_set_move_state_pal(0x45, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l11_enter_state_pal(0x4D, 1); + hero_l11_set_move_state_pal(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l11_enter_state_pal(0x40, 1); + hero_l11_set_move_state_pal(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -1582,14 +1582,14 @@ void hero_decide_next_state_pal(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l11_enter_state_pal(0x4E, 1); + hero_l11_set_move_state_pal(0x4E, 1); break; } rec = (u8 *)&g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l11_enter_state_pal(0x3F, 0); + hero_l11_set_move_state_pal(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -1598,13 +1598,13 @@ void hero_decide_next_state_pal(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0xD) ? n : 0xC, NULL) != 0) { - hero_l11_enter_state_pal(0x4D, 1); + hero_l11_set_move_state_pal(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l11_enter_state_pal(0x45, 1); + hero_l11_set_move_state_pal(0x45, 1); } break; } @@ -1667,42 +1667,42 @@ void hero_decide_next_state_pal(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 3, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { hero_resolve_stick_direction(0, 1.0f); - hero_l11_enter_state_pal(0x45, 1); + hero_l11_set_move_state_pal(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_anim_range_table[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x97)) < 1.5707964f)) { - hero_l11_enter_state_pal(0x40, 1); + hero_l11_set_move_state_pal(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xB) { - hero_l11_enter_state_pal(0x3F, 1); + hero_l11_set_move_state_pal(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x22)) { - hero_l11_enter_state_pal(0x41, 1); + hero_l11_set_move_state_pal(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 4, NULL) != 0)) { - hero_l11_enter_state_pal(0x4D, 1); + hero_l11_set_move_state_pal(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state_pal(0x46, 1); + hero_l11_set_move_state_pal(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l11_enter_state_pal(0x4B, 1); + hero_l11_set_move_state_pal(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l11_enter_state_pal(0x41, 1); + hero_l11_set_move_state_pal(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state_pal(0x46, 1); + hero_l11_set_move_state_pal(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -1712,11 +1712,11 @@ void hero_decide_next_state_pal(void) { FLD(g_hero_state, s16, 0x1EE) = 0xA - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l11_enter_state_pal(0x40, 1); + hero_l11_set_move_state_pal(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l11_enter_state_pal(0x3F, 1); + hero_l11_set_move_state_pal(0x3F, 1); } break; case 0x41: @@ -1728,29 +1728,29 @@ void hero_decide_next_state_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l11_enter_state_pal(0x43, 1); + hero_l11_set_move_state_pal(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l11_enter_state_pal(0x40, 1); + hero_l11_set_move_state_pal(0x40, 1); } else { - hero_l11_enter_state_pal(0x3F, 1); + hero_l11_set_move_state_pal(0x3F, 1); } } else { - hero_l11_enter_state_pal(0x3F, 1); + hero_l11_set_move_state_pal(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state_pal(0x46, 1); + hero_l11_set_move_state_pal(0x46, 1); break; } if ((PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l11_enter_state_pal(0x4B, 1); + hero_l11_set_move_state_pal(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l11_enter_state_pal(0x3F, 1); + hero_l11_set_move_state_pal(0x3F, 1); } break; case 0x4E: @@ -1759,9 +1759,9 @@ void hero_decide_next_state_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l11_enter_state_pal(0x41, 1); + hero_l11_set_move_state_pal(0x41, 1); } else { - hero_l11_enter_state_pal(0x3F, 1); + hero_l11_set_move_state_pal(0x3F, 1); } } break; @@ -1771,7 +1771,7 @@ void hero_decide_next_state_pal(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l11_enter_state_pal(0x4E, 1); + hero_l11_set_move_state_pal(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.030000001f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -1797,55 +1797,55 @@ void hero_decide_next_state_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l11_enter_state_pal(0x45, 1); + hero_l11_set_move_state_pal(0x45, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l11_enter_state_pal(0x4D, 1); + hero_l11_set_move_state_pal(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l11_enter_state_pal(0x41, 1); + hero_l11_set_move_state_pal(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l11_enter_state_pal(0x3F, 1); + hero_l11_set_move_state_pal(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1B) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l11_enter_state_pal(0x41, 1); + hero_l11_set_move_state_pal(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1E) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l11_enter_state_pal(0x43, 1); + hero_l11_set_move_state_pal(0x43, 1); } else { - hero_l11_enter_state_pal(0x3F, 0); + hero_l11_set_move_state_pal(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state_pal(0x47, 1); + hero_l11_set_move_state_pal(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)v10 = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l11_enter_state_pal(0x41, 1); + hero_l11_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state_pal(0x41, 1); + hero_l11_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l11_enter_state_pal(0x48, 1); + hero_l11_set_move_state_pal(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1854,7 +1854,7 @@ void hero_decide_next_state_pal(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l11_enter_state_pal(0x49, 1); + hero_l11_set_move_state_pal(0x49, 1); } break; } @@ -1865,7 +1865,7 @@ void hero_decide_next_state_pal(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l11_enter_state_pal(0x4A, 1); + hero_l11_set_move_state_pal(0x4A, 1); } } } @@ -1884,17 +1884,17 @@ void hero_decide_next_state_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state_pal(0x47, 1); + hero_l11_set_move_state_pal(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l11_enter_state_pal(0x41, 1); + hero_l11_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l11_enter_state_pal(0x48, 1); + hero_l11_set_move_state_pal(0x48, 1); } break; } @@ -1909,7 +1909,7 @@ void hero_decide_next_state_pal(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l11_enter_state_pal(0, 0); + hero_l11_set_move_state_pal(0, 0); anim = hero_get_gadget_value(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -1920,7 +1920,7 @@ void hero_decide_next_state_pal(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l11_enter_state_pal(0, 0); + hero_l11_set_move_state_pal(0, 0); } break; case 0x22: @@ -1930,12 +1930,12 @@ void hero_decide_next_state_pal(void) { hero_choose_jump_or_roll_move_pal(); break; } - hero_l11_enter_state_pal(7, 1); + hero_l11_set_move_state_pal(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l11_enter_state_pal(0, 0); + hero_l11_set_move_state_pal(0, 0); } break; default: diff --git a/src/pal/levels/11_joba/L11_002D22B8-sw2.c b/src/pal/levels/11_joba/L11_002D22B8-sw2.c index e26030fe5..15e93fd89 100644 --- a/src/pal/levels/11_joba/L11_002D22B8-sw2.c +++ b/src/pal/levels/11_joba/L11_002D22B8-sw2.c @@ -60,8 +60,8 @@ extern int hero_play_sound(int, int); extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -129,7 +129,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l11_enter_state_pal(s32 action, s32 animate) { +s32 hero_l11_set_move_state_pal(s32 action, s32 animate) { f32 dir[4]; u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -177,7 +177,9 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -190,7 +192,7 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_gadget_value(0) == 0x51) set_hero_animation_pal(hero_get_gadget_value(0), 0, 15.0f); else set_hero_animation_pal(hero_get_gadget_value(0), 0, -1.0f); @@ -245,7 +247,7 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l11_enter_state_pal(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l11_set_move_state_pal(0x76, 1); return 0; } } WORD(0x2298) = 0; BYTE(0x40C) = 0; BYTE(0x40E) = 0; @@ -275,11 +277,11 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state_pal(0x76, 1); return 0; } if (hero_try_start_grab_pal()) return 0; if (hero_get_gadget_value(0) == 0x51) { if (!animate) goto finish; - if (hero_l11_enter_state_pal(0, 0)) set_hero_animation_pal(hero_get_gadget_value(0), 0, 15.0f); + if (hero_l11_set_move_state_pal(0, 0)) set_hero_animation_pal(hero_get_gadget_value(0), 0, 15.0f); return 0; } if (!animate) goto finish; @@ -304,7 +306,7 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.14000002f) REAL(0x1B4) = 0.14000002f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.14000002f); @@ -463,13 +465,13 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l11_enter_state_pal(0x81, 1); return 0; + hero_l11_set_move_state_pal(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l11_input_blocked) { hero_l11_enter_state_pal(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l11_input_blocked) { hero_l11_set_move_state_pal(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l11_enter_state_pal(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l11_set_move_state_pal(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -529,9 +531,9 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_arena_l11_active_flag) hero_l11_enter_state_pal(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l11_enter_state_pal(0x79, 1); - else hero_l11_enter_state_pal(0x39, 1); + if (g_current_map_index == 2 && g_arena_l11_active_flag) hero_l11_set_move_state_pal(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l11_set_move_state_pal(0x79, 1); + else hero_l11_set_move_state_pal(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -568,7 +570,7 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -597,7 +599,7 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -606,7 +608,7 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4B8) = 0.6f; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -741,7 +743,7 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -822,7 +824,7 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -834,7 +836,7 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); @@ -869,7 +871,7 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { set_hero_animation_pal(0x11, 0, 7.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state_pal(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state_pal(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation_pal(0, 0, 7.0f); goto finish; case 0x4B: @@ -903,7 +905,7 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l11_float_sequences[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state_pal(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state_pal(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -947,7 +949,7 @@ s32 hero_l11_enter_state_pal(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.09f; if (WORD(0x640) > 12 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l11_enter_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; + PTR(0x2290)[0xA8] = 255; hero_l11_set_move_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; return 0; } HALF(0x1DC) = 64; REAL(0x69C) = 0.050000004f; diff --git a/src/pal/levels/11_joba/L11_004169A8-g8.c b/src/pal/levels/11_joba/L11_004169A8-g8.c index 49394980e..063ea16c0 100644 --- a/src/pal/levels/11_joba/L11_004169A8-g8.c +++ b/src/pal/levels/11_joba/L11_004169A8-g8.c @@ -36,7 +36,7 @@ extern f32 math_fast_sin_or_cos_b(f32); extern void FastVecAdd(void *, void *, void *); extern void mem_fast_helper_b(void *, s32); extern void cam_set_mode_state(s32); -extern s32 hero_l11_enter_state(s32, s32); +extern s32 hero_l11_set_move_state(s32, s32); extern void anim_start_blended(void *, s32, s32, s32); extern void SetCamera5Pose(void *, void *, s32, s32, s32); extern f32 fast_vec_dist(void *, void *); @@ -110,7 +110,7 @@ void turret_update_pal(TurretMoby *moby) { mem_fast_helper_b(&g_hero_state.velocity, 0xA0); if (g_pad_state.pressed & 0x10) { cam_set_mode_state(0); - hero_l11_enter_state(0, 1); + hero_l11_set_move_state(0, 1); moby->command = 2; moby->state = 4; moby->speed = 1.0f; @@ -135,7 +135,7 @@ void turret_update_pal(TurretMoby *moby) { g_hero_state.state != 0x39 && g_hero_state.ground == moby && fast_vec_dist(&seat, g_hero_state.moby + 0x10) < 1.2f && vars->mount_delay == 0 && D_L11_001A8FB4_block[0] == 0) { moby->command = 1; - hero_l11_enter_state(0x31, 1); + hero_l11_set_move_state(0x31, 1); } } switch (moby->state) { diff --git a/src/pal/levels/11_joba/L11_004439E4-main-g64.c b/src/pal/levels/11_joba/L11_004439E4-main-g64.c index 573cdfa61..e8172070b 100644 --- a/src/pal/levels/11_joba/L11_004439E4-main-g64.c +++ b/src/pal/levels/11_joba/L11_004439E4-main-g64.c @@ -222,7 +222,7 @@ extern void global_object_start(char *, int); extern void script_queue_keyed_request(s32, s32); extern s32 moby_has_free_child_slot_state2(u8 *); extern void moby_try_alloc_enter_state2(void *); -extern s32 hero_l11_enter_state(s32, s32); +extern s32 hero_l11_set_move_state(s32, s32); extern int arena_get_challenge_display_id(unsigned int); extern int arena_get_challenge_flag_index(unsigned int); extern void arena_end_frame(u8 *); @@ -777,10 +777,10 @@ void arena_controller_update_pal(u8 *obj) { ((Hero *)g_hero_state)->i[0xF4 / 4] = 0; if (((Hero *)g_hero_state)->i[0x2294 / 4] != 7) { if (((Hero *)g_hero_state)->i[0x2294 / 4] != 0x81) { - hero_l11_enter_state(7, 1); + hero_l11_set_move_state(7, 1); } } else { - hero_l11_enter_state(0x81, 1); + hero_l11_set_move_state(0x81, 1); } if (vec_distance_xy(&((Hero *)g_hero_state)->f[0x80 / 4], light_up->pos) < 0.01f) { ((Hero *)g_hero_state)->f[0x84 / 4] += 0.01f; @@ -902,7 +902,7 @@ void arena_controller_update_pal(u8 *obj) { arena_queue_voice_line(obj, 4); } } else { - hero_l11_enter_state(0x6F, 1); + hero_l11_set_move_state(0x6F, 1); OBJ->phase = 2; vars->mode = 4; OBJ->timer = 0; @@ -937,7 +937,7 @@ void arena_controller_update_pal(u8 *obj) { if (OBJ->timer >= 0x97) { ((Hero *)g_hero_state)->h[0x348 / 2] = 0; g_hero_speed_param = 5.0f; - hero_l11_enter_state(0x81, 1); + hero_l11_set_move_state(0x81, 1); OBJ->phase = 3; } } else if (OBJ->phase == 3) { diff --git a/src/pal/levels/11_joba/L11_00448CF0-g8.c b/src/pal/levels/11_joba/L11_00448CF0-g8.c index 433f5b8aa..426f7b454 100644 --- a/src/pal/levels/11_joba/L11_00448CF0-g8.c +++ b/src/pal/levels/11_joba/L11_00448CF0-g8.c @@ -4,7 +4,7 @@ extern int mode_get_stack_top(void); extern int flag_is_byte_set(void); extern int arena_get_challenge_flag_index(unsigned int); -extern int hero_l11_enter_state_pal(int, int); +extern int hero_l11_set_move_state_pal(int, int); extern int snd_play_from_global_bank(int, int, void *); extern int FastDecTimer(short *); extern void moby_set_state(u8 *, int, int); @@ -45,7 +45,7 @@ void UpdateJobaClassSelectionMenu_pal(u8 *object) int i, found; InputView *input; if (mode_get_stack_top()==5) return; - if (g_game_mode[0]!=0x6f) hero_l11_enter_state_pal(0x6f,1); + if (g_game_mode[0]!=0x6f) hero_l11_set_move_state_pal(0x6f,1); if (H(0x1ea)==0) { if ((((InputView *)g_pad_state)->field1c4&0x2000) && H(0x1e8)<12) { for (i=H(0x1e8)+1;i<13;i++) { diff --git a/src/pal/levels/11_joba/L11_00449550-g8.c b/src/pal/levels/11_joba/L11_00449550-g8.c index 07020ef25..ae8270f41 100644 --- a/src/pal/levels/11_joba/L11_00449550-g8.c +++ b/src/pal/levels/11_joba/L11_00449550-g8.c @@ -12,7 +12,7 @@ typedef struct { char pad1[0xDB]; } L11_00445990_Rec; extern L11_00445990_Rec g_item_l11_record_table[]; -extern s32 hero_l11_enter_state_pal(s32, s32); +extern s32 hero_l11_set_move_state_pal(s32, s32); extern s32 PadPressedWithin(s32, s32, s32 *); extern s32 arena_get_challenge_flag_index(s32); extern s32 flag_is_byte_set(void); @@ -28,7 +28,7 @@ void joba_menu_select_next_pal(char *object) { L11_00445990_Rec *record; if (g_game_mode != 0x6F) - hero_l11_enter_state_pal(0x6F, 1); + hero_l11_set_move_state_pal(0x6F, 1); if (PadPressedWithin(0x40, 0x32, 0) != 0) { moby_set_state(object, 7, -1); *(s16 *)(state + 0x1E8) = *(u16 *)(state + 0x1F0); diff --git a/src/pal/levels/12_todano/L12_002B8478-hero.c b/src/pal/levels/12_todano/L12_002B8478-hero.c index 120cbdc93..d5d3b835c 100644 --- a/src/pal/levels/12_todano/L12_002B8478-hero.c +++ b/src/pal/levels/12_todano/L12_002B8478-hero.c @@ -147,7 +147,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -716,7 +716,7 @@ void hero_l12_update_state_machine_pal(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { temp_a2 = ((Hero *)g_hero_state)->i[0x2440/4]; if (temp_a2 != -1) { @@ -1459,7 +1459,7 @@ void hero_l12_update_state_machine_pal(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x2a; if (g_hero_override_flag != 0) { ((Hero *)g_hero_state_copy_a)->f[0x180/4] = 0.1f; diff --git a/src/pal/levels/12_todano/L12_002B8478-sw.c b/src/pal/levels/12_todano/L12_002B8478-sw.c index 9e98513bf..35da63dad 100644 --- a/src/pal/levels/12_todano/L12_002B8478-sw.c +++ b/src/pal/levels/12_todano/L12_002B8478-sw.c @@ -76,7 +76,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed_pal(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction_pal(void); -s32 hero_l12_set_action_pal(s32, s32); +s32 hero_l12_set_move_state_pal(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition_pal(void); s32 hero_try_start_ledge_move(void); @@ -152,7 +152,7 @@ void hero_decide_todano_state_pal(void) { UpdateHeroHeldTarget_pal(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l12_set_action_pal(0x39, 1); + hero_l12_set_move_state_pal(0x39, 1); goto end; } } @@ -187,7 +187,7 @@ void hero_decide_todano_state_pal(void) { hero_apply_pending_change_pal(); if (FLD(g_hero_state, f32, 0x88) < g_todano_hero_height_limit) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l12_set_action_pal(0x74, 1); + hero_l12_set_move_state_pal(0x74, 1); goto end; } } @@ -198,12 +198,12 @@ void hero_decide_todano_state_pal(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action_pal(1, 1); + hero_l12_set_move_state_pal(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l12_set_action_pal(0x82, 1); + hero_l12_set_move_state_pal(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -240,7 +240,7 @@ void hero_decide_todano_state_pal(void) { rec = g_item_l12_record_table + selected_slot * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 5e+01f; if (FLD(rec, s32, 0x44) != 0) { - hero_l12_set_action_pal(0x3C, 1); + hero_l12_set_move_state_pal(0x3C, 1); } else { set_hero_animation_pal(FLD(rec, s32, 0x48), 0, 1e+01f); } @@ -283,12 +283,12 @@ void hero_decide_todano_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l12_set_action_pal(0x76, 1); + hero_l12_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); } break; } @@ -309,17 +309,17 @@ void hero_decide_todano_state_pal(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l12_action_block_flag == 0) && (PadPressedWithin(0x40, 6, NULL) != 0)) { - hero_l12_set_action_pal(0x6E, 1); + hero_l12_set_move_state_pal(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l12_set_action_pal(4, 1); + hero_l12_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l12_set_action_pal(0x2E, 1); + hero_l12_set_move_state_pal(0x2E, 1); break; } { @@ -339,28 +339,28 @@ void hero_decide_todano_state_pal(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust_pal(side, 0, 0, 0x1E); hero_play_footstep_sound_dust_pal(side, 1, 0, 0x1E); - hero_l12_set_action_pal(2, 1); + hero_l12_set_move_state_pal(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action_pal(1, 1); + hero_l12_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l12_set_action_pal(0x3D, 1); + hero_l12_set_move_state_pal(0x3D, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l12_set_action_pal(0x3D, 1); + hero_l12_set_move_state_pal(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l12_set_action_pal(0, 1); + hero_l12_set_move_state_pal(0, 1); } break; case 0x3D: @@ -369,22 +369,22 @@ void hero_decide_todano_state_pal(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); break; } if (hero_try_start_move_from_buffer_pal(6, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action_pal(4, 1); + hero_l12_set_move_state_pal(4, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l12_set_action_pal(2, 1); + hero_l12_set_move_state_pal(2, 1); break; } - hero_l12_set_action_pal(0, 1); + hero_l12_set_move_state_pal(0, 1); break; case 0x39: case 0x43: @@ -423,25 +423,25 @@ void hero_decide_todano_state_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.040000003f)) { - hero_l12_set_action_pal(0x33, 1); + hero_l12_set_move_state_pal(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12)) { - hero_l12_set_action_pal(0x34, 1); + hero_l12_set_move_state_pal(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l12_set_action_pal(0x32, 1); + hero_l12_set_move_state_pal(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l12_set_action_pal(0x33, 1); + hero_l12_set_move_state_pal(0x33, 1); } } break; @@ -454,81 +454,81 @@ void hero_decide_todano_state_pal(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l12_set_action_pal(0x32, 1); + hero_l12_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l12_set_action_pal(0x34, 1); + hero_l12_set_move_state_pal(0x34, 1); } else { - hero_l12_set_action_pal(0x32, 1); + hero_l12_set_move_state_pal(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l12_set_action_pal(0x12, 1); + hero_l12_set_move_state_pal(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 6, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 6, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l12_set_action_pal(0x32, 1); + hero_l12_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l12_set_action_pal(0x34, 1); + hero_l12_set_move_state_pal(0x34, 1); } else { - hero_l12_set_action_pal(0x32, 1); + hero_l12_set_move_state_pal(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l12_set_action_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l12_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 15.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l12_set_action_pal(0x35, 1); + hero_l12_set_move_state_pal(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l12_set_action_pal(0x12, 1); + hero_l12_set_move_state_pal(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 6, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l12_set_action_pal(0x32, 1); + hero_l12_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l12_set_action_pal(0x34, 1); + hero_l12_set_move_state_pal(0x34, 1); } else { - hero_l12_set_action_pal(0x32, 1); + hero_l12_set_move_state_pal(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l12_set_action_pal(0x70, 0); + hero_l12_set_move_state_pal(0x70, 0); set_hero_animation_pal(0x59, 0, 14.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l12_set_action_pal(0x36, 1); + hero_l12_set_move_state_pal(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action_pal(0x67, 1); + hero_l12_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x28, 15.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_pal(0x33, 1); + hero_l12_set_move_state_pal(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l12_set_action_pal(0x33, 0); + hero_l12_set_move_state_pal(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action_pal(0x67, 1); + hero_l12_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x25, 15.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l12_set_action_pal(0x36, 0); + hero_l12_set_move_state_pal(0x36, 0); } break; case 0x1: @@ -562,9 +562,9 @@ void hero_decide_todano_state_pal(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action_pal(4, 1); + hero_l12_set_move_state_pal(4, 1); } else { - hero_l12_set_action_pal(0, 0); + hero_l12_set_move_state_pal(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -576,9 +576,9 @@ void hero_decide_todano_state_pal(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l12_set_action_pal(0, 0); + hero_l12_set_move_state_pal(0, 0); } else { - hero_l12_set_action_pal(0, 1); + hero_l12_set_move_state_pal(0, 1); } } break; @@ -611,7 +611,7 @@ void hero_decide_todano_state_pal(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action_pal(7, 1); + hero_l12_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -620,7 +620,7 @@ void hero_decide_todano_state_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l12_set_action_pal(0, 0); + hero_l12_set_move_state_pal(0, 0); } break; } @@ -642,7 +642,7 @@ void hero_decide_todano_state_pal(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action_pal(7, 1); + hero_l12_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -655,7 +655,7 @@ void hero_decide_todano_state_pal(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l12_set_action_pal(2, 0); + hero_l12_set_move_state_pal(2, 0); set_hero_animation_pal(3, g_hero_l12_animation_ids[FLD(g_hero_state, s32, 0x2298)], 11.0f); break; } @@ -666,22 +666,22 @@ void hero_decide_todano_state_pal(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l12_set_action_pal(2, 1); + hero_l12_set_move_state_pal(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l12_set_action_pal(0, 0); + hero_l12_set_move_state_pal(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_pal(0, 0); + hero_l12_set_move_state_pal(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l12_set_action_pal(0, 1); + hero_l12_set_move_state_pal(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x54) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -698,7 +698,7 @@ void hero_decide_todano_state_pal(void) { } if (PadPressedWithin(0x40, 6, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action_pal(7, 1); + hero_l12_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -707,7 +707,7 @@ void hero_decide_todano_state_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l12_set_action_pal(0, 0); + hero_l12_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 12.0f); break; } @@ -719,7 +719,7 @@ void hero_decide_todano_state_pal(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_pal(0, 1); + hero_l12_set_move_state_pal(0, 1); } break; case 0x2: @@ -733,11 +733,11 @@ void hero_decide_todano_state_pal(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l12_set_action_pal(0x76, 1); + hero_l12_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead_pal() == 0)) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); break; } n = 7; @@ -751,12 +751,12 @@ void hero_decide_todano_state_pal(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l12_set_action_pal(9, 1); + hero_l12_set_move_state_pal(9, 1); } else { - hero_l12_set_action_pal(7, 1); + hero_l12_set_move_state_pal(7, 1); } } else { - hero_l12_set_action_pal(7, 1); + hero_l12_set_move_state_pal(7, 1); } break; } @@ -764,11 +764,11 @@ void hero_decide_todano_state_pal(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.040000003f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action_pal(1, 1); + hero_l12_set_move_state_pal(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action_pal(4, 1); + hero_l12_set_move_state_pal(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -785,21 +785,21 @@ void hero_decide_todano_state_pal(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l12_set_action_pal(0x2E, 1); + hero_l12_set_move_state_pal(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l12_set_action_pal(2, 1); + hero_l12_set_move_state_pal(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l12_set_action_pal(0x70, 1); + hero_l12_set_move_state_pal(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l12_set_action_pal(2, 1); + hero_l12_set_move_state_pal(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -810,7 +810,7 @@ void hero_decide_todano_state_pal(void) { if (hero_try_start_grab_pal() != 0) { break; } - if (hero_l12_set_action_pal(0, 0) == 0) { + if (hero_l12_set_move_state_pal(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.030000001f); @@ -827,7 +827,7 @@ void hero_decide_todano_state_pal(void) { hero_update_anim_scale_pal(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l12_set_action_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l12_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 14.0f); } if (FLD(cur_move, u8, 0x43) == 0x37) { @@ -848,7 +848,7 @@ void hero_decide_todano_state_pal(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l12_set_action_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l12_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 14.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 29.166668f; @@ -882,17 +882,17 @@ void hero_decide_todano_state_pal(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x19; - hero_l12_set_action_pal(3, 0); + hero_l12_set_move_state_pal(3, 0); set_hero_animation_pal(6, 4, 9.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l12_set_action_pal(0x77, 1); + hero_l12_set_move_state_pal(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l12_set_action_pal(0x77, 1); + hero_l12_set_move_state_pal(0x77, 1); break; } } @@ -910,11 +910,11 @@ void hero_decide_todano_state_pal(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.054000005f) && (FastDiffRots(FLD(g_hero_state, f32, 0x97), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l12_set_action_pal(0x64, 1); + hero_l12_set_move_state_pal(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.054000005f)) { - hero_l12_set_action_pal(0x63, 1); + hero_l12_set_move_state_pal(0x63, 1); } } else { hero_update_anim_scale_pal(); @@ -922,21 +922,21 @@ void hero_decide_todano_state_pal(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_pal(0x62, 1); + hero_l12_set_move_state_pal(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l12_set_action_pal(0, 1); + hero_l12_set_move_state_pal(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l12_set_action_pal(0x62, 1); + hero_l12_set_move_state_pal(0x62, 1); } break; case 0x65: /* switch 2 */ spawn_count = FLD(g_hero_state, s32, 0x18C0); if ((spawn_count < 3) && (((spawn_count * 6) + 0x8) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 6, &spawn_slot) != 0)) { - hero_l12_set_action_pal(0x66, 1); + hero_l12_set_move_state_pal(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters_pal(); @@ -979,7 +979,7 @@ void hero_decide_todano_state_pal(void) { return; case 0x6D: if ((f32)g_hero_l12_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l12_set_action_pal(0, 1); + hero_l12_set_move_state_pal(0, 1); } break; case 0x30: @@ -992,7 +992,7 @@ void hero_decide_todano_state_pal(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l12_set_action_pal(0, 0) != 0) { + if (hero_l12_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 14.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1000,25 +1000,25 @@ void hero_decide_todano_state_pal(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action_pal(1, 1); + hero_l12_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l12_set_action_pal(7, 1); + hero_l12_set_move_state_pal(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action_pal(4, 1); + hero_l12_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 8) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_pal(0, 1); + hero_l12_set_move_state_pal(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1026,45 +1026,45 @@ void hero_decide_todano_state_pal(void) { } if (hero_get_weapon_or_form_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l12_set_action_pal(0, 0); + hero_l12_set_move_state_pal(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l12_set_action_pal(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l12_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 14.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l12_set_action_pal(2, 1); + hero_l12_set_move_state_pal(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action_pal(1, 1); + hero_l12_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xA) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action_pal(0, 0); + hero_l12_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l12_set_action_pal(0x76, 1); + hero_l12_set_move_state_pal(0x76, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { break; } if ((PadPressedWithin(0x80, 0xC, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l12_set_action_pal(0x15, 1); + hero_l12_set_move_state_pal(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 8) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l12_set_action_pal(0, 1); + hero_l12_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1072,17 +1072,17 @@ void hero_decide_todano_state_pal(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l12_set_action_pal(0x8B, 1); + hero_l12_set_move_state_pal(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x4C) { - hero_l12_set_action_pal(0, 1); + hero_l12_set_move_state_pal(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l12_set_action_pal(0, 1); + hero_l12_set_move_state_pal(0, 1); } break; case 0x24: @@ -1108,14 +1108,14 @@ void hero_decide_todano_state_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l12_set_action_pal(0, 0); + hero_l12_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 25.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l12_set_action_pal(6, 0); + hero_l12_set_move_state_pal(6, 0); } else { - hero_l12_set_action_pal(6, 0); + hero_l12_set_move_state_pal(6, 0); set_hero_animation_pal(0xA, 0, 14.0f); } FLD(g_hero_state, f32, 0xA84) = 0.016800001f; @@ -1131,9 +1131,9 @@ void hero_decide_todano_state_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l12_set_action_pal(0, 1); + hero_l12_set_move_state_pal(0, 1); } else { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1145,7 +1145,7 @@ void hero_decide_todano_state_pal(void) { if (t < 0x21) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l12_set_action_pal(0x2C, 1); + hero_l12_set_move_state_pal(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0028000001f; FLD(g_hero_state, f32, 0xA80) = 0.0108f; } @@ -1162,13 +1162,13 @@ void hero_decide_todano_state_pal(void) { } } if (FLD(g_hero_state, s32, 0x6F0) >= 5) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x204) = 0x19; } break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l12_set_action_pal(0x18, 0); + hero_l12_set_move_state_pal(0x18, 0); } break; case 0x18: @@ -1177,18 +1177,18 @@ void hero_decide_todano_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab_pal((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x97)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 0xE, NULL) != 0) { - hero_l12_set_action_pal(0x1B, 1); + hero_l12_set_move_state_pal(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1197,7 +1197,7 @@ void hero_decide_todano_state_pal(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x97), 1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x97), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l12_set_action_pal(0x19, 1); + hero_l12_set_move_state_pal(0x19, 1); } break; } @@ -1208,7 +1208,7 @@ void hero_decide_todano_state_pal(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l12_set_action_pal(0x1A, 1); + hero_l12_set_move_state_pal(0x1A, 1); } } } @@ -1227,18 +1227,18 @@ void hero_decide_todano_state_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_pal(0x18, 1); + hero_l12_set_move_state_pal(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l12_set_action_pal(0x1B, 1); + hero_l12_set_move_state_pal(0x1B, 1); } break; } @@ -1248,9 +1248,9 @@ void hero_decide_todano_state_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); } else { - hero_l12_set_action_pal(0, 1); + hero_l12_set_move_state_pal(0, 1); } } break; @@ -1274,12 +1274,12 @@ void hero_decide_todano_state_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action_pal(0x39, 1); + hero_l12_set_move_state_pal(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x4B) { - if (hero_l12_set_action_pal(0, 0) != 0) { + if (hero_l12_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } if (low != 0) { @@ -1287,7 +1287,7 @@ void hero_decide_todano_state_pal(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l12_set_action_pal(0, 0) != 0) { + if (hero_l12_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1301,32 +1301,32 @@ void hero_decide_todano_state_pal(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l12_set_action_pal(2, 1); + hero_l12_set_move_state_pal(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.060000002f) { - if (hero_l12_set_action_pal(3, 0) != 0) { + if (hero_l12_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(6, 0, 1e+01f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.15400001f); } } else { - hero_l12_set_action_pal(0, 1); + hero_l12_set_move_state_pal(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l12_set_action_pal(8, 1); + hero_l12_set_move_state_pal(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x12) && (hero_try_start_move_from_buffer_pal((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 5, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action_pal(0x17, 1); + hero_l12_set_move_state_pal(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l12_set_action_pal(0x71, 1); + hero_l12_set_move_state_pal(0x71, 1); } } break; @@ -1357,7 +1357,7 @@ void hero_decide_todano_state_pal(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l12_set_action_pal(0, 0) != 0) { + if (hero_l12_set_move_state_pal(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1367,9 +1367,9 @@ void hero_decide_todano_state_pal(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l12_set_action_pal(0x74, 1); + hero_l12_set_move_state_pal(0x74, 1); } else { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); } } break; @@ -1382,16 +1382,16 @@ void hero_decide_todano_state_pal(void) { ok = 1; } if (ok != 0) { - hero_l12_set_action_pal(0x11, 1); + hero_l12_set_move_state_pal(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action_pal(0x17, 1); + hero_l12_set_move_state_pal(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1402,23 +1402,23 @@ void hero_decide_todano_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 3)) { - if (hero_l12_set_action_pal(3, 0) != 0) { + if (hero_l12_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x1C; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action_pal(4, 1); + hero_l12_set_move_state_pal(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_l12_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l12_set_action_pal(2, 1); + hero_l12_set_move_state_pal(2, 1); break; } - hero_l12_set_action_pal(2, 0); + hero_l12_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, 2, 7.0f); @@ -1427,21 +1427,21 @@ void hero_decide_todano_state_pal(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_l12_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l12_set_action_pal(2, 1); + hero_l12_set_move_state_pal(2, 1); break; } - hero_l12_set_action_pal(2, 0); + hero_l12_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, g_hero_l12_animation_id, 1e+01f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l12_set_action_pal(0, 0) != 0) { + if (hero_l12_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l12_set_action_pal(0, 0) != 0) { + } else if (hero_l12_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1489,14 +1489,14 @@ void hero_decide_todano_state_pal(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 4, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action_pal(0xB, 1); + hero_l12_set_move_state_pal(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x11)) { - hero_l12_set_action_pal(0x82, 1); + hero_l12_set_move_state_pal(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1505,25 +1505,25 @@ void hero_decide_todano_state_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 6) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f)) { - hero_l12_set_action_pal(0xA, 1); + hero_l12_set_move_state_pal(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l12_set_action_pal(0x10, 1); + hero_l12_set_move_state_pal(0x10, 1); } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l12_set_action_pal(0x71, 1); + hero_l12_set_move_state_pal(0x71, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.14000002f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l12_set_action_pal(0x77, 1); + hero_l12_set_move_state_pal(0x77, 1); break; } } @@ -1627,7 +1627,7 @@ void hero_decide_todano_state_pal(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l12_set_action_pal(3, 0) != 0) { + if (hero_l12_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1635,13 +1635,13 @@ void hero_decide_todano_state_pal(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l12_speed_params[0][2])) { - hero_l12_set_action_pal(7, 1); + hero_l12_set_move_state_pal(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l12_set_action_pal(7, 1); + hero_l12_set_move_state_pal(7, 1); } else if (g_hero_l12_speed_params[1][1] * 0.017f < FLD(g_hero_state, f32, 0x174)) { - hero_l12_set_action_pal(9, 1); + hero_l12_set_move_state_pal(9, 1); } else { - hero_l12_set_action_pal(7, 1); + hero_l12_set_move_state_pal(7, 1); } break; } @@ -1649,10 +1649,10 @@ void hero_decide_todano_state_pal(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_l00_choose_next_move_after_landing_pal(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); break; } { @@ -1662,7 +1662,7 @@ void hero_decide_todano_state_pal(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x16)) && (PadPressedWithin(0x40, 6, &tmp_d) != 0) && (tmp_d < FLD(g_hero_state, s32, 0x1B8))) { - hero_l12_set_action_pal(0x11, 1); + hero_l12_set_move_state_pal(0x11, 1); break; } } @@ -1691,7 +1691,7 @@ void hero_decide_todano_state_pal(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xD) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.11600001f)))) { - hero_l12_set_action_pal(0xE, 1); + hero_l12_set_move_state_pal(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1701,32 +1701,32 @@ void hero_decide_todano_state_pal(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l12_set_action_pal(8, 1); + hero_l12_set_move_state_pal(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x576) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l12_set_action_pal(0x17, 1); + hero_l12_set_move_state_pal(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l12_set_action_pal(6, 1); + hero_l12_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x17) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l12_set_action_pal(0x79, 1); + hero_l12_set_move_state_pal(0x79, 1); } else { - hero_l12_set_action_pal(0x39, 1); + hero_l12_set_move_state_pal(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l12_set_action_pal(0x82, 1); + hero_l12_set_move_state_pal(0x82, 1); } else { - hero_l12_set_action_pal(0, 0); + hero_l12_set_move_state_pal(0, 0); } } break; @@ -1736,8 +1736,8 @@ void hero_decide_todano_state_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x2B) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action_pal(0x39, 1); - } else if (hero_l12_set_action_pal(0, 0) != 0) { + hero_l12_set_move_state_pal(0x39, 1); + } else if (hero_l12_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 11.0f); } } @@ -1762,28 +1762,28 @@ void hero_decide_todano_state_pal(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l12_set_action_pal(0x4E, 1); + hero_l12_set_move_state_pal(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action_pal(1, 1); + hero_l12_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l12_set_action_pal(0x41, 1); + hero_l12_set_move_state_pal(0x41, 1); break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l12_set_action_pal(0x45, 1); + hero_l12_set_move_state_pal(0x45, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l12_set_action_pal(0x4D, 1); + hero_l12_set_move_state_pal(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l12_set_action_pal(0x40, 1); + hero_l12_set_move_state_pal(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -1796,14 +1796,14 @@ void hero_decide_todano_state_pal(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l12_set_action_pal(0x4E, 1); + hero_l12_set_move_state_pal(0x4E, 1); break; } rec = (u8 *)&g_hero_l12_action_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l12_set_action_pal(0x3F, 0); + hero_l12_set_move_state_pal(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -1812,13 +1812,13 @@ void hero_decide_todano_state_pal(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0xD) ? n : 0xC, NULL) != 0) { - hero_l12_set_action_pal(0x4D, 1); + hero_l12_set_move_state_pal(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l12_set_action_pal(0x45, 1); + hero_l12_set_move_state_pal(0x45, 1); } break; } @@ -1881,42 +1881,42 @@ void hero_decide_todano_state_pal(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 3, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { hero_resolve_stick_direction(0, 1.0f); - hero_l12_set_action_pal(0x45, 1); + hero_l12_set_move_state_pal(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l12_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x97)) < 1.5707964f)) { - hero_l12_set_action_pal(0x40, 1); + hero_l12_set_move_state_pal(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xB) { - hero_l12_set_action_pal(0x3F, 1); + hero_l12_set_move_state_pal(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x22)) { - hero_l12_set_action_pal(0x41, 1); + hero_l12_set_move_state_pal(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 4, NULL) != 0)) { - hero_l12_set_action_pal(0x4D, 1); + hero_l12_set_move_state_pal(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action_pal(0x46, 1); + hero_l12_set_move_state_pal(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l12_set_action_pal(0x4B, 1); + hero_l12_set_move_state_pal(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l12_set_action_pal(0x41, 1); + hero_l12_set_move_state_pal(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action_pal(0x46, 1); + hero_l12_set_move_state_pal(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -1926,11 +1926,11 @@ void hero_decide_todano_state_pal(void) { FLD(g_hero_state, s16, 0x1EE) = 0xA - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l12_set_action_pal(0x40, 1); + hero_l12_set_move_state_pal(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l12_set_action_pal(0x3F, 1); + hero_l12_set_move_state_pal(0x3F, 1); } break; case 0x41: @@ -1942,29 +1942,29 @@ void hero_decide_todano_state_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action_pal(0x43, 1); + hero_l12_set_move_state_pal(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l12_set_action_pal(0x40, 1); + hero_l12_set_move_state_pal(0x40, 1); } else { - hero_l12_set_action_pal(0x3F, 1); + hero_l12_set_move_state_pal(0x3F, 1); } } else { - hero_l12_set_action_pal(0x3F, 1); + hero_l12_set_move_state_pal(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action_pal(0x46, 1); + hero_l12_set_move_state_pal(0x46, 1); break; } if ((PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l12_set_action_pal(0x4B, 1); + hero_l12_set_move_state_pal(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l12_set_action_pal(0x3F, 1); + hero_l12_set_move_state_pal(0x3F, 1); } break; case 0x4E: @@ -1973,9 +1973,9 @@ void hero_decide_todano_state_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l12_set_action_pal(0x41, 1); + hero_l12_set_move_state_pal(0x41, 1); } else { - hero_l12_set_action_pal(0x3F, 1); + hero_l12_set_move_state_pal(0x3F, 1); } } break; @@ -1985,7 +1985,7 @@ void hero_decide_todano_state_pal(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l12_set_action_pal(0x4E, 1); + hero_l12_set_move_state_pal(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.030000001f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2011,55 +2011,55 @@ void hero_decide_todano_state_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l12_set_action_pal(0x45, 1); + hero_l12_set_move_state_pal(0x45, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l12_set_action_pal(0x4D, 1); + hero_l12_set_move_state_pal(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l12_set_action_pal(0x41, 1); + hero_l12_set_move_state_pal(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l12_set_action_pal(0x3F, 1); + hero_l12_set_move_state_pal(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1B) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l12_set_action_pal(0x41, 1); + hero_l12_set_move_state_pal(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1E) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action_pal(0x43, 1); + hero_l12_set_move_state_pal(0x43, 1); } else { - hero_l12_set_action_pal(0x3F, 0); + hero_l12_set_move_state_pal(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_pal(0x47, 1); + hero_l12_set_move_state_pal(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)vec_a = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l12_set_action_pal(0x41, 1); + hero_l12_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action_pal(0x41, 1); + hero_l12_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l12_set_action_pal(0x48, 1); + hero_l12_set_move_state_pal(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2068,7 +2068,7 @@ void hero_decide_todano_state_pal(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l12_set_action_pal(0x49, 1); + hero_l12_set_move_state_pal(0x49, 1); } break; } @@ -2079,7 +2079,7 @@ void hero_decide_todano_state_pal(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l12_set_action_pal(0x4A, 1); + hero_l12_set_move_state_pal(0x4A, 1); } } } @@ -2098,17 +2098,17 @@ void hero_decide_todano_state_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_pal(0x47, 1); + hero_l12_set_move_state_pal(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l12_set_action_pal(0x41, 1); + hero_l12_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l12_set_action_pal(0x48, 1); + hero_l12_set_move_state_pal(0x48, 1); } break; } @@ -2123,7 +2123,7 @@ void hero_decide_todano_state_pal(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l12_set_action_pal(0, 0); + hero_l12_set_move_state_pal(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -2134,7 +2134,7 @@ void hero_decide_todano_state_pal(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l12_set_action_pal(0, 0); + hero_l12_set_move_state_pal(0, 0); } break; case 0x22: @@ -2144,12 +2144,12 @@ void hero_decide_todano_state_pal(void) { hero_choose_jump_or_roll_move_pal(); break; } - hero_l12_set_action_pal(7, 1); + hero_l12_set_move_state_pal(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l12_set_action_pal(0, 0); + hero_l12_set_move_state_pal(0, 0); } break; default: diff --git a/src/pal/levels/12_todano/L12_002B8478-sw2.c b/src/pal/levels/12_todano/L12_002B8478-sw2.c index a1d009a7a..85cd5f1dc 100644 --- a/src/pal/levels/12_todano/L12_002B8478-sw2.c +++ b/src/pal/levels/12_todano/L12_002B8478-sw2.c @@ -78,8 +78,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -147,7 +147,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l12_set_action_pal(s32 action, s32 animate) { +s32 hero_l12_set_move_state_pal(s32 action, s32 animate) { f32 dir[4]; u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -195,7 +195,9 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -208,8 +210,8 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l12_set_action_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action_pal(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l12_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_or_form_id(0) == 0x51) set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 15.0f); else set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, -1.0f); @@ -356,7 +358,7 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l12_set_action_pal(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l12_set_move_state_pal(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.15400001f) REAL(0x1B4) = 0.15400001f; @@ -402,12 +404,12 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l12_set_action_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action_pal(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l12_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state_pal(0x76, 1); return 0; } if (hero_try_start_grab_pal()) return 0; if (hero_get_weapon_or_form_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l12_set_action_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 15.0f); + if (hero_l12_set_move_state_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 15.0f); return 0; } if (!animate) goto finish; @@ -432,7 +434,7 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.14000002f) REAL(0x1B4) = 0.14000002f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.14000002f); @@ -591,13 +593,13 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l12_set_action_pal(0x81, 1); return 0; + hero_l12_set_move_state_pal(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l12_action_block_flag) { hero_l12_set_action_pal(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l12_action_block_flag) { hero_l12_set_move_state_pal(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l12_set_action_pal(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l12_set_move_state_pal(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -672,9 +674,9 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_condition_flag) hero_l12_set_action_pal(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l12_set_action_pal(0x79, 1); - else hero_l12_set_action_pal(0x39, 1); + if (g_current_map_index == 2 && g_hero_condition_flag) hero_l12_set_move_state_pal(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l12_set_move_state_pal(0x79, 1); + else hero_l12_set_move_state_pal(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -711,7 +713,7 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -740,7 +742,7 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -749,7 +751,7 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4B8) = 0.6f; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -885,7 +887,7 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -966,7 +968,7 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -978,7 +980,7 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); @@ -1013,7 +1015,7 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { set_hero_animation_pal(0x11, 0, 7.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action_pal(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state_pal(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation_pal(0, 0, 7.0f); goto finish; case 0x4B: @@ -1047,7 +1049,7 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l12_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action_pal(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state_pal(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1091,7 +1093,7 @@ s32 hero_l12_set_action_pal(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.09f; if (WORD(0x640) > 12 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l12_set_action_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; + PTR(0x2290)[0xA8] = 255; hero_l12_set_move_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; return 0; } HALF(0x1DC) = 64; REAL(0x69C) = 0.050000004f; diff --git a/src/pal/levels/12_todano/L12_002B8478.c b/src/pal/levels/12_todano/L12_002B8478.c index dc2540193..ef5ece701 100644 --- a/src/pal/levels/12_todano/L12_002B8478.c +++ b/src/pal/levels/12_todano/L12_002B8478.c @@ -62,7 +62,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l12_set_action_pal(s32, s32); +extern s32 hero_l12_set_move_state_pal(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_pal(s32); extern int hero_play_sound(s32, s32); @@ -133,7 +133,7 @@ s32 hero_l12_apply_contact_push_pal(s32 apply_push) { case 0: hit_moby = g_hero_state.f249C; if (hit_moby != 0 && (*(s16 *)(hit_moby + 0xAA) == 0x4EB || *(s16 *)(hit_moby + 0xAA) == 0x558)) { - hero_l12_set_action_pal(0x7D, 1); + hero_l12_set_move_state_pal(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -144,7 +144,7 @@ s32 hero_l12_apply_contact_push_pal(s32 apply_push) { AdjustPlayerHealth_pal(FloatToInt(*(float *)(effect_slot + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l12_set_action_pal(0x16, 1); + hero_l12_set_move_state_pal(0x16, 1); } g_hero_state.f1DC = 0x40; if (g_hero_state.f21C == 0) { @@ -154,13 +154,13 @@ s32 hero_l12_apply_contact_push_pal(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l12_set_action_pal(0x72, 1); + hero_l12_set_move_state_pal(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l12_set_action_pal(0x73, 1); + hero_l12_set_move_state_pal(0x73, 1); } else if (entry->f24 & 8) { - hero_l12_set_action_pal(0x8C, 1); + hero_l12_set_move_state_pal(0x8C, 1); } else { - hero_l12_set_action_pal(0x16, 1); + hero_l12_set_move_state_pal(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&push); @@ -172,7 +172,7 @@ s32 hero_l12_apply_contact_push_pal(s32 apply_push) { } break; case 1: - hero_l12_set_action_pal(0x42, 1); + hero_l12_set_move_state_pal(0x42, 1); hero_flatten_push_vector(&push, has_direction, 0.10000001f, 0.060000002f); break; } diff --git a/src/pal/levels/14_aranos_prison/L14_003CF468-flags.c b/src/pal/levels/14_aranos_prison/L14_003CF468-flags.c index dffe2c97e..6dadf6627 100644 --- a/src/pal/levels/14_aranos_prison/L14_003CF468-flags.c +++ b/src/pal/levels/14_aranos_prison/L14_003CF468-flags.c @@ -10,7 +10,7 @@ extern float math_random_float_range(float a, float b); extern float square_root(float a); extern void FastVecScale(void *dst, void *src, float s); extern void entity_start_launch_to_target(char *e, void *v, float a, float b, float c); -extern s32 hero_l00_set_action_pal(int a0, int a1); +extern s32 hero_l00_set_move_state_pal(int a0, int a1); extern unsigned short *g_group_entity_lists[]; extern unsigned char *g_moby_l14_pool MACRO_ADDR; extern int g_group_link_limit __attribute__((sda)); @@ -78,7 +78,7 @@ void UpdateLaunchVolume_pal(char *self) { fall = (target_height - tmp[2]) * 2.0f; duration += square_root(fall / 0.008f); FastVecSub(vec, tmp, hero2 + 0x80); FastVecScale(vec, vec, 1.0f / duration); vec[2] = square_root(rise * 0.008f); - hero_l00_set_action_pal(0x44, 1); + hero_l00_set_move_state_pal(0x44, 1); qcopy(hero2 + 0xF0, vec); } } diff --git a/src/pal/levels/14_aranos_prison/L14_003E3E84-g64.c b/src/pal/levels/14_aranos_prison/L14_003E3E84-g64.c index 66f701399..e5f22748b 100644 --- a/src/pal/levels/14_aranos_prison/L14_003E3E84-g64.c +++ b/src/pal/levels/14_aranos_prison/L14_003E3E84-g64.c @@ -48,7 +48,7 @@ extern u8 g_item_slot_to_record[]; extern u8 g_hero_weapon_id_index NOT_SDA; extern float g_strip_axis[4] NOT_SDA; extern WeaponEntry g_weapon_l00_table[]; -extern u8 g_effect_handle_records[]; +extern u8 g_spread_weapon_rumble_waves[]; extern u8 g_default_vector[] MACRO_ADDR; typedef struct { u8 pad[0x160]; float f160; int pad164; int i168; int i16C; float f170; int pad174; int i178; } Shake; extern Shake g_scalar_transition_state; @@ -67,15 +67,15 @@ extern int g_effect_state_param __attribute__((sda)); extern s32 FastDecTimer(s16 *); extern int math_fast_float_d(void *); extern int vec_fast_helper_b(void *); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern int get_ammo(int); extern int weapon_spend_ammo(int, int); extern void hud_add_moby_marker(void *, float, u32, void *, int, float, int, float, int); extern void cancel_hero_item_animation_pal(void); extern void start_equipped_item_animation_pal(void); extern void anim_start_blended_with_flags(void *, int, int, int, int); -extern int slot_copy_records_to_free(void *); -extern void slot_reset_active(int); +extern int actuator_play_waves(void *); +extern void actuator_end_looping_waves(int); extern float math_random_angle(void); extern float IntToFloat(int); extern int PlayMobySound(int, int, void *); @@ -133,7 +133,7 @@ void spread_weapon_update_pal(u8 *self) self[0x20] = 1; } if (((Hero *)g_hero_state)->i[0x2294 / 4] == 1) - hero_l00_set_action_pal(0x1D, 1); + hero_l00_set_move_state_pal(0x1D, 1); vec_fast_helper_b(st); if (((Hero *)g_hero_state)->i[0x2294 / 4] == 0x1D) { u32 color; @@ -173,7 +173,7 @@ void spread_weapon_update_pal(u8 *self) st->t6 = 2; } start_equipped_item_animation_pal(); - st->handle = slot_copy_records_to_free(g_effect_handle_records); + st->handle = actuator_play_waves(g_spread_weapon_rumble_waves); anim_start_blended_with_flags(self, 2, 0, 2, 0); st->t4C = ((s32)(g_effect_state_param) * 5 + 2) / 6; self[0x20] = 2; @@ -193,7 +193,7 @@ void spread_weapon_update_pal(u8 *self) } if (!(((Hero *)g_pad_state)->i[0x1A0 / 4] & ((Hero *)g_hero_state)->i[0x1230 / 4]) || !get_ammo(-1) || ((Hero *)g_hero_state)->b[0x22B8] == 0) { if (st->handle >= 0) { - slot_reset_active(st->handle); + actuator_end_looping_waves(st->handle); st->handle = -1; } } diff --git a/src/pal/levels/14_aranos_prison/L14_0042B28C.c b/src/pal/levels/14_aranos_prison/L14_0042B28C.c index 5738df84d..8d771165d 100644 --- a/src/pal/levels/14_aranos_prison/L14_0042B28C.c +++ b/src/pal/levels/14_aranos_prison/L14_0042B28C.c @@ -76,7 +76,7 @@ extern void lift_request_start(void *); extern void moby_mark_spawned(void *); extern void lift_set_moving_state(void *); extern void moby_set_state(void *, int, int); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern int math_fast_float_d(void *); extern float math_fast_sin_or_cos_b(float); extern void gfx_add_draw_callback_third(void (*)(void *), void *); @@ -226,7 +226,7 @@ void lift_scene_update_pal(unsigned char *moby) { if (flag_set_first_pending(moby)) { state->fadeTimer = ((s32)(state->fadeLength) * 5 + 2) / 6 * 2; state->waitTimer = ((s32)(state->fadeLength) * 5 + 2) / 6; - hero_l00_set_action_pal(0x6F, 1); + hero_l00_set_move_state_pal(0x6F, 1); } if (math_fast_float_d(&state->waitTimer)) moby_set_state(moby, state->nextState, -1); diff --git a/src/pal/levels/15_gorn/L15_00433068-g8.c b/src/pal/levels/15_gorn/L15_00433068-g8.c index 558eb9f73..8587ab588 100644 --- a/src/pal/levels/15_gorn/L15_00433068-g8.c +++ b/src/pal/levels/15_gorn/L15_00433068-g8.c @@ -100,7 +100,7 @@ extern void hero_set_state_value_b(s32 value); extern void level_select_random_object(void); extern void level_store_pair_with_increment(s32 a0, s32 a1); extern void moby_set_flag_bit(Moby *moby, s32 enabled); -extern s32 hero_l00_set_action_pal(s32 action, s32 animate); +extern s32 hero_l00_set_move_state_pal(s32 action, s32 animate); extern void hero_set_state_value_c(s32 value); extern s32 LockedEntryMenuInput_pal(void); extern void ship_save_transform_state_pal(void); @@ -199,7 +199,7 @@ void gorn_controller_update_pal(Moby *moby) if (g_gorn_message_counter++ < 5 || g_challenge_mode == 2) break; - hero_l00_set_action_pal(0x31, 0); + hero_l00_set_move_state_pal(0x31, 0); if (g_gorn_enabled_flag) { hero_set_state_value_c(on); g_challenge_menu_choice = LockedEntryMenuInput_pal(); diff --git a/src/pal/levels/16_snivelak/L16_002B30E8-cc.c b/src/pal/levels/16_snivelak/L16_002B30E8-cc.c index 3345652a6..5a2c2e70f 100644 --- a/src/pal/levels/16_snivelak/L16_002B30E8-cc.c +++ b/src/pal/levels/16_snivelak/L16_002B30E8-cc.c @@ -67,7 +67,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l16_enter_state_pal(unsigned long, unsigned long); +extern s32 hero_l16_set_move_state_pal(unsigned long, unsigned long); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_pal(s32); extern int hero_play_sound(s32, s32); @@ -142,7 +142,7 @@ s32 hero_handle_contact_reaction_pal(s32 apply_reaction) { case 0: hit_moby = g_hero_state.f249C; if (hit_moby != 0 && (*(s16 *)(hit_moby + 0xAA) == 0x4EB || *(s16 *)(hit_moby + 0xAA) == 0x558)) { - hero_l16_enter_state_pal(0x7D, 1); + hero_l16_set_move_state_pal(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -153,7 +153,7 @@ s32 hero_handle_contact_reaction_pal(s32 apply_reaction) { AdjustPlayerHealth_pal(FloatToInt(*(float *)(effect_slot + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l16_enter_state_pal(0x16, 1); + hero_l16_set_move_state_pal(0x16, 1); } g_hero_state.f1DC = 0x40; if (g_hero_state.f21C == 0) { @@ -163,9 +163,9 @@ s32 hero_handle_contact_reaction_pal(s32 apply_reaction) { return 0; } if (entry->f24 & 8) { - hero_l16_enter_state_pal(0x8C, 1); + hero_l16_set_move_state_pal(0x8C, 1); } else { - hero_l16_enter_state_pal(0x16, 1); + hero_l16_set_move_state_pal(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&push); diff --git a/src/pal/levels/16_snivelak/L16_002B9EE0-hero.c b/src/pal/levels/16_snivelak/L16_002B9EE0-hero.c index 06a49a2f4..a305f445b 100644 --- a/src/pal/levels/16_snivelak/L16_002B9EE0-hero.c +++ b/src/pal/levels/16_snivelak/L16_002B9EE0-hero.c @@ -139,7 +139,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -978,7 +978,7 @@ void hero_update_state_handler_pal(void) { coll_process_hit(0.4f, (s32)((TI128*)vec_a), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec_b)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x2a; if (g_hero_override_flag != 0) { ((Hero *)g_snivelak_hero_state)->f[0x180/4] = 0.1f; diff --git a/src/pal/levels/16_snivelak/L16_002B9EE0-sw.c b/src/pal/levels/16_snivelak/L16_002B9EE0-sw.c index 609a55fa6..64a935a39 100644 --- a/src/pal/levels/16_snivelak/L16_002B9EE0-sw.c +++ b/src/pal/levels/16_snivelak/L16_002B9EE0-sw.c @@ -71,7 +71,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_refresh_speed_from_timer_pal(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction_pal(void); -s32 hero_l16_enter_state_pal(s32, s32); +s32 hero_l16_set_move_state_pal(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition_pal(void); s32 hero_try_start_ledge_move(void); @@ -151,7 +151,7 @@ void hero_decide_state_snivelak_pal(void) { UpdateHeroHeldTarget_pal(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l16_enter_state_pal(0x39, 1); + hero_l16_set_move_state_pal(0x39, 1); goto end; } } @@ -180,7 +180,7 @@ void hero_decide_state_snivelak_pal(void) { hero_apply_pending_change_pal(); if (FLD(g_hero_state, f32, 0x88) < g_snivelak_hero_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l16_enter_state_pal(0x74, 1); + hero_l16_set_move_state_pal(0x74, 1); goto end; } } @@ -190,12 +190,12 @@ void hero_decide_state_snivelak_pal(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state_pal(1, 1); + hero_l16_set_move_state_pal(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l16_enter_state_pal(0x82, 1); + hero_l16_set_move_state_pal(0x82, 1); break; } { @@ -231,7 +231,7 @@ void hero_decide_state_snivelak_pal(void) { rec = g_hero_record_table + sp40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 5e+01f; if (FLD(rec, s32, 0x44) != 0) { - hero_l16_enter_state_pal(0x3C, 1); + hero_l16_set_move_state_pal(0x3C, 1); } else { set_hero_animation_pal(FLD(rec, s32, 0x48), 0, 1e+01f); } @@ -274,12 +274,12 @@ void hero_decide_state_snivelak_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l16_enter_state_pal(0x76, 1); + hero_l16_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); } break; } @@ -300,17 +300,17 @@ void hero_decide_state_snivelak_pal(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_action_lock_flag == 0) && (PadPressedWithin(0x40, 6, NULL) != 0)) { - hero_l16_enter_state_pal(0x6E, 1); + hero_l16_set_move_state_pal(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l16_enter_state_pal(4, 1); + hero_l16_set_move_state_pal(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state_pal(0x27, 1); + hero_l16_set_move_state_pal(0x27, 1); break; } { @@ -330,28 +330,28 @@ void hero_decide_state_snivelak_pal(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust_pal(side, 0, 0, 0x1E); hero_play_footstep_sound_dust_pal(side, 1, 0, 0x1E); - hero_l16_enter_state_pal(2, 1); + hero_l16_set_move_state_pal(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state_pal(1, 1); + hero_l16_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l16_enter_state_pal(0x3D, 1); + hero_l16_set_move_state_pal(0x3D, 1); break; } hero_refresh_speed_from_timer_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l16_enter_state_pal(0x3D, 1); + hero_l16_set_move_state_pal(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l16_enter_state_pal(0, 1); + hero_l16_set_move_state_pal(0, 1); } break; case 0x3D: @@ -360,22 +360,22 @@ void hero_decide_state_snivelak_pal(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); break; } if (hero_try_start_move_from_buffer_pal(6, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state_pal(4, 1); + hero_l16_set_move_state_pal(4, 1); break; } hero_refresh_speed_from_timer_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l16_enter_state_pal(2, 1); + hero_l16_set_move_state_pal(2, 1); break; } - hero_l16_enter_state_pal(0, 1); + hero_l16_set_move_state_pal(0, 1); break; case 0x39: case 0x43: @@ -425,9 +425,9 @@ void hero_decide_state_snivelak_pal(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state_pal(4, 1); + hero_l16_set_move_state_pal(4, 1); } else { - hero_l16_enter_state_pal(0, 0); + hero_l16_set_move_state_pal(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -439,9 +439,9 @@ void hero_decide_state_snivelak_pal(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l16_enter_state_pal(0, 0); + hero_l16_set_move_state_pal(0, 0); } else { - hero_l16_enter_state_pal(0, 1); + hero_l16_set_move_state_pal(0, 1); } } break; @@ -474,7 +474,7 @@ void hero_decide_state_snivelak_pal(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state_pal(7, 1); + hero_l16_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -483,7 +483,7 @@ void hero_decide_state_snivelak_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l16_enter_state_pal(0, 0); + hero_l16_set_move_state_pal(0, 0); } break; } @@ -505,7 +505,7 @@ void hero_decide_state_snivelak_pal(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state_pal(7, 1); + hero_l16_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -518,7 +518,7 @@ void hero_decide_state_snivelak_pal(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l16_enter_state_pal(2, 0); + hero_l16_set_move_state_pal(2, 0); set_hero_animation_pal(3, g_hero_l16_animation_table[FLD(g_hero_state, s32, 0x2298)], 11.0f); break; } @@ -529,22 +529,22 @@ void hero_decide_state_snivelak_pal(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l16_enter_state_pal(2, 1); + hero_l16_set_move_state_pal(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l16_enter_state_pal(0, 0); + hero_l16_set_move_state_pal(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state_pal(0, 0); + hero_l16_set_move_state_pal(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l16_enter_state_pal(0, 1); + hero_l16_set_move_state_pal(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x54) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -561,7 +561,7 @@ void hero_decide_state_snivelak_pal(void) { } if (PadPressedWithin(0x40, 6, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state_pal(7, 1); + hero_l16_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -570,7 +570,7 @@ void hero_decide_state_snivelak_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l16_enter_state_pal(0, 0); + hero_l16_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 12.0f); break; } @@ -582,7 +582,7 @@ void hero_decide_state_snivelak_pal(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state_pal(0, 1); + hero_l16_set_move_state_pal(0, 1); } break; case 0x2: @@ -596,11 +596,11 @@ void hero_decide_state_snivelak_pal(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l16_enter_state_pal(0x76, 1); + hero_l16_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead_pal() == 0)) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); break; } n = 7; @@ -614,12 +614,12 @@ void hero_decide_state_snivelak_pal(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l16_enter_state_pal(9, 1); + hero_l16_set_move_state_pal(9, 1); } else { - hero_l16_enter_state_pal(7, 1); + hero_l16_set_move_state_pal(7, 1); } } else { - hero_l16_enter_state_pal(7, 1); + hero_l16_set_move_state_pal(7, 1); } break; } @@ -627,15 +627,15 @@ void hero_decide_state_snivelak_pal(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.040000003f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state_pal(1, 1); + hero_l16_set_move_state_pal(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state_pal(4, 1); + hero_l16_set_move_state_pal(4, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state_pal(0x27, 1); + hero_l16_set_move_state_pal(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -646,7 +646,7 @@ void hero_decide_state_snivelak_pal(void) { if (hero_try_start_grab_pal() != 0) { break; } - if (hero_l16_enter_state_pal(0, 0) == 0) { + if (hero_l16_set_move_state_pal(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.030000001f); @@ -686,17 +686,17 @@ void hero_decide_state_snivelak_pal(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x19; - hero_l16_enter_state_pal(3, 0); + hero_l16_set_move_state_pal(3, 0); set_hero_animation_pal(6, 4, 9.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l16_enter_state_pal(0x77, 1); + hero_l16_set_move_state_pal(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l16_enter_state_pal(0x77, 1); + hero_l16_set_move_state_pal(0x77, 1); break; } } @@ -714,11 +714,11 @@ void hero_decide_state_snivelak_pal(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.054000005f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l16_enter_state_pal(0x64, 1); + hero_l16_set_move_state_pal(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.054000005f)) { - hero_l16_enter_state_pal(0x63, 1); + hero_l16_set_move_state_pal(0x63, 1); } } else { hero_update_anim_scale_pal(); @@ -726,22 +726,22 @@ void hero_decide_state_snivelak_pal(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state_pal(0x62, 1); + hero_l16_set_move_state_pal(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l16_enter_state_pal(0, 1); + hero_l16_set_move_state_pal(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l16_enter_state_pal(0x62, 1); + hero_l16_set_move_state_pal(0x62, 1); } break; case 0x65: { s32 n = FLD(g_hero_state, s32, 0x18C0); if ((n < 3) && (((n * 6) + 0x8) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40, 6, &sp44) != 0)) { - hero_l16_enter_state_pal(0x66, 1); + hero_l16_set_move_state_pal(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters_pal(); @@ -775,29 +775,29 @@ void hero_decide_state_snivelak_pal(void) { return; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state_pal(1, 1); + hero_l16_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l16_enter_state_pal(7, 1); + hero_l16_set_move_state_pal(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state_pal(4, 1); + hero_l16_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 8) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state_pal(0, 1); + hero_l16_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state_pal(0x27, 1); + hero_l16_set_move_state_pal(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -805,45 +805,45 @@ void hero_decide_state_snivelak_pal(void) { } if (hero_get_weapon_anim_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l16_enter_state_pal(0, 0); + hero_l16_set_move_state_pal(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l16_enter_state_pal(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l16_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 14.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l16_enter_state_pal(2, 1); + hero_l16_set_move_state_pal(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state_pal(1, 1); + hero_l16_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xA) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state_pal(0, 0); + hero_l16_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l16_enter_state_pal(0x76, 1); + hero_l16_set_move_state_pal(0x76, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { break; } if ((PadPressedWithin(0x80, 0xC, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l16_enter_state_pal(0x15, 1); + hero_l16_set_move_state_pal(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 8) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l16_enter_state_pal(0, 1); + hero_l16_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -851,17 +851,17 @@ void hero_decide_state_snivelak_pal(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l16_enter_state_pal(0x8B, 1); + hero_l16_set_move_state_pal(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x4C) { - hero_l16_enter_state_pal(0, 1); + hero_l16_set_move_state_pal(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l16_enter_state_pal(0, 1); + hero_l16_set_move_state_pal(0, 1); } break; case 0x24: @@ -887,14 +887,14 @@ void hero_decide_state_snivelak_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l16_enter_state_pal(0, 0); + hero_l16_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 25.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l16_enter_state_pal(6, 0); + hero_l16_set_move_state_pal(6, 0); } else { - hero_l16_enter_state_pal(6, 0); + hero_l16_set_move_state_pal(6, 0); set_hero_animation_pal(0xA, 0, 14.0f); } FLD(g_hero_state, f32, 0xA84) = 0.016800001f; @@ -910,9 +910,9 @@ void hero_decide_state_snivelak_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l16_enter_state_pal(0, 1); + hero_l16_set_move_state_pal(0, 1); } else { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -924,7 +924,7 @@ void hero_decide_state_snivelak_pal(void) { if (t < 0x21) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l16_enter_state_pal(0x2C, 1); + hero_l16_set_move_state_pal(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0028000001f; FLD(g_hero_state, f32, 0xA80) = 0.0108f; } @@ -988,11 +988,11 @@ void hero_decide_state_snivelak_pal(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.26000002f); FLD(g_hero_state, f32, 0x128) = 0.20000002f; - hero_l16_enter_state_pal(0x16, 1); + hero_l16_set_move_state_pal(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x3A; FLD(g_hero_state, s16, 0x1D0) = 0x3A; } else { - hero_l16_enter_state_pal(0x3E, 1); + hero_l16_set_move_state_pal(0x3E, 1); } break; } @@ -1005,7 +1005,7 @@ void hero_decide_state_snivelak_pal(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l16_enter_state_pal(0x28, 1); + hero_l16_set_move_state_pal(0x28, 1); } break; } @@ -1016,16 +1016,16 @@ void hero_decide_state_snivelak_pal(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x3A; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l16_enter_state_pal(0x74, 1); + hero_l16_set_move_state_pal(0x74, 1); } else { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0x8, NULL) != 0)) { - hero_l16_enter_state_pal(0x2A, 1); + hero_l16_set_move_state_pal(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1042,7 +1042,7 @@ void hero_decide_state_snivelak_pal(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l16_enter_state_pal(0x28, 1); + hero_l16_set_move_state_pal(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)vec_b = 0; @@ -1059,7 +1059,7 @@ void hero_decide_state_snivelak_pal(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 4, NULL) != 0) && ((f32)g_hero_state_record_table[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l16_enter_state_pal(0x28, 1); + hero_l16_set_move_state_pal(0x28, 1); break; } top = 0xE; @@ -1068,19 +1068,19 @@ void hero_decide_state_snivelak_pal(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0x8, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l16_enter_state_pal(0x2A, 1); + hero_l16_set_move_state_pal(0x2A, 1); } break; } if ((f32)g_hero_state_record_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l16_enter_state_pal(0x27, 1); + hero_l16_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 5) || (FLD(g_hero_state, s32, 0x6C8) >= 5)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l16_enter_state_pal(0x74, 1); + hero_l16_set_move_state_pal(0x74, 1); } else { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; @@ -1089,11 +1089,11 @@ void hero_decide_state_snivelak_pal(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 5) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l16_enter_state_pal(0x27, 1); + hero_l16_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 5) && (g_current_map_index == 0x14)) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0x8) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1129,7 +1129,7 @@ void hero_decide_state_snivelak_pal(void) { find_nearest_path_point(sp50, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), sp5C, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l16_enter_state_pal(0x29, 1); + hero_l16_set_move_state_pal(0x29, 1); break; } } @@ -1177,7 +1177,7 @@ void hero_decide_state_snivelak_pal(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x3A; FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; @@ -1185,7 +1185,7 @@ void hero_decide_state_snivelak_pal(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l16_enter_state_pal(0x71, 1); + hero_l16_set_move_state_pal(0x71, 1); break; } { @@ -1197,7 +1197,7 @@ void hero_decide_state_snivelak_pal(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l16_enter_state_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l16_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(0xC, 4, 5.0f); } } else if (st == 0x3E) { @@ -1206,24 +1206,24 @@ void hero_decide_state_snivelak_pal(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)sp64, 0.5f, -1.0f); } if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s32, 0x340) != 0)) { - if (hero_l16_enter_state_pal(0, 0) != 0) { + if (hero_l16_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state_pal(0x27, 1); + hero_l16_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xD) && (FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l16_enter_state_pal(0x27, 1); + hero_l16_set_move_state_pal(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l16_enter_state_pal(0x18, 0); + hero_l16_set_move_state_pal(0x18, 0); } break; case 0x18: @@ -1232,18 +1232,18 @@ void hero_decide_state_snivelak_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab_pal((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 0xE, NULL) != 0) { - hero_l16_enter_state_pal(0x1B, 1); + hero_l16_set_move_state_pal(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1252,7 +1252,7 @@ void hero_decide_state_snivelak_pal(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x97), 1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x97), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l16_enter_state_pal(0x19, 1); + hero_l16_set_move_state_pal(0x19, 1); } break; } @@ -1263,7 +1263,7 @@ void hero_decide_state_snivelak_pal(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l16_enter_state_pal(0x1A, 1); + hero_l16_set_move_state_pal(0x1A, 1); } } } @@ -1282,18 +1282,18 @@ void hero_decide_state_snivelak_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state_pal(0x18, 1); + hero_l16_set_move_state_pal(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l16_enter_state_pal(0x1B, 1); + hero_l16_set_move_state_pal(0x1B, 1); } break; } @@ -1303,9 +1303,9 @@ void hero_decide_state_snivelak_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); } else { - hero_l16_enter_state_pal(0, 1); + hero_l16_set_move_state_pal(0, 1); } } break; @@ -1329,12 +1329,12 @@ void hero_decide_state_snivelak_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l16_enter_state_pal(0x39, 1); + hero_l16_set_move_state_pal(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x4B) { - if (hero_l16_enter_state_pal(0, 0) != 0) { + if (hero_l16_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } if (low != 0) { @@ -1342,7 +1342,7 @@ void hero_decide_state_snivelak_pal(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l16_enter_state_pal(0, 0) != 0) { + if (hero_l16_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1356,32 +1356,32 @@ void hero_decide_state_snivelak_pal(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l16_enter_state_pal(2, 1); + hero_l16_set_move_state_pal(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.060000002f) { - if (hero_l16_enter_state_pal(3, 0) != 0) { + if (hero_l16_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(6, 0, 1e+01f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.15400001f); } } else { - hero_l16_enter_state_pal(0, 1); + hero_l16_set_move_state_pal(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l16_enter_state_pal(8, 1); + hero_l16_set_move_state_pal(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x12) && (hero_try_start_move_from_buffer_pal((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 5, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l16_enter_state_pal(0x17, 1); + hero_l16_set_move_state_pal(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state_pal(0x27, 1); + hero_l16_set_move_state_pal(0x27, 1); break; } } @@ -1413,7 +1413,7 @@ void hero_decide_state_snivelak_pal(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l16_enter_state_pal(0, 0) != 0) { + if (hero_l16_set_move_state_pal(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1424,12 +1424,12 @@ void hero_decide_state_snivelak_pal(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l16_enter_state_pal(0x74, 1); + hero_l16_set_move_state_pal(0x74, 1); } else { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); } } else { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); } } break; @@ -1442,16 +1442,16 @@ void hero_decide_state_snivelak_pal(void) { ok = 1; } if (ok != 0) { - hero_l16_enter_state_pal(0x11, 1); + hero_l16_set_move_state_pal(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l16_enter_state_pal(0x17, 1); + hero_l16_set_move_state_pal(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1462,23 +1462,23 @@ void hero_decide_state_snivelak_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 3)) { - if (hero_l16_enter_state_pal(3, 0) != 0) { + if (hero_l16_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x1C; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state_pal(4, 1); + hero_l16_set_move_state_pal(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l16_speed_params[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l16_enter_state_pal(2, 1); + hero_l16_set_move_state_pal(2, 1); break; } - hero_l16_enter_state_pal(2, 0); + hero_l16_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, 2, 7.0f); @@ -1487,21 +1487,21 @@ void hero_decide_state_snivelak_pal(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l16_speed_params[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l16_enter_state_pal(2, 1); + hero_l16_set_move_state_pal(2, 1); break; } - hero_l16_enter_state_pal(2, 0); + hero_l16_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, g_hero_l16_animation_id, 1e+01f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l16_enter_state_pal(0, 0) != 0) { + if (hero_l16_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l16_enter_state_pal(0, 0) != 0) { + } else if (hero_l16_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1547,14 +1547,14 @@ void hero_decide_state_snivelak_pal(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 4, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state_pal(0xB, 1); + hero_l16_set_move_state_pal(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x11)) { - hero_l16_enter_state_pal(0x82, 1); + hero_l16_set_move_state_pal(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1563,25 +1563,25 @@ void hero_decide_state_snivelak_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 6) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f)) { - hero_l16_enter_state_pal(0xA, 1); + hero_l16_set_move_state_pal(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l16_enter_state_pal(0x10, 1); + hero_l16_set_move_state_pal(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state_pal(0x27, 1); + hero_l16_set_move_state_pal(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.14000002f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l16_enter_state_pal(0x77, 1); + hero_l16_set_move_state_pal(0x77, 1); break; } } @@ -1685,7 +1685,7 @@ void hero_decide_state_snivelak_pal(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l16_enter_state_pal(3, 0) != 0) { + if (hero_l16_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1693,13 +1693,13 @@ void hero_decide_state_snivelak_pal(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l16_speed_params[0][2])) { - hero_l16_enter_state_pal(7, 1); + hero_l16_set_move_state_pal(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l16_enter_state_pal(7, 1); + hero_l16_set_move_state_pal(7, 1); } else if (g_hero_l16_speed_params[1][1] * 0.017f < FLD(g_hero_state, f32, 0x174)) { - hero_l16_enter_state_pal(9, 1); + hero_l16_set_move_state_pal(9, 1); } else { - hero_l16_enter_state_pal(7, 1); + hero_l16_set_move_state_pal(7, 1); } break; } @@ -1707,10 +1707,10 @@ void hero_decide_state_snivelak_pal(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_l01_choose_next_move_after_landing_pal(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); break; } { @@ -1720,7 +1720,7 @@ void hero_decide_state_snivelak_pal(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x16)) && (PadPressedWithin(0x40, 6, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l16_enter_state_pal(0x11, 1); + hero_l16_set_move_state_pal(0x11, 1); break; } } @@ -1749,7 +1749,7 @@ void hero_decide_state_snivelak_pal(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xD) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.11600001f)))) { - hero_l16_enter_state_pal(0xE, 1); + hero_l16_set_move_state_pal(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1759,32 +1759,32 @@ void hero_decide_state_snivelak_pal(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l16_enter_state_pal(8, 1); + hero_l16_set_move_state_pal(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x576) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l16_enter_state_pal(0x17, 1); + hero_l16_set_move_state_pal(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l16_enter_state_pal(6, 1); + hero_l16_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x17) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l16_enter_state_pal(0x79, 1); + hero_l16_set_move_state_pal(0x79, 1); } else { - hero_l16_enter_state_pal(0x39, 1); + hero_l16_set_move_state_pal(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l16_enter_state_pal(0x82, 1); + hero_l16_set_move_state_pal(0x82, 1); } else { - hero_l16_enter_state_pal(0, 0); + hero_l16_set_move_state_pal(0, 0); } } break; @@ -1794,8 +1794,8 @@ void hero_decide_state_snivelak_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x2B) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l16_enter_state_pal(0x39, 1); - } else if (hero_l16_enter_state_pal(0, 0) != 0) { + hero_l16_set_move_state_pal(0x39, 1); + } else if (hero_l16_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 11.0f); } } @@ -1816,7 +1816,7 @@ void hero_decide_state_snivelak_pal(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l16_enter_state_pal(0, 0); + hero_l16_set_move_state_pal(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -1827,7 +1827,7 @@ void hero_decide_state_snivelak_pal(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l16_enter_state_pal(0, 0); + hero_l16_set_move_state_pal(0, 0); } break; case 0x22: @@ -1837,12 +1837,12 @@ void hero_decide_state_snivelak_pal(void) { hero_choose_jump_or_roll_move_pal(); break; } - hero_l16_enter_state_pal(7, 1); + hero_l16_set_move_state_pal(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l16_enter_state_pal(0, 0); + hero_l16_set_move_state_pal(0, 0); } break; default: diff --git a/src/pal/levels/16_snivelak/L16_002B9EE0-sw2.c b/src/pal/levels/16_snivelak/L16_002B9EE0-sw2.c index adbf7c3cc..0ffeb3346 100644 --- a/src/pal/levels/16_snivelak/L16_002B9EE0-sw2.c +++ b/src/pal/levels/16_snivelak/L16_002B9EE0-sw2.c @@ -58,8 +58,8 @@ extern int hero_play_sound(int, int); extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -126,7 +126,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l16_enter_state_pal(s32 action, s32 animate) { +s32 hero_l16_set_move_state_pal(s32 action, s32 animate) { f32 dir[4]; u8 *hero_moby; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -174,7 +174,9 @@ s32 hero_l16_enter_state_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -187,7 +189,7 @@ s32 hero_l16_enter_state_pal(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_anim_id(0) == 0x51) set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 15.0f); else set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, -1.0f); @@ -238,7 +240,7 @@ s32 hero_l16_enter_state_pal(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l16_enter_state_pal(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l16_set_move_state_pal(0x76, 1); return 0; } } WORD(0x2298) = 0; BYTE(0x40C) = 0; BYTE(0x40E) = 0; @@ -268,11 +270,11 @@ s32 hero_l16_enter_state_pal(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_set_move_state_pal(0x76, 1); return 0; } if (hero_try_start_grab_pal()) return 0; if (hero_get_weapon_anim_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l16_enter_state_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 15.0f); + if (hero_l16_set_move_state_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_anim_id(0), 0, 15.0f); return 0; } if (!animate) goto finish; @@ -297,7 +299,7 @@ s32 hero_l16_enter_state_pal(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.14000002f) REAL(0x1B4) = 0.14000002f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_enter_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.14000002f); @@ -461,13 +463,13 @@ s32 hero_l16_enter_state_pal(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l16_enter_state_pal(0x81, 1); return 0; + hero_l16_set_move_state_pal(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_action_lock_flag) { hero_l16_enter_state_pal(0x6E, 1); return 0; } + action != 0x38 && !g_hero_action_lock_flag) { hero_l16_set_move_state_pal(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l16_enter_state_pal(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l16_set_move_state_pal(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -527,9 +529,9 @@ s32 hero_l16_enter_state_pal(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_special_enter_flag) hero_l16_enter_state_pal(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l16_enter_state_pal(0x79, 1); - else hero_l16_enter_state_pal(0x39, 1); + if (g_current_map_index == 2 && g_hero_special_enter_flag) hero_l16_set_move_state_pal(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l16_set_move_state_pal(0x79, 1); + else hero_l16_set_move_state_pal(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -577,7 +579,7 @@ s32 hero_l16_enter_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -603,7 +605,7 @@ s32 hero_l16_enter_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -612,7 +614,7 @@ s32 hero_l16_enter_state_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4B8) = 0.6f; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -751,7 +753,7 @@ s32 hero_l16_enter_state_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -816,7 +818,7 @@ s32 hero_l16_enter_state_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -828,7 +830,7 @@ s32 hero_l16_enter_state_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); @@ -867,7 +869,7 @@ s32 hero_l16_enter_state_pal(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.09f; if (WORD(0x640) > 12 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l16_enter_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; + PTR(0x2290)[0xA8] = 255; hero_l16_set_move_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; return 0; } HALF(0x1DC) = 64; REAL(0x69C) = 0.050000004f; diff --git a/src/pal/levels/17_smolg/L17_003EB968-port.c b/src/pal/levels/17_smolg/L17_003EB968-port.c index 000799f87..bc921621b 100644 --- a/src/pal/levels/17_smolg/L17_003EB968-port.c +++ b/src/pal/levels/17_smolg/L17_003EB968-port.c @@ -181,7 +181,7 @@ extern int ForceClaimNotice(s32, s32, s32); extern s32 PlayMobySound(s32, s32, void *); extern void moby_set_flag_bit(void *, s32); extern void cam_lock_entry(s32); -extern s32 hero_set_action_state_pal(s32, s32); +extern s32 hero_l13_set_move_state_pal(s32, s32); /* func_PAL_L17_00424368's state record. */ typedef struct { @@ -255,7 +255,7 @@ void target_pad_update_pal(u8 *obj) } if (vars->cuboid >= 0 && IsPointInCuboid(g_hero_state.pos, vars->cuboid) && g_hero_state.mode == 0x82) - hero_set_action_state_pal(6, 1); + hero_l13_set_move_state_pal(6, 1); } /* func_L17_00420E08's state record. */ diff --git a/src/pal/levels/17_smolg/L17_004266C8-cc-g8.c b/src/pal/levels/17_smolg/L17_004266C8-cc-g8.c index cf115e77e..583244e92 100644 --- a/src/pal/levels/17_smolg/L17_004266C8-cc-g8.c +++ b/src/pal/levels/17_smolg/L17_004266C8-cc-g8.c @@ -193,7 +193,7 @@ extern int ForceClaimNotice(s32, s32, s32); extern s32 PlayMobySound(s32, s32, void *); extern void moby_set_flag_bit(void *, s32); extern void cam_lock_entry(s32); -extern s32 hero_change_action(s32, s32); +extern s32 hero_l13_set_move_state(s32, s32); /* func_L17_0041EAA8's state record. */ typedef struct { diff --git a/src/pal/levels/18_damosel/L18_002D0098.c b/src/pal/levels/18_damosel/L18_002D0098.c index 5c55cd60c..4069f0dd5 100644 --- a/src/pal/levels/18_damosel/L18_002D0098.c +++ b/src/pal/levels/18_damosel/L18_002D0098.c @@ -63,7 +63,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l18_set_action_pal(s32, s32); +extern s32 hero_l18_set_move_state_pal(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_pal(s32); extern int hero_play_sound(s32, s32); @@ -154,7 +154,7 @@ s32 hero_handle_hit_object_contact_pal(s32 apply_push) { case 0: hit_moby = g_hero_state.f249C; if (hit_moby != 0 && (*(s16 *)(hit_moby + 0xAA) == 0x4EB || *(s16 *)(hit_moby + 0xAA) == 0x558)) { - hero_l18_set_action_pal(0x7D, 1); + hero_l18_set_move_state_pal(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -165,7 +165,7 @@ s32 hero_handle_hit_object_contact_pal(s32 apply_push) { AdjustPlayerHealth_pal(FloatToInt(*(float *)(effect_slot + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l18_set_action_pal(0x16, 1); + hero_l18_set_move_state_pal(0x16, 1); } g_hero_state.f1DC = 0x40; if (g_hero_state.f21C == 0) { @@ -175,13 +175,13 @@ s32 hero_handle_hit_object_contact_pal(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l18_set_action_pal(0x72, 1); + hero_l18_set_move_state_pal(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l18_set_action_pal(0x73, 1); + hero_l18_set_move_state_pal(0x73, 1); } else if (entry->f24 & 8) { - hero_l18_set_action_pal(0x8C, 1); + hero_l18_set_move_state_pal(0x8C, 1); } else { - hero_l18_set_action_pal(0x16, 1); + hero_l18_set_move_state_pal(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&push_vec); @@ -193,7 +193,7 @@ s32 hero_handle_hit_object_contact_pal(s32 apply_push) { } break; case 4: - hero_l18_set_action_pal(0x90, 1); + hero_l18_set_move_state_pal(0x90, 1); hero_flatten_push_vector(&push_vec, is_special, 0.10000001f, 0.060000002f); break; } diff --git a/src/pal/levels/18_damosel/L18_002D7598-hero.c b/src/pal/levels/18_damosel/L18_002D7598-hero.c index 9652592cb..da9794fed 100644 --- a/src/pal/levels/18_damosel/L18_002D7598-hero.c +++ b/src/pal/levels/18_damosel/L18_002D7598-hero.c @@ -147,7 +147,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -166,7 +166,7 @@ extern s32 shooter_update_ranged_attack_pal(s32); extern s32 hero_get_screen_id(s32); extern void hero_detach_from_object_pal(s32); extern void ClipHeroVelocityAtWall_pal(s32); -extern s32 hero_l18_set_action_pal(s32, s32); +extern s32 hero_l18_set_move_state_pal(s32, s32); extern char g_impact_effect_data[] MACRO_ADDR; extern void moby_l00_raise_state_to_8(); extern void moby_raise_state_to_eight_copy(); @@ -679,7 +679,7 @@ void hero_l18_update_state_machine_pal(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { temp_a2 = ((Hero *)g_hero_state)->i[0x2440/4]; if (temp_a2 != -1) { @@ -1384,7 +1384,7 @@ void hero_l18_update_state_machine_pal(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x2a; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l18_state_extra)->f[0x180/4] = 0.1f; @@ -2779,7 +2779,7 @@ void hero_l18_update_state_machine_pal(void) { } hero_try_surface_push_response(3.7f, 0.0f, 0.35f); if (shooter_update_ranged_attack_pal((s32) temp_fp) != 0) { - hero_l18_set_action_pal(0x8D, 1); + hero_l18_set_move_state_pal(0x8D, 1); } } break; diff --git a/src/pal/levels/18_damosel/L18_002E01E0-sw.c b/src/pal/levels/18_damosel/L18_002E01E0-sw.c index a8bc47f6a..3511d4e83 100644 --- a/src/pal/levels/18_damosel/L18_002E01E0-sw.c +++ b/src/pal/levels/18_damosel/L18_002E01E0-sw.c @@ -60,8 +60,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -131,7 +131,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l18_set_action_pal(s32 action, s32 animate) { +s32 hero_l18_set_move_state_pal(s32 action, s32 animate) { f32 dir[4]; u8 *old_object; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -179,7 +179,9 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -192,8 +194,8 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { snd_start_mode_sound(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l18_set_action_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action_pal(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l18_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_screen_id(0) == 0x51) set_hero_animation_pal(hero_get_screen_id(0), 0, 15.0f); else set_hero_animation_pal(hero_get_screen_id(0), 0, -1.0f); @@ -328,7 +330,7 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l18_set_action_pal(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l18_set_move_state_pal(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.15400001f) REAL(0x1B4) = 0.15400001f; @@ -368,12 +370,12 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l18_set_action_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action_pal(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l18_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state_pal(0x76, 1); return 0; } if (hero_try_start_grab_pal()) return 0; if (hero_get_screen_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l18_set_action_pal(0, 0)) set_hero_animation_pal(hero_get_screen_id(0), 0, 15.0f); + if (hero_l18_set_move_state_pal(0, 0)) set_hero_animation_pal(hero_get_screen_id(0), 0, 15.0f); return 0; } if (!animate) goto finish; @@ -398,7 +400,7 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.14000002f) REAL(0x1B4) = 0.14000002f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.14000002f); @@ -552,13 +554,13 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l18_set_action_pal(0x81, 1); return 0; + hero_l18_set_move_state_pal(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_action_lock) { hero_l18_set_action_pal(0x6E, 1); return 0; } + action != 0x38 && !g_hero_action_lock) { hero_l18_set_move_state_pal(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l18_set_action_pal(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l18_set_move_state_pal(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -665,7 +667,7 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -691,7 +693,7 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -700,7 +702,7 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4B8) = 0.6f; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -838,7 +840,7 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -907,7 +909,7 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -919,7 +921,7 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); @@ -930,7 +932,7 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { goto finish; case 0x8D: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action_pal(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state_pal(0x94, 1); return 0; } if (!animate) goto finish; set_hero_animation_pal(13, 0, 7.0f); goto finish; case 0x8F: @@ -951,7 +953,7 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l18_float_sequences[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x8E: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action_pal(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state_pal(0x94, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); BYTE(0x40C) = 0; BYTE(0x40F) = 0; if (WORD(0x22A4) == 0) REAL(0x1B4) = vec_length_xy(VEC(0x160)); @@ -980,7 +982,7 @@ s32 hero_l18_set_action_pal(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.09f; if (WORD(0x640) > 12 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l18_set_action_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; + PTR(0x2290)[0xA8] = 255; hero_l18_set_move_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; return 0; } HALF(0x1DC) = 64; REAL(0x69C) = 0.050000004f; diff --git a/src/pal/levels/18_damosel/L18_002E6C50-sw.c b/src/pal/levels/18_damosel/L18_002E6C50-sw.c index 36e22d396..e36b1343b 100644 --- a/src/pal/levels/18_damosel/L18_002E6C50-sw.c +++ b/src/pal/levels/18_damosel/L18_002E6C50-sw.c @@ -73,7 +73,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed_pal(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction_pal(void); -s32 hero_l18_set_action_pal(s32, s32); +s32 hero_l18_set_move_state_pal(s32, s32); void snd_start_mode_sound(s32 a0); s32 hero_try_start_transition_pal(void); s32 hero_try_start_ledge_move(void); @@ -153,7 +153,7 @@ void hero_update_state_decider_pal(void) { UpdateHeroHeldTarget_pal(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l18_set_action_pal(0x39, 1); + hero_l18_set_move_state_pal(0x39, 1); goto end; } } @@ -183,15 +183,15 @@ void hero_update_state_decider_pal(void) { if (FLD(g_hero_state, f32, 0x88) < g_hero_l18_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { if (FLD(g_hero_state, u8, 0x22B4) == 4) { - hero_l18_set_action_pal(0x91, 1); + hero_l18_set_move_state_pal(0x91, 1); goto end; } - hero_l18_set_action_pal(0x74, 1); + hero_l18_set_move_state_pal(0x74, 1); goto end; } } if ((FLD(g_hero_state, u8, 0x22B4) == 4) && (FLD(g_hero_state, f32, 0x88) < FLD(FLD(FLD(g_hero_state, void *, 0x2290), void *, 0x68), f32, 0x3EC))) { - hero_l18_set_action_pal(0x91, 1); + hero_l18_set_move_state_pal(0x91, 1); } switch (FLD(g_hero_state, u32, 0x2294)) { case 0x0: @@ -200,12 +200,12 @@ void hero_update_state_decider_pal(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action_pal(1, 1); + hero_l18_set_move_state_pal(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l18_set_action_pal(0x82, 1); + hero_l18_set_move_state_pal(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -242,7 +242,7 @@ void hero_update_state_decider_pal(void) { rec = g_item_l18_record_table + item_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 5e+01f; if (FLD(rec, s32, 0x44) != 0) { - hero_l18_set_action_pal(0x3C, 1); + hero_l18_set_move_state_pal(0x3C, 1); } else { set_hero_animation_pal(FLD(rec, s32, 0x48), 0, 1e+01f); } @@ -285,12 +285,12 @@ void hero_update_state_decider_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l18_set_action_pal(0x76, 1); + hero_l18_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); } break; } @@ -311,21 +311,21 @@ void hero_update_state_decider_pal(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_action_lock == 0) && (PadPressedWithin(0x40, 6, NULL) != 0)) { - hero_l18_set_action_pal(0x6E, 1); + hero_l18_set_move_state_pal(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l18_set_action_pal(4, 1); + hero_l18_set_move_state_pal(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action_pal(0x27, 1); + hero_l18_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l18_set_action_pal(0x2E, 1); + hero_l18_set_move_state_pal(0x2E, 1); break; } { @@ -345,28 +345,28 @@ void hero_update_state_decider_pal(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust_pal(side, 0, 0, 0x1E); hero_play_footstep_sound_dust_pal(side, 1, 0, 0x1E); - hero_l18_set_action_pal(2, 1); + hero_l18_set_move_state_pal(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action_pal(1, 1); + hero_l18_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_flags = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_flags & 8)) { - hero_l18_set_action_pal(0x3D, 1); + hero_l18_set_move_state_pal(0x3D, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l18_set_action_pal(0x3D, 1); + hero_l18_set_move_state_pal(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l18_set_action_pal(0, 1); + hero_l18_set_move_state_pal(0, 1); } break; case 0x3D: @@ -375,22 +375,22 @@ void hero_update_state_decider_pal(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); break; } if (hero_try_start_move_from_buffer_pal(6, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action_pal(4, 1); + hero_l18_set_move_state_pal(4, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l18_set_action_pal(2, 1); + hero_l18_set_move_state_pal(2, 1); break; } - hero_l18_set_action_pal(0, 1); + hero_l18_set_move_state_pal(0, 1); break; case 0x39: case 0x43: @@ -423,25 +423,25 @@ void hero_update_state_decider_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.040000003f)) { - hero_l18_set_action_pal(0x33, 1); + hero_l18_set_move_state_pal(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12)) { - hero_l18_set_action_pal(0x34, 1); + hero_l18_set_move_state_pal(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l18_set_action_pal(0x32, 1); + hero_l18_set_move_state_pal(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l18_set_action_pal(0x33, 1); + hero_l18_set_move_state_pal(0x33, 1); } } break; @@ -454,81 +454,81 @@ void hero_update_state_decider_pal(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l18_set_action_pal(0x32, 1); + hero_l18_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l18_set_action_pal(0x34, 1); + hero_l18_set_move_state_pal(0x34, 1); } else { - hero_l18_set_action_pal(0x32, 1); + hero_l18_set_move_state_pal(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l18_set_action_pal(0x12, 1); + hero_l18_set_move_state_pal(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 6, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 6, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l18_set_action_pal(0x32, 1); + hero_l18_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l18_set_action_pal(0x34, 1); + hero_l18_set_move_state_pal(0x34, 1); } else { - hero_l18_set_action_pal(0x32, 1); + hero_l18_set_move_state_pal(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l18_set_action_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l18_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_screen_id(0), 0, 15.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l18_set_action_pal(0x35, 1); + hero_l18_set_move_state_pal(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l18_set_action_pal(0x12, 1); + hero_l18_set_move_state_pal(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 6, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l18_set_action_pal(0x32, 1); + hero_l18_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l18_set_action_pal(0x34, 1); + hero_l18_set_move_state_pal(0x34, 1); } else { - hero_l18_set_action_pal(0x32, 1); + hero_l18_set_move_state_pal(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l18_set_action_pal(0x70, 0); + hero_l18_set_move_state_pal(0x70, 0); set_hero_animation_pal(0x59, 0, 14.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l18_set_action_pal(0x36, 1); + hero_l18_set_move_state_pal(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action_pal(0x67, 1); + hero_l18_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x28, 15.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action_pal(0x33, 1); + hero_l18_set_move_state_pal(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l18_set_action_pal(0x33, 0); + hero_l18_set_move_state_pal(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action_pal(0x67, 1); + hero_l18_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x25, 15.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l18_set_action_pal(0x36, 0); + hero_l18_set_move_state_pal(0x36, 0); } break; case 0x1: @@ -562,9 +562,9 @@ void hero_update_state_decider_pal(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { snd_start_mode_sound(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action_pal(4, 1); + hero_l18_set_move_state_pal(4, 1); } else { - hero_l18_set_action_pal(0, 0); + hero_l18_set_move_state_pal(0, 0); anim = hero_get_screen_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -576,9 +576,9 @@ void hero_update_state_decider_pal(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l18_set_action_pal(0, 0); + hero_l18_set_move_state_pal(0, 0); } else { - hero_l18_set_action_pal(0, 1); + hero_l18_set_move_state_pal(0, 1); } } break; @@ -611,7 +611,7 @@ void hero_update_state_decider_pal(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action_pal(7, 1); + hero_l18_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -620,7 +620,7 @@ void hero_update_state_decider_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l18_set_action_pal(0, 0); + hero_l18_set_move_state_pal(0, 0); } break; } @@ -642,7 +642,7 @@ void hero_update_state_decider_pal(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action_pal(7, 1); + hero_l18_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -655,7 +655,7 @@ void hero_update_state_decider_pal(void) { goto tail_13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l18_set_action_pal(2, 0); + hero_l18_set_move_state_pal(2, 0); set_hero_animation_pal(3, g_hero_l18_anim_table[FLD(g_hero_state, s32, 0x2298)], 11.0f); break; } @@ -666,22 +666,22 @@ void hero_update_state_decider_pal(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l18_set_action_pal(2, 1); + hero_l18_set_move_state_pal(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l18_set_action_pal(0, 0); + hero_l18_set_move_state_pal(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action_pal(0, 0); + hero_l18_set_move_state_pal(0, 0); } break; } tail_13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l18_set_action_pal(0, 1); + hero_l18_set_move_state_pal(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x54) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -698,7 +698,7 @@ void hero_update_state_decider_pal(void) { } if (PadPressedWithin(0x40, 6, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action_pal(7, 1); + hero_l18_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -707,7 +707,7 @@ void hero_update_state_decider_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l18_set_action_pal(0, 0); + hero_l18_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_screen_id(0), 0, 12.0f); break; } @@ -719,7 +719,7 @@ void hero_update_state_decider_pal(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action_pal(0, 1); + hero_l18_set_move_state_pal(0, 1); } break; case 0x2: @@ -733,11 +733,11 @@ void hero_update_state_decider_pal(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l18_set_action_pal(0x76, 1); + hero_l18_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead_pal() == 0)) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); break; } n = 7; @@ -751,12 +751,12 @@ void hero_update_state_decider_pal(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l18_set_action_pal(9, 1); + hero_l18_set_move_state_pal(9, 1); } else { - hero_l18_set_action_pal(7, 1); + hero_l18_set_move_state_pal(7, 1); } } else { - hero_l18_set_action_pal(7, 1); + hero_l18_set_move_state_pal(7, 1); } break; } @@ -764,11 +764,11 @@ void hero_update_state_decider_pal(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.040000003f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action_pal(1, 1); + hero_l18_set_move_state_pal(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action_pal(4, 1); + hero_l18_set_move_state_pal(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -785,25 +785,25 @@ void hero_update_state_decider_pal(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l18_set_action_pal(0x2E, 1); + hero_l18_set_move_state_pal(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l18_set_action_pal(2, 1); + hero_l18_set_move_state_pal(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l18_set_action_pal(0x70, 1); + hero_l18_set_move_state_pal(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l18_set_action_pal(2, 1); + hero_l18_set_move_state_pal(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action_pal(0x27, 1); + hero_l18_set_move_state_pal(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -814,7 +814,7 @@ void hero_update_state_decider_pal(void) { if (hero_try_start_grab_pal() != 0) { break; } - if (hero_l18_set_action_pal(0, 0) == 0) { + if (hero_l18_set_move_state_pal(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.030000001f); @@ -831,7 +831,7 @@ void hero_update_state_decider_pal(void) { hero_update_anim_scale_pal(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l18_set_action_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l18_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_screen_id(0), 0, 14.0f); } if (FLD(hit_object, u8, 0x43) == 0x37) { @@ -852,7 +852,7 @@ void hero_update_state_decider_pal(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l18_set_action_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l18_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_screen_id(0), 0, 14.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 29.166668f; @@ -886,17 +886,17 @@ void hero_update_state_decider_pal(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x19; - hero_l18_set_action_pal(3, 0); + hero_l18_set_move_state_pal(3, 0); set_hero_animation_pal(6, 4, 9.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l18_set_action_pal(0x77, 1); + hero_l18_set_move_state_pal(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l18_set_action_pal(0x77, 1); + hero_l18_set_move_state_pal(0x77, 1); break; } } @@ -914,11 +914,11 @@ void hero_update_state_decider_pal(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.054000005f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l18_set_action_pal(0x64, 1); + hero_l18_set_move_state_pal(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.054000005f)) { - hero_l18_set_action_pal(0x63, 1); + hero_l18_set_move_state_pal(0x63, 1); } } else { hero_update_anim_scale_pal(); @@ -926,42 +926,42 @@ void hero_update_state_decider_pal(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action_pal(0x62, 1); + hero_l18_set_move_state_pal(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l18_set_action_pal(0, 1); + hero_l18_set_move_state_pal(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l18_set_action_pal(0x62, 1); + hero_l18_set_move_state_pal(0x62, 1); } break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action_pal(1, 1); + hero_l18_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l18_set_action_pal(7, 1); + hero_l18_set_move_state_pal(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action_pal(4, 1); + hero_l18_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 8) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action_pal(0, 1); + hero_l18_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action_pal(0x27, 1); + hero_l18_set_move_state_pal(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -969,45 +969,45 @@ void hero_update_state_decider_pal(void) { } if (hero_get_screen_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l18_set_action_pal(0, 0); + hero_l18_set_move_state_pal(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l18_set_action_pal(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l18_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_screen_id(0), 0, 14.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l18_set_action_pal(2, 1); + hero_l18_set_move_state_pal(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action_pal(1, 1); + hero_l18_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xA) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action_pal(0, 0); + hero_l18_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_screen_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l18_set_action_pal(0x76, 1); + hero_l18_set_move_state_pal(0x76, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { break; } if ((PadPressedWithin(0x80, 0xC, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l18_set_action_pal(0x15, 1); + hero_l18_set_move_state_pal(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 8) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); } } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l18_set_action_pal(0, 1); + hero_l18_set_move_state_pal(0, 1); } break; case 0x24: @@ -1033,14 +1033,14 @@ void hero_update_state_decider_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l18_set_action_pal(0, 0); + hero_l18_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_screen_id(0), 0, 25.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l18_set_action_pal(6, 0); + hero_l18_set_move_state_pal(6, 0); } else { - hero_l18_set_action_pal(6, 0); + hero_l18_set_move_state_pal(6, 0); set_hero_animation_pal(0xA, 0, 14.0f); } FLD(g_hero_state, f32, 0xA84) = 0.016800001f; @@ -1056,9 +1056,9 @@ void hero_update_state_decider_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l18_set_action_pal(0, 1); + hero_l18_set_move_state_pal(0, 1); } else { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1070,7 +1070,7 @@ void hero_update_state_decider_pal(void) { if (t < 0x21) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l18_set_action_pal(0x2C, 1); + hero_l18_set_move_state_pal(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0028000001f; FLD(g_hero_state, f32, 0xA80) = 0.0108f; } @@ -1134,11 +1134,11 @@ void hero_update_state_decider_pal(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.26000002f); FLD(g_hero_state, f32, 0x128) = 0.20000002f; - hero_l18_set_action_pal(0x16, 1); + hero_l18_set_move_state_pal(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x3A; FLD(g_hero_state, s16, 0x1D0) = 0x3A; } else { - hero_l18_set_action_pal(0x3E, 1); + hero_l18_set_move_state_pal(0x3E, 1); } break; } @@ -1151,7 +1151,7 @@ void hero_update_state_decider_pal(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l18_set_action_pal(0x28, 1); + hero_l18_set_move_state_pal(0x28, 1); } break; } @@ -1162,16 +1162,16 @@ void hero_update_state_decider_pal(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x3A; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l18_set_action_pal(0x74, 1); + hero_l18_set_move_state_pal(0x74, 1); } else { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0x8, NULL) != 0)) { - hero_l18_set_action_pal(0x2A, 1); + hero_l18_set_move_state_pal(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1188,7 +1188,7 @@ void hero_update_state_decider_pal(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l18_set_action_pal(0x28, 1); + hero_l18_set_move_state_pal(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)vec_b = 0; @@ -1205,7 +1205,7 @@ void hero_update_state_decider_pal(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 4, NULL) != 0) && ((f32)g_hero_l18_state_records[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l18_set_action_pal(0x28, 1); + hero_l18_set_move_state_pal(0x28, 1); break; } top = 0xE; @@ -1214,19 +1214,19 @@ void hero_update_state_decider_pal(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0x8, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l18_set_action_pal(0x2A, 1); + hero_l18_set_move_state_pal(0x2A, 1); } break; } if ((f32)g_hero_l18_state_records[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l18_set_action_pal(0x27, 1); + hero_l18_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 5) || (FLD(g_hero_state, s32, 0x6C8) >= 5)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l18_set_action_pal(0x74, 1); + hero_l18_set_move_state_pal(0x74, 1); } else { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; @@ -1235,11 +1235,11 @@ void hero_update_state_decider_pal(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 5) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l18_set_action_pal(0x27, 1); + hero_l18_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 5) && (g_current_map_index == 0x14)) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0x8) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1275,7 +1275,7 @@ void hero_update_state_decider_pal(void) { find_nearest_path_point(rail_path, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), rail_segment, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l18_set_action_pal(0x29, 1); + hero_l18_set_move_state_pal(0x29, 1); break; } } @@ -1323,7 +1323,7 @@ void hero_update_state_decider_pal(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x3A; FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; @@ -1331,7 +1331,7 @@ void hero_update_state_decider_pal(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l18_set_action_pal(0x71, 1); + hero_l18_set_move_state_pal(0x71, 1); break; } { @@ -1343,7 +1343,7 @@ void hero_update_state_decider_pal(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l18_set_action_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l18_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(0xC, 4, 5.0f); } } else if (st == 0x3E) { @@ -1352,24 +1352,24 @@ void hero_update_state_decider_pal(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)quantized_height_b, 0.5f, -1.0f); } if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s32, 0x340) != 0)) { - if (hero_l18_set_action_pal(0, 0) != 0) { + if (hero_l18_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action_pal(0x27, 1); + hero_l18_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xD) && (FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l18_set_action_pal(0x27, 1); + hero_l18_set_move_state_pal(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l18_set_action_pal(0x18, 0); + hero_l18_set_move_state_pal(0x18, 0); } break; case 0x18: @@ -1378,18 +1378,18 @@ void hero_update_state_decider_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab_pal((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 0xE, NULL) != 0) { - hero_l18_set_action_pal(0x1B, 1); + hero_l18_set_move_state_pal(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1398,7 +1398,7 @@ void hero_update_state_decider_pal(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l18_set_action_pal(0x19, 1); + hero_l18_set_move_state_pal(0x19, 1); } break; } @@ -1409,7 +1409,7 @@ void hero_update_state_decider_pal(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l18_set_action_pal(0x1A, 1); + hero_l18_set_move_state_pal(0x1A, 1); } } } @@ -1428,18 +1428,18 @@ void hero_update_state_decider_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action_pal(0x18, 1); + hero_l18_set_move_state_pal(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l18_set_action_pal(0x1B, 1); + hero_l18_set_move_state_pal(0x1B, 1); } break; } @@ -1449,9 +1449,9 @@ void hero_update_state_decider_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); } else { - hero_l18_set_action_pal(0, 1); + hero_l18_set_move_state_pal(0, 1); } } break; @@ -1475,12 +1475,12 @@ void hero_update_state_decider_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action_pal(0x39, 1); + hero_l18_set_move_state_pal(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x4B) { - if (hero_l18_set_action_pal(0, 0) != 0) { + if (hero_l18_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } if (low != 0) { @@ -1488,7 +1488,7 @@ void hero_update_state_decider_pal(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l18_set_action_pal(0, 0) != 0) { + if (hero_l18_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1502,32 +1502,32 @@ void hero_update_state_decider_pal(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l18_set_action_pal(2, 1); + hero_l18_set_move_state_pal(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.060000002f) { - if (hero_l18_set_action_pal(3, 0) != 0) { + if (hero_l18_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(6, 0, 1e+01f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.15400001f); } } else { - hero_l18_set_action_pal(0, 1); + hero_l18_set_move_state_pal(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l18_set_action_pal(8, 1); + hero_l18_set_move_state_pal(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x12) && (hero_try_start_move_from_buffer_pal((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 5, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l18_set_action_pal(0x17, 1); + hero_l18_set_move_state_pal(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action_pal(0x27, 1); + hero_l18_set_move_state_pal(0x27, 1); break; } } @@ -1559,7 +1559,7 @@ void hero_update_state_decider_pal(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l18_set_action_pal(0, 0) != 0) { + if (hero_l18_set_move_state_pal(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1569,9 +1569,9 @@ void hero_update_state_decider_pal(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l18_set_action_pal(0x74, 1); + hero_l18_set_move_state_pal(0x74, 1); } else { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); } } break; @@ -1584,16 +1584,16 @@ void hero_update_state_decider_pal(void) { ok = 1; } if (ok != 0) { - hero_l18_set_action_pal(0x11, 1); + hero_l18_set_move_state_pal(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l18_set_action_pal(0x17, 1); + hero_l18_set_move_state_pal(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1604,23 +1604,23 @@ void hero_update_state_decider_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 3)) { - if (hero_l18_set_action_pal(3, 0) != 0) { + if (hero_l18_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x1C; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action_pal(4, 1); + hero_l18_set_move_state_pal(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_l18_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l18_set_action_pal(2, 1); + hero_l18_set_move_state_pal(2, 1); break; } - hero_l18_set_action_pal(2, 0); + hero_l18_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, 2, 7.0f); @@ -1629,21 +1629,21 @@ void hero_update_state_decider_pal(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_l18_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l18_set_action_pal(2, 1); + hero_l18_set_move_state_pal(2, 1); break; } - hero_l18_set_action_pal(2, 0); + hero_l18_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, g_hero_anim_id, 1e+01f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l18_set_action_pal(0, 0) != 0) { + if (hero_l18_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_screen_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l18_set_action_pal(0, 0) != 0) { + } else if (hero_l18_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1691,14 +1691,14 @@ void hero_update_state_decider_pal(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 4, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action_pal(0xB, 1); + hero_l18_set_move_state_pal(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x11)) { - hero_l18_set_action_pal(0x82, 1); + hero_l18_set_move_state_pal(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1707,25 +1707,25 @@ void hero_update_state_decider_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 6) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f)) { - hero_l18_set_action_pal(0xA, 1); + hero_l18_set_move_state_pal(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l18_set_action_pal(0x10, 1); + hero_l18_set_move_state_pal(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action_pal(0x27, 1); + hero_l18_set_move_state_pal(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.14000002f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l18_set_action_pal(0x77, 1); + hero_l18_set_move_state_pal(0x77, 1); break; } } @@ -1829,7 +1829,7 @@ void hero_update_state_decider_pal(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l18_set_action_pal(3, 0) != 0) { + if (hero_l18_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1837,13 +1837,13 @@ void hero_update_state_decider_pal(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l18_speed_params[0][2])) { - hero_l18_set_action_pal(7, 1); + hero_l18_set_move_state_pal(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l18_set_action_pal(7, 1); + hero_l18_set_move_state_pal(7, 1); } else if (g_hero_l18_speed_params[1][1] * 0.017f < FLD(g_hero_state, f32, 0x174)) { - hero_l18_set_action_pal(9, 1); + hero_l18_set_move_state_pal(9, 1); } else { - hero_l18_set_action_pal(7, 1); + hero_l18_set_move_state_pal(7, 1); } break; } @@ -1851,10 +1851,10 @@ void hero_update_state_decider_pal(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_l00_choose_next_move_after_landing_pal(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); break; } { @@ -1864,7 +1864,7 @@ void hero_update_state_decider_pal(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x16)) && (PadPressedWithin(0x40, 6, &quantized_height_d) != 0) && (quantized_height_d < FLD(g_hero_state, s32, 0x1B8))) { - hero_l18_set_action_pal(0x11, 1); + hero_l18_set_move_state_pal(0x11, 1); break; } } @@ -1893,7 +1893,7 @@ void hero_update_state_decider_pal(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xD) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.11600001f)))) { - hero_l18_set_action_pal(0xE, 1); + hero_l18_set_move_state_pal(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1903,28 +1903,28 @@ void hero_update_state_decider_pal(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l18_set_action_pal(8, 1); + hero_l18_set_move_state_pal(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x576) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l18_set_action_pal(0x17, 1); + hero_l18_set_move_state_pal(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l18_set_action_pal(6, 1); + hero_l18_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x17) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action_pal(0x39, 1); + hero_l18_set_move_state_pal(0x39, 1); } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l18_set_action_pal(0x82, 1); + hero_l18_set_move_state_pal(0x82, 1); } else { - hero_l18_set_action_pal(0, 0); + hero_l18_set_move_state_pal(0, 0); } } break; @@ -1934,8 +1934,8 @@ void hero_update_state_decider_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x2B) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action_pal(0x39, 1); - } else if (hero_l18_set_action_pal(0, 0) != 0) { + hero_l18_set_move_state_pal(0x39, 1); + } else if (hero_l18_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_screen_id(0), 0, 11.0f); } } @@ -1952,35 +1952,35 @@ void hero_update_state_decider_pal(void) { set_hero_animation_pal(0xD, 0, 1e+01f); } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l18_set_action_pal(0x94, 1); + hero_l18_set_move_state_pal(0x94, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action_pal(1, 1); + hero_l18_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l18_set_action_pal(0x8F, 1); + hero_l18_set_move_state_pal(0x8F, 1); break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l18_set_action_pal(0x92, 1); + hero_l18_set_move_state_pal(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != 0xEE1) && (PadPressedWithin(0x80, 7, NULL) != 0)) { - hero_l18_set_action_pal(0x93, 1); + hero_l18_set_move_state_pal(0x93, 1); break; } hero_resolve_stick_direction(0, 1.0f); turned = hero_is_turned_past_angle(0.17453295f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (turned != 0)) { - hero_l18_set_action_pal(0x8E, 1); + hero_l18_set_move_state_pal(0x8E, 1); } break; } case 0x93: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l18_set_action_pal(0x94, 1); + hero_l18_set_move_state_pal(0x94, 1); } break; case 0x92: @@ -2046,20 +2046,20 @@ void hero_update_state_decider_pal(void) { after_pose: if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 3, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { hero_resolve_stick_direction(0, 1.0f); - hero_l18_set_action_pal(0x92, 1); + hero_l18_set_move_state_pal(0x92, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l18_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l18_set_action_pal(0x8E, 1); + hero_l18_set_move_state_pal(0x8E, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xB) { - hero_l18_set_action_pal(0x8D, 1); + hero_l18_set_move_state_pal(0x8D, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x22)) { - hero_l18_set_action_pal(0x8F, 1); + hero_l18_set_move_state_pal(0x8F, 1); } break; } @@ -2072,15 +2072,15 @@ void hero_update_state_decider_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action_pal(0x91, 1); + hero_l18_set_move_state_pal(0x91, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l18_set_action_pal(0x8E, 1); + hero_l18_set_move_state_pal(0x8E, 1); } else { - hero_l18_set_action_pal(0x8D, 1); + hero_l18_set_move_state_pal(0x8D, 1); } } else { - hero_l18_set_action_pal(0x8D, 1); + hero_l18_set_move_state_pal(0x8D, 1); } } break; @@ -2090,43 +2090,43 @@ void hero_update_state_decider_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l18_set_action_pal(0x8F, 1); + hero_l18_set_move_state_pal(0x8F, 1); } else { - hero_l18_set_action_pal(0x8D, 1); + hero_l18_set_move_state_pal(0x8D, 1); } } break; case 0x8E: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l18_set_action_pal(0x94, 1); + hero_l18_set_move_state_pal(0x94, 1); break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l18_set_action_pal(0x92, 1); + hero_l18_set_move_state_pal(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != 0xEE1) && (PadPressedWithin(0x80, 7, NULL) != 0)) { - hero_l18_set_action_pal(0x93, 1); + hero_l18_set_move_state_pal(0x93, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l18_set_action_pal(0x8F, 1); + hero_l18_set_move_state_pal(0x8F, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f) && (FLD(g_hero_state, s16, 0x1454) == 0)) { - hero_l18_set_action_pal(0x8D, 1); + hero_l18_set_move_state_pal(0x8D, 1); } break; case 0x90: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1B) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l18_set_action_pal(0x8F, 1); + hero_l18_set_move_state_pal(0x8F, 1); break; } if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1E)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action_pal(0x91, 1); + hero_l18_set_move_state_pal(0x91, 1); } else { - hero_l18_set_action_pal(0x8D, 0); + hero_l18_set_move_state_pal(0x8D, 0); } } break; @@ -2141,7 +2141,7 @@ void hero_update_state_decider_pal(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l18_set_action_pal(0, 0); + hero_l18_set_move_state_pal(0, 0); anim = hero_get_screen_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -2152,7 +2152,7 @@ void hero_update_state_decider_pal(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l18_set_action_pal(0, 0); + hero_l18_set_move_state_pal(0, 0); } break; case 0x22: @@ -2162,12 +2162,12 @@ void hero_update_state_decider_pal(void) { hero_choose_jump_or_roll_move_pal(); break; } - hero_l18_set_action_pal(7, 1); + hero_l18_set_move_state_pal(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l18_set_action_pal(0, 0); + hero_l18_set_move_state_pal(0, 0); } break; default: diff --git a/src/pal/levels/18_damosel/L18_003FF850.c b/src/pal/levels/18_damosel/L18_003FF850.c index 61bdddc3c..f622d3e44 100644 --- a/src/pal/levels/18_damosel/L18_003FF850.c +++ b/src/pal/levels/18_damosel/L18_003FF850.c @@ -126,7 +126,7 @@ extern void gfx_queue_draw_callback(void *, void *); extern void protopet_start_enter_anim(char *, int); extern void part_spawn_upward(char *); extern void part_spawn_spray(char *); -extern s32 hero_l18_set_action(int, int); +extern s32 hero_l18_set_move_state(int, int); /* Updates the train: it rides its rail path or follows another object, speeds up and slows down, falls when released, and plays its sounds and effects. (PAL: 50 Hz timings) */ void train_l18_update_pal(char *moby) @@ -260,7 +260,7 @@ void train_l18_update_pal(char *moby) FastVecScale(vm[1], moby + 0xC0, -g_train_push_speed_back); vm[1][2] = g_train_push_speed_back * 4.0f; vm[1][3] = 5627.9248f; - hero_l18_set_action(0, 1); + hero_l18_set_move_state(0, 1); damage = (f32)g_player_stats[0] * 30.0f; part_queue_impact_effect(target, moby, 0x10001, g_hero_state + 0x80, vm[1], damage > 100.0f ? damage : 100.0f); vars->iE0 = (g_train_timer_start * 5 + 2) / 6; diff --git a/src/pal/levels/18_damosel/L18_0044C9C0-cc-g8.c b/src/pal/levels/18_damosel/L18_0044C9C0-cc-g8.c index 69d040cb3..db0fe7397 100644 --- a/src/pal/levels/18_damosel/L18_0044C9C0-cc-g8.c +++ b/src/pal/levels/18_damosel/L18_0044C9C0-cc-g8.c @@ -66,7 +66,7 @@ extern void vec_scale_to_length(void *, void *, float); extern void make_hit_descriptor(void *, void *, int, float, void *); extern void QueueMobyImpact(void *, void *); extern int StartAttachedEffect_pal(void *, int, void *); -extern s32 hero_l18_set_action_pal(int, int); +extern s32 hero_l18_set_move_state_pal(int, int); extern void vec_clear_128(void *); extern void matrix_mul_vec3(void *, void *, void *); extern void vec_compute_object_to_target(void *, void *, void *, float); @@ -181,7 +181,7 @@ void lava_l18_gun_update_pal(u8 *obj) math_spring_float_to_goal(state + 0x50, state + 0x54, 0.0f, 0.072000004f, 0.012f, 0.15f); *(int *)(state + 0x60) = 0; } - if (g_hero_state.action == 1) hero_l18_set_action_pal(29, 1); + if (g_hero_state.action == 1) hero_l18_set_move_state_pal(29, 1); moby_transform_joint_to_world(obj, 0, state); vec_clear_128(velocity); velocity[1] = -1.0f; diff --git a/src/pal/levels/19_grelbin/L19_002B5AD8.c b/src/pal/levels/19_grelbin/L19_002B5AD8.c index 185ad8cdb..a71a3bd93 100644 --- a/src/pal/levels/19_grelbin/L19_002B5AD8.c +++ b/src/pal/levels/19_grelbin/L19_002B5AD8.c @@ -63,7 +63,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l19_set_state_pal(s32, s32); +extern s32 hero_l19_set_move_state_pal(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_pal(s32); extern int hero_play_sound(s32, s32); @@ -149,7 +149,7 @@ s32 hero_l19_apply_contact_push_pal(s32 apply) { case 0: other = g_hero_state.unk_249c; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB || *(s16 *)(other + 0xAA) == 0x558)) { - hero_l19_set_state_pal(0x7D, 1); + hero_l19_set_move_state_pal(0x7D, 1); return 1; } if ((g_hero_state.unk_2294 == 1 || g_hero_state.unk_2294 == 0x1D || g_hero_state.unk_1500 != 0) @@ -160,7 +160,7 @@ s32 hero_l19_apply_contact_push_pal(s32 apply) { AdjustPlayerHealth_pal(FloatToInt(*(float *)(effect_slot + 0x2C))); } if (g_hero_state.unk_24cc == 0) { - hero_l19_set_state_pal(0x16, 1); + hero_l19_set_move_state_pal(0x16, 1); } g_hero_state.unk_1dc = 0x40; if (g_hero_state.unk_21c == 0) { @@ -170,13 +170,13 @@ s32 hero_l19_apply_contact_push_pal(s32 apply) { return 0; } if (g_hero_state.unk_229c == 0x12) { - hero_l19_set_state_pal(0x72, 1); + hero_l19_set_move_state_pal(0x72, 1); } else if (g_hero_state.unk_229c == 0x11) { - hero_l19_set_state_pal(0x73, 1); + hero_l19_set_move_state_pal(0x73, 1); } else if (entry->unk_24 & 8) { - hero_l19_set_state_pal(0x8C, 1); + hero_l19_set_move_state_pal(0x8C, 1); } else { - hero_l19_set_state_pal(0x16, 1); + hero_l19_set_move_state_pal(0x16, 1); } if (g_hero_state.unk_2294 == 0x8C) { qzero(&vec); @@ -188,7 +188,7 @@ s32 hero_l19_apply_contact_push_pal(s32 apply) { } break; case 4: - hero_l19_set_state_pal(0x90, 1); + hero_l19_set_move_state_pal(0x90, 1); hero_flatten_push_vector(&vec, flag, 0.10000001f, 0.060000002f); break; } diff --git a/src/pal/levels/19_grelbin/L19_002BC990-hero.c b/src/pal/levels/19_grelbin/L19_002BC990-hero.c index 19bfbc0fa..d172a9832 100644 --- a/src/pal/levels/19_grelbin/L19_002BC990-hero.c +++ b/src/pal/levels/19_grelbin/L19_002BC990-hero.c @@ -141,7 +141,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -156,7 +156,7 @@ extern s32 shooter_update_ranged_attack_pal(s32); extern s32 hero_get_anim_id(s32); extern void hero_detach_from_object_pal(s32); extern void ClipHeroVelocityAtWall_pal(s32); -extern s32 hero_l19_set_state_pal(s32, s32); +extern s32 hero_l19_set_move_state_pal(s32, s32); extern char g_impact_effect_data[] MACRO_ADDR; extern void moby_l00_raise_state_to_8(); extern void moby_raise_state_to_eight_copy(); @@ -695,7 +695,7 @@ void hero_l19_update_state_machine_pal(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { int_val_21 = ((Hero *)g_hero_state)->i[0x2440/4]; if (int_val_21 != -1) { @@ -1417,7 +1417,7 @@ void hero_l19_update_state_machine_pal(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x2a; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l19_state_block)->f[0x180/4] = 0.1f; @@ -2424,7 +2424,7 @@ void hero_l19_update_state_machine_pal(void) { } hero_try_surface_push_response(3.7f, 0.0f, 0.35f); if (shooter_update_ranged_attack_pal((s32) ptr_val_21) != 0) { - hero_l19_set_state_pal(0x8D, 1); + hero_l19_set_move_state_pal(0x8D, 1); } } break; diff --git a/src/pal/levels/19_grelbin/L19_002BC990-sw.c b/src/pal/levels/19_grelbin/L19_002BC990-sw.c index e779c193a..461d4c585 100644 --- a/src/pal/levels/19_grelbin/L19_002BC990-sw.c +++ b/src/pal/levels/19_grelbin/L19_002BC990-sw.c @@ -70,7 +70,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed_pal(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction_pal(void); -s32 hero_l19_set_state_pal(s32, s32); +s32 hero_l19_set_move_state_pal(s32, s32); void snd_start_mode_sound(s32 a0); s32 hero_try_start_transition_pal(void); s32 hero_try_start_ledge_move(void); @@ -147,7 +147,7 @@ void hero_l19_decide_state_transition_pal(void) { UpdateHeroHeldTarget_pal(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l19_set_state_pal(0x39, 1); + hero_l19_set_move_state_pal(0x39, 1); goto end; } } @@ -177,15 +177,15 @@ void hero_l19_decide_state_transition_pal(void) { if (FLD(g_hero_state, f32, 0x88) < g_mover_current_value) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { if (FLD(g_hero_state, u8, 0x22B4) == 4) { - hero_l19_set_state_pal(0x91, 1); + hero_l19_set_move_state_pal(0x91, 1); goto end; } - hero_l19_set_state_pal(0x74, 1); + hero_l19_set_move_state_pal(0x74, 1); goto end; } } if ((FLD(g_hero_state, u8, 0x22B4) == 4) && (FLD(g_hero_state, f32, 0x88) < FLD(FLD(FLD(g_hero_state, void *, 0x2290), void *, 0x68), f32, 0x3EC))) { - hero_l19_set_state_pal(0x91, 1); + hero_l19_set_move_state_pal(0x91, 1); } switch (FLD(g_hero_state, u32, 0x2294)) { case 0x0: @@ -193,12 +193,12 @@ void hero_l19_decide_state_transition_pal(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state_pal(1, 1); + hero_l19_set_move_state_pal(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l19_set_state_pal(0x82, 1); + hero_l19_set_move_state_pal(0x82, 1); break; } { @@ -234,7 +234,7 @@ void hero_l19_decide_state_transition_pal(void) { rec = g_hero_l19_slot_records + stack_40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 5e+01f; if (FLD(rec, s32, 0x44) != 0) { - hero_l19_set_state_pal(0x3C, 1); + hero_l19_set_move_state_pal(0x3C, 1); } else { set_hero_animation_pal(FLD(rec, s32, 0x48), 0, 1e+01f); } @@ -277,12 +277,12 @@ void hero_l19_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l19_set_state_pal(0x76, 1); + hero_l19_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); } break; } @@ -303,12 +303,12 @@ void hero_l19_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_aim_block_flag == 0) && (PadPressedWithin(0x40, 6, NULL) != 0)) { - hero_l19_set_state_pal(0x6E, 1); + hero_l19_set_move_state_pal(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l19_set_state_pal(4, 1); + hero_l19_set_move_state_pal(4, 1); break; } } @@ -329,28 +329,28 @@ void hero_l19_decide_state_transition_pal(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust_pal(side, 0, 0, 0x1E); hero_play_footstep_sound_dust_pal(side, 1, 0, 0x1E); - hero_l19_set_state_pal(2, 1); + hero_l19_set_move_state_pal(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state_pal(1, 1); + hero_l19_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l19_set_state_pal(0x3D, 1); + hero_l19_set_move_state_pal(0x3D, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l19_set_state_pal(0x3D, 1); + hero_l19_set_move_state_pal(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l19_set_state_pal(0, 1); + hero_l19_set_move_state_pal(0, 1); } break; case 0x3D: @@ -359,22 +359,22 @@ void hero_l19_decide_state_transition_pal(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); break; } if (hero_try_start_move_from_buffer_pal(6, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state_pal(4, 1); + hero_l19_set_move_state_pal(4, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l19_set_state_pal(2, 1); + hero_l19_set_move_state_pal(2, 1); break; } - hero_l19_set_state_pal(0, 1); + hero_l19_set_move_state_pal(0, 1); break; case 0x39: case 0x43: @@ -413,25 +413,25 @@ void hero_l19_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.040000003f)) { - hero_l19_set_state_pal(0x33, 1); + hero_l19_set_move_state_pal(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12)) { - hero_l19_set_state_pal(0x34, 1); + hero_l19_set_move_state_pal(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l19_set_state_pal(0x32, 1); + hero_l19_set_move_state_pal(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l19_set_state_pal(0x33, 1); + hero_l19_set_move_state_pal(0x33, 1); } } break; @@ -444,81 +444,81 @@ void hero_l19_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l19_set_state_pal(0x32, 1); + hero_l19_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l19_set_state_pal(0x34, 1); + hero_l19_set_move_state_pal(0x34, 1); } else { - hero_l19_set_state_pal(0x32, 1); + hero_l19_set_move_state_pal(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l19_set_state_pal(0x12, 1); + hero_l19_set_move_state_pal(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 6, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 6, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l19_set_state_pal(0x32, 1); + hero_l19_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l19_set_state_pal(0x34, 1); + hero_l19_set_move_state_pal(0x34, 1); } else { - hero_l19_set_state_pal(0x32, 1); + hero_l19_set_move_state_pal(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l19_set_state_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l19_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_anim_id(0), 0, 15.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l19_set_state_pal(0x35, 1); + hero_l19_set_move_state_pal(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l19_set_state_pal(0x12, 1); + hero_l19_set_move_state_pal(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 6, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l19_set_state_pal(0x32, 1); + hero_l19_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l19_set_state_pal(0x34, 1); + hero_l19_set_move_state_pal(0x34, 1); } else { - hero_l19_set_state_pal(0x32, 1); + hero_l19_set_move_state_pal(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l19_set_state_pal(0x70, 0); + hero_l19_set_move_state_pal(0x70, 0); set_hero_animation_pal(0x59, 0, 14.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l19_set_state_pal(0x36, 1); + hero_l19_set_move_state_pal(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state_pal(0x67, 1); + hero_l19_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x28, 15.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state_pal(0x33, 1); + hero_l19_set_move_state_pal(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l19_set_state_pal(0x33, 0); + hero_l19_set_move_state_pal(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state_pal(0x67, 1); + hero_l19_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x25, 15.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l19_set_state_pal(0x36, 0); + hero_l19_set_move_state_pal(0x36, 0); } break; case 0x1: @@ -552,9 +552,9 @@ void hero_l19_decide_state_transition_pal(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { snd_start_mode_sound(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state_pal(4, 1); + hero_l19_set_move_state_pal(4, 1); } else { - hero_l19_set_state_pal(0, 0); + hero_l19_set_move_state_pal(0, 0); anim = hero_get_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -566,9 +566,9 @@ void hero_l19_decide_state_transition_pal(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l19_set_state_pal(0, 0); + hero_l19_set_move_state_pal(0, 0); } else { - hero_l19_set_state_pal(0, 1); + hero_l19_set_move_state_pal(0, 1); } } break; @@ -601,7 +601,7 @@ void hero_l19_decide_state_transition_pal(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state_pal(7, 1); + hero_l19_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -610,7 +610,7 @@ void hero_l19_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l19_set_state_pal(0, 0); + hero_l19_set_move_state_pal(0, 0); } break; } @@ -632,7 +632,7 @@ void hero_l19_decide_state_transition_pal(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state_pal(7, 1); + hero_l19_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -645,7 +645,7 @@ void hero_l19_decide_state_transition_pal(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l19_set_state_pal(2, 0); + hero_l19_set_move_state_pal(2, 0); set_hero_animation_pal(3, g_hero_l19_animation_ids[FLD(g_hero_state, s32, 0x2298)], 11.0f); break; } @@ -656,22 +656,22 @@ void hero_l19_decide_state_transition_pal(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l19_set_state_pal(2, 1); + hero_l19_set_move_state_pal(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l19_set_state_pal(0, 0); + hero_l19_set_move_state_pal(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state_pal(0, 0); + hero_l19_set_move_state_pal(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l19_set_state_pal(0, 1); + hero_l19_set_move_state_pal(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x54) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -688,7 +688,7 @@ void hero_l19_decide_state_transition_pal(void) { } if (PadPressedWithin(0x40, 6, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state_pal(7, 1); + hero_l19_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -697,7 +697,7 @@ void hero_l19_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l19_set_state_pal(0, 0); + hero_l19_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_anim_id(0), 0, 12.0f); break; } @@ -709,7 +709,7 @@ void hero_l19_decide_state_transition_pal(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state_pal(0, 1); + hero_l19_set_move_state_pal(0, 1); } break; case 0x2: @@ -723,11 +723,11 @@ void hero_l19_decide_state_transition_pal(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l19_set_state_pal(0x76, 1); + hero_l19_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead_pal() == 0)) { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); break; } n = 7; @@ -741,12 +741,12 @@ void hero_l19_decide_state_transition_pal(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l19_set_state_pal(9, 1); + hero_l19_set_move_state_pal(9, 1); } else { - hero_l19_set_state_pal(7, 1); + hero_l19_set_move_state_pal(7, 1); } } else { - hero_l19_set_state_pal(7, 1); + hero_l19_set_move_state_pal(7, 1); } break; } @@ -754,21 +754,21 @@ void hero_l19_decide_state_transition_pal(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.040000003f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state_pal(1, 1); + hero_l19_set_move_state_pal(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state_pal(4, 1); + hero_l19_set_move_state_pal(4, 1); break; } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l19_set_state_pal(0x70, 1); + hero_l19_set_move_state_pal(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l19_set_state_pal(2, 1); + hero_l19_set_move_state_pal(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -779,7 +779,7 @@ void hero_l19_decide_state_transition_pal(void) { if (hero_try_start_grab_pal() != 0) { break; } - if (hero_l19_set_state_pal(0, 0) == 0) { + if (hero_l19_set_move_state_pal(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.030000001f); @@ -796,7 +796,7 @@ void hero_l19_decide_state_transition_pal(void) { hero_update_anim_scale_pal(); } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l19_set_state_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l19_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_anim_id(0), 0, 14.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 29.166668f; @@ -830,17 +830,17 @@ void hero_l19_decide_state_transition_pal(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x19; - hero_l19_set_state_pal(3, 0); + hero_l19_set_move_state_pal(3, 0); set_hero_animation_pal(6, 4, 9.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l19_set_state_pal(0x77, 1); + hero_l19_set_move_state_pal(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l19_set_state_pal(0x77, 1); + hero_l19_set_move_state_pal(0x77, 1); break; } } @@ -858,11 +858,11 @@ void hero_l19_decide_state_transition_pal(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.054000005f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l19_set_state_pal(0x64, 1); + hero_l19_set_move_state_pal(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.054000005f)) { - hero_l19_set_state_pal(0x63, 1); + hero_l19_set_move_state_pal(0x63, 1); } } else { hero_update_anim_scale_pal(); @@ -870,15 +870,15 @@ void hero_l19_decide_state_transition_pal(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state_pal(0x62, 1); + hero_l19_set_move_state_pal(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l19_set_state_pal(0, 1); + hero_l19_set_move_state_pal(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l19_set_state_pal(0x62, 1); + hero_l19_set_move_state_pal(0x62, 1); } break; case 0x79: @@ -893,25 +893,25 @@ void hero_l19_decide_state_transition_pal(void) { return; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state_pal(1, 1); + hero_l19_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l19_set_state_pal(7, 1); + hero_l19_set_move_state_pal(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state_pal(4, 1); + hero_l19_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 8) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state_pal(0, 1); + hero_l19_set_move_state_pal(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -919,45 +919,45 @@ void hero_l19_decide_state_transition_pal(void) { } if (hero_get_anim_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l19_set_state_pal(0, 0); + hero_l19_set_move_state_pal(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l19_set_state_pal(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l19_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_anim_id(0), 0, 14.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l19_set_state_pal(2, 1); + hero_l19_set_move_state_pal(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state_pal(1, 1); + hero_l19_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xA) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state_pal(0, 0); + hero_l19_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_anim_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l19_set_state_pal(0x76, 1); + hero_l19_set_move_state_pal(0x76, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { break; } if ((PadPressedWithin(0x80, 0xC, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l19_set_state_pal(0x15, 1); + hero_l19_set_move_state_pal(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 8) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l19_set_state_pal(0, 1); + hero_l19_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -965,17 +965,17 @@ void hero_l19_decide_state_transition_pal(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l19_set_state_pal(0x8B, 1); + hero_l19_set_move_state_pal(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x4C) { - hero_l19_set_state_pal(0, 1); + hero_l19_set_move_state_pal(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l19_set_state_pal(0, 1); + hero_l19_set_move_state_pal(0, 1); } break; case 0x24: @@ -1001,14 +1001,14 @@ void hero_l19_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l19_set_state_pal(0, 0); + hero_l19_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_anim_id(0), 0, 25.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l19_set_state_pal(6, 0); + hero_l19_set_move_state_pal(6, 0); } else { - hero_l19_set_state_pal(6, 0); + hero_l19_set_move_state_pal(6, 0); set_hero_animation_pal(0xA, 0, 14.0f); } FLD(g_hero_state, f32, 0xA84) = 0.016800001f; @@ -1024,9 +1024,9 @@ void hero_l19_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l19_set_state_pal(0, 1); + hero_l19_set_move_state_pal(0, 1); } else { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1038,7 +1038,7 @@ void hero_l19_decide_state_transition_pal(void) { if (t < 0x21) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l19_set_state_pal(0x2C, 1); + hero_l19_set_move_state_pal(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0028000001f; FLD(g_hero_state, f32, 0xA80) = 0.0108f; } @@ -1046,7 +1046,7 @@ void hero_l19_decide_state_transition_pal(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l19_set_state_pal(0x18, 0); + hero_l19_set_move_state_pal(0x18, 0); } break; case 0x18: @@ -1055,18 +1055,18 @@ void hero_l19_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab_pal((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 0xE, NULL) != 0) { - hero_l19_set_state_pal(0x1B, 1); + hero_l19_set_move_state_pal(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1075,7 +1075,7 @@ void hero_l19_decide_state_transition_pal(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l19_set_state_pal(0x19, 1); + hero_l19_set_move_state_pal(0x19, 1); } break; } @@ -1086,7 +1086,7 @@ void hero_l19_decide_state_transition_pal(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l19_set_state_pal(0x1A, 1); + hero_l19_set_move_state_pal(0x1A, 1); } } } @@ -1105,18 +1105,18 @@ void hero_l19_decide_state_transition_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state_pal(0x18, 1); + hero_l19_set_move_state_pal(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l19_set_state_pal(0x1B, 1); + hero_l19_set_move_state_pal(0x1B, 1); } break; } @@ -1126,9 +1126,9 @@ void hero_l19_decide_state_transition_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); } else { - hero_l19_set_state_pal(0, 1); + hero_l19_set_move_state_pal(0, 1); } } break; @@ -1152,12 +1152,12 @@ void hero_l19_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state_pal(0x39, 1); + hero_l19_set_move_state_pal(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x4B) { - if (hero_l19_set_state_pal(0, 0) != 0) { + if (hero_l19_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } if (low != 0) { @@ -1165,7 +1165,7 @@ void hero_l19_decide_state_transition_pal(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l19_set_state_pal(0, 0) != 0) { + if (hero_l19_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1179,28 +1179,28 @@ void hero_l19_decide_state_transition_pal(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l19_set_state_pal(2, 1); + hero_l19_set_move_state_pal(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.060000002f) { - if (hero_l19_set_state_pal(3, 0) != 0) { + if (hero_l19_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(6, 0, 1e+01f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.15400001f); } } else { - hero_l19_set_state_pal(0, 1); + hero_l19_set_move_state_pal(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l19_set_state_pal(8, 1); + hero_l19_set_move_state_pal(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x12) && (hero_try_start_move_from_buffer_pal((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 5, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l19_set_state_pal(0x17, 1); + hero_l19_set_move_state_pal(0x17, 1); break; } } @@ -1232,7 +1232,7 @@ void hero_l19_decide_state_transition_pal(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l19_set_state_pal(0, 0) != 0) { + if (hero_l19_set_move_state_pal(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1243,12 +1243,12 @@ void hero_l19_decide_state_transition_pal(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l19_set_state_pal(0x74, 1); + hero_l19_set_move_state_pal(0x74, 1); } else { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); } } else { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); } } break; @@ -1261,16 +1261,16 @@ void hero_l19_decide_state_transition_pal(void) { ok = 1; } if (ok != 0) { - hero_l19_set_state_pal(0x11, 1); + hero_l19_set_move_state_pal(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l19_set_state_pal(0x17, 1); + hero_l19_set_move_state_pal(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1281,23 +1281,23 @@ void hero_l19_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 3)) { - if (hero_l19_set_state_pal(3, 0) != 0) { + if (hero_l19_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x1C; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state_pal(4, 1); + hero_l19_set_move_state_pal(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_limits[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l19_set_state_pal(2, 1); + hero_l19_set_move_state_pal(2, 1); break; } - hero_l19_set_state_pal(2, 0); + hero_l19_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, 2, 7.0f); @@ -1306,21 +1306,21 @@ void hero_l19_decide_state_transition_pal(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_limits[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l19_set_state_pal(2, 1); + hero_l19_set_move_state_pal(2, 1); break; } - hero_l19_set_state_pal(2, 0); + hero_l19_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, g_hero_l19_animation_id_extra, 1e+01f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l19_set_state_pal(0, 0) != 0) { + if (hero_l19_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_anim_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l19_set_state_pal(0, 0) != 0) { + } else if (hero_l19_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1366,14 +1366,14 @@ void hero_l19_decide_state_transition_pal(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 4, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state_pal(0xB, 1); + hero_l19_set_move_state_pal(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x11)) { - hero_l19_set_state_pal(0x82, 1); + hero_l19_set_move_state_pal(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1382,21 +1382,21 @@ void hero_l19_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 6) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f)) { - hero_l19_set_state_pal(0xA, 1); + hero_l19_set_move_state_pal(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l19_set_state_pal(0x10, 1); + hero_l19_set_move_state_pal(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.14000002f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l19_set_state_pal(0x77, 1); + hero_l19_set_move_state_pal(0x77, 1); break; } } @@ -1500,7 +1500,7 @@ void hero_l19_decide_state_transition_pal(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l19_set_state_pal(3, 0) != 0) { + if (hero_l19_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1508,13 +1508,13 @@ void hero_l19_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_limits[0][2])) { - hero_l19_set_state_pal(7, 1); + hero_l19_set_move_state_pal(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l19_set_state_pal(7, 1); + hero_l19_set_move_state_pal(7, 1); } else if (g_hero_speed_limits[1][1] * 0.017f < FLD(g_hero_state, f32, 0x174)) { - hero_l19_set_state_pal(9, 1); + hero_l19_set_move_state_pal(9, 1); } else { - hero_l19_set_state_pal(7, 1); + hero_l19_set_move_state_pal(7, 1); } break; } @@ -1522,10 +1522,10 @@ void hero_l19_decide_state_transition_pal(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_l01_choose_next_move_after_landing_pal(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); break; } { @@ -1535,7 +1535,7 @@ void hero_l19_decide_state_transition_pal(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x16)) && (PadPressedWithin(0x40, 6, &stack_6c) != 0) && (stack_6c < FLD(g_hero_state, s32, 0x1B8))) { - hero_l19_set_state_pal(0x11, 1); + hero_l19_set_move_state_pal(0x11, 1); break; } } @@ -1564,7 +1564,7 @@ void hero_l19_decide_state_transition_pal(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xD) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.11600001f)))) { - hero_l19_set_state_pal(0xE, 1); + hero_l19_set_move_state_pal(0xE, 1); } else if ((g_hero_item_flags[29] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1574,32 +1574,32 @@ void hero_l19_decide_state_transition_pal(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l19_set_state_pal(8, 1); + hero_l19_set_move_state_pal(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l19_set_state_pal(0x17, 1); + hero_l19_set_move_state_pal(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l19_set_state_pal(6, 1); + hero_l19_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x17) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l19_set_state_pal(0x79, 1); + hero_l19_set_move_state_pal(0x79, 1); } else { - hero_l19_set_state_pal(0x39, 1); + hero_l19_set_move_state_pal(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l19_set_state_pal(0x82, 1); + hero_l19_set_move_state_pal(0x82, 1); } else { - hero_l19_set_state_pal(0, 0); + hero_l19_set_move_state_pal(0, 0); } } break; @@ -1609,8 +1609,8 @@ void hero_l19_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x2B) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state_pal(0x39, 1); - } else if (hero_l19_set_state_pal(0, 0) != 0) { + hero_l19_set_move_state_pal(0x39, 1); + } else if (hero_l19_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_anim_id(0), 0, 11.0f); } } @@ -1627,35 +1627,35 @@ void hero_l19_decide_state_transition_pal(void) { set_hero_animation_pal(0xD, 0, 1e+01f); } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l19_set_state_pal(0x94, 1); + hero_l19_set_move_state_pal(0x94, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state_pal(1, 1); + hero_l19_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l19_set_state_pal(0x8F, 1); + hero_l19_set_move_state_pal(0x8F, 1); break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l19_set_state_pal(0x92, 1); + hero_l19_set_move_state_pal(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != 0xEE1) && (PadPressedWithin(0x80, 7, NULL) != 0)) { - hero_l19_set_state_pal(0x93, 1); + hero_l19_set_move_state_pal(0x93, 1); break; } hero_resolve_stick_direction(0, 1.0f); turned = hero_is_turned_past_angle(0.17453295f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (turned != 0)) { - hero_l19_set_state_pal(0x8E, 1); + hero_l19_set_move_state_pal(0x8E, 1); } break; } case 0x93: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l19_set_state_pal(0x94, 1); + hero_l19_set_move_state_pal(0x94, 1); } break; case 0x92: @@ -1721,20 +1721,20 @@ void hero_l19_decide_state_transition_pal(void) { after_pose: if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 3, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { hero_resolve_stick_direction(0, 1.0f); - hero_l19_set_state_pal(0x92, 1); + hero_l19_set_move_state_pal(0x92, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_limits[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l19_set_state_pal(0x8E, 1); + hero_l19_set_move_state_pal(0x8E, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xB) { - hero_l19_set_state_pal(0x8D, 1); + hero_l19_set_move_state_pal(0x8D, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x22)) { - hero_l19_set_state_pal(0x8F, 1); + hero_l19_set_move_state_pal(0x8F, 1); } break; } @@ -1747,15 +1747,15 @@ void hero_l19_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state_pal(0x91, 1); + hero_l19_set_move_state_pal(0x91, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l19_set_state_pal(0x8E, 1); + hero_l19_set_move_state_pal(0x8E, 1); } else { - hero_l19_set_state_pal(0x8D, 1); + hero_l19_set_move_state_pal(0x8D, 1); } } else { - hero_l19_set_state_pal(0x8D, 1); + hero_l19_set_move_state_pal(0x8D, 1); } } break; @@ -1765,43 +1765,43 @@ void hero_l19_decide_state_transition_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l19_set_state_pal(0x8F, 1); + hero_l19_set_move_state_pal(0x8F, 1); } else { - hero_l19_set_state_pal(0x8D, 1); + hero_l19_set_move_state_pal(0x8D, 1); } } break; case 0x8E: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l19_set_state_pal(0x94, 1); + hero_l19_set_move_state_pal(0x94, 1); break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l19_set_state_pal(0x92, 1); + hero_l19_set_move_state_pal(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != 0xEE1) && (PadPressedWithin(0x80, 7, NULL) != 0)) { - hero_l19_set_state_pal(0x93, 1); + hero_l19_set_move_state_pal(0x93, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l19_set_state_pal(0x8F, 1); + hero_l19_set_move_state_pal(0x8F, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f) && (FLD(g_hero_state, s16, 0x1454) == 0)) { - hero_l19_set_state_pal(0x8D, 1); + hero_l19_set_move_state_pal(0x8D, 1); } break; case 0x90: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1B) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l19_set_state_pal(0x8F, 1); + hero_l19_set_move_state_pal(0x8F, 1); break; } if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1E)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state_pal(0x91, 1); + hero_l19_set_move_state_pal(0x91, 1); } else { - hero_l19_set_state_pal(0x8D, 0); + hero_l19_set_move_state_pal(0x8D, 0); } } break; @@ -1816,7 +1816,7 @@ void hero_l19_decide_state_transition_pal(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l19_set_state_pal(0, 0); + hero_l19_set_move_state_pal(0, 0); anim = hero_get_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -1827,7 +1827,7 @@ void hero_l19_decide_state_transition_pal(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l19_set_state_pal(0, 0); + hero_l19_set_move_state_pal(0, 0); } break; case 0x22: @@ -1837,12 +1837,12 @@ void hero_l19_decide_state_transition_pal(void) { hero_choose_jump_or_roll_move_pal(); break; } - hero_l19_set_state_pal(7, 1); + hero_l19_set_move_state_pal(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l19_set_state_pal(0, 0); + hero_l19_set_move_state_pal(0, 0); } break; default: diff --git a/src/pal/levels/19_grelbin/L19_002BC990-sw2.c b/src/pal/levels/19_grelbin/L19_002BC990-sw2.c index 469d0a92a..37f976930 100644 --- a/src/pal/levels/19_grelbin/L19_002BC990-sw2.c +++ b/src/pal/levels/19_grelbin/L19_002BC990-sw2.c @@ -56,8 +56,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -127,7 +127,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l19_set_state_pal(s32 action, s32 animate) { +s32 hero_l19_set_move_state_pal(s32 action, s32 animate) { u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 old_step; @@ -174,7 +174,9 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -187,7 +189,7 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { snd_start_mode_sound(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_anim_id(0) == 0x51) set_hero_animation_pal(hero_get_anim_id(0), 0, 15.0f); else set_hero_animation_pal(hero_get_anim_id(0), 0, -1.0f); @@ -336,7 +338,7 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l19_set_state_pal(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l19_set_move_state_pal(0x76, 1); return 0; } } if (BYTE(0x22B9) || WORD(0x2294) == 0x70) { WORD(0x2294) = 0x70; set_hero_animation_pal(0x59, 0, 7.0f); goto finish; @@ -369,11 +371,11 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state_pal(0x76, 1); return 0; } if (hero_try_start_grab_pal()) return 0; if (hero_get_anim_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l19_set_state_pal(0, 0)) set_hero_animation_pal(hero_get_anim_id(0), 0, 15.0f); + if (hero_l19_set_move_state_pal(0, 0)) set_hero_animation_pal(hero_get_anim_id(0), 0, 15.0f); return 0; } if (!animate) goto finish; @@ -398,7 +400,7 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.14000002f) REAL(0x1B4) = 0.14000002f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.14000002f); @@ -542,13 +544,13 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { case 0x45: case 0x48: case 0x5B: case 0x66: case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l19_set_state_pal(0x81, 1); return 0; + hero_l19_set_move_state_pal(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_aim_block_flag) { hero_l19_set_state_pal(0x6E, 1); return 0; } + action != 0x38 && !g_hero_aim_block_flag) { hero_l19_set_move_state_pal(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l19_set_state_pal(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l19_set_move_state_pal(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -622,9 +624,9 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_l19_special_state_flag) { hero_l19_set_state_pal(0x7D, 1); return 0; } - if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l19_set_state_pal(0x79, 1); - else hero_l19_set_state_pal(0x39, 1); + if (g_current_map_index == 2 && g_hero_l19_special_state_flag) { hero_l19_set_move_state_pal(0x7D, 1); return 0; } + if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l19_set_move_state_pal(0x79, 1); + else hero_l19_set_move_state_pal(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -664,7 +666,7 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -690,7 +692,7 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -699,7 +701,7 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4B8) = 0.6f; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -832,7 +834,7 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -891,7 +893,7 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -903,7 +905,7 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); @@ -919,7 +921,7 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { set_hero_animation_pal(0x6A, 0, 7.0f); goto finish; case 0x8D: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state_pal(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state_pal(0x94, 1); return 0; } if (!animate) goto finish; set_hero_animation_pal(13, 0, 7.0f); goto finish; case 0x8F: @@ -940,7 +942,7 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l19_float_sequences[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x8E: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state_pal(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state_pal(0x94, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); BYTE(0x40C) = 0; BYTE(0x40F) = 0; if (WORD(0x22A4) == 0) REAL(0x1B4) = vec_length_xy(VEC(0x160)); @@ -969,7 +971,7 @@ s32 hero_l19_set_state_pal(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.09f; if (WORD(0x640) > 12 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l19_set_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; + PTR(0x2290)[0xA8] = 255; hero_l19_set_move_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; return 0; } HALF(0x1DC) = 64; REAL(0x69C) = 0.050000004f; diff --git a/src/pal/levels/20_yeedil/L20_002B9270-g8.c b/src/pal/levels/20_yeedil/L20_002B9270-g8.c index dbe75366f..bb72234df 100644 --- a/src/pal/levels/20_yeedil/L20_002B9270-g8.c +++ b/src/pal/levels/20_yeedil/L20_002B9270-g8.c @@ -28,7 +28,7 @@ extern void hero_process_action_command(void); extern int hero_find_ledge_grab_pal(char *, char *, char *); extern void UpdateHeroMotionResponseParameters_pal(void); extern s32 FastDecTimer(s32); -extern s32 hero_l20_set_state_pal(s32, s32); +extern s32 hero_l20_set_move_state_pal(s32, s32); extern s32 subtitle_request_voice_line_pal(s32, s32); extern void hero_l20_decide_state_transition(void); extern void RebuildRegionObjectMembership(void); @@ -71,7 +71,7 @@ void hero_l20_update_frame_pal(void) if (*(int *)(base + 0x2294) != 0x6F) { if (FastDecTimer(*(int *)(*(int *)(base + 0x2290) + 0x68) + 0x3BC) != 0) { *(int *)(base + 0x24CC) = 0; - hero_l20_set_state_pal(0x91, 1); + hero_l20_set_move_state_pal(0x91, 1); } if (g_current_map_index == 0x14) { if (g_hero_frame_flag == 0) { diff --git a/src/pal/levels/20_yeedil/L20_002B9270.c b/src/pal/levels/20_yeedil/L20_002B9270.c index 1bb6f6b5b..7a4278160 100644 --- a/src/pal/levels/20_yeedil/L20_002B9270.c +++ b/src/pal/levels/20_yeedil/L20_002B9270.c @@ -17,7 +17,7 @@ extern void attachment_reset_all(void); extern int level_run_slot_callback(s32); extern void hero_clear_queued_anim(void); extern void func_002A677C(s32); -extern s32 hero_l20_set_state_pal(s32, s32); +extern s32 hero_l20_set_move_state_pal(s32, s32); extern void set_hero_animation_pal(f32, s32, s32); extern s32 g_pad_pressed_flags[]; extern void UpdateYeedilHeroCollisionCapsule_pal(void); @@ -82,7 +82,7 @@ void SetYeedilHeroVehicleMode_pal(s32 new_mode_arg, s32 animation_arg, char *att *(u16 *)(hero + 0x24D4) = *(u16 *)(hero + 0x24CC); *(s32 *)(hero + 0x24CC) = 3; } - hero_l20_set_state_pal(animation, 2); + hero_l20_set_move_state_pal(animation, 2); if (new_mode == 4) set_hero_animation_pal(4.0f, 0xF, 0); } diff --git a/src/pal/levels/20_yeedil/L20_002C59B0-qcopy.c b/src/pal/levels/20_yeedil/L20_002C59B0-qcopy.c index e00f4042f..140b593e7 100644 --- a/src/pal/levels/20_yeedil/L20_002C59B0-qcopy.c +++ b/src/pal/levels/20_yeedil/L20_002C59B0-qcopy.c @@ -18,7 +18,7 @@ extern void hero_clear_tracked_slots(void); extern void hero_clear_queued_anim(void); extern s32 anim_copy_entry_data(char *, s32, s32, s32); extern void cam_reset_default(void); -extern s32 hero_l20_set_state_pal(s32, s32); +extern s32 hero_l20_set_move_state_pal(s32, s32); /* Apart from the leading state-1 block this is the same code as func_L18_002CFF48 (src/levels/shared/L18_002CFD68-qcopy.c), and it needs the same grouped-copy profile. @@ -94,7 +94,7 @@ void hero_exit_vehicle_mode_pal(s32 keep) goto done; } reset: - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); done: if (g_hero_state[0x22B4] == 4) cam_reset_default(); } diff --git a/src/pal/levels/20_yeedil/L20_002C5C68-hero.c b/src/pal/levels/20_yeedil/L20_002C5C68-hero.c index 3bae2162c..e25473a5d 100644 --- a/src/pal/levels/20_yeedil/L20_002C5C68-hero.c +++ b/src/pal/levels/20_yeedil/L20_002C5C68-hero.c @@ -154,7 +154,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -173,7 +173,7 @@ extern s32 shooter_update_ranged_attack_pal(s32); extern s32 SelectHeroStateAnimation(s32); extern void hero_exit_vehicle_mode_pal(s32); extern void hero_slide_along_wall_pal(s32); -extern s32 hero_l20_set_state_pal(s32, s32); +extern s32 hero_l20_set_move_state_pal(s32, s32); extern s32 g_hero_sound_flag_4; extern char g_impact_effect_data[] MACRO_ADDR; extern void moby_l00_raise_state_to_8(); @@ -721,7 +721,7 @@ void hero_l20_update_state_machine_pal(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { ival_21 = ((Hero *)g_hero_state)->i[0x2440/4]; if (ival_21 != -1) { @@ -1464,7 +1464,7 @@ void hero_l20_update_state_machine_pal(void) { coll_process_hit(0.4f, (s32)((TI128*)vec_00), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec_10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x2a; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l20_extra_state)->f[0x180/4] = 0.1f; @@ -3125,7 +3125,7 @@ void hero_l20_update_state_machine_pal(void) { } hero_try_surface_push_response(3.7f, 0.0f, 0.35f); if (shooter_update_ranged_attack_pal((s32) pval_21) != 0) { - hero_l20_set_state_pal(0x8D, 1); + hero_l20_set_move_state_pal(0x8D, 1); } } break; diff --git a/src/pal/levels/20_yeedil/L20_002C5C68-sw.c b/src/pal/levels/20_yeedil/L20_002C5C68-sw.c index 27a0c8bea..9683c9546 100644 --- a/src/pal/levels/20_yeedil/L20_002C5C68-sw.c +++ b/src/pal/levels/20_yeedil/L20_002C5C68-sw.c @@ -72,8 +72,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -143,7 +143,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l20_set_state_pal(s32 action, s32 animate) { +s32 hero_l20_set_move_state_pal(s32 action, s32 animate) { f32 dir[4]; u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -191,7 +191,9 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -204,8 +206,8 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_load_state_by_game_mode(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l20_set_state_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state_pal(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l20_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (SelectHeroStateAnimation(0) == 0x51) set_hero_animation_pal(SelectHeroStateAnimation(0), 0, 15.0f); else set_hero_animation_pal(SelectHeroStateAnimation(0), 0, -1.0f); @@ -352,7 +354,7 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l20_set_state_pal(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l20_set_move_state_pal(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.15400001f) REAL(0x1B4) = 0.15400001f; @@ -398,12 +400,12 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l20_set_state_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state_pal(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l20_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state_pal(0x76, 1); return 0; } if (hero_try_start_grab_pal()) return 0; if (SelectHeroStateAnimation(0) == 0x51) { if (!animate) goto finish; - if (hero_l20_set_state_pal(0, 0)) set_hero_animation_pal(SelectHeroStateAnimation(0), 0, 15.0f); + if (hero_l20_set_move_state_pal(0, 0)) set_hero_animation_pal(SelectHeroStateAnimation(0), 0, 15.0f); return 0; } if (!animate) goto finish; @@ -428,7 +430,7 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.14000002f) REAL(0x1B4) = 0.14000002f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.14000002f); @@ -594,13 +596,13 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l20_set_state_pal(0x81, 1); return 0; + hero_l20_set_move_state_pal(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l20_lock_flag_b) { hero_l20_set_state_pal(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l20_lock_flag_b) { hero_l20_set_move_state_pal(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l20_set_state_pal(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l20_set_move_state_pal(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -675,9 +677,9 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_special_map_flag) hero_l20_set_state_pal(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l20_set_state_pal(0x79, 1); - else hero_l20_set_state_pal(0x39, 1); + if (g_current_map_index == 2 && g_hero_special_map_flag) hero_l20_set_move_state_pal(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l20_set_move_state_pal(0x79, 1); + else hero_l20_set_move_state_pal(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -740,7 +742,7 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -769,7 +771,7 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -778,7 +780,7 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4B8) = 0.6f; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -921,7 +923,7 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -1016,7 +1018,7 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -1028,7 +1030,7 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); @@ -1063,7 +1065,7 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { set_hero_animation_pal(0x11, 0, 7.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state_pal(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state_pal(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation_pal(0, 0, 7.0f); goto finish; case 0x4B: @@ -1097,7 +1099,7 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l20_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state_pal(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state_pal(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1130,7 +1132,7 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { set_hero_animation_pal(12, 0, 5.0f); goto finish; case 0x8D: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state_pal(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state_pal(0x94, 1); return 0; } if (!animate) goto finish; set_hero_animation_pal(13, 0, 7.0f); goto finish; case 0x8F: @@ -1151,7 +1153,7 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l20_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x8E: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state_pal(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state_pal(0x94, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); BYTE(0x40C) = 0; BYTE(0x40F) = 0; if (WORD(0x22A4) == 0) REAL(0x1B4) = vec_length_xy(VEC(0x160)); @@ -1180,7 +1182,7 @@ s32 hero_l20_set_state_pal(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.09f; if (WORD(0x640) > 12 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l20_set_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; + PTR(0x2290)[0xA8] = 255; hero_l20_set_move_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; return 0; } HALF(0x1DC) = 64; REAL(0x69C) = 0.050000004f; diff --git a/src/pal/levels/20_yeedil/L20_002C5C68.c b/src/pal/levels/20_yeedil/L20_002C5C68.c index f06b3b8d2..29e7bfd43 100644 --- a/src/pal/levels/20_yeedil/L20_002C5C68.c +++ b/src/pal/levels/20_yeedil/L20_002C5C68.c @@ -63,7 +63,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l20_set_state_pal(s32, s32); +extern s32 hero_l20_set_move_state_pal(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_pal(s32); extern int hero_play_sound(s32, s32); @@ -150,7 +150,7 @@ s32 hero_handle_hazard_contact_pal(s32 apply_push) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB || *(s16 *)(other + 0xAA) == 0x558)) { - hero_l20_set_state_pal(0x7D, 1); + hero_l20_set_move_state_pal(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -161,7 +161,7 @@ s32 hero_handle_hazard_contact_pal(s32 apply_push) { AdjustPlayerHealth_pal(FloatToInt(*(float *)(effect_slot + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l20_set_state_pal(0x16, 1); + hero_l20_set_move_state_pal(0x16, 1); } g_hero_state.f1DC = 0x40; if (g_hero_state.f21C == 0) { @@ -171,13 +171,13 @@ s32 hero_handle_hazard_contact_pal(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l20_set_state_pal(0x72, 1); + hero_l20_set_move_state_pal(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l20_set_state_pal(0x73, 1); + hero_l20_set_move_state_pal(0x73, 1); } else if (entry->f24 & 8) { - hero_l20_set_state_pal(0x8C, 1); + hero_l20_set_move_state_pal(0x8C, 1); } else { - hero_l20_set_state_pal(0x16, 1); + hero_l20_set_move_state_pal(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&push); @@ -189,11 +189,11 @@ s32 hero_handle_hazard_contact_pal(s32 apply_push) { } break; case 1: - hero_l20_set_state_pal(0x42, 1); + hero_l20_set_move_state_pal(0x42, 1); hero_flatten_push_vector(&push, flag, 0.10000001f, 0.060000002f); break; case 4: - hero_l20_set_state_pal(0x90, 1); + hero_l20_set_move_state_pal(0x90, 1); hero_flatten_push_vector(&push, flag, 0.10000001f, 0.060000002f); break; } diff --git a/src/pal/levels/20_yeedil/L20_002D6678-timers-g8.c b/src/pal/levels/20_yeedil/L20_002D6678-timers-g8.c index a07933120..b2e18ecff 100644 --- a/src/pal/levels/20_yeedil/L20_002D6678-timers-g8.c +++ b/src/pal/levels/20_yeedil/L20_002D6678-timers-g8.c @@ -94,7 +94,7 @@ extern int D_L20_001A8F00_abs __asm__("D_L20_001A8F00"); extern float g_hero_timer_trigger_a, g_hero_timer_trigger_b; extern unsigned char g_hero_event_flags[] __attribute__((sda)); extern void hero_ease_lean_to_upright_pal(void), hero_queue_glow_draw_routine(void), hero_update_landing_slide_pal(void), hero_record_play_counters_pal(void); -extern s32 hero_l20_set_state_pal(int, int); +extern s32 hero_l20_set_move_state_pal(int, int); extern int FastDecTimer(void *), math_fast_float_d(void *); extern void vec_clear_128(void *); extern int moby_is_in_special_class_range(void *), math_random_int_below(int); @@ -175,7 +175,7 @@ void hero_l20_update_timers_pal(void) { if (g_hero_state.field_24CC && !D_L20_001A8F00_abs && g_hero_state.mode == 4 && g_hero_state.field_2294 != 0x6F && (g_pad_state.pressed&0x10)) { g_hero_state.field_1E0 = 0; g_hero_state.field_24CC = 0; - hero_l20_set_state_pal(0x91, 1); + hero_l20_set_move_state_pal(0x91, 1); } if (!D_L20_001A8F00_abs) { if (g_hero_timer_trigger_a>0) g_hero_state.field_22A++; diff --git a/src/pal/levels/20_yeedil/L20_002DF028-deck.c b/src/pal/levels/20_yeedil/L20_002DF028-deck.c index b469b8a38..0f44666ba 100644 --- a/src/pal/levels/20_yeedil/L20_002DF028-deck.c +++ b/src/pal/levels/20_yeedil/L20_002DF028-deck.c @@ -78,7 +78,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed_pal(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction_pal(void); -s32 hero_l20_set_state_pal(s32, s32); +s32 hero_l20_set_move_state_pal(s32, s32); void hero_load_state_by_game_mode(s32 a0); s32 hero_try_start_transition_pal(void); s32 hero_try_start_ledge_move(void); @@ -158,7 +158,7 @@ void hero_l20_decide_state_transition_pal(void) { UpdateHeroHeldTarget_pal(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l20_set_state_pal(0x39, 1); + hero_l20_set_move_state_pal(0x39, 1); goto end; } } @@ -194,15 +194,15 @@ void hero_l20_decide_state_transition_pal(void) { if (FLD(g_hero_state, f32, 0x88) < g_level_shared_float) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { if (FLD(g_hero_state, u8, 0x22B4) == 4) { - hero_l20_set_state_pal(0x91, 1); + hero_l20_set_move_state_pal(0x91, 1); goto end; } - hero_l20_set_state_pal(0x74, 1); + hero_l20_set_move_state_pal(0x74, 1); goto end; } } if ((FLD(g_hero_state, u8, 0x22B4) == 4) && (FLD(g_hero_state, f32, 0x88) < FLD(FLD(FLD(g_hero_state, void *, 0x2290), void *, 0x68), f32, 0x3EC))) { - hero_l20_set_state_pal(0x91, 1); + hero_l20_set_move_state_pal(0x91, 1); } switch (FLD(g_hero_state, u32, 0x2294)) { case 0x0: @@ -211,12 +211,12 @@ void hero_l20_decide_state_transition_pal(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state_pal(1, 1); + hero_l20_set_move_state_pal(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l20_set_state_pal(0x82, 1); + hero_l20_set_move_state_pal(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -253,7 +253,7 @@ void hero_l20_decide_state_transition_pal(void) { rec = g_hero_decision_records + record_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 5e+01f; if (FLD(rec, s32, 0x44) != 0) { - hero_l20_set_state_pal(0x3C, 1); + hero_l20_set_move_state_pal(0x3C, 1); } else { set_hero_animation_pal(FLD(rec, s32, 0x48), 0, 1e+01f); } @@ -296,12 +296,12 @@ void hero_l20_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l20_set_state_pal(0x76, 1); + hero_l20_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); } break; } @@ -322,21 +322,21 @@ void hero_l20_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l20_lock_flag_b == 0) && (PadPressedWithin(0x40, 6, NULL) != 0)) { - hero_l20_set_state_pal(0x6E, 1); + hero_l20_set_move_state_pal(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l20_set_state_pal(4, 1); + hero_l20_set_move_state_pal(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state_pal(0x27, 1); + hero_l20_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l20_set_state_pal(0x2E, 1); + hero_l20_set_move_state_pal(0x2E, 1); break; } { @@ -356,28 +356,28 @@ void hero_l20_decide_state_transition_pal(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust_pal(side, 0, 0, 0x1E); hero_play_footstep_sound_dust_pal(side, 1, 0, 0x1E); - hero_l20_set_state_pal(2, 1); + hero_l20_set_move_state_pal(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state_pal(1, 1); + hero_l20_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_flags = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_flags & 8)) { - hero_l20_set_state_pal(0x3D, 1); + hero_l20_set_move_state_pal(0x3D, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l20_set_state_pal(0x3D, 1); + hero_l20_set_move_state_pal(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); } break; case 0x3D: @@ -386,22 +386,22 @@ void hero_l20_decide_state_transition_pal(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); break; } if (hero_try_start_move_from_buffer_pal(6, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state_pal(4, 1); + hero_l20_set_move_state_pal(4, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l20_set_state_pal(2, 1); + hero_l20_set_move_state_pal(2, 1); break; } - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); break; case 0x39: case 0x43: @@ -440,25 +440,25 @@ void hero_l20_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.040000003f)) { - hero_l20_set_state_pal(0x33, 1); + hero_l20_set_move_state_pal(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12)) { - hero_l20_set_state_pal(0x34, 1); + hero_l20_set_move_state_pal(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l20_set_state_pal(0x32, 1); + hero_l20_set_move_state_pal(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l20_set_state_pal(0x33, 1); + hero_l20_set_move_state_pal(0x33, 1); } } break; @@ -471,81 +471,81 @@ void hero_l20_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l20_set_state_pal(0x32, 1); + hero_l20_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l20_set_state_pal(0x34, 1); + hero_l20_set_move_state_pal(0x34, 1); } else { - hero_l20_set_state_pal(0x32, 1); + hero_l20_set_move_state_pal(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l20_set_state_pal(0x12, 1); + hero_l20_set_move_state_pal(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 6, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 6, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l20_set_state_pal(0x32, 1); + hero_l20_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l20_set_state_pal(0x34, 1); + hero_l20_set_move_state_pal(0x34, 1); } else { - hero_l20_set_state_pal(0x32, 1); + hero_l20_set_move_state_pal(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l20_set_state_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l20_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(SelectHeroStateAnimation(0), 0, 15.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l20_set_state_pal(0x35, 1); + hero_l20_set_move_state_pal(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l20_set_state_pal(0x12, 1); + hero_l20_set_move_state_pal(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 6, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l20_set_state_pal(0x32, 1); + hero_l20_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l20_set_state_pal(0x34, 1); + hero_l20_set_move_state_pal(0x34, 1); } else { - hero_l20_set_state_pal(0x32, 1); + hero_l20_set_move_state_pal(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l20_set_state_pal(0x70, 0); + hero_l20_set_move_state_pal(0x70, 0); set_hero_animation_pal(0x59, 0, 14.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l20_set_state_pal(0x36, 1); + hero_l20_set_move_state_pal(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_pal(0x67, 1); + hero_l20_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x28, 15.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_pal(0x33, 1); + hero_l20_set_move_state_pal(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l20_set_state_pal(0x33, 0); + hero_l20_set_move_state_pal(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_pal(0x67, 1); + hero_l20_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x25, 15.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l20_set_state_pal(0x36, 0); + hero_l20_set_move_state_pal(0x36, 0); } break; case 0x1: @@ -579,9 +579,9 @@ void hero_l20_decide_state_transition_pal(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_load_state_by_game_mode(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state_pal(4, 1); + hero_l20_set_move_state_pal(4, 1); } else { - hero_l20_set_state_pal(0, 0); + hero_l20_set_move_state_pal(0, 0); anim = SelectHeroStateAnimation(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -593,9 +593,9 @@ void hero_l20_decide_state_transition_pal(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l20_set_state_pal(0, 0); + hero_l20_set_move_state_pal(0, 0); } else { - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); } } break; @@ -628,7 +628,7 @@ void hero_l20_decide_state_transition_pal(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state_pal(7, 1); + hero_l20_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -637,7 +637,7 @@ void hero_l20_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l20_set_state_pal(0, 0); + hero_l20_set_move_state_pal(0, 0); } break; } @@ -659,7 +659,7 @@ void hero_l20_decide_state_transition_pal(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state_pal(7, 1); + hero_l20_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -672,7 +672,7 @@ void hero_l20_decide_state_transition_pal(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l20_set_state_pal(2, 0); + hero_l20_set_move_state_pal(2, 0); set_hero_animation_pal(3, g_hero_l20_animation_ids[FLD(g_hero_state, s32, 0x2298)], 11.0f); break; } @@ -683,22 +683,22 @@ void hero_l20_decide_state_transition_pal(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l20_set_state_pal(2, 1); + hero_l20_set_move_state_pal(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l20_set_state_pal(0, 0); + hero_l20_set_move_state_pal(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_pal(0, 0); + hero_l20_set_move_state_pal(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x54) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -715,7 +715,7 @@ void hero_l20_decide_state_transition_pal(void) { } if (PadPressedWithin(0x40, 6, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state_pal(7, 1); + hero_l20_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -724,7 +724,7 @@ void hero_l20_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l20_set_state_pal(0, 0); + hero_l20_set_move_state_pal(0, 0); set_hero_animation_pal(SelectHeroStateAnimation(0), 0, 12.0f); break; } @@ -736,7 +736,7 @@ void hero_l20_decide_state_transition_pal(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); } break; case 0x2: @@ -750,11 +750,11 @@ void hero_l20_decide_state_transition_pal(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l20_set_state_pal(0x76, 1); + hero_l20_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead_pal() == 0)) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); break; } n = 7; @@ -768,12 +768,12 @@ void hero_l20_decide_state_transition_pal(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l20_set_state_pal(9, 1); + hero_l20_set_move_state_pal(9, 1); } else { - hero_l20_set_state_pal(7, 1); + hero_l20_set_move_state_pal(7, 1); } } else { - hero_l20_set_state_pal(7, 1); + hero_l20_set_move_state_pal(7, 1); } break; } @@ -781,11 +781,11 @@ void hero_l20_decide_state_transition_pal(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.040000003f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state_pal(1, 1); + hero_l20_set_move_state_pal(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state_pal(4, 1); + hero_l20_set_move_state_pal(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -802,25 +802,25 @@ void hero_l20_decide_state_transition_pal(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l20_set_state_pal(0x2E, 1); + hero_l20_set_move_state_pal(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l20_set_state_pal(2, 1); + hero_l20_set_move_state_pal(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l20_set_state_pal(0x70, 1); + hero_l20_set_move_state_pal(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l20_set_state_pal(2, 1); + hero_l20_set_move_state_pal(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state_pal(0x27, 1); + hero_l20_set_move_state_pal(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -831,7 +831,7 @@ void hero_l20_decide_state_transition_pal(void) { if (hero_try_start_grab_pal() != 0) { break; } - if (hero_l20_set_state_pal(0, 0) == 0) { + if (hero_l20_set_move_state_pal(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.030000001f); @@ -848,7 +848,7 @@ void hero_l20_decide_state_transition_pal(void) { hero_update_anim_scale_pal(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l20_set_state_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l20_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(SelectHeroStateAnimation(0), 0, 14.0f); } if (FLD(hero_moby, u8, 0x43) == 0x37) { @@ -869,7 +869,7 @@ void hero_l20_decide_state_transition_pal(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l20_set_state_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l20_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(SelectHeroStateAnimation(0), 0, 14.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 29.166668f; @@ -903,17 +903,17 @@ void hero_l20_decide_state_transition_pal(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x19; - hero_l20_set_state_pal(3, 0); + hero_l20_set_move_state_pal(3, 0); set_hero_animation_pal(6, 4, 9.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l20_set_state_pal(0x77, 1); + hero_l20_set_move_state_pal(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l20_set_state_pal(0x77, 1); + hero_l20_set_move_state_pal(0x77, 1); break; } } @@ -931,11 +931,11 @@ void hero_l20_decide_state_transition_pal(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.054000005f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l20_set_state_pal(0x64, 1); + hero_l20_set_move_state_pal(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.054000005f)) { - hero_l20_set_state_pal(0x63, 1); + hero_l20_set_move_state_pal(0x63, 1); } } else { hero_update_anim_scale_pal(); @@ -943,21 +943,21 @@ void hero_l20_decide_state_transition_pal(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_pal(0x62, 1); + hero_l20_set_move_state_pal(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l20_set_state_pal(0x62, 1); + hero_l20_set_move_state_pal(0x62, 1); } break; case 0x65: /* switch 2 */ step_level = FLD(g_hero_state, s32, 0x18C0); if ((step_level < 3) && (((step_level * 6) + 0x8) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 6, &button_frame) != 0)) { - hero_l20_set_state_pal(0x66, 1); + hero_l20_set_move_state_pal(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters_pal(); @@ -1000,7 +1000,7 @@ void hero_l20_decide_state_transition_pal(void) { return; case 0x6D: if ((f32)g_hero_l20_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); } break; case 0x30: @@ -1013,7 +1013,7 @@ void hero_l20_decide_state_transition_pal(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l20_set_state_pal(0, 0) != 0) { + if (hero_l20_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(SelectHeroStateAnimation(0), 0, 14.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1021,29 +1021,29 @@ void hero_l20_decide_state_transition_pal(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state_pal(1, 1); + hero_l20_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l20_set_state_pal(7, 1); + hero_l20_set_move_state_pal(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state_pal(4, 1); + hero_l20_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 8) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state_pal(0x27, 1); + hero_l20_set_move_state_pal(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1051,45 +1051,45 @@ void hero_l20_decide_state_transition_pal(void) { } if (SelectHeroStateAnimation(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l20_set_state_pal(0, 0); + hero_l20_set_move_state_pal(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l20_set_state_pal(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l20_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(SelectHeroStateAnimation(0), 0, 14.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l20_set_state_pal(2, 1); + hero_l20_set_move_state_pal(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state_pal(1, 1); + hero_l20_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xA) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state_pal(0, 0); + hero_l20_set_move_state_pal(0, 0); set_hero_animation_pal(SelectHeroStateAnimation(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l20_set_state_pal(0x76, 1); + hero_l20_set_move_state_pal(0x76, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { break; } if ((PadPressedWithin(0x80, 0xC, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l20_set_state_pal(0x15, 1); + hero_l20_set_move_state_pal(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 8) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1097,17 +1097,17 @@ void hero_l20_decide_state_transition_pal(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l20_set_state_pal(0x8B, 1); + hero_l20_set_move_state_pal(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x4C) { - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); } break; case 0x24: @@ -1133,14 +1133,14 @@ void hero_l20_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l20_set_state_pal(0, 0); + hero_l20_set_move_state_pal(0, 0); set_hero_animation_pal(SelectHeroStateAnimation(0), 0, 25.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l20_set_state_pal(6, 0); + hero_l20_set_move_state_pal(6, 0); } else { - hero_l20_set_state_pal(6, 0); + hero_l20_set_move_state_pal(6, 0); set_hero_animation_pal(0xA, 0, 14.0f); } FLD(g_hero_state, f32, 0xA84) = 0.016800001f; @@ -1156,9 +1156,9 @@ void hero_l20_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); } else { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1170,7 +1170,7 @@ void hero_l20_decide_state_transition_pal(void) { if (t < 0x21) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l20_set_state_pal(0x2C, 1); + hero_l20_set_move_state_pal(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0028000001f; FLD(g_hero_state, f32, 0xA80) = 0.0108f; } @@ -1234,11 +1234,11 @@ void hero_l20_decide_state_transition_pal(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.26000002f); FLD(g_hero_state, f32, 0x128) = 0.20000002f; - hero_l20_set_state_pal(0x16, 1); + hero_l20_set_move_state_pal(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x3A; FLD(g_hero_state, s16, 0x1D0) = 0x3A; } else { - hero_l20_set_state_pal(0x3E, 1); + hero_l20_set_move_state_pal(0x3E, 1); } break; } @@ -1251,7 +1251,7 @@ void hero_l20_decide_state_transition_pal(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l20_set_state_pal(0x28, 1); + hero_l20_set_move_state_pal(0x28, 1); } break; } @@ -1262,16 +1262,16 @@ void hero_l20_decide_state_transition_pal(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x3A; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l20_set_state_pal(0x74, 1); + hero_l20_set_move_state_pal(0x74, 1); } else { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0x8, NULL) != 0)) { - hero_l20_set_state_pal(0x2A, 1); + hero_l20_set_move_state_pal(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1288,7 +1288,7 @@ void hero_l20_decide_state_transition_pal(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l20_set_state_pal(0x28, 1); + hero_l20_set_move_state_pal(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)v20 = 0; @@ -1305,7 +1305,7 @@ void hero_l20_decide_state_transition_pal(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 4, NULL) != 0) && ((f32)g_hero_l20_action_table[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l20_set_state_pal(0x28, 1); + hero_l20_set_move_state_pal(0x28, 1); break; } top = 0xE; @@ -1314,19 +1314,19 @@ void hero_l20_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0x8, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l20_set_state_pal(0x2A, 1); + hero_l20_set_move_state_pal(0x2A, 1); } break; } if ((f32)g_hero_l20_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l20_set_state_pal(0x27, 1); + hero_l20_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 5) || (FLD(g_hero_state, s32, 0x6C8) >= 5)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l20_set_state_pal(0x74, 1); + hero_l20_set_move_state_pal(0x74, 1); } else { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; @@ -1335,11 +1335,11 @@ void hero_l20_decide_state_transition_pal(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 5) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l20_set_state_pal(0x27, 1); + hero_l20_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 5) && (g_current_map_index == 0x14)) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0x8) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1375,7 +1375,7 @@ void hero_l20_decide_state_transition_pal(void) { find_nearest_path_point(next_path_point, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), path_wrap, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l20_set_state_pal(0x29, 1); + hero_l20_set_move_state_pal(0x29, 1); break; } } @@ -1423,7 +1423,7 @@ void hero_l20_decide_state_transition_pal(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x3A; FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; @@ -1431,7 +1431,7 @@ void hero_l20_decide_state_transition_pal(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l20_set_state_pal(0x71, 1); + hero_l20_set_move_state_pal(0x71, 1); break; } { @@ -1443,7 +1443,7 @@ void hero_l20_decide_state_transition_pal(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l20_set_state_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l20_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(0xC, 4, 5.0f); } } else if (st == 0x3E) { @@ -1452,24 +1452,24 @@ void hero_l20_decide_state_transition_pal(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)turn_angle2, 0.5f, -1.0f); } if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s32, 0x340) != 0)) { - if (hero_l20_set_state_pal(0, 0) != 0) { + if (hero_l20_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_pal(0x27, 1); + hero_l20_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xD) && (FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l20_set_state_pal(0x27, 1); + hero_l20_set_move_state_pal(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l20_set_state_pal(0x18, 0); + hero_l20_set_move_state_pal(0x18, 0); } break; case 0x18: @@ -1478,18 +1478,18 @@ void hero_l20_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab_pal((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 0xE, NULL) != 0) { - hero_l20_set_state_pal(0x1B, 1); + hero_l20_set_move_state_pal(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1498,7 +1498,7 @@ void hero_l20_decide_state_transition_pal(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x97), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x97), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l20_set_state_pal(0x19, 1); + hero_l20_set_move_state_pal(0x19, 1); } break; } @@ -1509,7 +1509,7 @@ void hero_l20_decide_state_transition_pal(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l20_set_state_pal(0x1A, 1); + hero_l20_set_move_state_pal(0x1A, 1); } } } @@ -1528,18 +1528,18 @@ void hero_l20_decide_state_transition_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_pal(0x18, 1); + hero_l20_set_move_state_pal(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l20_set_state_pal(0x1B, 1); + hero_l20_set_move_state_pal(0x1B, 1); } break; } @@ -1549,9 +1549,9 @@ void hero_l20_decide_state_transition_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); } else { - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); } } break; @@ -1575,12 +1575,12 @@ void hero_l20_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_pal(0x39, 1); + hero_l20_set_move_state_pal(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x4B) { - if (hero_l20_set_state_pal(0, 0) != 0) { + if (hero_l20_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } if (low != 0) { @@ -1588,7 +1588,7 @@ void hero_l20_decide_state_transition_pal(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l20_set_state_pal(0, 0) != 0) { + if (hero_l20_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1602,32 +1602,32 @@ void hero_l20_decide_state_transition_pal(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l20_set_state_pal(2, 1); + hero_l20_set_move_state_pal(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.060000002f) { - if (hero_l20_set_state_pal(3, 0) != 0) { + if (hero_l20_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(6, 0, 1e+01f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.15400001f); } } else { - hero_l20_set_state_pal(0, 1); + hero_l20_set_move_state_pal(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l20_set_state_pal(8, 1); + hero_l20_set_move_state_pal(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x12) && (hero_try_start_move_from_buffer_pal((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 5, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state_pal(0x17, 1); + hero_l20_set_move_state_pal(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state_pal(0x27, 1); + hero_l20_set_move_state_pal(0x27, 1); break; } } @@ -1659,7 +1659,7 @@ void hero_l20_decide_state_transition_pal(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l20_set_state_pal(0, 0) != 0) { + if (hero_l20_set_move_state_pal(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1669,9 +1669,9 @@ void hero_l20_decide_state_transition_pal(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l20_set_state_pal(0x74, 1); + hero_l20_set_move_state_pal(0x74, 1); } else { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); } } break; @@ -1684,16 +1684,16 @@ void hero_l20_decide_state_transition_pal(void) { ok = 1; } if (ok != 0) { - hero_l20_set_state_pal(0x11, 1); + hero_l20_set_move_state_pal(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state_pal(0x17, 1); + hero_l20_set_move_state_pal(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1704,23 +1704,23 @@ void hero_l20_decide_state_transition_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 3)) { - if (hero_l20_set_state_pal(3, 0) != 0) { + if (hero_l20_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x1C; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state_pal(4, 1); + hero_l20_set_move_state_pal(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_l20_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l20_set_state_pal(2, 1); + hero_l20_set_move_state_pal(2, 1); break; } - hero_l20_set_state_pal(2, 0); + hero_l20_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, 2, 7.0f); @@ -1729,21 +1729,21 @@ void hero_l20_decide_state_transition_pal(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_l20_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l20_set_state_pal(2, 1); + hero_l20_set_move_state_pal(2, 1); break; } - hero_l20_set_state_pal(2, 0); + hero_l20_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, g_hero_l20_animation_id_extra, 1e+01f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l20_set_state_pal(0, 0) != 0) { + if (hero_l20_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(SelectHeroStateAnimation(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l20_set_state_pal(0, 0) != 0) { + } else if (hero_l20_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1791,14 +1791,14 @@ void hero_l20_decide_state_transition_pal(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 4, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state_pal(0xB, 1); + hero_l20_set_move_state_pal(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x11)) { - hero_l20_set_state_pal(0x82, 1); + hero_l20_set_move_state_pal(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1807,25 +1807,25 @@ void hero_l20_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 6) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f)) { - hero_l20_set_state_pal(0xA, 1); + hero_l20_set_move_state_pal(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l20_set_state_pal(0x10, 1); + hero_l20_set_move_state_pal(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state_pal(0x27, 1); + hero_l20_set_move_state_pal(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.14000002f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l20_set_state_pal(0x77, 1); + hero_l20_set_move_state_pal(0x77, 1); break; } } @@ -1929,7 +1929,7 @@ void hero_l20_decide_state_transition_pal(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l20_set_state_pal(3, 0) != 0) { + if (hero_l20_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1937,13 +1937,13 @@ void hero_l20_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l20_speed_params[0][2])) { - hero_l20_set_state_pal(7, 1); + hero_l20_set_move_state_pal(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l20_set_state_pal(7, 1); + hero_l20_set_move_state_pal(7, 1); } else if (g_hero_l20_speed_params[1][1] * 0.017f < FLD(g_hero_state, f32, 0x174)) { - hero_l20_set_state_pal(9, 1); + hero_l20_set_move_state_pal(9, 1); } else { - hero_l20_set_state_pal(7, 1); + hero_l20_set_move_state_pal(7, 1); } break; } @@ -1951,10 +1951,10 @@ void hero_l20_decide_state_transition_pal(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_l00_choose_next_move_after_landing_pal(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); break; } { @@ -1964,7 +1964,7 @@ void hero_l20_decide_state_transition_pal(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x16)) && (PadPressedWithin(0x40, 6, &button_frame_b) != 0) && (button_frame_b < FLD(g_hero_state, s32, 0x1B8))) { - hero_l20_set_state_pal(0x11, 1); + hero_l20_set_move_state_pal(0x11, 1); break; } } @@ -1993,7 +1993,7 @@ void hero_l20_decide_state_transition_pal(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xD) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.11600001f)))) { - hero_l20_set_state_pal(0xE, 1); + hero_l20_set_move_state_pal(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -2003,32 +2003,32 @@ void hero_l20_decide_state_transition_pal(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l20_set_state_pal(8, 1); + hero_l20_set_move_state_pal(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x576) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l20_set_state_pal(0x17, 1); + hero_l20_set_move_state_pal(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l20_set_state_pal(6, 1); + hero_l20_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x17) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l20_set_state_pal(0x79, 1); + hero_l20_set_move_state_pal(0x79, 1); } else { - hero_l20_set_state_pal(0x39, 1); + hero_l20_set_move_state_pal(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l20_set_state_pal(0x82, 1); + hero_l20_set_move_state_pal(0x82, 1); } else { - hero_l20_set_state_pal(0, 0); + hero_l20_set_move_state_pal(0, 0); } } break; @@ -2038,8 +2038,8 @@ void hero_l20_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x2B) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_pal(0x39, 1); - } else if (hero_l20_set_state_pal(0, 0) != 0) { + hero_l20_set_move_state_pal(0x39, 1); + } else if (hero_l20_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(SelectHeroStateAnimation(0), 0, 11.0f); } } @@ -2064,28 +2064,28 @@ void hero_l20_decide_state_transition_pal(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state_pal(0x4E, 1); + hero_l20_set_move_state_pal(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state_pal(1, 1); + hero_l20_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state_pal(0x41, 1); + hero_l20_set_move_state_pal(0x41, 1); break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l20_set_state_pal(0x45, 1); + hero_l20_set_move_state_pal(0x45, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l20_set_state_pal(0x4D, 1); + hero_l20_set_move_state_pal(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l20_set_state_pal(0x40, 1); + hero_l20_set_move_state_pal(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -2098,14 +2098,14 @@ void hero_l20_decide_state_transition_pal(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state_pal(0x4E, 1); + hero_l20_set_move_state_pal(0x4E, 1); break; } rec = (u8 *)&g_hero_l20_action_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l20_set_state_pal(0x3F, 0); + hero_l20_set_move_state_pal(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -2114,13 +2114,13 @@ void hero_l20_decide_state_transition_pal(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0xD) ? n : 0xC, NULL) != 0) { - hero_l20_set_state_pal(0x4D, 1); + hero_l20_set_move_state_pal(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l20_set_state_pal(0x45, 1); + hero_l20_set_move_state_pal(0x45, 1); } break; } @@ -2183,42 +2183,42 @@ void hero_l20_decide_state_transition_pal(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 3, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { hero_resolve_stick_direction(0, 1.0f); - hero_l20_set_state_pal(0x45, 1); + hero_l20_set_move_state_pal(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l20_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x97)) < 1.5707964f)) { - hero_l20_set_state_pal(0x40, 1); + hero_l20_set_move_state_pal(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xB) { - hero_l20_set_state_pal(0x3F, 1); + hero_l20_set_move_state_pal(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x22)) { - hero_l20_set_state_pal(0x41, 1); + hero_l20_set_move_state_pal(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 4, NULL) != 0)) { - hero_l20_set_state_pal(0x4D, 1); + hero_l20_set_move_state_pal(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state_pal(0x46, 1); + hero_l20_set_move_state_pal(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l20_set_state_pal(0x4B, 1); + hero_l20_set_move_state_pal(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l20_set_state_pal(0x41, 1); + hero_l20_set_move_state_pal(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state_pal(0x46, 1); + hero_l20_set_move_state_pal(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -2228,11 +2228,11 @@ void hero_l20_decide_state_transition_pal(void) { FLD(g_hero_state, s16, 0x1EE) = 0xA - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l20_set_state_pal(0x40, 1); + hero_l20_set_move_state_pal(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l20_set_state_pal(0x3F, 1); + hero_l20_set_move_state_pal(0x3F, 1); } break; case 0x41: @@ -2244,29 +2244,29 @@ void hero_l20_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_pal(0x43, 1); + hero_l20_set_move_state_pal(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l20_set_state_pal(0x40, 1); + hero_l20_set_move_state_pal(0x40, 1); } else { - hero_l20_set_state_pal(0x3F, 1); + hero_l20_set_move_state_pal(0x3F, 1); } } else { - hero_l20_set_state_pal(0x3F, 1); + hero_l20_set_move_state_pal(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state_pal(0x46, 1); + hero_l20_set_move_state_pal(0x46, 1); break; } if ((PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l20_set_state_pal(0x4B, 1); + hero_l20_set_move_state_pal(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l20_set_state_pal(0x3F, 1); + hero_l20_set_move_state_pal(0x3F, 1); } break; case 0x4E: @@ -2275,9 +2275,9 @@ void hero_l20_decide_state_transition_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state_pal(0x41, 1); + hero_l20_set_move_state_pal(0x41, 1); } else { - hero_l20_set_state_pal(0x3F, 1); + hero_l20_set_move_state_pal(0x3F, 1); } } break; @@ -2287,7 +2287,7 @@ void hero_l20_decide_state_transition_pal(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state_pal(0x4E, 1); + hero_l20_set_move_state_pal(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.030000001f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2313,55 +2313,55 @@ void hero_l20_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l20_set_state_pal(0x45, 1); + hero_l20_set_move_state_pal(0x45, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l20_set_state_pal(0x4D, 1); + hero_l20_set_move_state_pal(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l20_set_state_pal(0x41, 1); + hero_l20_set_move_state_pal(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l20_set_state_pal(0x3F, 1); + hero_l20_set_move_state_pal(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1B) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l20_set_state_pal(0x41, 1); + hero_l20_set_move_state_pal(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1E) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_pal(0x43, 1); + hero_l20_set_move_state_pal(0x43, 1); } else { - hero_l20_set_state_pal(0x3F, 0); + hero_l20_set_move_state_pal(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_pal(0x47, 1); + hero_l20_set_move_state_pal(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)v10 = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l20_set_state_pal(0x41, 1); + hero_l20_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state_pal(0x41, 1); + hero_l20_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l20_set_state_pal(0x48, 1); + hero_l20_set_move_state_pal(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2370,7 +2370,7 @@ void hero_l20_decide_state_transition_pal(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l20_set_state_pal(0x49, 1); + hero_l20_set_move_state_pal(0x49, 1); } break; } @@ -2381,7 +2381,7 @@ void hero_l20_decide_state_transition_pal(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l20_set_state_pal(0x4A, 1); + hero_l20_set_move_state_pal(0x4A, 1); } } } @@ -2400,17 +2400,17 @@ void hero_l20_decide_state_transition_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_pal(0x47, 1); + hero_l20_set_move_state_pal(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l20_set_state_pal(0x41, 1); + hero_l20_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l20_set_state_pal(0x48, 1); + hero_l20_set_move_state_pal(0x48, 1); } break; } @@ -2421,35 +2421,35 @@ void hero_l20_decide_state_transition_pal(void) { set_hero_animation_pal(0xD, 0, 1e1f); } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state_pal(0x94, 1); + hero_l20_set_move_state_pal(0x94, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state_pal(1, 1); + hero_l20_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state_pal(0x8F, 1); + hero_l20_set_move_state_pal(0x8F, 1); break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l20_set_state_pal(0x92, 1); + hero_l20_set_move_state_pal(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != 0xEE1) && (PadPressedWithin(0x80, 7, NULL) != 0)) { - hero_l20_set_state_pal(0x93, 1); + hero_l20_set_move_state_pal(0x93, 1); break; } hero_resolve_stick_direction(0, 1.0f); turned = hero_is_turned_past_angle(0.17453295f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (turned != 0)) { - hero_l20_set_state_pal(0x8E, 1); + hero_l20_set_move_state_pal(0x8E, 1); } break; } case 0x93: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state_pal(0x94, 1); + hero_l20_set_move_state_pal(0x94, 1); } break; case 0x92: @@ -2515,20 +2515,20 @@ void hero_l20_decide_state_transition_pal(void) { after_pose: if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 3, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { hero_resolve_stick_direction(0, 1.0f); - hero_l20_set_state_pal(0x92, 1); + hero_l20_set_move_state_pal(0x92, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l20_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l20_set_state_pal(0x8E, 1); + hero_l20_set_move_state_pal(0x8E, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xb) { - hero_l20_set_state_pal(0x8D, 1); + hero_l20_set_move_state_pal(0x8D, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x22)) { - hero_l20_set_state_pal(0x8F, 1); + hero_l20_set_move_state_pal(0x8F, 1); } break; } @@ -2541,15 +2541,15 @@ void hero_l20_decide_state_transition_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_pal(0x91, 1); + hero_l20_set_move_state_pal(0x91, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l20_set_state_pal(0x8E, 1); + hero_l20_set_move_state_pal(0x8E, 1); } else { - hero_l20_set_state_pal(0x8D, 1); + hero_l20_set_move_state_pal(0x8D, 1); } } else { - hero_l20_set_state_pal(0x8D, 1); + hero_l20_set_move_state_pal(0x8D, 1); } } break; @@ -2559,43 +2559,43 @@ void hero_l20_decide_state_transition_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state_pal(0x8F, 1); + hero_l20_set_move_state_pal(0x8F, 1); } else { - hero_l20_set_state_pal(0x8D, 1); + hero_l20_set_move_state_pal(0x8D, 1); } } break; case 0x8E: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state_pal(0x94, 1); + hero_l20_set_move_state_pal(0x94, 1); break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l20_set_state_pal(0x92, 1); + hero_l20_set_move_state_pal(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != 0xEE1) && (PadPressedWithin(0x80, 7, NULL) != 0)) { - hero_l20_set_state_pal(0x93, 1); + hero_l20_set_move_state_pal(0x93, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l20_set_state_pal(0x8F, 1); + hero_l20_set_move_state_pal(0x8F, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f) && (FLD(g_hero_state, s16, 0x1454) == 0)) { - hero_l20_set_state_pal(0x8D, 1); + hero_l20_set_move_state_pal(0x8D, 1); } break; case 0x90: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1b) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l20_set_state_pal(0x8F, 1); + hero_l20_set_move_state_pal(0x8F, 1); break; } if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1e)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_pal(0x91, 1); + hero_l20_set_move_state_pal(0x91, 1); } else { - hero_l20_set_state_pal(0x8D, 0); + hero_l20_set_move_state_pal(0x8D, 0); } } break; @@ -2610,7 +2610,7 @@ void hero_l20_decide_state_transition_pal(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l20_set_state_pal(0, 0); + hero_l20_set_move_state_pal(0, 0); anim = SelectHeroStateAnimation(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -2621,7 +2621,7 @@ void hero_l20_decide_state_transition_pal(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l20_set_state_pal(0, 0); + hero_l20_set_move_state_pal(0, 0); } break; case 0x22: @@ -2631,12 +2631,12 @@ void hero_l20_decide_state_transition_pal(void) { hero_choose_jump_or_roll_move_pal(); break; } - hero_l20_set_state_pal(7, 1); + hero_l20_set_move_state_pal(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l20_set_state_pal(0, 0); + hero_l20_set_move_state_pal(0, 0); } break; default: diff --git a/src/pal/levels/22_dobbo_orbit/L22_002B73E8.c b/src/pal/levels/22_dobbo_orbit/L22_002B73E8.c index 2ea4d6fdb..5dcecba21 100644 --- a/src/pal/levels/22_dobbo_orbit/L22_002B73E8.c +++ b/src/pal/levels/22_dobbo_orbit/L22_002B73E8.c @@ -62,7 +62,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l22_set_action_pal(s32, s32); +extern s32 hero_l22_set_move_state_pal(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_pal(s32); extern int hero_play_sound(s32, s32); @@ -147,7 +147,7 @@ s32 hero_l22_apply_hazard_contact_pal(s32 apply_push) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB || *(s16 *)(other + 0xAA) == 0x558)) { - hero_l22_set_action_pal(0x7D, 1); + hero_l22_set_move_state_pal(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -158,7 +158,7 @@ s32 hero_l22_apply_hazard_contact_pal(s32 apply_push) { AdjustPlayerHealth_pal(FloatToInt(*(float *)(effect_slot + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l22_set_action_pal(0x16, 1); + hero_l22_set_move_state_pal(0x16, 1); } g_hero_state.f1DC = 0x40; if (g_hero_state.f21C == 0) { @@ -168,13 +168,13 @@ s32 hero_l22_apply_hazard_contact_pal(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l22_set_action_pal(0x72, 1); + hero_l22_set_move_state_pal(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l22_set_action_pal(0x73, 1); + hero_l22_set_move_state_pal(0x73, 1); } else if (entry->f24 & 8) { - hero_l22_set_action_pal(0x8C, 1); + hero_l22_set_move_state_pal(0x8C, 1); } else { - hero_l22_set_action_pal(0x16, 1); + hero_l22_set_move_state_pal(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&vec); @@ -186,15 +186,15 @@ s32 hero_l22_apply_hazard_contact_pal(s32 apply_push) { } break; case 1: - hero_l22_set_action_pal(0x42, 1); + hero_l22_set_move_state_pal(0x42, 1); hero_flatten_push_vector(&vec, flag, 0.10000001f, 0.060000002f); break; case 2: if ((entry->f24 & 4) || g_hero_state.f1874 <= 0) { if (entry->f20 != 0 && *(s16 *)(entry->f20 + 0xAA) == 0x11DF) { - hero_l22_set_action_pal(0x5A, 1); + hero_l22_set_move_state_pal(0x5A, 1); } else { - hero_l22_set_action_pal(0x59, 1); + hero_l22_set_move_state_pal(0x59, 1); } player_slot_clear_object(g_hero_state.f2290); FastVecScale(&vec, &vec, 0.11400001f); diff --git a/src/pal/levels/22_dobbo_orbit/L22_002BF0A8-hero.c b/src/pal/levels/22_dobbo_orbit/L22_002BF0A8-hero.c index 85c255058..6b8345ed7 100644 --- a/src/pal/levels/22_dobbo_orbit/L22_002BF0A8-hero.c +++ b/src/pal/levels/22_dobbo_orbit/L22_002BF0A8-hero.c @@ -82,7 +82,7 @@ extern void cam_project_vector_onto_view_plane(void *, void *); extern float cam_get_view_space_vector_length(void *); extern float cam_get_view_space_height(void *); extern void cam_set_view_space_vector_length(void *, void *, float); -extern int queue_copy_record_by_index(unsigned int index); +extern int actuator_play_pattern(unsigned int index); extern void moby_update_transform_history_followers(void *, int); extern float ReadPadFloatHistory(int); extern void UpdateHeroAimTarget(float, float, float); @@ -486,7 +486,7 @@ case 0x32: case 0x33: case 0x34: float old_pitch,steer,minimum_steer,pitch_change,controller_scale,rate,maximum_input,steering_limit; if (H(u32,0x2294)==0x34) { if (H(s32,0x1B8)>58) g_hero_state_machine_word=65535; - snd_update_slot_object(5,H(void*,0x2290),15);queue_copy_record_by_index(22); + snd_update_slot_object(5,H(void*,0x2290),15);actuator_play_pattern(22); } else { int slot=H(s32,0x2440); if (slot!=-1 && FLD(g_sound_state+slot*0x70, void *, 0x88)==H(void*,0x2290) && @@ -1090,7 +1090,7 @@ case 20: coll_process_hit(&workspace.state_14.delta, 0x10, 0.4f, H(void *, 0x2290), workspace.state_14.u.contact); } if (math_is_below_plane_within_depth(25.7f)) { - queue_copy_record_by_index(25); + actuator_play_pattern(25); H(u16, 0x1FA) = 42; if (g_hero_override_flag) { FLD(g_hero_l22_state_block, float, 0x180) = 0.1f; diff --git a/src/pal/levels/23_damosel_orbit/L23_002BBAE8-hero.c b/src/pal/levels/23_damosel_orbit/L23_002BBAE8-hero.c index 3dc13d9a9..58ec87a8d 100644 --- a/src/pal/levels/23_damosel_orbit/L23_002BBAE8-hero.c +++ b/src/pal/levels/23_damosel_orbit/L23_002BBAE8-hero.c @@ -83,7 +83,7 @@ extern void cam_project_vector_onto_view_plane(void *, void *); extern float cam_get_view_space_vector_length(void *); extern float cam_get_view_space_height(void *); extern void cam_set_view_space_vector_length(void *, void *, float); -extern int queue_copy_record_by_index(unsigned int index); +extern int actuator_play_pattern(unsigned int index); extern void moby_update_transform_history_followers(void *, int); extern float ReadPadFloatHistory(int); extern void UpdateHeroAimTarget(float, float, float); @@ -478,7 +478,7 @@ case 0x32: case 0x33: case 0x34: float oldPitch,steer,minimumSteer,pitchChange,controllerScale,rate,maximumInput,steeringLimit; if (H(u32,0x2294)==0x34) { if (H(s32,0x1B8)>58) g_hero_state_machine_word=65535; - snd_update_slot_object(5,H(void*,0x2290),15);queue_copy_record_by_index(22); + snd_update_slot_object(5,H(void*,0x2290),15);actuator_play_pattern(22); } else { int slot=H(s32,0x2440); if (slot!=-1 && FLD(g_sound_state+slot*0x70, void *, 0x88)==H(void*,0x2290) && @@ -1083,7 +1083,7 @@ case 20: coll_process_hit(0.4f, &workspace.state_14.delta, 0x10, H(void *, 0x2290), workspace.state_14.u.contact); } if (math_is_below_plane_within_depth(25.7f)) { - queue_copy_record_by_index(25); + actuator_play_pattern(25); H(u16, 0x1FA) = 42; if (g_hero_override_flag) { FLD(g_hero_l23_state_block, float, 0x180) = 0.1f; diff --git a/src/pal/levels/23_damosel_orbit/L23_002BBAE8.c b/src/pal/levels/23_damosel_orbit/L23_002BBAE8.c index 5f2f77ebb..0e2938764 100644 --- a/src/pal/levels/23_damosel_orbit/L23_002BBAE8.c +++ b/src/pal/levels/23_damosel_orbit/L23_002BBAE8.c @@ -62,7 +62,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l22_set_action_pal(s32, s32); +extern s32 hero_l22_set_move_state_pal(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_pal(s32); extern int hero_play_sound(s32, s32); @@ -146,7 +146,7 @@ s32 hero_l23_apply_contact_push_pal(s32 apply_push) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB || *(s16 *)(other + 0xAA) == 0x558)) { - hero_l22_set_action_pal(0x7D, 1); + hero_l22_set_move_state_pal(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -157,7 +157,7 @@ s32 hero_l23_apply_contact_push_pal(s32 apply_push) { AdjustPlayerHealth_pal(FloatToInt(*(float *)(effect_slot + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l22_set_action_pal(0x16, 1); + hero_l22_set_move_state_pal(0x16, 1); } g_hero_state.f1DC = 0x40; if (g_hero_state.f21C == 0) { @@ -167,13 +167,13 @@ s32 hero_l23_apply_contact_push_pal(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l22_set_action_pal(0x72, 1); + hero_l22_set_move_state_pal(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l22_set_action_pal(0x73, 1); + hero_l22_set_move_state_pal(0x73, 1); } else if (entry->f24 & 8) { - hero_l22_set_action_pal(0x8C, 1); + hero_l22_set_move_state_pal(0x8C, 1); } else { - hero_l22_set_action_pal(0x16, 1); + hero_l22_set_move_state_pal(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&vec); @@ -185,15 +185,15 @@ s32 hero_l23_apply_contact_push_pal(s32 apply_push) { } break; case 1: - hero_l22_set_action_pal(0x42, 1); + hero_l22_set_move_state_pal(0x42, 1); hero_flatten_push_vector(&vec, flag, 0.10000001f, 0.060000002f); break; case 2: if ((entry->f24 & 4) || g_hero_state.f1874 <= 0) { if (entry->f20 != 0 && *(s16 *)(entry->f20 + 0xAA) == 0x11DF) { - hero_l22_set_action_pal(0x5A, 1); + hero_l22_set_move_state_pal(0x5A, 1); } else { - hero_l22_set_action_pal(0x59, 1); + hero_l22_set_move_state_pal(0x59, 1); } charged_shot_release(g_hero_state.f2290, 0); FastVecScale(&vec, &vec, 0.11400001f); diff --git a/src/pal/levels/23_damosel_orbit/L23_003C2268-cc-g8.c b/src/pal/levels/23_damosel_orbit/L23_003C2268-cc-g8.c index 97e332a50..a962c4f0b 100644 --- a/src/pal/levels/23_damosel_orbit/L23_003C2268-cc-g8.c +++ b/src/pal/levels/23_damosel_orbit/L23_003C2268-cc-g8.c @@ -114,7 +114,7 @@ extern float moby_get_anim_value(char *),math_random_float_range(float,float); extern int math_is_value_within_step_pal(char *,float); extern void *ribbon_trail_create(u8 *,u8 *,u8 *,u8,u8,float,float,float,float,short,short,int,int,int,int,int); extern void moby_transform_joint_to_world(char *,int,char *); -extern int queue_copy_record_by_index(unsigned int); +extern int actuator_play_pattern(unsigned int); /* Runs the enemy's state machine: updates its distance to the hero, then handles its states (idle, charge, beam attack, retreat). (PAL) */ void enemy_update_state_machine_pal(u8 *moby) @@ -309,7 +309,7 @@ void enemy_update_state_machine_pal(u8 *moby) FastVecAdd(point,point,((DispatchState *)vars)->f2A0+0xC0); FastVecScale(point,point,15.0f); point[3]=5627.9248f; part_queue_impact_effect((int)g_hero_moby,(int)moby,0x10007,(int)(moby+0x10),(int)point,g_mothership_impact_param); - queue_copy_record_by_index(43); + actuator_play_pattern(43); SpawnExplosion_pal(g_boss_hit_point,1,10,10,10,10,45,0,1.2f,20.0f,0,1,0,0); ((DispatchState *)vars)->f3BE=1; } @@ -320,7 +320,7 @@ void enemy_update_state_machine_pal(u8 *moby) if (((DispatchState *)vars)->f3B4!=-1) { snd_stop_voice(((DispatchState *)vars)->f3B4); ((DispatchState *)vars)->f3B4=-1; } } else if ((int)U(moby,0x96)>(((int)(g_enemy_flee_health_threshold) * 5 + 2) / 6)) { moby_clear_selected((char *)moby); moby_set_state(moby,5,0); } else { if ((int)U(moby,0x96)>=(((int)(g_enemy_flee_health_threshold-5) * 5 + 2) / 6) && ((DispatchState *)vars)->f3BE) { - snd_start_in_slot(29,0,0); ((DispatchState *)vars)->f3BE=0; queue_copy_record_by_index(43); + snd_start_in_slot(29,0,0); ((DispatchState *)vars)->f3BE=0; actuator_play_pattern(43); } } break; diff --git a/src/pal/levels/23_damosel_orbit/L23_0041B350-boss-g8.c b/src/pal/levels/23_damosel_orbit/L23_0041B350-boss-g8.c index a2760eec1..d19174bcf 100644 --- a/src/pal/levels/23_damosel_orbit/L23_0041B350-boss-g8.c +++ b/src/pal/levels/23_damosel_orbit/L23_0041B350-boss-g8.c @@ -114,7 +114,7 @@ extern void moby_store_position_private(u8 *, void *); extern int player_slot_has_object(unsigned int); extern int charged_shot_get_for_owner(int); extern void charged_shot_release(int, int); -extern int queue_copy_record_by_index(unsigned int); +extern int actuator_play_pattern(unsigned int); extern int moby_check_target_point_from_offset(char *, void *); extern void boss_turn_gun_toward_target_pal(char *); extern void mothership_project_point_onto_surface(char *, float); @@ -150,7 +150,7 @@ extern char *SpawnExplosion_pal(char *, int, int, int, int, int, int, int, float extern void FadeToBlack(int); extern void moby_copy_joint_transform_to_object(u8 *, char *, int, int); extern void hero_reset_position_and_direction_pal(char *, char *, int, int); -extern int hero_l22_set_action_pal(int, int); +extern int hero_l22_set_move_state_pal(int, int); extern char *effect_create_attached(char *, char *); extern void build_axis_rotation_quaternion(char *, int, float); @@ -579,7 +579,7 @@ void mothership_boss_part_update_pal(u8 *object) cancel_hero_item_animation_pal(); release_moby_animation_slot((LvlSlotCtx *)(((ResidentHeroView *)g_hero_state)->player), &((ResidentHeroView *)g_hero_state)->slotList); ((ResidentHeroView *)g_hero_state)->slotCount = 0; - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); g_charged_l23_blast_timer = 0; return; } @@ -649,5 +649,5 @@ void mothership_boss_part_update_pal(u8 *object) } math_fast_float_d((char *)&g_boss_camera_timer[0]); if (g_boss_camera_timer[0]) - queue_copy_record_by_index(0x2b); + actuator_play_pattern(0x2b); } diff --git a/src/pal/levels/23_damosel_orbit/L23_0041C820-cc-g8.c b/src/pal/levels/23_damosel_orbit/L23_0041C820-cc-g8.c index 2244171a5..397dcfb10 100644 --- a/src/pal/levels/23_damosel_orbit/L23_0041C820-cc-g8.c +++ b/src/pal/levels/23_damosel_orbit/L23_0041C820-cc-g8.c @@ -196,7 +196,7 @@ extern int mothership_call_helper_return_true(void); extern int L23_DrawEncounterHud(void); extern void cancel_hero_item_animation_pal(void); extern void release_moby_animation_slot(void *, void *); -extern int hero_l22_set_action_pal(int, int); +extern int hero_l22_set_move_state_pal(int, int); extern char *GetLocalizedString(int); extern int level_l00_call_module_handler_with_arg_9_pal(int, int); extern void cam_compute_view_direction(void *, void *, int); @@ -420,7 +420,7 @@ void mothership_update_pal(L23Moby *moby) { cancel_hero_item_animation_pal(); release_moby_animation_slot(game->f2290, game->f1870); game->f187C = 0; - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); } } cam_compute_view_direction(&moby->pos, vars->m410, 0); diff --git a/src/pal/levels/23_damosel_orbit/L23_00420AD0-g8.c b/src/pal/levels/23_damosel_orbit/L23_00420AD0-g8.c index e9d67c3ee..f2e951d3b 100644 --- a/src/pal/levels/23_damosel_orbit/L23_00420AD0-g8.c +++ b/src/pal/levels/23_damosel_orbit/L23_00420AD0-g8.c @@ -44,7 +44,7 @@ extern void part_l23_spawn_hit_sparks_pal(char *); extern void moby_set_state(void *, int, int); extern void cancel_hero_item_animation_pal(void); extern void release_moby_animation_slot(int, void *); -extern s32 hero_l22_set_action_pal(int, int); +extern s32 hero_l22_set_move_state_pal(int, int); extern void gfx_update_color_fade_pal(void *, void *); extern int part_spawn_damage_debris_pal(void *, void *, void *); extern void moby_transform_joint_point(void *, int, void *); @@ -108,7 +108,7 @@ void UpdateShieldHitsAndStrength_pal(unsigned char *moby) { cancel_hero_item_animation_pal(); release_moby_animation_slot(g_hero_state.f2290, g_hero_state.f1870); g_hero_state.f187C = 0; - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); return; } } diff --git a/src/pal/levels/23_damosel_orbit/L23_00423838-flags.c b/src/pal/levels/23_damosel_orbit/L23_00423838-flags.c index c721730d1..b6917a63f 100644 --- a/src/pal/levels/23_damosel_orbit/L23_00423838-flags.c +++ b/src/pal/levels/23_damosel_orbit/L23_00423838-flags.c @@ -25,7 +25,7 @@ extern u8 *g_hero_moby; extern s32 CollLine(void *, void *, s32, void *, s32); extern void make_hit_descriptor(float, L23Hit *, u8 *, s32, L23Vec *); extern void QueueMobyImpact(u8 *, L23Hit *); -extern int queue_copy_record_by_index(s32); +extern int actuator_play_pattern(s32); extern void part_start_random_scale_effect(void *, s32, s32); /* the object's first record is set up against the table entry, then its marker byte is set */ @@ -50,7 +50,7 @@ void shot_update_hit_check_pal(u8 *shot, void *ray_start) { hit.h1A = *(u16 *)(shot + 0xAA); if (g_last_ray_hit.f18 == g_hero_moby) { QueueMobyImpact(g_last_ray_hit.f18, &hit); - queue_copy_record_by_index(0x2B); + actuator_play_pattern(0x2B); } part_start_random_scale_effect(shot + 0x10, 0xA, 1); } else { diff --git a/src/pal/levels/24_ship_shack/L24_003FED38-g8.c b/src/pal/levels/24_ship_shack/L24_003FED38-g8.c index 4d1f3a238..ff1d78c7f 100644 --- a/src/pal/levels/24_ship_shack/L24_003FED38-g8.c +++ b/src/pal/levels/24_ship_shack/L24_003FED38-g8.c @@ -40,7 +40,7 @@ extern void vec_scale_to_length(void *, void *, float); extern void make_hit_descriptor(void *, char *, int, void *, float); extern void QueueMobyImpact(char *, void *); extern int StartAttachedEffect(char *, int, char *); -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern void vec_clear_128(void *); extern void matrix_mul_vec3(void *, void *, void *); extern void vec_compute_object_to_target(char *, char *, void *, float); @@ -120,7 +120,7 @@ void lava_l24_gun_update_pal(char *moby) math_spring_float_to_goal((float *)(vars+0x50),(float *)(vars+0x54),0,0.072000004f,0.012f,0.15f); *(int *)(vars+0x60)=0; } - if (g_hero_state.i[0x2294/4]==1) hero_l00_set_action(29,1); + if (g_hero_state.i[0x2294/4]==1) hero_l00_set_move_state(29,1); moby_transform_joint_to_world(moby,0,vars); vec_clear_128(emit_vec); emit_vec[1]=-1; matrix_mul_vec3(emit_vec,emit_vec,moby+0xc0); diff --git a/src/pal/levels/30_insomniac_museum/L30_003B7808-sw.c b/src/pal/levels/30_insomniac_museum/L30_003B7808-sw.c index 0d9293722..84fd8b1ac 100644 --- a/src/pal/levels/30_insomniac_museum/L30_003B7808-sw.c +++ b/src/pal/levels/30_insomniac_museum/L30_003B7808-sw.c @@ -45,7 +45,7 @@ extern int g_vehicle_current_anim __attribute__((sda)); extern char * part_find_owned_effect_slot(void *,int,int); extern float func_002A0558(void *,void *); extern int TryClaimNotice(int,int,int); -extern s32 hero_l00_set_action_pal(int,int); +extern s32 hero_l00_set_move_state_pal(int,int); extern void set_hero_animation_pal(int,int,float); extern float FastVecLength(void *); extern float FastAddRotations(float,float); @@ -147,7 +147,7 @@ void UpdateHoverVehicleMoby_pal(HoverMoby *obj) { if(g_pad_held_flags&16) in.active=request; } if(in.active) { - hero_l00_set_action_pal(0x31,0); + hero_l00_set_move_state_pal(0x31,0); set_hero_animation_pal(g_vehicle_idle_anim,0,15.0f); qcopy_nc(&g_hero_state.rotation,&obj->rotation); qcopy_nc(&g_hero_state.position,&obj->position); @@ -258,14 +258,14 @@ void UpdateHoverVehicleMoby_pal(HoverMoby *obj) { case 4: obj->flags=obj->mclass->flags; I(g_hero_state.moby,0x9c)=0; - hero_l00_set_action_pal(0,1); + hero_l00_set_move_state_pal(0,1); g_hero_state.vehicle=0; obj->state=1; break; case 5: obj->flags=obj->mclass->flags; I(g_hero_state.moby,0x9c)=0; - hero_l00_set_action_pal(0,1); + hero_l00_set_move_state_pal(0,1); moby_transform_joint_to_world(obj,0,&frame.dir); SpawnExplosionEffects_pal(obj,st,&frame.dir,0.0f,0.0f,10,3,16,4.0f,2.0f,9.0f,1.0f,-1,15.0f,1,1,-1,0,0x810001); moby_mark_spawned(obj); diff --git a/src/pal/levels/30_insomniac_museum/L30_003E5F94-g82.c b/src/pal/levels/30_insomniac_museum/L30_003E5F94-g82.c index c55449ae7..18f151f2c 100644 --- a/src/pal/levels/30_insomniac_museum/L30_003E5F94-g82.c +++ b/src/pal/levels/30_insomniac_museum/L30_003E5F94-g82.c @@ -48,7 +48,7 @@ extern int AcquireEntitySlot(void *,int,void *); extern u8 *level_get_slot_body(int,int); extern float math_random_signed_float_range(float,float), math_random_float_range(float,float); extern void vec_clear_128(void *), sheepinator_clear_records(void); -extern s32 hero_l00_set_action_pal(int,int); +extern s32 hero_l00_set_move_state_pal(int,int); extern int math_fast_float_d(void *), get_ammo(int); extern void hud_add_moby_marker(void *,unsigned int,float,void *,float,int,int,float,int); extern void moby_transform_joint_to_world(void *,int,void *); @@ -118,7 +118,7 @@ void UpdateMuseumChargedWeapon_pal(ChargeWeaponMoby *obj) { g_charge_weapon_effects.reticle=-1; if (g_hero_state.selected) g_hero_state.held=g_hero_state.selected; if (!g_charge_weapon_initialized) g_charge_weapon_initialized=1; - if (g_hero_state.mode==1) hero_l00_set_action_pal(29,1); + if (g_hero_state.mode==1) hero_l00_set_move_state_pal(29,1); enabled=1; if (g_hero_state.mode==29) { if (!math_fast_float_d(&g_hero_state.timer)) enabled=0; diff --git a/src/pal/levels/30_insomniac_museum/L30_00410A38-g8.c b/src/pal/levels/30_insomniac_museum/L30_00410A38-g8.c index a46aeb209..1abd0b5eb 100644 --- a/src/pal/levels/30_insomniac_museum/L30_00410A38-g8.c +++ b/src/pal/levels/30_insomniac_museum/L30_00410A38-g8.c @@ -50,7 +50,7 @@ extern char *part_find_owned_effect_slot(char *,int,int); extern void gfx_start_color_fade_pal(char *,void *), gfx_update_color_fade_pal(char *,void *); extern float vec_length_xy(void *), func_002A0558(char *,char *), FastAddRotations(float,float), math_fast_sin_or_cos_b(float), fast_vec_dist(void *,void *); extern int TryClaimNotice(int,int,int), math_random_int_below(int), flag_set_first_pending(char *); -extern int hero_l00_set_action_pal(int,int); +extern int hero_l00_set_move_state_pal(int,int); extern void UpdateHoverVehicleMotion_pal(char *,int), set_hero_animation_pal(int,int,float), moby_mark_in_range(char *); extern void moby_set_state(char *,int,int), moby_update_ground_check(char *), gfx_add_draw_callback_third(void (*)(char *),void *); extern void moby_transform_joint_to_world(char *,int,void *); @@ -136,7 +136,7 @@ void MuseumVehicleUpdate_pal(MuseumVehicle *obj) { if (g_pad_state.pressed&16) activate=prompt_shown; } if (activate) { - hero_l00_set_action_pal(49,0);set_hero_animation_pal(g_vehicle_animation_id,0,15.0f); + hero_l00_set_move_state_pal(49,0);set_hero_animation_pal(g_vehicle_animation_id,0,15.0f); qcopy(g_hero_state.rotation,obj->rotation);qcopy(g_hero_state.position,obj->position); g_hero_state.vehicle=obj;obj->state=3;obj->flags=0;I(g_hero_state.hero,0x9C)=-1; } @@ -156,7 +156,7 @@ void MuseumVehicleUpdate_pal(MuseumVehicle *obj) { break; case 4: if (flag_set_first_pending(obj)) { - g_hero_state.camera_x=0;g_hero_state.camera_y=-1.0f;hero_l00_set_action_pal(11,1); + g_hero_state.camera_x=0;g_hero_state.camera_y=-1.0f;hero_l00_set_move_state_pal(11,1); g_hero_state.vehicle=0;g_hero_state.vehicle_id=-1; } obj->flags=0;I(g_hero_state.hero,0x9C)=0;UpdateHoverVehicleMotion_pal(obj,0); @@ -166,7 +166,7 @@ void MuseumVehicleUpdate_pal(MuseumVehicle *obj) { case 6: break; case 5: obj->flags=I(obj->class_data,0x10);I(g_hero_state.hero,0x9C)=0; - hero_l00_set_action_pal(0,1);moby_transform_joint_to_world(obj,0,pos); + hero_l00_set_move_state_pal(0,1);moby_transform_joint_to_world(obj,0,pos); SpawnExplosionEffects_pal(obj,vars,pos,0.0f,0.0f,10,3,16,4.0f,2.0f,9.0f,1.0f,-1,15.0f,1,1,-1,0,0x810001); qcopy(obj->position,&vars->spawn);g_hero_state.vehicle_id=-1;g_hero_state.vehicle=0;obj->state=0; break; diff --git a/src/pal/levels/30_insomniac_museum/L30_0041C218-sw-g8.c b/src/pal/levels/30_insomniac_museum/L30_0041C218-sw-g8.c index 978d4751a..d38092bdb 100644 --- a/src/pal/levels/30_insomniac_museum/L30_0041C218-sw-g8.c +++ b/src/pal/levels/30_insomniac_museum/L30_0041C218-sw-g8.c @@ -53,7 +53,7 @@ extern void museum_effect_object_spawn(char *),museum_effect_holder_update(char extern int ForceClaimNotice(int,int,int); extern int load_is_class_cached(int); extern void LoadClassIntoFreeCacheSlot(int), hero_start_loader_state(int); -extern s32 hero_l00_set_action_pal(int,int); +extern s32 hero_l00_set_move_state_pal(int,int); extern void matrix_mul_vec3(void *,void *,void *),FastVecAdd(void *,void *,void *),FastVecSub(void *,void *,void *); extern float FastAddRotations(float,float),mat_fast_helper_a(float,float),vec_distance_xy(void *,void *); extern void hero_start_target_state(void *,int,float); @@ -150,7 +150,7 @@ void museum_effect_exhibit_update_pal(char *obj) { } case 3: if (flag_set_first_pending(obj)) { - hero_l00_set_action_pal(0x6F,0);set_hero_animation_pal(0x54,0,17.0f); + hero_l00_set_move_state_pal(0x6F,0);set_hero_animation_pal(0x54,0,17.0f); FastVecSub(vec,g_camera_l30_position,g_hero_state.position); matrix_mul_vec3(vec,vec,g_hero_state.matrix_40); SetCamera5Pose(g_camera_l30_position,g_camera_l30_position,3,100,0); diff --git a/src/pal/levels/shared/L00_002A3988-g8.c b/src/pal/levels/shared/L00_002A3988-g8.c index 11fbb757e..05f76d58a 100644 --- a/src/pal/levels/shared/L00_002A3988-g8.c +++ b/src/pal/levels/shared/L00_002A3988-g8.c @@ -114,7 +114,7 @@ extern void menu_update_pause_pal(void), gfx_call_engine_routine_zero_pal(void), extern void update_purchase_menu_and_preview_pal(void), shop_draw_purchase_menu_scene_pal(void), transition_draw_background_pal(void); extern int update_playback_scene_pal(void); extern void level_call_seq_update_disc_player_pal(void), level_call_text_draw_screen_wipe_pal(void); -extern void math_trap_always(void), level_decrement_counter_clamped(void), math_add_wrapping_counter(void); +extern void math_trap_always(void), level_decrement_counter_clamped(void), actuator_update(void); extern void mc_update_state_pal(void), map_update_state_machine(void), SetupGifPaging(int); extern void VU1_addGSregister(unsigned int, unsigned long long); extern int GetIconFrame(int, int); @@ -270,7 +270,7 @@ void RunLevelLoop_pal(void) } g_pad_hold_frame_count[0]++; level_decrement_counter_clamped(); - if (!g_game_l00_mode[0]) math_add_wrapping_counter(); + if (!g_game_l00_mode[0]) actuator_update(); mc_update_state_pal(); map_update_state_machine(); if ((unsigned)(g_memcard_state.pressed - 15) < 2 || g_memcard_state.alternate == 15 || g_memcard_input_latch[0]) { @@ -348,7 +348,7 @@ void RunLevelLoop_pal(void) pad_poll_ports_pal(); cutscene_update_frame_pal(); } - math_add_wrapping_counter(); + actuator_update(); sceGsSyncV(0); g_ring_animation_counter[0]++; } else if (g_debug_state == 3) { @@ -364,7 +364,7 @@ void RunLevelLoop_pal(void) pad_poll_ports_pal(); cutscene_update_frame_pal(); } - math_add_wrapping_counter(); + actuator_update(); counter_count_calls_bump(); sceGsSyncV(0); g_ring_animation_counter[0]++; diff --git a/src/pal/levels/shared/L00_002B1200.c b/src/pal/levels/shared/L00_002B1200.c index a71256f3e..6be85ec8b 100644 --- a/src/pal/levels/shared/L00_002B1200.c +++ b/src/pal/levels/shared/L00_002B1200.c @@ -121,7 +121,7 @@ extern void attachment_reset_all(void); extern void hero_update_collision_capsule_pal(void); extern void hero_clear_queued_anim(void); extern void func_002A677C(char *); -extern int hero_l00_set_action_pal(int, int); +extern int hero_l00_set_move_state_pal(int, int); extern int level_run_slot_callback(int); extern int g_pad_pressed_flags[]; extern char g_str_timed_state_text_a[]; @@ -178,7 +178,7 @@ void SetHeroMode_pal(int mode, int value, char *object) if (count >= 5) *(int *)(r + 0x24CC) = 4; } - hero_l00_set_action_pal(value, 2); + hero_l00_set_move_state_pal(value, 2); } } } diff --git a/src/pal/levels/shared/L00_002B9C20.c b/src/pal/levels/shared/L00_002B9C20.c index 8f2548313..580393730 100644 --- a/src/pal/levels/shared/L00_002B9C20.c +++ b/src/pal/levels/shared/L00_002B9C20.c @@ -44,7 +44,7 @@ extern void hero_reset_speeds_and_vectors(void); extern void level_release_slot_list(void *p); extern void cancel_hero_item_animation_pal(void); extern void attachment_reset_all(void); -extern s32 hero_l00_set_action_pal(int a0, int a1); +extern s32 hero_l00_set_move_state_pal(int a0, int a1); extern void anim_start_object_at_frame(int a0, int a1); extern void hero_l00_update_ground_contact(void); extern float fast_vec_dist(void *a, void *b); @@ -93,7 +93,7 @@ void hero_reset_position_and_direction_pal(void *position, void *direction, int attachment_reset_all(); if (sound != -1) - hero_l00_set_action_pal(sound, 2); + hero_l00_set_move_state_pal(sound, 2); anim_start_object_at_frame(*(u8 *)(res->object + 0x43), *(u8 *)(res->object + 0x41)); diff --git a/src/pal/levels/shared/L00_002BA480-hero.c b/src/pal/levels/shared/L00_002BA480-hero.c index 2c2821124..da4eb8097 100644 --- a/src/pal/levels/shared/L00_002BA480-hero.c +++ b/src/pal/levels/shared/L00_002BA480-hero.c @@ -153,7 +153,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -727,7 +727,7 @@ void hero_l00_update_state_machine_pal(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { temp_a2 = ((Hero *)g_hero_state)->i[0x2440/4]; if (temp_a2 != -1) { @@ -1470,7 +1470,7 @@ void hero_l00_update_state_machine_pal(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x2a; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l20_extra_state)->f[0x180/4] = 0.1f; diff --git a/src/pal/levels/shared/L00_002C4480-sw.c b/src/pal/levels/shared/L00_002C4480-sw.c index 35a9ca039..330d86f0e 100644 --- a/src/pal/levels/shared/L00_002C4480-sw.c +++ b/src/pal/levels/shared/L00_002C4480-sw.c @@ -70,8 +70,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -139,7 +139,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l00_set_action_pal(s32 action, s32 animate) { +s32 hero_l00_set_move_state_pal(s32 action, s32 animate) { f32 dir[4]; f32 pos[4]; u8 *objectSnapshot; @@ -188,7 +188,9 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -201,8 +203,8 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l00_set_action_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_action_pal(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l00_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_or_form_id(0) == 0x51) set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 15.0f); else set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, -1.0f); @@ -349,7 +351,7 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l00_set_action_pal(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l00_set_move_state_pal(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.15400001f) REAL(0x1B4) = 0.15400001f; @@ -395,12 +397,12 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l00_set_action_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_action_pal(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l00_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state_pal(0x76, 1); return 0; } if (hero_try_start_grab_pal()) return 0; if (hero_get_weapon_or_form_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l00_set_action_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 15.0f); + if (hero_l00_set_move_state_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 15.0f); return 0; } if (!animate) goto finish; @@ -425,7 +427,7 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.14000002f) REAL(0x1B4) = 0.14000002f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_action_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.14000002f); @@ -604,13 +606,13 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l00_set_action_pal(0x81, 1); return 0; + hero_l00_set_move_state_pal(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_action_blocked_flag) { hero_l00_set_action_pal(0x6E, 1); return 0; } + action != 0x38 && !g_hero_action_blocked_flag) { hero_l00_set_move_state_pal(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l00_set_action_pal(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l00_set_move_state_pal(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -685,9 +687,9 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_map_event_flag) hero_l00_set_action_pal(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l00_set_action_pal(0x79, 1); - else hero_l00_set_action_pal(0x39, 1); + if (g_current_map_index == 2 && g_map_event_flag) hero_l00_set_move_state_pal(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l00_set_move_state_pal(0x79, 1); + else hero_l00_set_move_state_pal(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -738,7 +740,7 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -767,7 +769,7 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -776,7 +778,7 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4B8) = 0.6f; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -918,7 +920,7 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -1009,7 +1011,7 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -1021,7 +1023,7 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); @@ -1056,7 +1058,7 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { set_hero_animation_pal(0x11, 0, 7.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_action_pal(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state_pal(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation_pal(0, 0, 7.0f); goto finish; case 0x4B: @@ -1090,7 +1092,7 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_action_curve_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_action_pal(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state_pal(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1134,7 +1136,7 @@ s32 hero_l00_set_action_pal(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.09f; if (WORD(0x640) > 12 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l00_set_action_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; + PTR(0x2290)[0xA8] = 255; hero_l00_set_move_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; return 0; } HALF(0x1DC) = 64; REAL(0x69C) = 0.050000004f; diff --git a/src/pal/levels/shared/L00_002C8F98.c b/src/pal/levels/shared/L00_002C8F98.c index 483681f10..19e8678b4 100644 --- a/src/pal/levels/shared/L00_002C8F98.c +++ b/src/pal/levels/shared/L00_002C8F98.c @@ -2,7 +2,7 @@ #include "names.h" extern char D_00189E20_4[]; -extern int hero_l00_set_action(int a0, int a1); +extern int hero_l00_set_move_state(int a0, int a1); extern void cancel_hero_item_animation(void); /* Gates the level transition on the shared block: the state word must be 0, 2 or 3, the byte at @@ -23,7 +23,7 @@ int hero_try_start_transition_pal(void) return 0; cancel_hero_item_animation(); *(int *)(p + 0xEA4) = 2; - hero_l00_set_action(0x22, 1); + hero_l00_set_move_state(0x22, 1); return 1; } return 0; diff --git a/src/pal/levels/shared/L00_002C95C0-sw.c b/src/pal/levels/shared/L00_002C95C0-sw.c index 44a5cd89a..823e773e9 100644 --- a/src/pal/levels/shared/L00_002C95C0-sw.c +++ b/src/pal/levels/shared/L00_002C95C0-sw.c @@ -104,7 +104,7 @@ extern int PadPressedWithin(u32, int, int *); extern int moby_is_class_71(unsigned char *); extern void hero_setup_attached_object_transform_pal(void); extern int FloatToInt(float); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern int get_ammo(int); extern int snd_play_from_class_bank(int, int, char *, int); extern char *SelectBestEligibleTarget(void *, int, int, float, float, float, float); @@ -164,9 +164,9 @@ int ProcessHeroEquippedItemInput_pal(void) if ((g_hero_state.mode == 1 || g_hero_state.mode == 29) && g_hero_state.frame >= 18) hero_setup_attached_object_transform_pal(); else - hero_l00_set_action_pal(21, 1); + hero_l00_set_move_state_pal(21, 1); } else { - hero_l00_set_action_pal(19, 1); + hero_l00_set_move_state_pal(19, 1); } goto clear_action; } @@ -193,9 +193,9 @@ int ProcessHeroEquippedItemInput_pal(void) (g_hero_state.fast_attack && g_hero_state.movement > 0.57f) || (g_hero_state.mode == 8 && g_hero_state.movement > 0.57f)) { if (g_hero_state.attack_blocked || g_hero_state.attack_pending) goto clear_action; - hero_l00_set_action_pal(20, 1); + hero_l00_set_move_state_pal(20, 1); } else { - hero_l00_set_action_pal(19, 1); + hero_l00_set_move_state_pal(19, 1); } goto clear_action; @@ -207,7 +207,7 @@ int ProcessHeroEquippedItemInput_pal(void) if (g_hero_state.attack_delay) goto clear_action; if ((float)range->trigger_frame <= g_hero_state.animation_frame && (g_pad_state.buttons.word.held & 8) && PadPressedWithin(mask, 12, 0)) { - hero_l00_set_action_pal(21, 1); + hero_l00_set_move_state_pal(21, 1); break; } } @@ -221,10 +221,10 @@ int ProcessHeroEquippedItemInput_pal(void) action = action < 13 ? action : 12; if (PadPressedWithin(mask, action, 0)) { if (g_pad_state.buttons.word.held & 8) { - hero_l00_set_action_pal(21, 1); + hero_l00_set_move_state_pal(21, 1); goto clear_action; } - hero_l00_set_action_pal(19, 1); + hero_l00_set_move_state_pal(19, 1); } } } @@ -243,7 +243,7 @@ int ProcessHeroEquippedItemInput_pal(void) break; if (!(g_pad_state.buttons.word.held & 32) || g_hero_state.input_window < 19) break; if (get_ammo(state)) { - hero_l00_set_action_pal(131, 1); + hero_l00_set_move_state_pal(131, 1); break; } if (g_pad_state.buttons.word.pressed & 32) { @@ -288,7 +288,7 @@ int ProcessHeroEquippedItemInput_pal(void) if (g_hero_state.mode == 39 && (g_hero_state.alternate_target_ready || g_hero_state.nearby_ready)) { if (PadPressedWithin(mask, action, 0) || ((g_pad_state.buttons.word.held & mask) && g_hero_state.input_window >= 13)) { - hero_l00_set_action_pal(40, 1); + hero_l00_set_move_state_pal(40, 1); break; } } @@ -304,16 +304,16 @@ int ProcessHeroEquippedItemInput_pal(void) else g_hero_state.alternate_target_ready = 0; } if (g_hero_state.alternate_target_ready && !g_hero_state.control_lock && g_hero_state.mode != 43) { - hero_l00_set_action_pal(43, 1); + hero_l00_set_move_state_pal(43, 1); break; } } if (g_hero_state.nearby_ready && !g_hero_state.control_lock) { - hero_l00_set_action_pal(35, 1); + hero_l00_set_move_state_pal(35, 1); break; } if (g_hero_state.second_target_ready) { - hero_l00_set_action_pal(138, 1); + hero_l00_set_move_state_pal(138, 1); break; } break; @@ -338,7 +338,7 @@ int ProcessHeroEquippedItemInput_pal(void) if (get_ammo(-1)) { if (g_hero_state.state == 12 || g_hero_state.state == 0 || g_hero_state.mode == 3 || (g_hero_state.state == 1 && g_hero_state.transition_progress < 0.7f)) { - hero_l00_set_action_pal(34, 1); + hero_l00_set_move_state_pal(34, 1); break; } start_equipped_item_animation_pal(); @@ -358,7 +358,7 @@ int ProcessHeroEquippedItemInput_pal(void) action = action < frame_window ? 8 : frame_window; if (!PadPressedWithin(mask, action, &scratch.detach_age)) break; if (g_hero_state.object) { - hero_l00_set_action_pal(31, 1); + hero_l00_set_move_state_pal(31, 1); if (g_hero_state.object) PlayMobySound(0, 0, g_hero_state.object); } } @@ -374,7 +374,7 @@ int ProcessHeroEquippedItemInput_pal(void) (g_hero_state.state < 2 || g_hero_state.state == 12 || ((g_hero_state.state == 2 || g_hero_state.state == 4) && g_hero_state.action_ready)) && (g_pad_state.buttons.both & 0x800000008ULL) == 0x800000008ULL) - hero_l00_set_action_pal(123, 1); + hero_l00_set_move_state_pal(123, 1); if (g_pad_state.buttons.word.pressed & 8) g_button_hold_timer = 25; } return g_hero_state.frame < previous_frame; diff --git a/src/pal/levels/shared/L00_002C95C0.c b/src/pal/levels/shared/L00_002C95C0.c index 83c9b535f..8e1de8dee 100644 --- a/src/pal/levels/shared/L00_002C95C0.c +++ b/src/pal/levels/shared/L00_002C95C0.c @@ -92,7 +92,7 @@ void hero_update_height_offset_pal(void) extern char D_00189E20_4[]; -extern s32 hero_l00_set_action(int a0, int a1); +extern s32 hero_l00_set_move_state(int a0, int a1); extern int PadPressedWithin(int, int, int *); extern int hero_get_step_offset_from_direction(void); extern int pad_presses_within_frames(int, int, int, int); @@ -113,7 +113,7 @@ int hero_try_start_move_from_buffer_pal(int window, int no_idle_fallback) r = hero_get_step_offset_from_direction(); if ((g_pad_pressed_flags[0] & 8) && r > 0) { if (pad_presses_within_frames(0x40, 0x1F000, window + r, r) != 0) { - hero_l00_set_action(0xB, 1); + hero_l00_set_move_state(0xB, 1); return 1; } } @@ -121,14 +121,14 @@ int hero_try_start_move_from_buffer_pal(int window, int no_idle_fallback) if (*(short *)(p + 0x1454) != 0) { if (0.9f < *(float *)(p + 0x24B8)) { if (hero_classify_input_direction() != 2) { - hero_l00_set_action(0xB, 1); + hero_l00_set_move_state(0xB, 1); return 1; } } } if (no_idle_fallback != 0) return 0; - hero_l00_set_action(7, 1); + hero_l00_set_move_state(7, 1); return 1; } diff --git a/src/pal/levels/shared/L00_002CA888-deck.c b/src/pal/levels/shared/L00_002CA888-deck.c index 4d49a9656..ce365a041 100644 --- a/src/pal/levels/shared/L00_002CA888-deck.c +++ b/src/pal/levels/shared/L00_002CA888-deck.c @@ -78,7 +78,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed_pal(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction_pal(void); -s32 hero_l00_set_action_pal(s32, s32); +s32 hero_l00_set_move_state_pal(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition_pal(void); s32 hero_try_start_ledge_move(void); @@ -158,7 +158,7 @@ void hero_l00_decide_state_pal(void) { UpdateHeroHeldTarget_pal(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l00_set_action_pal(0x39, 1); + hero_l00_set_move_state_pal(0x39, 1); goto end; } } @@ -193,7 +193,7 @@ void hero_l00_decide_state_pal(void) { hero_apply_pending_change_pal(); if (FLD(g_hero_state, f32, 0x88) < g_hero_proximity_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l00_set_action_pal(0x74, 1); + hero_l00_set_move_state_pal(0x74, 1); goto end; } } @@ -204,12 +204,12 @@ void hero_l00_decide_state_pal(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_PAL_L00_002CB7A0_01() == 0)) { - hero_l00_set_action_pal(1, 1); + hero_l00_set_move_state_pal(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l00_set_action_pal(0x82, 1); + hero_l00_set_move_state_pal(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -246,7 +246,7 @@ void hero_l00_decide_state_pal(void) { rec = g_hero_idle_choice_table + sp40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 5e+01f; if (FLD(rec, s32, 0x44) != 0) { - hero_l00_set_action_pal(0x3C, 1); + hero_l00_set_move_state_pal(0x3C, 1); } else { set_hero_animation_pal(FLD(rec, s32, 0x48), 0, 1e+01f); } @@ -289,12 +289,12 @@ void hero_l00_decide_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l00_set_action_pal(0x76, 1); + hero_l00_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); } break; } @@ -315,21 +315,21 @@ void hero_l00_decide_state_pal(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_action_blocked_flag == 0) && (PadPressedWithin(0x40, 6, NULL) != 0)) { - hero_l00_set_action_pal(0x6E, 1); + hero_l00_set_move_state_pal(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l00_set_action_pal(4, 1); + hero_l00_set_move_state_pal(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_set_action_pal(0x27, 1); + hero_l00_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l00_set_action_pal(0x2E, 1); + hero_l00_set_move_state_pal(0x2E, 1); break; } { @@ -349,28 +349,28 @@ void hero_l00_decide_state_pal(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust_pal(side, 0, 0, 0x1E); hero_play_footstep_sound_dust_pal(side, 1, 0, 0x1E); - hero_l00_set_action_pal(2, 1); + hero_l00_set_move_state_pal(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_PAL_L00_002CB7A0_01() == 0)) { - hero_l00_set_action_pal(1, 1); + hero_l00_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l00_set_action_pal(0x3D, 1); + hero_l00_set_move_state_pal(0x3D, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l00_set_action_pal(0x3D, 1); + hero_l00_set_move_state_pal(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); } break; case 0x3D: @@ -379,22 +379,22 @@ void hero_l00_decide_state_pal(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); break; } if (hero_try_start_move_from_buffer_pal(6, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_set_action_pal(4, 1); + hero_l00_set_move_state_pal(4, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l00_set_action_pal(2, 1); + hero_l00_set_move_state_pal(2, 1); break; } - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); break; case 0x39: case 0x43: @@ -433,25 +433,25 @@ void hero_l00_decide_state_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.040000003f)) { - hero_l00_set_action_pal(0x33, 1); + hero_l00_set_move_state_pal(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12)) { - hero_l00_set_action_pal(0x34, 1); + hero_l00_set_move_state_pal(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l00_set_action_pal(0x32, 1); + hero_l00_set_move_state_pal(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l00_set_action_pal(0x33, 1); + hero_l00_set_move_state_pal(0x33, 1); } } break; @@ -464,81 +464,81 @@ void hero_l00_decide_state_pal(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l00_set_action_pal(0x32, 1); + hero_l00_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l00_set_action_pal(0x34, 1); + hero_l00_set_move_state_pal(0x34, 1); } else { - hero_l00_set_action_pal(0x32, 1); + hero_l00_set_move_state_pal(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l00_set_action_pal(0x12, 1); + hero_l00_set_move_state_pal(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 6, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 6, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l00_set_action_pal(0x32, 1); + hero_l00_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l00_set_action_pal(0x34, 1); + hero_l00_set_move_state_pal(0x34, 1); } else { - hero_l00_set_action_pal(0x32, 1); + hero_l00_set_move_state_pal(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l00_set_action_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l00_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 15.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l00_set_action_pal(0x35, 1); + hero_l00_set_move_state_pal(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l00_set_action_pal(0x12, 1); + hero_l00_set_move_state_pal(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 6, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l00_set_action_pal(0x32, 1); + hero_l00_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l00_set_action_pal(0x34, 1); + hero_l00_set_move_state_pal(0x34, 1); } else { - hero_l00_set_action_pal(0x32, 1); + hero_l00_set_move_state_pal(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l00_set_action_pal(0x70, 0); + hero_l00_set_move_state_pal(0x70, 0); set_hero_animation_pal(0x59, 0, 14.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l00_set_action_pal(0x36, 1); + hero_l00_set_move_state_pal(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_set_action_pal(0x67, 1); + hero_l00_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x28, 15.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action_pal(0x33, 1); + hero_l00_set_move_state_pal(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l00_set_action_pal(0x33, 0); + hero_l00_set_move_state_pal(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_set_action_pal(0x67, 1); + hero_l00_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x25, 15.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l00_set_action_pal(0x36, 0); + hero_l00_set_move_state_pal(0x36, 0); } break; case 0x1: @@ -572,9 +572,9 @@ void hero_l00_decide_state_pal(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_set_action_pal(4, 1); + hero_l00_set_move_state_pal(4, 1); } else { - hero_l00_set_action_pal(0, 0); + hero_l00_set_move_state_pal(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -586,9 +586,9 @@ void hero_l00_decide_state_pal(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l00_set_action_pal(0, 0); + hero_l00_set_move_state_pal(0, 0); } else { - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); } } break; @@ -621,7 +621,7 @@ void hero_l00_decide_state_pal(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_set_action_pal(7, 1); + hero_l00_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -630,7 +630,7 @@ void hero_l00_decide_state_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l00_set_action_pal(0, 0); + hero_l00_set_move_state_pal(0, 0); } break; } @@ -652,7 +652,7 @@ void hero_l00_decide_state_pal(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_set_action_pal(7, 1); + hero_l00_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -665,7 +665,7 @@ void hero_l00_decide_state_pal(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l00_set_action_pal(2, 0); + hero_l00_set_move_state_pal(2, 0); set_hero_animation_pal(3, g_hero_anim_ids_by_mode[FLD(g_hero_state, s32, 0x2298)], 11.0f); break; } @@ -676,22 +676,22 @@ void hero_l00_decide_state_pal(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l00_set_action_pal(2, 1); + hero_l00_set_move_state_pal(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l00_set_action_pal(0, 0); + hero_l00_set_move_state_pal(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action_pal(0, 0); + hero_l00_set_move_state_pal(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x54) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -708,7 +708,7 @@ void hero_l00_decide_state_pal(void) { } if (PadPressedWithin(0x40, 6, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_set_action_pal(7, 1); + hero_l00_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -717,7 +717,7 @@ void hero_l00_decide_state_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l00_set_action_pal(0, 0); + hero_l00_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 12.0f); break; } @@ -729,7 +729,7 @@ void hero_l00_decide_state_pal(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); } break; case 0x2: @@ -743,11 +743,11 @@ void hero_l00_decide_state_pal(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l00_set_action_pal(0x76, 1); + hero_l00_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead_pal() == 0)) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); break; } n = 7; @@ -761,12 +761,12 @@ void hero_l00_decide_state_pal(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l00_set_action_pal(9, 1); + hero_l00_set_move_state_pal(9, 1); } else { - hero_l00_set_action_pal(7, 1); + hero_l00_set_move_state_pal(7, 1); } } else { - hero_l00_set_action_pal(7, 1); + hero_l00_set_move_state_pal(7, 1); } break; } @@ -774,11 +774,11 @@ void hero_l00_decide_state_pal(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.040000003f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_PAL_L00_002CB7A0_01() == 0)) { - hero_l00_set_action_pal(1, 1); + hero_l00_set_move_state_pal(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_set_action_pal(4, 1); + hero_l00_set_move_state_pal(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -795,25 +795,25 @@ void hero_l00_decide_state_pal(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l00_set_action_pal(0x2E, 1); + hero_l00_set_move_state_pal(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l00_set_action_pal(2, 1); + hero_l00_set_move_state_pal(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l00_set_action_pal(0x70, 1); + hero_l00_set_move_state_pal(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l00_set_action_pal(2, 1); + hero_l00_set_move_state_pal(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_set_action_pal(0x27, 1); + hero_l00_set_move_state_pal(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -824,7 +824,7 @@ void hero_l00_decide_state_pal(void) { if (hero_try_start_grab_pal() != 0) { break; } - if (hero_l00_set_action_pal(0, 0) == 0) { + if (hero_l00_set_move_state_pal(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.030000001f); @@ -841,7 +841,7 @@ void hero_l00_decide_state_pal(void) { hero_update_anim_scale_pal(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l00_set_action_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l00_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 14.0f); } if (FLD(sp74, u8, 0x43) == 0x37) { @@ -862,7 +862,7 @@ void hero_l00_decide_state_pal(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l00_set_action_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l00_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 14.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 29.166668f; @@ -896,17 +896,17 @@ void hero_l00_decide_state_pal(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x19; - hero_l00_set_action_pal(3, 0); + hero_l00_set_move_state_pal(3, 0); set_hero_animation_pal(6, 4, 9.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l00_set_action_pal(0x77, 1); + hero_l00_set_move_state_pal(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l00_set_action_pal(0x77, 1); + hero_l00_set_move_state_pal(0x77, 1); break; } } @@ -924,11 +924,11 @@ void hero_l00_decide_state_pal(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.054000005f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l00_set_action_pal(0x64, 1); + hero_l00_set_move_state_pal(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.054000005f)) { - hero_l00_set_action_pal(0x63, 1); + hero_l00_set_move_state_pal(0x63, 1); } } else { hero_update_anim_scale_pal(); @@ -936,21 +936,21 @@ void hero_l00_decide_state_pal(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action_pal(0x62, 1); + hero_l00_set_move_state_pal(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l00_set_action_pal(0x62, 1); + hero_l00_set_move_state_pal(0x62, 1); } break; case 0x65: /* switch 2 */ temp_a0_11 = FLD(g_hero_state, s32, 0x18C0); if ((temp_a0_11 < 3) && (((temp_a0_11 * 6) + 0x8) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 6, &sp44) != 0)) { - hero_l00_set_action_pal(0x66, 1); + hero_l00_set_move_state_pal(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters_pal(); @@ -993,7 +993,7 @@ void hero_l00_decide_state_pal(void) { return; case 0x6D: if ((f32)g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); } break; case 0x30: @@ -1006,7 +1006,7 @@ void hero_l00_decide_state_pal(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l00_set_action_pal(0, 0) != 0) { + if (hero_l00_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 14.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1014,29 +1014,29 @@ void hero_l00_decide_state_pal(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_PAL_L00_002CB7A0_01() == 0)) { - hero_l00_set_action_pal(1, 1); + hero_l00_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l00_set_action_pal(7, 1); + hero_l00_set_move_state_pal(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_set_action_pal(4, 1); + hero_l00_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 8) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_set_action_pal(0x27, 1); + hero_l00_set_move_state_pal(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1044,45 +1044,45 @@ void hero_l00_decide_state_pal(void) { } if (hero_get_weapon_or_form_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l00_set_action_pal(0, 0); + hero_l00_set_move_state_pal(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l00_set_action_pal(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l00_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 14.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l00_set_action_pal(2, 1); + hero_l00_set_move_state_pal(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_PAL_L00_002CB7A0_01() == 0)) { - hero_l00_set_action_pal(1, 1); + hero_l00_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xA) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_set_action_pal(0, 0); + hero_l00_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l00_set_action_pal(0x76, 1); + hero_l00_set_move_state_pal(0x76, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { break; } if ((PadPressedWithin(0x80, 0xC, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l00_set_action_pal(0x15, 1); + hero_l00_set_move_state_pal(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 8) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1090,17 +1090,17 @@ void hero_l00_decide_state_pal(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l00_set_action_pal(0x8B, 1); + hero_l00_set_move_state_pal(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x4C) { - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); } break; case 0x24: @@ -1126,14 +1126,14 @@ void hero_l00_decide_state_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l00_set_action_pal(0, 0); + hero_l00_set_move_state_pal(0, 0); set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 25.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l00_set_action_pal(6, 0); + hero_l00_set_move_state_pal(6, 0); } else { - hero_l00_set_action_pal(6, 0); + hero_l00_set_move_state_pal(6, 0); set_hero_animation_pal(0xA, 0, 14.0f); } FLD(g_hero_state, f32, 0xA84) = 0.016800001f; @@ -1149,9 +1149,9 @@ void hero_l00_decide_state_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); } else { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1163,7 +1163,7 @@ void hero_l00_decide_state_pal(void) { if (t < 0x21) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l00_set_action_pal(0x2C, 1); + hero_l00_set_move_state_pal(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0028000001f; FLD(g_hero_state, f32, 0xA80) = 0.0108f; } @@ -1227,11 +1227,11 @@ void hero_l00_decide_state_pal(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.26000002f); FLD(g_hero_state, f32, 0x128) = 0.20000002f; - hero_l00_set_action_pal(0x16, 1); + hero_l00_set_move_state_pal(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x3A; FLD(g_hero_state, s16, 0x1D0) = 0x3A; } else { - hero_l00_set_action_pal(0x3E, 1); + hero_l00_set_move_state_pal(0x3E, 1); } break; } @@ -1244,7 +1244,7 @@ void hero_l00_decide_state_pal(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l00_set_action_pal(0x28, 1); + hero_l00_set_move_state_pal(0x28, 1); } break; } @@ -1255,16 +1255,16 @@ void hero_l00_decide_state_pal(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x3A; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l00_set_action_pal(0x74, 1); + hero_l00_set_move_state_pal(0x74, 1); } else { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0x8, NULL) != 0)) { - hero_l00_set_action_pal(0x2A, 1); + hero_l00_set_move_state_pal(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1281,7 +1281,7 @@ void hero_l00_decide_state_pal(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l00_set_action_pal(0x28, 1); + hero_l00_set_move_state_pal(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)v20 = 0; @@ -1298,7 +1298,7 @@ void hero_l00_decide_state_pal(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 4, NULL) != 0) && ((f32)g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l00_set_action_pal(0x28, 1); + hero_l00_set_move_state_pal(0x28, 1); break; } top = 0xE; @@ -1307,19 +1307,19 @@ void hero_l00_decide_state_pal(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0x8, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l00_set_action_pal(0x2A, 1); + hero_l00_set_move_state_pal(0x2A, 1); } break; } if ((f32)g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l00_set_action_pal(0x27, 1); + hero_l00_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 5) || (FLD(g_hero_state, s32, 0x6C8) >= 5)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l00_set_action_pal(0x74, 1); + hero_l00_set_move_state_pal(0x74, 1); } else { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; @@ -1328,11 +1328,11 @@ void hero_l00_decide_state_pal(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 5) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l00_set_action_pal(0x27, 1); + hero_l00_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 5) && (g_current_map_index == 0x14)) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0x8) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1368,7 +1368,7 @@ void hero_l00_decide_state_pal(void) { find_nearest_path_point(sp50, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), sp5C, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l00_set_action_pal(0x29, 1); + hero_l00_set_move_state_pal(0x29, 1); break; } } @@ -1416,7 +1416,7 @@ void hero_l00_decide_state_pal(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x3A; FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; @@ -1424,7 +1424,7 @@ void hero_l00_decide_state_pal(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l00_set_action_pal(0x71, 1); + hero_l00_set_move_state_pal(0x71, 1); break; } { @@ -1436,7 +1436,7 @@ void hero_l00_decide_state_pal(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l00_set_action_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l00_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(0xC, 4, 5.0f); } } else if (st == 0x3E) { @@ -1445,17 +1445,17 @@ void hero_l00_decide_state_pal(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)sp64, 0.5f, -1.0f); } if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s32, 0x340) != 0)) { - if (hero_l00_set_action_pal(0, 0) != 0) { + if (hero_l00_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action_pal(0x27, 1); + hero_l00_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xD) && (FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l00_set_action_pal(0x27, 1); + hero_l00_set_move_state_pal(0x27, 1); } } break; @@ -1471,13 +1471,13 @@ void hero_l00_decide_state_pal(void) { } } if (FLD(g_hero_state, s32, 0x6F0) >= 5) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x204) = 0x19; } break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l00_set_action_pal(0x18, 0); + hero_l00_set_move_state_pal(0x18, 0); } break; case 0x18: @@ -1486,18 +1486,18 @@ void hero_l00_decide_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab_pal((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 0xE, NULL) != 0) { - hero_l00_set_action_pal(0x1B, 1); + hero_l00_set_move_state_pal(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1506,7 +1506,7 @@ void hero_l00_decide_state_pal(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x97), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x97), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l00_set_action_pal(0x19, 1); + hero_l00_set_move_state_pal(0x19, 1); } break; } @@ -1517,7 +1517,7 @@ void hero_l00_decide_state_pal(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l00_set_action_pal(0x1A, 1); + hero_l00_set_move_state_pal(0x1A, 1); } } } @@ -1536,18 +1536,18 @@ void hero_l00_decide_state_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action_pal(0x18, 1); + hero_l00_set_move_state_pal(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l00_set_action_pal(0x1B, 1); + hero_l00_set_move_state_pal(0x1B, 1); } break; } @@ -1557,9 +1557,9 @@ void hero_l00_decide_state_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); } else { - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); } } break; @@ -1583,12 +1583,12 @@ void hero_l00_decide_state_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_set_action_pal(0x39, 1); + hero_l00_set_move_state_pal(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x4B) { - if (hero_l00_set_action_pal(0, 0) != 0) { + if (hero_l00_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } if (low != 0) { @@ -1596,7 +1596,7 @@ void hero_l00_decide_state_pal(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l00_set_action_pal(0, 0) != 0) { + if (hero_l00_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1610,36 +1610,36 @@ void hero_l00_decide_state_pal(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l00_set_action_pal(2, 1); + hero_l00_set_move_state_pal(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.060000002f) { - if (hero_l00_set_action_pal(3, 0) != 0) { + if (hero_l00_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(6, 0, 1e+01f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.15400001f); } } else { - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l00_set_action_pal(8, 1); + hero_l00_set_move_state_pal(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x12) && (hero_try_start_move_from_buffer_pal((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 5, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_set_action_pal(0x17, 1); + hero_l00_set_move_state_pal(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_set_action_pal(0x27, 1); + hero_l00_set_move_state_pal(0x27, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l00_set_action_pal(0x71, 1); + hero_l00_set_move_state_pal(0x71, 1); } } break; @@ -1670,7 +1670,7 @@ void hero_l00_decide_state_pal(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l00_set_action_pal(0, 0) != 0) { + if (hero_l00_set_move_state_pal(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1680,9 +1680,9 @@ void hero_l00_decide_state_pal(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l00_set_action_pal(0x74, 1); + hero_l00_set_move_state_pal(0x74, 1); } else { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); } } break; @@ -1695,16 +1695,16 @@ void hero_l00_decide_state_pal(void) { ok = 1; } if (ok != 0) { - hero_l00_set_action_pal(0x11, 1); + hero_l00_set_move_state_pal(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_set_action_pal(0x17, 1); + hero_l00_set_move_state_pal(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1715,23 +1715,23 @@ void hero_l00_decide_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 3)) { - if (hero_l00_set_action_pal(3, 0) != 0) { + if (hero_l00_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x1C; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_set_action_pal(4, 1); + hero_l00_set_move_state_pal(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_anim_range_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l00_set_action_pal(2, 1); + hero_l00_set_move_state_pal(2, 1); break; } - hero_l00_set_action_pal(2, 0); + hero_l00_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, 2, 7.0f); @@ -1740,21 +1740,21 @@ void hero_l00_decide_state_pal(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_anim_range_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l00_set_action_pal(2, 1); + hero_l00_set_move_state_pal(2, 1); break; } - hero_l00_set_action_pal(2, 0); + hero_l00_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, g_hero_landing_anim_id, 1e+01f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l00_set_action_pal(0, 0) != 0) { + if (hero_l00_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l00_set_action_pal(0, 0) != 0) { + } else if (hero_l00_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1801,14 +1801,14 @@ void hero_l00_decide_state_pal(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 4, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_set_action_pal(0xB, 1); + hero_l00_set_move_state_pal(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x11)) { - hero_l00_set_action_pal(0x82, 1); + hero_l00_set_move_state_pal(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1817,29 +1817,29 @@ void hero_l00_decide_state_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 6) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f)) { - hero_l00_set_action_pal(0xA, 1); + hero_l00_set_move_state_pal(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l00_set_action_pal(0x10, 1); + hero_l00_set_move_state_pal(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_set_action_pal(0x27, 1); + hero_l00_set_move_state_pal(0x27, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l00_set_action_pal(0x71, 1); + hero_l00_set_move_state_pal(0x71, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.14000002f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l00_set_action_pal(0x77, 1); + hero_l00_set_move_state_pal(0x77, 1); break; } } @@ -1943,7 +1943,7 @@ void hero_l00_decide_state_pal(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l00_set_action_pal(3, 0) != 0) { + if (hero_l00_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1951,13 +1951,13 @@ void hero_l00_decide_state_pal(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_anim_range_table[0][2])) { - hero_l00_set_action_pal(7, 1); + hero_l00_set_move_state_pal(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l00_set_action_pal(7, 1); + hero_l00_set_move_state_pal(7, 1); } else if (g_hero_anim_range_table[1][1] * 0.017f < FLD(g_hero_state, f32, 0x174)) { - hero_l00_set_action_pal(9, 1); + hero_l00_set_move_state_pal(9, 1); } else { - hero_l00_set_action_pal(7, 1); + hero_l00_set_move_state_pal(7, 1); } break; } @@ -1965,10 +1965,10 @@ void hero_l00_decide_state_pal(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_l00_choose_next_move_after_landing_pal(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); break; } { @@ -1978,7 +1978,7 @@ void hero_l00_decide_state_pal(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x16)) && (PadPressedWithin(0x40, 6, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l00_set_action_pal(0x11, 1); + hero_l00_set_move_state_pal(0x11, 1); break; } } @@ -2007,7 +2007,7 @@ void hero_l00_decide_state_pal(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xD) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.11600001f)))) { - hero_l00_set_action_pal(0xE, 1); + hero_l00_set_move_state_pal(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -2017,32 +2017,32 @@ void hero_l00_decide_state_pal(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l00_set_action_pal(8, 1); + hero_l00_set_move_state_pal(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x576) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l00_set_action_pal(0x17, 1); + hero_l00_set_move_state_pal(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l00_set_action_pal(6, 1); + hero_l00_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x17) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l00_set_action_pal(0x79, 1); + hero_l00_set_move_state_pal(0x79, 1); } else { - hero_l00_set_action_pal(0x39, 1); + hero_l00_set_move_state_pal(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l00_set_action_pal(0x82, 1); + hero_l00_set_move_state_pal(0x82, 1); } else { - hero_l00_set_action_pal(0, 0); + hero_l00_set_move_state_pal(0, 0); } } break; @@ -2052,8 +2052,8 @@ void hero_l00_decide_state_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x2B) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_set_action_pal(0x39, 1); - } else if (hero_l00_set_action_pal(0, 0) != 0) { + hero_l00_set_move_state_pal(0x39, 1); + } else if (hero_l00_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 11.0f); } } @@ -2078,28 +2078,28 @@ void hero_l00_decide_state_pal(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l00_set_action_pal(0x4E, 1); + hero_l00_set_move_state_pal(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_PAL_L00_002CB7A0_01() == 0)) { - hero_l00_set_action_pal(1, 1); + hero_l00_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l00_set_action_pal(0x41, 1); + hero_l00_set_move_state_pal(0x41, 1); break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l00_set_action_pal(0x45, 1); + hero_l00_set_move_state_pal(0x45, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l00_set_action_pal(0x4D, 1); + hero_l00_set_move_state_pal(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l00_set_action_pal(0x40, 1); + hero_l00_set_move_state_pal(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -2112,14 +2112,14 @@ void hero_l00_decide_state_pal(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l00_set_action_pal(0x4E, 1); + hero_l00_set_move_state_pal(0x4E, 1); break; } rec = (u8 *)&g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l00_set_action_pal(0x3F, 0); + hero_l00_set_move_state_pal(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -2128,13 +2128,13 @@ void hero_l00_decide_state_pal(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0xD) ? n : 0xC, NULL) != 0) { - hero_l00_set_action_pal(0x4D, 1); + hero_l00_set_move_state_pal(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l00_set_action_pal(0x45, 1); + hero_l00_set_move_state_pal(0x45, 1); } break; } @@ -2197,42 +2197,42 @@ void hero_l00_decide_state_pal(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 3, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { hero_resolve_stick_direction(0, 1.0f); - hero_l00_set_action_pal(0x45, 1); + hero_l00_set_move_state_pal(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_anim_range_table[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x97)) < 1.5707964f)) { - hero_l00_set_action_pal(0x40, 1); + hero_l00_set_move_state_pal(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xB) { - hero_l00_set_action_pal(0x3F, 1); + hero_l00_set_move_state_pal(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x22)) { - hero_l00_set_action_pal(0x41, 1); + hero_l00_set_move_state_pal(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 4, NULL) != 0)) { - hero_l00_set_action_pal(0x4D, 1); + hero_l00_set_move_state_pal(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_set_action_pal(0x46, 1); + hero_l00_set_move_state_pal(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l00_set_action_pal(0x4B, 1); + hero_l00_set_move_state_pal(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l00_set_action_pal(0x41, 1); + hero_l00_set_move_state_pal(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_set_action_pal(0x46, 1); + hero_l00_set_move_state_pal(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -2242,11 +2242,11 @@ void hero_l00_decide_state_pal(void) { FLD(g_hero_state, s16, 0x1EE) = 0xA - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l00_set_action_pal(0x40, 1); + hero_l00_set_move_state_pal(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l00_set_action_pal(0x3F, 1); + hero_l00_set_move_state_pal(0x3F, 1); } break; case 0x41: @@ -2258,29 +2258,29 @@ void hero_l00_decide_state_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_set_action_pal(0x43, 1); + hero_l00_set_move_state_pal(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l00_set_action_pal(0x40, 1); + hero_l00_set_move_state_pal(0x40, 1); } else { - hero_l00_set_action_pal(0x3F, 1); + hero_l00_set_move_state_pal(0x3F, 1); } } else { - hero_l00_set_action_pal(0x3F, 1); + hero_l00_set_move_state_pal(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_set_action_pal(0x46, 1); + hero_l00_set_move_state_pal(0x46, 1); break; } if ((PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l00_set_action_pal(0x4B, 1); + hero_l00_set_move_state_pal(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l00_set_action_pal(0x3F, 1); + hero_l00_set_move_state_pal(0x3F, 1); } break; case 0x4E: @@ -2289,9 +2289,9 @@ void hero_l00_decide_state_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l00_set_action_pal(0x41, 1); + hero_l00_set_move_state_pal(0x41, 1); } else { - hero_l00_set_action_pal(0x3F, 1); + hero_l00_set_move_state_pal(0x3F, 1); } } break; @@ -2301,7 +2301,7 @@ void hero_l00_decide_state_pal(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l00_set_action_pal(0x4E, 1); + hero_l00_set_move_state_pal(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.030000001f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2327,55 +2327,55 @@ void hero_l00_decide_state_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l00_set_action_pal(0x45, 1); + hero_l00_set_move_state_pal(0x45, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l00_set_action_pal(0x4D, 1); + hero_l00_set_move_state_pal(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l00_set_action_pal(0x41, 1); + hero_l00_set_move_state_pal(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l00_set_action_pal(0x3F, 1); + hero_l00_set_move_state_pal(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1B) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l00_set_action_pal(0x41, 1); + hero_l00_set_move_state_pal(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1E) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_set_action_pal(0x43, 1); + hero_l00_set_move_state_pal(0x43, 1); } else { - hero_l00_set_action_pal(0x3F, 0); + hero_l00_set_move_state_pal(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action_pal(0x47, 1); + hero_l00_set_move_state_pal(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)v10 = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l00_set_action_pal(0x41, 1); + hero_l00_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_set_action_pal(0x41, 1); + hero_l00_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l00_set_action_pal(0x48, 1); + hero_l00_set_move_state_pal(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2384,7 +2384,7 @@ void hero_l00_decide_state_pal(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l00_set_action_pal(0x49, 1); + hero_l00_set_move_state_pal(0x49, 1); } break; } @@ -2395,7 +2395,7 @@ void hero_l00_decide_state_pal(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l00_set_action_pal(0x4A, 1); + hero_l00_set_move_state_pal(0x4A, 1); } } } @@ -2414,17 +2414,17 @@ void hero_l00_decide_state_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab_pal((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_set_action_pal(0x47, 1); + hero_l00_set_move_state_pal(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l00_set_action_pal(0x41, 1); + hero_l00_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l00_set_action_pal(0x48, 1); + hero_l00_set_move_state_pal(0x48, 1); } break; } @@ -2439,7 +2439,7 @@ void hero_l00_decide_state_pal(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l00_set_action_pal(0, 0); + hero_l00_set_move_state_pal(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -2450,7 +2450,7 @@ void hero_l00_decide_state_pal(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l00_set_action_pal(0, 0); + hero_l00_set_move_state_pal(0, 0); } break; case 0x22: @@ -2460,12 +2460,12 @@ void hero_l00_decide_state_pal(void) { hero_choose_jump_or_roll_move_pal(); break; } - hero_l00_set_action_pal(7, 1); + hero_l00_set_move_state_pal(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l00_set_action_pal(0, 0); + hero_l00_set_move_state_pal(0, 0); } break; default: diff --git a/src/pal/levels/shared/L00_002CA888-flags2.c b/src/pal/levels/shared/L00_002CA888-flags2.c index b5a7e1008..14b321cd6 100644 --- a/src/pal/levels/shared/L00_002CA888-flags2.c +++ b/src/pal/levels/shared/L00_002CA888-flags2.c @@ -30,7 +30,7 @@ extern u8 g_item_slot_to_record[]; extern Entry_2CAF20 g_weapon_l00_table[]; extern s32 hero_slot_item_id(s32); extern void cancel_hero_item_animation_pal(void); -extern int hero_l00_set_action_pal(int a0, int a1); +extern int hero_l00_set_move_state_pal(int a0, int a1); extern void set_hero_animation_pal(void *, int, f32); extern void vec_clamp_length(float *, float); @@ -48,7 +48,7 @@ int hero_try_start_grab_pal(void) return 0; } moby = (g_weapon_l00_table + g_item_slot_to_record[idx])->moby; - if (hero_l00_set_action_pal(0, 0) == 0) + if (hero_l00_set_move_state_pal(0, 0) == 0) return 0; vec_clamp_length(h->v160, 0.030000001f); if (0.030000001f < h->f1B4) diff --git a/src/pal/levels/shared/L00_00394148-tether-g8.c b/src/pal/levels/shared/L00_00394148-tether-g8.c index 7b19dbc62..4b3ee70f5 100644 --- a/src/pal/levels/shared/L00_00394148-tether-g8.c +++ b/src/pal/levels/shared/L00_00394148-tether-g8.c @@ -31,7 +31,7 @@ extern char *moby_get_private_value_2(u8 *); extern float FastVecLength(void *); extern void level_save_and_dim_lighting(void *), func_002A0F48(void *); extern char *cam_follow_create(void *); -extern int hero_l00_set_action_pal(int a0, int a1); +extern int hero_l00_set_move_state_pal(int a0, int a1); extern void mem_clear(void *, int, int), AttachManipulator(u8 *, u32, u8 *); extern char *tether_create_fin_piece(char *); extern void hero_copy_field_to_moby(u8 *); @@ -80,7 +80,7 @@ char *visibomb_create_missile_pal(char *owner, char *position, float yaw, float { char *attachment = cam_follow_create(actor); state->attachment = attachment; - hero_l00_set_action_pal(28, 1); + hero_l00_set_move_state_pal(28, 1); } mem_clear(state->matrix24, 0, 64); mem_clear(state->matrix28, 0, 64); diff --git a/src/pal/levels/shared/L00_003A44FC-eye.c b/src/pal/levels/shared/L00_003A44FC-eye.c index 2cc152214..07108b1c4 100644 --- a/src/pal/levels/shared/L00_003A44FC-eye.c +++ b/src/pal/levels/shared/L00_003A44FC-eye.c @@ -44,7 +44,7 @@ extern int AcquireEntitySlot(void *, int, void *); extern char *level_get_slot_body(int, int); extern float math_random_signed_float_range(float, float), math_random_float_range(float, float); extern void vec_clear_128(VectorBits *); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern int get_ammo(int); extern void hud_add_moby_marker(void *, unsigned int, int, int, int, int, float, float, float); extern int vec_fast_helper_b(void *); @@ -117,7 +117,7 @@ void charged_l00_beam_weapon_update_pal(char *moby) g_charged_beam_init_flag = 1; } if (g_hero_state.mode == 1) - hero_l00_set_action_pal(29, 1); + hero_l00_set_move_state_pal(29, 1); if (g_hero_state.mode == 29) { unsigned int color; if (*(float *)state != 0.0f && get_ammo(-1)) diff --git a/src/pal/levels/shared/L00_003A6238-g8.c b/src/pal/levels/shared/L00_003A6238-g8.c index 875d6bd70..37c4b0c6a 100644 --- a/src/pal/levels/shared/L00_003A6238-g8.c +++ b/src/pal/levels/shared/L00_003A6238-g8.c @@ -44,7 +44,7 @@ extern char g_camera_l00_position[]; extern char *g_hit_l00_result[]; extern MuzzleLight g_light_table[]; extern WeaponEntry g_weapon_l00_table[]; -extern TargetRecord g_target_hud_records[]; +extern TargetRecord g_scoped_weapon_rumble_waves[]; extern void cam_set_value_target(int, int, float, float, float, float); extern void hud_add_moby_marker(void *, float, u32, void *, int, float, int, float, int); extern int CollLine(void *, void *, int, int, void *); @@ -66,11 +66,11 @@ extern int moby_is_in_special_class_range(void *); extern void snd_stop_voice(s32); extern int PlayMobySound(int, int, void *); extern void start_equipped_item_animation_pal(void); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern int weapon_spend_ammo(int, int); extern int get_ammo(int); -extern int slot_copy_records_to_free(TargetRecord *); -extern void slot_reset_active(int); +extern int actuator_play_waves(TargetRecord *); +extern void actuator_end_looping_waves(int); extern int AcquireEntitySlot(void *, int, int *); extern char *mem_round_up_to_16(char *); extern char *level_get_slot_body(int, int); @@ -191,7 +191,7 @@ void UpdateScopedWeapon_pal(u8 *moby) case 1: { float t; if (HERO->i[0x2294 / 4] == 1) - hero_l00_set_action_pal(0x1D, 1); + hero_l00_set_move_state_pal(0x1D, 1); fire = 1; if (HERO->i[0x1500 / 4] != 0) { fire = 0; @@ -257,7 +257,7 @@ void UpdateScopedWeapon_pal(u8 *moby) if (HERO->b[0x22BC] == 0 && (GAME->i[0x1A4 / 4] & HERO->i[0x1230 / 4]) && fire) { if (weapon_spend_ammo(-1, 1) != 0) { start_equipped_item_animation_pal(); - scope->hud = slot_copy_records_to_free(g_target_hud_records); + scope->hud = actuator_play_waves(g_scoped_weapon_rumble_waves); scope->fire_timer = 2; moby[0x20] = 2; anim_start_blended_pal(moby, 2, 0, 0); @@ -267,7 +267,7 @@ void UpdateScopedWeapon_pal(u8 *moby) } if (!(GAME->i[0x1A0 / 4] & HERO->i[0x1230 / 4]) || get_ammo(-1) == 0 || HERO->b[0x22B8] == 0) { if (scope->hud >= 0) { - slot_reset_active(scope->hud); + actuator_end_looping_waves(scope->hud); scope->hud = -1; } } diff --git a/src/pal/levels/shared/L00_003A6238-g83.c b/src/pal/levels/shared/L00_003A6238-g83.c index aeaa73983..6ae46745e 100644 --- a/src/pal/levels/shared/L00_003A6238-g83.c +++ b/src/pal/levels/shared/L00_003A6238-g83.c @@ -14,7 +14,7 @@ typedef struct { char prefix[0x54]; float fireRate; char tail[0x88]; } WeaponEnt extern WeaponEntry g_weapon_l00_table[]; extern void anim_start_blended_with_flags(void *, int, int, int, int); extern void ReleaseDeadOrExpiredSlots(void *); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern int get_ammo(int); extern void hud_add_moby_marker(void *, unsigned int, int, int, int, int, float, float, float); extern int math_fast_float_d(void *); @@ -39,7 +39,7 @@ void seeker_gun_update_pal(char *moby) *(float *)(moby + 0x2C) = *(float *)(*(char **)(moby + 0x24) + 0x24) * g_seeker_gun_speed_scale; g_weapon_effect_scale = 0.1f; if (H->i[0x2294 / 4] == 1) - hero_l00_set_action_pal(29, 1); + hero_l00_set_move_state_pal(29, 1); if (H->i[0x2294 / 4] == 29) { unsigned int color; if (*cooldown > 0.0f && get_ammo(-1)) diff --git a/src/pal/levels/shared/L00_003A7ED8-cc.c b/src/pal/levels/shared/L00_003A7ED8-cc.c index a728971c5..f31b4288b 100644 --- a/src/pal/levels/shared/L00_003A7ED8-cc.c +++ b/src/pal/levels/shared/L00_003A7ED8-cc.c @@ -58,11 +58,11 @@ extern Moby *g_area_hit_targets[]; extern CollisionResult g_collision_result; extern MuzzleLight g_light_table[]; extern WeaponEntry g_weapon_table_2[]; -extern u8 g_minirocket_sound_records[]; +extern u8 g_minirocket_rumble_waves[]; extern void EmitLayeredSparks_pal(void *); extern int vec_fast_helper_b(void *); -extern int hero_l00_set_action_pal(int, int); +extern int hero_l00_set_move_state_pal(int, int); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern void anim_start_blended_pal(void *, int, int, int); extern int get_ammo(int); @@ -84,8 +84,8 @@ extern void part_spawn_fragment_fan_and_smoke_pal(Moby *); extern void weapon_spawn_muzzle_effect_pal(Moby *); extern void set_hero_animation_pal(int, int, float); extern void start_equipped_item_animation_pal(void); -extern void slot_reset_active(int); -extern int slot_copy_records_to_free(void *); +extern void actuator_end_looping_waves(int); +extern int actuator_play_waves(void *); extern void moby_transform_joint_to_world(void *, int, void *); extern int part_l00_alloc_effect_slot_2(void *, float, float, float, float, float); extern void gfx_free_point_light(int); @@ -113,7 +113,7 @@ void minirocket_tube_update_pal(Moby *moby) EmitLayeredSparks_pal(moby); vec_fast_helper_b(vars); if (((Hero *)g_hero_state)->i[0x2294 / 4] == 1) - hero_l00_set_action_pal(0x1D, 1); + hero_l00_set_move_state_pal(0x1D, 1); if (moby->animation == moby->nextAnimation && (moby->flags & 2)) anim_start_blended_with_flags(moby, 1, 0, 2, 0); if (((Hero *)g_hero_state)->i[0x1450 / 4] != 0) @@ -248,7 +248,7 @@ void minirocket_tube_update_pal(Moby *moby) else start_equipped_item_animation_pal(); anim_start_blended_pal(moby, 2, 0, 0); - vars->sound = slot_copy_records_to_free(g_minirocket_sound_records); + vars->sound = actuator_play_waves(g_minirocket_rumble_waves); { WeaponEntry *weapon = g_weapon_table_2 + g_item_slot_to_record[0x1B]; vars->cooldown = 1.0f / weapon->rate; @@ -259,7 +259,7 @@ void minirocket_tube_update_pal(Moby *moby) } if (!((g_pad_state[0x1A0 / 4] & ((Hero *)g_hero_state)->u[0x1230 / 4]) && get_ammo(-1) && ((Hero *)g_hero_state)->b[0x22B8]) && vars->sound >= 0) { - slot_reset_active(vars->sound); + actuator_end_looping_waves(vars->sound); vars->sound = -1; } } diff --git a/src/pal/levels/shared/L00_003A89F0-g16.c b/src/pal/levels/shared/L00_003A89F0-g16.c index e1e81e547..9feac9364 100644 --- a/src/pal/levels/shared/L00_003A89F0-g16.c +++ b/src/pal/levels/shared/L00_003A89F0-g16.c @@ -3,7 +3,7 @@ The spill slots follow gcse's bucket order, (hash % 335) here: the `short` values, vars (set beside self, read through holder) and the hit list reached through RayBlock's tail give retail's order. */ struct Rac2Native_5f824a0e369ccf7b_src_record { u8 b0,b1,b2,b3; u16 s4,s6,s8,s10,s12; u8 e,f; }; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_blitz_gun_sound_records[]; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_blitz_gun_rumble_waves[]; extern u8 g_item_slot_to_record[]; extern float g_blitz_gun_euler_angles[4] __attribute__((sda)); extern unsigned int g_blitz_startup_ticks __attribute__((sda)); @@ -53,12 +53,12 @@ extern char *g_area_hit_targets[]; extern int FastDecTimer(void *),math_fast_float_d(void *),vec_fast_helper_b(void *); extern int PlayMobySound(int,int,char *); extern void anim_start_blended_with_flags(void *,int,int,int,int),anim_start_blended(void *,int,int,int); -extern int hero_l00_set_action(int,int); +extern int hero_l00_set_move_state(int,int); extern int get_ammo(int),weapon_spend_ammo(int,int); extern void hud_add_moby_marker(void *,unsigned int,void *,int,int,int,float,float,float); extern void start_equipped_item_animation(void); -extern void slot_reset_active(int); -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern void actuator_end_looping_waves(int); +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); extern float math_random_angle(void),IntToFloat(int),math_random_float_range(float,float),FastAddRotations(float,float); extern void beam_draw_ring_and_core(void *); /* The binder: func_L00_002E6EF8 in 23 programs, its twin func_L08_002F2D10 in levels 08, 09, @@ -117,7 +117,7 @@ void blitz_gun_update_pal(char *moby) anim_start_blended_with_flags(moby,1,0,2,0); } if (g_hero_state.c0b4 == 1) - hero_l00_set_action(29,1); + hero_l00_set_move_state(29,1); vec_fast_helper_b(state); { char *holder = state; @@ -158,7 +158,7 @@ void blitz_gun_update_pal(char *moby) ((BlastTimers *)state)->charged = 0; } start_equipped_item_animation(); - *(int *)(state + 0x4C) = slot_copy_records_to_free(g_blitz_gun_sound_records); + *(int *)(state + 0x4C) = actuator_play_waves(g_blitz_gun_rumble_waves); *(u8 *)(moby + 0x20) = 2; *(float *)(state + 0xC) = math_random_angle(); anim_start_blended(moby,2,0,0); @@ -176,7 +176,7 @@ void blitz_gun_update_pal(char *moby) } if (!((g_pad_state.b320 & g_hero_state.b050) && get_ammo(-1) && g_hero_state.c0d8) && *(int *)(state + 0x4C) >= 0) { - slot_reset_active(*(int *)(state + 0x4C)); + actuator_end_looping_waves(*(int *)(state + 0x4C)); *(int *)(state + 0x4C) = -1; } } diff --git a/src/pal/levels/shared/L00_003AA2D8-g8.c b/src/pal/levels/shared/L00_003AA2D8-g8.c index f479c1df5..3b064a77b 100644 --- a/src/pal/levels/shared/L00_003AA2D8-g8.c +++ b/src/pal/levels/shared/L00_003AA2D8-g8.c @@ -19,7 +19,7 @@ extern u8 g_item_slot_to_record[]; extern Statistics g_progress_statistics[]; extern u32 g_frame_counter; extern u32 g_current_map_index; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_lancer_sound_records_a[], g_lancer_sound_records_b[]; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_lancer_shot_rumble_waves[], g_lancer_held_rumble_waves[]; extern int g_game_l00_mode; extern float g_lancer_horizontal_arc; extern float g_lancer_range; @@ -55,7 +55,7 @@ extern float math_fabs(float); extern float IntToFloat(int); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern void anim_start_blended_pal(void *, int, int, int); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern void EmitParticleTrailLayers_pal(char *); extern void part_spawn_line_at_moby_pal(char *); extern void start_equipped_item_animation_pal(void); @@ -63,15 +63,15 @@ extern void cancel_hero_item_animation_pal(void); extern int gfx_add_point_light(void *, int, float, float); extern int snd_play_from_class_bank(int, int, char *, int); extern int PlayMobySound(int, int, char *); -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); -extern int slot_is_entry_nonzero(int); +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern int actuator_is_channel_active(int); extern char *CreateTargetedMovingEffect_pal(void *, char *, char *, float); extern char *SpawnAimedShot_pal(void *, char *, char *); extern int coll_process_hit(float, void *, int, void *, int); extern void QueueMobyImpact(void *, void *); extern void cam_compute_view_direction(void *, void *, int); extern void part_l00_spawn_spark_burst_3_pal(void *, int, int); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern void gfx_free_point_light(int); extern void matrix_mul_vec3(void *, void *, void *); @@ -197,7 +197,7 @@ void lancer_update_pal(char *moby) case 1: { int ready; if (((Hero *)g_hero_state)->i[0x2294 / 4] == 1) - hero_l00_set_action_pal(29, 1); + hero_l00_set_move_state_pal(29, 1); ready = 1; if (((Hero *)g_hero_state)->i[0x2294 / 4] == 29) { @@ -231,9 +231,9 @@ void lancer_update_pal(char *moby) *(int *)(state + 0x28) = 8; snd_play_from_class_bank(0, 0, moby, TYPE(moby)); if (TYPE(moby) == 0x5D2) - slot_copy_records_to_free(g_lancer_sound_records_a); + actuator_play_waves(g_lancer_shot_rumble_waves); else if (*(int *)(state + 0x3C) < 0) - *(int *)(state + 0x3C) = slot_copy_records_to_free(g_lancer_sound_records_b); + *(int *)(state + 0x3C) = actuator_play_waves(g_lancer_held_rumble_waves); if (TYPE(moby) == 0x5D2) CreateTargetedMovingEffect_pal(muzzle, moby, target, previousRange); else @@ -281,11 +281,11 @@ void lancer_update_pal(char *moby) } if (!((g_pad_state[0x1A0 / 4] & ((Hero *)g_hero_state)->i[0x1230 / 4]) && get_ammo(-1) && ((Hero *)g_hero_state)->b[0x22B8])) { if (*(int *)(state + 0x3C) >= 0) { - slot_reset_active(*(int *)(state + 0x3C)); + actuator_end_looping_waves(*(int *)(state + 0x3C)); *(int *)(state + 0x3C) = -1; } } - if (*(int *)(state + 0x3C) > 0 && !slot_is_entry_nonzero(*(int *)(state + 0x3C) - 1)) + if (*(int *)(state + 0x3C) > 0 && !actuator_is_channel_active(*(int *)(state + 0x3C) - 1)) *(int *)(state + 0x3C) = -1; if (!((g_pad_state[0x1A0 / 4] & ((Hero *)g_hero_state)->i[0x1230 / 4]) && get_ammo(-1)) && !(((Hero *)g_hero_state)->i[0x1D8 / 4] < 8 && ((Hero *)g_hero_state)->b[0x22B8])) { diff --git a/src/pal/levels/shared/L00_003B9360-g8.c b/src/pal/levels/shared/L00_003B9360-g8.c index 22020cdef..596024a05 100644 --- a/src/pal/levels/shared/L00_003B9360-g8.c +++ b/src/pal/levels/shared/L00_003B9360-g8.c @@ -16,7 +16,7 @@ extern Vector g_camera_offset_vector MACRO_ADDR; extern float g_electrolyzer_turn_step __attribute__((sda)); extern void moby_set_state(unsigned char *,int,int),cam_set_mode_state(int); extern void level_start_timed_object_once_pal(void); -extern s32 hero_l00_set_action_pal(int,int); +extern s32 hero_l00_set_move_state_pal(int,int); extern int ForceClaimNotice(int,int,int); extern void euler_rotation_basis(float *,float *),vec_scale_to_length(void *,void *,float),FastVecAdd(void *,void *,void *); extern float ApproachValue(float *,float,float),fast_vec_dist(void *,void *),FastVecDot(void *,void *),math_fabs(float),mat_fast_helper_a(float,float); @@ -41,7 +41,7 @@ void electrolyzer_update_pal(unsigned char *object) case 1: break; case 2: - if(g_pad_state.pressed&0x200) {cam_set_mode_state(0);hero_l00_set_action_pal(0,1);moby_set_state(object,1,-1);} + if(g_pad_state.pressed&0x200) {cam_set_mode_state(0);hero_l00_set_move_state_pal(0,1);moby_set_state(object,1,-1);} level_start_timed_object_once_pal(); object[0x31]=0;*(unsigned short *)(object+0x34)|=1; g_partial_camera_lock.active=1; diff --git a/src/pal/levels/shared/L00_003BCEB8-cc-g8.c b/src/pal/levels/shared/L00_003BCEB8-cc-g8.c index e51cadb4f..47623898e 100644 --- a/src/pal/levels/shared/L00_003BCEB8-cc-g8.c +++ b/src/pal/levels/shared/L00_003BCEB8-cc-g8.c @@ -93,7 +93,7 @@ extern void FastVecSub(void *,void *,void *),vec_scale_to_length(void *,void *,f extern void matrix_from_basis_rows(void *,void *),transform_vector(void *,void *,void *); extern float mat_fast_helper_a(float,float),FastAddRotations(float,float),vec_length_xy(void *); extern void moby_update_eased_node(void *,void *,int,float,float); -extern s32 hero_l00_set_action_pal(int,int); +extern s32 hero_l00_set_move_state_pal(int,int); extern void start_equipped_item_animation_pal(void),cancel_hero_item_animation_pal(void),gfx_add_draw_callback_first(void (*)(void),void *); extern void target_tether_draw_beam_pal(void); extern int PlayMobySound(int,int,void *); @@ -207,7 +207,7 @@ void target_lock_on_update_pal(unsigned char *object,AimState *state) } } if (state->mode==1 && g_hero_state.f2294!=28 && g_hero_state.f2294!=49) { - if (g_hero_state.f2294==1) hero_l00_set_action_pal(29,1); + if (g_hero_state.f2294==1) hero_l00_set_move_state_pal(29,1); if (g_hero_state.f22b4!=4) moby_update_eased_node(object,&g_target_lock_aim_angles,g_hero_state.f22b4==4?5:0,ref_L00_003B9310_02*1.44f,ref_L00_003B9310_03*1.44f); if (g_hero_state.f340 && !g_hero_state.f34e && !g_target_lock_disabled && !g_hero_state.f22bc && (g_pad_state.held&g_hero_state.f1230) && (g_hero_state.f1240>=13 || g_hero_state.f22b4==4)) { if (!state->held) { diff --git a/src/pal/levels/shared/L00_003C6C58-g8.c b/src/pal/levels/shared/L00_003C6C58-g8.c index 134d5d858..0c5233727 100644 --- a/src/pal/levels/shared/L00_003C6C58-g8.c +++ b/src/pal/levels/shared/L00_003C6C58-g8.c @@ -15,7 +15,7 @@ struct Rac2Native_5f824a0e369ccf7b_src_record { }; extern AimQueryConfig g_nuke_l00_aim_query_config; extern AimTuning g_weapon_l00_table[]; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_mini_nuke_sound_records[]; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_mini_nuke_rumble_waves[]; extern unsigned char g_hero_state[]; extern unsigned char g_pad_state[]; extern unsigned char g_gravity_bomb_weapon_index[]; @@ -34,11 +34,11 @@ extern int coll_trace_projectile_to_impact_pal(void *, void *, void *, void *, v extern void cancel_hero_item_animation_pal(void); extern int weapon_spend_ammo(int, int); extern void start_equipped_item_animation_pal(void); -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); extern int PlayMobySound(int, int, char *); extern char *mini_nuke_projectile_spawn_pal(int, char *, char *); extern int get_ammo(int); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern int vec_fast_helper_b(void *); extern void moby_apply_active_effect_pal(void *); extern void ref_L00_003C2FC8_00(void (*)(void *), void *); @@ -90,7 +90,7 @@ void mini_l00_nuke_update_pal(unsigned char *object) { if (weapon_spend_ammo(-1, 1)) { g_nuke_fire_held = 1; start_equipped_item_animation_pal(); - *(int *)(state + 0x2C) = slot_copy_records_to_free(g_mini_nuke_sound_records); + *(int *)(state + 0x2C) = actuator_play_waves(g_mini_nuke_rumble_waves); anim_start_blended_with_flags(object, 2, 0, 2, 0); mini_nuke_projectile_spawn_pal((int)object, (char *)&position, (char *)&config); PlayMobySound(0, 0, (char *)object); @@ -104,7 +104,7 @@ void mini_l00_nuke_update_pal(unsigned char *object) { } if (!(PAD->u[0x1A0 / 4] & H->u[0x1230 / 4]) || !get_ammo(-1) || !H->b[0x22B8]) { if (*(int *)(state + 0x2C) >= 0) { - slot_reset_active(*(int *)(state + 0x2C)); + actuator_end_looping_waves(*(int *)(state + 0x2C)); *(int *)(state + 0x2C) = -1; } } diff --git a/src/pal/levels/shared/L00_003C715C-g16.c b/src/pal/levels/shared/L00_003C715C-g16.c index 0e419e08d..b7ade3d6f 100644 --- a/src/pal/levels/shared/L00_003C715C-g16.c +++ b/src/pal/levels/shared/L00_003C715C-g16.c @@ -14,7 +14,7 @@ extern void moby_init_vars_once(char *); extern void moby_fire_shot_pal(char *, void *); typedef struct { char pad00[0x54]; float rate; char pad58[0xE0 - 0x58]; } AimEntry; extern AimEntry g_weapon_l00_table[]; -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern int FastDecTimer(s16 *); extern int math_fast_float_d(int *); @@ -37,9 +37,9 @@ extern int coll_trace_projectile_to_impact(float, void *, void *, void *, void * extern void part_spawn_muzzle_spark_burst(void *, void *, void *); extern int bouncer_spawn_debris(int, int, int); struct Rac2Native_5f824a0e369ccf7b_src_record; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_sound_record; -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); -extern void slot_reset_active(void); +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_rumble_waves; +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern void actuator_end_looping_waves(void); extern void gfx_add_draw_callback_third(void (*)(void *), void *); extern void moby_draw_attached_effect(void *); @@ -59,7 +59,7 @@ void hoverbomb_l00_gun_update_pal(unsigned char *object) { int phase; moby_init_vars_once(object); - if (((Hero *)g_hero_state)->i[2213] == 1) hero_l00_set_action_pal(29, 1); + if (((Hero *)g_hero_state)->i[2213] == 1) hero_l00_set_move_state_pal(29, 1); if (((Hero *)g_hero_state)->ptr[1300] != 0) ((Hero *)g_hero_state)->ptr[766] = ((Hero *)g_hero_state)->ptr[1300]; if (object[0x42] == object[0x43] && (object[0x60] & 2)) anim_start_blended_with_flags(object, 1, 0, 8, 0); diff --git a/src/pal/levels/shared/L00_003CA0B4-gun-g8.c b/src/pal/levels/shared/L00_003CA0B4-gun-g8.c index 9bd199977..d63f69ef1 100644 --- a/src/pal/levels/shared/L00_003CA0B4-gun-g8.c +++ b/src/pal/levels/shared/L00_003CA0B4-gun-g8.c @@ -61,7 +61,7 @@ extern void anim_start_blended_pal(void *, int, int, int); extern void start_equipped_item_animation_pal(void); extern void cancel_hero_item_animation_pal(void); extern void moby_transform_joint_to_world(void *, int, void *); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern void copy_matrix3x4(void *, void *); extern void matrix_from_basis_rows(void *, void *); extern void transform_vector(void *, void *, void *); @@ -130,7 +130,7 @@ void sheepinator_update_pal(char *owner) } if (!context->timer) context->timer = 12; moby_transform_joint_to_world(owner, 0, context); - if (g_hero_state.state == 1) hero_l00_set_action_pal(29, 1); + if (g_hero_state.state == 1) hero_l00_set_move_state_pal(29, 1); direction.q = 0; if (g_hero_state.state == 29 && (FIELD(g_hero_state.object, unsigned short, 0x34) & 1)) { diff --git a/src/pal/levels/shared/L00_003CC93C-cc-g8.c b/src/pal/levels/shared/L00_003CC93C-cc-g8.c index 07b9acff7..7643f44bb 100644 --- a/src/pal/levels/shared/L00_003CC93C-cc-g8.c +++ b/src/pal/levels/shared/L00_003CC93C-cc-g8.c @@ -65,11 +65,11 @@ extern Moby *g_area_hit_targets[]; extern CollisionResult g_collision_result; extern WeaponEntry g_weapon_l00_table[]; extern Light g_light_table[]; -extern u8 g_charge_sound_records[]; +extern u8 g_lock_on_weapon_rumble_waves[]; extern u8 g_default_vector[] __attribute__((sda)); extern int vec_fast_helper_b(void *); -extern int hero_l00_set_action_pal(int, int); +extern int hero_l00_set_move_state_pal(int, int); extern int math_fast_float_d(void *); extern void FastVecScale(void *, void *, float); extern void FastVecAdd(void *, void *, void *); @@ -87,13 +87,13 @@ extern int moby_is_in_special_class_range(void *); extern int PlayMobySound(int, int, void *); extern void weapon_spawn_muzzle_burst_pal(void *); extern void anim_start_blended_with_flags(void *, int, int, int, int); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern void matrix_mul_vec3(void *, void *, void *); extern char *pair_choose_owner_for_key(void *, void *, int, int *, int); extern void KeyOwnerTableInsert(void *, void *, int); extern Moby *aimed_projectile_spawn_pal(void *, void *, void *, void *, float, float, float, float); extern int weapon_spend_ammo(int, int); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern void cancel_hero_item_animation_pal(void); extern float IntToFloat(int); extern int part_l00_alloc_effect_slot_2(void *, float, float, float, float, float); @@ -128,7 +128,7 @@ void UpdateLockOnWeapon_pal(Moby *moby) } vec_fast_helper_b(vars); if (((Hero *)g_hero_state)->i[0x2294 / 4] == 1) - hero_l00_set_action_pal(0x1D, 1); + hero_l00_set_move_state_pal(0x1D, 1); ready = 1; if (((Hero *)g_hero_state)->i[0x2294 / 4] == 0x1D) { if (math_fast_float_d(&((Hero *)g_hero_state)->i[0x2534 / 4]) == 0) @@ -214,7 +214,7 @@ void UpdateLockOnWeapon_pal(Moby *moby) weapon_spawn_muzzle_burst_pal(moby); anim_start_blended_with_flags(moby, 2, 0, 1, 0); moby->scale = 0.9f; - vars->sound = slot_copy_records_to_free(g_charge_sound_records); + vars->sound = actuator_play_waves(g_lock_on_weapon_rumble_waves); *(Quad *)offset = 0; offset[0] = 0.513000011f; offset[1] = -1.0f; @@ -249,7 +249,7 @@ void UpdateLockOnWeapon_pal(Moby *moby) } if (!(g_pad_state[0x1A0 / 4] & ((Hero *)g_hero_state)->u[0x1230 / 4]) || ((Hero *)g_hero_state)->b[0x22B8] == 0) { if (vars->sound >= 0) { - slot_reset_active(vars->sound); + actuator_end_looping_waves(vars->sound); vars->sound = -1; cancel_hero_item_animation_pal(); } diff --git a/src/pal/levels/shared/L00_003D5C90-g64.c b/src/pal/levels/shared/L00_003D5C90-g64.c index b3d0b6db7..344c3a2c3 100644 --- a/src/pal/levels/shared/L00_003D5C90-g64.c +++ b/src/pal/levels/shared/L00_003D5C90-g64.c @@ -48,7 +48,7 @@ extern u8 g_item_slot_to_record[]; extern u8 g_hero_weapon_id_index NOT_SDA; extern float g_strip_axis[4] NOT_SDA; extern WeaponEntry g_weapon_l00_table[]; -extern u8 g_effect_handle_records[]; +extern u8 g_spread_weapon_rumble_waves[]; extern u8 g_default_vector[] MACRO_ADDR; typedef struct { u8 pad[0x160]; float f160; int pad164; int i168; int i16C; float f170; int pad174; int i178; } Shake; extern Shake g_scalar_transition_state; @@ -74,8 +74,8 @@ extern void hud_add_moby_marker(void *, float, u32, void *, int, float, int, flo extern void cancel_hero_item_animation_pal(void); extern void start_equipped_item_animation_pal(void); extern void anim_start_blended_with_flags(void *, int, int, int, int); -extern int slot_copy_records_to_free(void *); -extern void slot_reset_active(int); +extern int actuator_play_waves(void *); +extern void actuator_end_looping_waves(int); extern float math_random_angle(void); extern float IntToFloat(int); extern int PlayMobySound(int, int, void *); @@ -170,7 +170,7 @@ void UpdateSpreadWeapon_pal(u8 *self) turret_state->t40 = 0; } start_equipped_item_animation_pal(); - turret_state->handle = slot_copy_records_to_free(g_effect_handle_records); + turret_state->handle = actuator_play_waves(g_spread_weapon_rumble_waves); anim_start_blended_with_flags(self, 2, 0, 2, 0); turret_state->t4C = ((s32)g_effect_state_param * 5 + 2) / 6; self[0x20] = 2; @@ -190,7 +190,7 @@ void UpdateSpreadWeapon_pal(u8 *self) } if (!(((Hero *)g_pad_state)->i[0x1A0 / 4] & ((Hero *)g_hero_state)->i[0x1230 / 4]) || !get_ammo(-1) || ((Hero *)g_hero_state)->b[0x22B8] == 0) { if (turret_state->handle >= 0) { - slot_reset_active(turret_state->handle); + actuator_end_looping_waves(turret_state->handle); turret_state->handle = -1; } } diff --git a/src/pal/levels/shared/L00_003E7C98-g8.c b/src/pal/levels/shared/L00_003E7C98-g8.c index 8703d42ea..7deb78922 100644 --- a/src/pal/levels/shared/L00_003E7C98-g8.c +++ b/src/pal/levels/shared/L00_003E7C98-g8.c @@ -49,7 +49,7 @@ extern unsigned char g_beam_weapon_index NOT_SDA; extern UpdateTuning g_weapon_l00_table[]; typedef struct { float red, green, blue, unused; UpdateVector position; } ScopeLight; extern ScopeLight g_light_table[]; -extern char g_vaporizer_sound_records[]; +extern char g_vaporizer_rumble_waves[]; extern void anim_start_blended_with_flags(char *, int, int, int, int); extern void cam_set_value_target(int, int, float, float, float, float); extern void gfx_free_point_light(int); @@ -68,14 +68,14 @@ extern int *level_get_slot_header(int, int); extern char *mem_round_up_to_16(char *); extern void mem_fast_helper_b(void *, int); extern void ref_L00_003E3A18_00(int); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern int math_fast_float_d(int *); extern int weapon_spend_ammo(int, int); extern void start_equipped_item_animation_pal(void); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern void anim_start_blended_pal(char *, int, int, int); extern int PlayMobySound(int, int, char *); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern int FastDecTimer(short *); extern void AimAndSpawnBeamWithMuzzleFlashes_pal(char *); extern int vec_fast_helper_b(float *); @@ -213,7 +213,7 @@ void vaporizer_update_pal(u8 *object) if (data->resource >= 0) ref_L00_003E3A18_00(data->resource); break; case 1: - if (g_hero_state.mode == 1) hero_l00_set_action_pal(29, 1); + if (g_hero_state.mode == 1) hero_l00_set_move_state_pal(29, 1); if (g_hero_state.scope) { if (data->scoped == 0) g_render_state_word = 0; data->scoped = 1; @@ -247,14 +247,14 @@ void vaporizer_update_pal(u8 *object) if (g_hero_state.blocked == 0 && (g_pad_state[0x1A4/4] & g_hero_state.input) && canFire) { if (weapon_spend_ammo(-1, 1)) { start_equipped_item_animation_pal(); - data->sound = slot_copy_records_to_free(g_vaporizer_sound_records); + data->sound = actuator_play_waves(g_vaporizer_rumble_waves); data->firingDelay = 2; object[0x20] = 2; anim_start_blended_pal(object, 2, 0, 0); } else PlayMobySound(1, 0, object); if ((g_pad_state[0x1A0/4] & g_hero_state.input) && get_ammo(-1) && g_hero_state.active) break; if (data->sound >= 0) { - slot_reset_active(data->sound); + actuator_end_looping_waves(data->sound); data->sound = -1; } } diff --git a/src/pal/levels/shared/L00_003EC43C-g8.c b/src/pal/levels/shared/L00_003EC43C-g8.c index 3ea622f55..c67a8f2fd 100644 --- a/src/pal/levels/shared/L00_003EC43C-g8.c +++ b/src/pal/levels/shared/L00_003EC43C-g8.c @@ -48,7 +48,7 @@ extern int AcquireEntitySlot(void *,int,void *); extern u8 *level_get_slot_body(int,int); extern float math_random_signed_float_range(float,float), math_random_float_range(float,float); extern void vec_clear_128(void *), sheepinator_clear_records(void); -extern s32 hero_l00_set_action_pal(int,int); +extern s32 hero_l00_set_move_state_pal(int,int); extern int math_fast_float_d(void *), get_ammo(int); extern void hud_add_moby_marker(void *,unsigned int,float,void *,float,int,int,float,int); extern void moby_transform_joint_to_world(void *,int,void *); @@ -118,7 +118,7 @@ void UpdateChargedWeapon_pal(ChargeWeaponMoby *moby) { g_charge_weapon_effects.reticle=-1; if (g_hero_state.selected) g_hero_state.held=g_hero_state.selected; if (!g_charge_weapon_initialized) g_charge_weapon_initialized=1; - if (g_hero_state.mode==1) hero_l00_set_action_pal(29,1); + if (g_hero_state.mode==1) hero_l00_set_move_state_pal(29,1); enabled=1; if (g_hero_state.mode==29) { if (!math_fast_float_d(&g_hero_state.timer)) enabled=0; diff --git a/src/pal/levels/shared/L00_003F2840-g82.c b/src/pal/levels/shared/L00_003F2840-g82.c index 7445b6df9..c4302ab80 100644 --- a/src/pal/levels/shared/L00_003F2840-g82.c +++ b/src/pal/levels/shared/L00_003F2840-g82.c @@ -15,7 +15,7 @@ struct Rac2Native_5f824a0e369ccf7b_src_record { }; extern AimQueryConfig g_gravity_bomb_aim_config; extern AimTuning g_weapon_l00_table[]; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_gravity_bomb_sound_records[]; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_gravity_bomb_rumble_waves[]; extern unsigned char g_hero_state[]; extern unsigned char g_pad_state[]; extern unsigned char g_gravity_bomb_weapon_index[]; @@ -34,11 +34,11 @@ extern int coll_trace_projectile_to_impact_pal(void *, void *, void *, void *, v extern void cancel_hero_item_animation_pal(void); extern int weapon_spend_ammo(int, int); extern void start_equipped_item_animation_pal(void); -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); extern int PlayMobySound(int, int, char *); extern char *gravity_bomb_spawn_projectile_pal(int, char *, char *); extern int get_ammo(int); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern int vec_fast_helper_b(void *); extern void weapon_draw_aim_effect_pal(void *); extern void ref_L00_003EE4C0_00(void (*)(void *), void *); @@ -89,7 +89,7 @@ void gravity_bomb_launcher_update_pal(unsigned char *object) { if (weapon_spend_ammo(-1, 1)) { g_gravity_bomb_fire_held = 1; start_equipped_item_animation_pal(); - *(int *)(state + 0x2C) = slot_copy_records_to_free(g_gravity_bomb_sound_records); + *(int *)(state + 0x2C) = actuator_play_waves(g_gravity_bomb_rumble_waves); anim_start_blended_with_flags(object, 2, 0, 2, 0); gravity_bomb_spawn_projectile_pal((int)object, (char *)&position, (char *)&config); PlayMobySound(0, 0, (char *)object); @@ -103,7 +103,7 @@ void gravity_bomb_launcher_update_pal(unsigned char *object) { } if (!(PAD->u[0x1A0 / 4] & H->u[0x1230 / 4]) || !get_ammo(-1) || !H->b[0x22B8]) { if (*(int *)(state + 0x2C) >= 0) { - slot_reset_active(*(int *)(state + 0x2C)); + actuator_end_looping_waves(*(int *)(state + 0x2C)); *(int *)(state + 0x2C) = -1; } } diff --git a/src/pal/levels/shared/L00_003F8134-g8.c b/src/pal/levels/shared/L00_003F8134-g8.c index 494c8f728..4cf01875b 100644 --- a/src/pal/levels/shared/L00_003F8134-g8.c +++ b/src/pal/levels/shared/L00_003F8134-g8.c @@ -16,7 +16,7 @@ extern float g_hk22_speed_scale __attribute__((sda)); extern float g_weapon_effect_scale[]; extern void ReleaseDeadOrExpiredSlots(void *); extern void anim_start_blended_with_flags(void *, int, int, int, int); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern void hud_add_moby_marker(void *, unsigned int, int, int, int, int, float, float, float); extern int math_fast_float_d(void *); extern int vec_fast_helper_b(void *); @@ -49,7 +49,7 @@ void hk22_update_pal(unsigned char *object) { *(float *)(object + 0x2C) = *(float *)(*(char **)(object + 0x24) + 0x24) * g_hk22_speed_scale; g_weapon_effect_scale[0] = 0.1f; if (H->i[2213] == 1) - hero_l00_set_action_pal(0x1D, 1); + hero_l00_set_move_state_pal(0x1D, 1); if (H->i[2213] == 0x1D) { if (*(float *)state > 0.0f && get_ammo(-1)) color = 0x600000FF; diff --git a/src/pal/levels/shared/L00_004026C4-g8.c b/src/pal/levels/shared/L00_004026C4-g8.c index 9ada870d8..8f46ef5ec 100644 --- a/src/pal/levels/shared/L00_004026C4-g8.c +++ b/src/pal/levels/shared/L00_004026C4-g8.c @@ -28,7 +28,7 @@ extern int g_game_l00_mode; extern int g_bouncer_timer; typedef struct { char pad00[0x54]; float rate; char pad58[0xE0 - 0x58]; } AimEntry; extern AimEntry g_weapon_l00_table[]; -extern s32 hero_l00_set_action_pal(int a0, int a1); +extern s32 hero_l00_set_move_state_pal(int a0, int a1); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern int math_fast_float_d(int *); extern int vec_fast_helper_b(float *); @@ -44,9 +44,9 @@ extern int coll_trace_projectile_to_impact_pal(float, void *, void *, void *, vo extern void part_spawn_muzzle_spark_burst_pal(void *, void *, void *); extern int bouncer_spawn_debris(int, int, int); struct Rac2Native_5f824a0e369ccf7b_src_record; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_sound_record; -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); -extern void slot_reset_active(int); +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_rumble_waves; +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern void actuator_end_looping_waves(int); extern void ref_L00_003FDE48_00(void *, void *); extern void moby_draw_attached_effect_pal(void *); @@ -70,7 +70,7 @@ void bouncer_update_pal(unsigned char *object) { *(int *)(state + 0x2C) = 0; g_bouncer_timer = 17; } - if (g_hero_state.level == 1) hero_l00_set_action_pal(29, 1); + if (g_hero_state.level == 1) hero_l00_set_move_state_pal(29, 1); if (object[0x42] == object[0x43] && (object[0x60] & 2)) anim_start_blended_with_flags(object, 1, 0, 2, 0); moby_compute_offset_point(object, (char *)origin); target = 0; @@ -103,12 +103,12 @@ void bouncer_update_pal(unsigned char *object) { bouncer_spawn_debris((int)object, (int)origin, (int)aim); start_equipped_item_animation_pal(); *(int *)(state + 0x2C) = 13; - *(int *)(state + 0x28) = slot_copy_records_to_free(&g_bouncer_sound_record); + *(int *)(state + 0x28) = actuator_play_waves(&g_bouncer_rumble_waves); } if (!(g_pad_state.held & g_hero_state.buttons) || !get_ammo(-1) || g_hero_state.unk_22B8 == 0) { handle = *(int *)(state + 0x28); if (handle >= 0) { - slot_reset_active(handle); + actuator_end_looping_waves(handle); *(int *)(state + 0x28) = -1; } } diff --git a/src/pal/levels/shared/L00_00402D4C-g16.c b/src/pal/levels/shared/L00_00402D4C-g16.c index e422e50ad..6378e6835 100644 --- a/src/pal/levels/shared/L00_00402D4C-g16.c +++ b/src/pal/levels/shared/L00_00402D4C-g16.c @@ -17,7 +17,7 @@ extern int g_spread_shot_count __attribute__((sda)); typedef struct { char pad00[0x54]; float rate; char pad58[0xE0 - 0x58]; } AimEntry; extern AimEntry g_weapon_l00_table[]; extern void moby_init_private_data(char *); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern int FastDecTimer(s16 *); extern int math_fast_float_d(int *); @@ -56,7 +56,7 @@ void tetrabomb_l00_gun_update_pal(unsigned char *object) { int phase; moby_init_private_data(object); - if (((Hero *)g_hero_state)->i[2213] == 1) hero_l00_set_action_pal(29, 1); + if (((Hero *)g_hero_state)->i[2213] == 1) hero_l00_set_move_state_pal(29, 1); if (((Hero *)g_hero_state)->ptr[1300] != 0) ((Hero *)g_hero_state)->ptr[766] = ((Hero *)g_hero_state)->ptr[1300]; if (object[0x42] == object[0x43] && (object[0x60] & 2)) anim_start_blended_with_flags(object, 1, 0, 5, 0); diff --git a/src/pal/levels/shared/L00_00403200-sw-g8.c b/src/pal/levels/shared/L00_00403200-sw-g8.c index 848d35593..03f3bb778 100644 --- a/src/pal/levels/shared/L00_00403200-sw-g8.c +++ b/src/pal/levels/shared/L00_00403200-sw-g8.c @@ -67,7 +67,7 @@ extern void part_steer_effect_direction(int, void *, int); extern void vec_transform_or_copy(void *, void *); extern void shop_trigger_current_state_effect(void *, void *); extern void vec_add_object_direction_scaled(void *, void *, float); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern void part_setup_object_effect_entry(void *, void *, void *); extern void anim_start_blended_pal(void *, int, int, int); extern int PlayMobySound(int, int, void *); @@ -175,7 +175,7 @@ void timed_ground_actor_update_pal(char *obj) break; qcopy(obj + 0x10, &collision->point); ForceClaimNotice(6, 0, 1); - hero_l00_set_action_pal(28, 1); + hero_l00_set_move_state_pal(28, 1); part_setup_object_effect_entry(obj + 0x10, obj + 0xF0, obj); STATE(obj) = 2; anim_start_blended_pal(obj, 1, 0, 10); @@ -277,7 +277,7 @@ void timed_ground_actor_update_pal(char *obj) break; case 8: if (g_game_mode == 28) - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); if (*(short *)(g_follow_camera_object + 0x86) == 27) ref_L00_003FFBA0_00(); table_clear_entry_flag(update_handle); diff --git a/src/pal/levels/shared/L00_0040A210-cc-g8.c b/src/pal/levels/shared/L00_0040A210-cc-g8.c index 430567c84..eaaffca80 100644 --- a/src/pal/levels/shared/L00_0040A210-cc-g8.c +++ b/src/pal/levels/shared/L00_0040A210-cc-g8.c @@ -50,7 +50,7 @@ extern int FastDecTimer(void *); extern void anim_start_blended_pal(void *,int,int,int); extern void matrix_mul_vec3(void *,void *,void *); extern void FastVecAdd(void *,void *,void *); -extern s32 hero_l00_set_action_pal(int,int); +extern s32 hero_l00_set_move_state_pal(int,int); extern void copy_matrix3x4(void *,void *); extern void matrix_from_basis_rows(void *,void *); extern void transform_vector(void *,void *,void *); @@ -116,7 +116,7 @@ void morphoray_update_pal(char *object) offset.x=0.15f; offset.y=-1.0f; offset.z=0.06f; offset.w=1.0f; matrix_mul_vec3(&offset,&offset,object+0xc0); FastVecAdd(state,object+0x10,&offset); - if (g_hero_state.current==1) hero_l00_set_action_pal(29,1); + if (g_hero_state.current==1) hero_l00_set_move_state_pal(29,1); *(Quad *)&direction=0; if (g_hero_state.current==29 && (U(g_hero_state.object,0x34)&1)) { copy_matrix3x4(matrix,g_scalar_transition_state); diff --git a/src/pal/levels/shared/L00_0040D990-g8.c b/src/pal/levels/shared/L00_0040D990-g8.c index c63f4fbf5..aa224cfda 100644 --- a/src/pal/levels/shared/L00_0040D990-g8.c +++ b/src/pal/levels/shared/L00_0040D990-g8.c @@ -24,7 +24,7 @@ extern void mem_fast_helper_b(void *, int); extern int math_fast_float_d(void *); extern int get_ammo(int); extern void start_equipped_item_animation_pal(void); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern int PlayMobySound(int, int, char *); extern void vec_scale_to_length(void *, void *, float); extern char *spark_effect_spawn_pal(void *, int, char *); @@ -61,7 +61,7 @@ extern int g_charging_weapon_initial_value __attribute__((sda)); extern unsigned char g_charging_weapon_index __attribute__((nosda)); extern RateEntry g_weapon_l00_table[]; extern float g_weapon_effect_scale __attribute__((nosda)); -extern char g_charging_weapon_sound_records[]; +extern char g_charging_weapon_rumble_waves[]; extern char g_cam_follow_matrix[]; #define I(p, n) (*(int *)((char *)(p) + (n))) @@ -100,7 +100,7 @@ void charging_weapon_update_pal(char *moby) } if (get_ammo(-1)) { start_equipped_item_animation_pal(); - I(vars, 24) = slot_copy_records_to_free(g_charging_weapon_sound_records); + I(vars, 24) = actuator_play_waves(g_charging_weapon_rumble_waves); B(moby, 32) = 2; I(vars, 4) = (((int)(g_charging_weapon_initial_value) * 5 + 2) / 6); } else { diff --git a/src/pal/levels/shared/L00_00413EA4-g16.c b/src/pal/levels/shared/L00_00413EA4-g16.c index 00e2b833b..da432f418 100644 --- a/src/pal/levels/shared/L00_00413EA4-g16.c +++ b/src/pal/levels/shared/L00_00413EA4-g16.c @@ -60,8 +60,8 @@ extern float g_camera_l00_position[]; extern Moby *g_area_hit_targets[]; extern CollisionResult g_collision_result; extern WeaponEntry g_weapon_table_2[]; -extern u8 g_megarocket_sound_records[]; -extern s32 hero_l00_set_action_pal(int, int); +extern u8 g_megarocket_rumble_waves[]; +extern s32 hero_l00_set_move_state_pal(int, int); extern void matrix_mul_vec3(void *, void *, void *); extern void FastVecAdd(void *, void *, void *); extern void FastVecScale(void *, void *, float); @@ -90,9 +90,9 @@ extern int coll_process_hit(float, void *, int, void *, void *); extern void particle_burst_around_object_pal(Moby *, int); extern void charge_shot_start_effect_pal(Moby *, Vector *, int); extern void start_equipped_item_animation_pal(void); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern int subtitle_request_voice_line_pal(int, int); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern void sequenced_child_spawn_pal(Moby *, Vector *); extern void light_flash_update_pal(Moby *, Vector *); #define HERO ((Hero *)D_00189E20) @@ -122,7 +122,7 @@ void megarocket_cannon_update_pal(Moby *moby) vars->chargeSound = -1; } if (HERO->i[0x2294 / 4] == 1) - hero_l00_set_action_pal(0x1D, 1); + hero_l00_set_move_state_pal(0x1D, 1); matrix_mul_vec3(&nozzle, &g_megarocket_nozzle_offset, &moby->right); FastVecAdd(&nozzle, &nozzle, &moby->position); if (HERO->i[0x1450 / 4] != 0) @@ -291,7 +291,7 @@ void megarocket_cannon_update_pal(Moby *moby) charge_shot_start_effect_pal(moby, &nozzle, charged); anim_start_blended_with_flags(moby, 2, 0, 2, 0); start_equipped_item_animation_pal(); - vars->sound = slot_copy_records_to_free(g_megarocket_sound_records); + vars->sound = actuator_play_waves(g_megarocket_rumble_waves); if (charged) g_subtitle_history[0x3A8 / 2] = 0xFFFF; else if (g_subtitle_history[0x3A8 / 2] < 40 && ++g_subtitle_history[0x3A8 / 2] == 40) @@ -299,7 +299,7 @@ void megarocket_cannon_update_pal(Moby *moby) } if (!((g_pad_state[0x1A0 / 4] & HERO->u[0x1230 / 4]) && get_ammo(-1) && HERO->b[0x22B8]) && vars->sound >= 0) { - slot_reset_active(vars->sound); + actuator_end_looping_waves(vars->sound); vars->sound = -1; } { diff --git a/src/pal/levels/shared/L00_0041EF38-cc-g8.c b/src/pal/levels/shared/L00_0041EF38-cc-g8.c index 9046fa70a..63e9a4bf1 100644 --- a/src/pal/levels/shared/L00_0041EF38-cc-g8.c +++ b/src/pal/levels/shared/L00_0041EF38-cc-g8.c @@ -41,7 +41,7 @@ extern void vec_scale_to_length(void *, void *, float); extern void make_hit_descriptor(void *, char *, int, void *, float); extern void QueueMobyImpact(char *, void *); extern int StartAttachedEffect_pal(char *, int, char *); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern void vec_clear_128(void *); extern void matrix_mul_vec3(void *, void *, void *); extern void vec_compute_object_to_target(char *, char *, void *, float); @@ -118,7 +118,7 @@ void lava_l00_l00_gun_update_pal(char *object) math_spring_float_to_goal((float *)(state+0x50),(float *)(state+0x54),0,0.072000004f,0.012f,0.15f); *(int *)(state+0x60)=0; } - if (g_hero_state.i[0x2294/4]==1) hero_l00_set_action_pal(29,1); + if (g_hero_state.i[0x2294/4]==1) hero_l00_set_move_state_pal(29,1); moby_transform_joint_to_world(object,0,state); vec_clear_128(vector); vector[1]=-1; matrix_mul_vec3(vector,vector,object+0xc0); diff --git a/src/pal/levels/shared/L00_0042E68C.c b/src/pal/levels/shared/L00_0042E68C.c index 888a18e21..989dbe355 100644 --- a/src/pal/levels/shared/L00_0042E68C.c +++ b/src/pal/levels/shared/L00_0042E68C.c @@ -12,7 +12,7 @@ typedef struct { u8 pad[0x194]; InitQuad *transform; } PathCamera; extern PathCamera g_scalar_transition_state; extern float mat_fast_helper_a(float x, float y); extern void vec_clear_128(InitQuad *v); -extern int hero_l00_set_action(int event, int value); +extern int hero_l00_set_move_state(int event, int value); extern float fast_vec_dist(char *a, char *b); extern float IntToFloat(int); #define SDA_OBJ __attribute__((section(".sdata"))) @@ -123,6 +123,6 @@ void cam_path_motion_init_pal(u8 *object) qcopy(object + 0x10, transform + 1); qcopy(object + 0x20, transform + 2); if (data->eventGate == 0) - hero_l00_set_action(0x6f, 1); + hero_l00_set_move_state(0x6f, 1); data->initialized = 1; } diff --git a/src/pal/levels/shared/L00_0042EA98-cc.c b/src/pal/levels/shared/L00_0042EA98-cc.c index 7e9bbba11..973a94367 100644 --- a/src/pal/levels/shared/L00_0042EA98-cc.c +++ b/src/pal/levels/shared/L00_0042EA98-cc.c @@ -25,7 +25,7 @@ void FastVecCross(void *,void *,void *); float math_fast_sin_or_cos_b(float); float math_fast_sin_or_cos_a(float); void UpdateViewContext(void); -s32 hero_l00_set_action_pal(int,int); +s32 hero_l00_set_move_state_pal(int,int); int Spline_AdvanceByDistance(void *,void *,int *,float *,float,int); int FastDecTimer(void *); float math_cosine_blend(float,float,float); @@ -109,7 +109,7 @@ void cam_path_update_cinematic_pal(char *moby) { *(short *)(moby + 0x7E) = 4; g_cam_path_cinematic_flag = 0; if (*(int *)(cam_def + 0x4C) == 0) { - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); } } if (*(int *)(cam_def + 0x40) == 0) { diff --git a/src/pal/levels/shared/L02_003C6394-g16.c b/src/pal/levels/shared/L02_003C6394-g16.c index d2f76a41c..349a85973 100644 --- a/src/pal/levels/shared/L02_003C6394-g16.c +++ b/src/pal/levels/shared/L02_003C6394-g16.c @@ -124,7 +124,7 @@ extern void LoadClassIntoFreeCacheSlot(int); extern int ForceClaimNotice(int, int, int); extern void object_copy_vector_to_selected(const void *), cam_set_state_rotation(const void *); extern void SetCamera5Pose(const void *, const void *, int, int, int); -extern int hero_l00_set_action_pal(int, int); +extern int hero_l00_set_move_state_pal(int, int); extern void set_hero_animation_pal(int, int, float); extern void script_queue_keyed_request(int, int); extern void advance_path_follower_pal(char *, int); @@ -265,7 +265,7 @@ void challenge_controller_update_pal(u8 *object) g_hero_state.controlMode = 3; status = hero_get_target_state_kind(); if (status == 2 && g_hero_state.object[0x42] == g_hero_state.object[0x43]) { - hero_l00_set_action_pal(0x6F, 0); + hero_l00_set_move_state_pal(0x6F, 0); set_hero_animation_pal(0x54, 0, 6.0f); position.f[0] = math_fast_sin_or_cos_a(*(float *)(object + 0xF8)) * 3.0f; position.f[1] = math_fast_sin_or_cos_b(*(float *)(object + 0xF8)) * 3.0f; @@ -376,7 +376,7 @@ void challenge_controller_update_pal(u8 *object) char *actors; u16 *list; ForceClaimNotice(1, 0, 1); - hero_l00_set_action_pal(0x6F, 1); + hero_l00_set_move_state_pal(0x6F, 1); record = g_matrix_l02_record_table + state->record * 0x80; if (fast_vec_dist(&g_camera_l02_position.from, record + 0x30) <= 1.0f) { if (g_arena_state_words == 7) { @@ -398,7 +398,7 @@ void challenge_controller_update_pal(u8 *object) break; cam_set_mode_state(3); g_hero_state.cameraRequest = state->savedCamera; - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); g_hero_state.cameraRequest = state->savedCamera; if (state->restoreMode != -1) cam_reset_entry(state->restoreMode); @@ -423,7 +423,7 @@ void challenge_controller_update_pal(u8 *object) g_hero_state.cameraRequest = state->savedCamera; cam_set_mode_state(3); g_hero_state.cameraRequest = state->savedCamera; - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -497,7 +497,7 @@ void challenge_controller_update_pal(u8 *object) break; cam_set_mode_state(3); g_hero_state.cameraRequest = state->savedCamera; - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -544,7 +544,7 @@ void challenge_controller_update_pal(u8 *object) } cam_set_mode_state(3); g_hero_state.cameraRequest = state->savedCamera; - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -576,7 +576,7 @@ void challenge_controller_update_pal(u8 *object) } cam_set_mode_state(3); g_hero_state.cameraRequest = state->savedCamera; - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -601,7 +601,7 @@ void challenge_controller_update_pal(u8 *object) } else if (g_pad_state.buttons.word.high & 0x10) { cam_set_mode_state(3); g_hero_state.cameraRequest = state->savedCamera; - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -648,7 +648,7 @@ void challenge_controller_update_pal(u8 *object) break; cam_set_mode_state(3); g_hero_state.cameraRequest = state->savedCamera; - hero_l00_set_action_pal(0, 1); + hero_l00_set_move_state_pal(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); diff --git a/src/pal/levels/shared/L02_004150B8-sw-g8.c b/src/pal/levels/shared/L02_004150B8-sw-g8.c index 065471d14..cddb53ff8 100644 --- a/src/pal/levels/shared/L02_004150B8-sw-g8.c +++ b/src/pal/levels/shared/L02_004150B8-sw-g8.c @@ -23,7 +23,7 @@ extern int PlayMobySound(int,int,char *); extern void hero_start_target_state(Quad *,int,float); extern int coll_sweep_from_object(void *,float,float *,int,float,float,int,int,int); extern int hero_get_target_state_kind(void); -extern int hero_l00_set_action_pal(int,int); +extern int hero_l00_set_move_state_pal(int,int); extern void gfx_add_draw_callback_first(DrawCallback,void *); extern void gfx_add_draw_callback_third(DrawCallback,void *); extern float ApproachValue(float *,float,float); @@ -111,7 +111,7 @@ void teleporter_l02_update_pal(u8 *object) } else if(state->orbitB<1.0f) { math_step_value_toward_target(&state->orbitB,&state->rateB,1.0f,g_teleporter_orbit_speed*0.00040000002f,g_teleporter_orbit_accel*0.00040000002f,g_teleporter_orbit_rate_limit*0.020000001f); } else if(g_teleporter_state!=11 || !(state->orbitA>0.25f)) { - if(answer==2) {hero_l00_set_action_pal(0x6F,1);state->timer=1.95f;object[0x20]=3;} + if(answer==2) {hero_l00_set_move_state_pal(0x6F,1);state->timer=1.95f;object[0x20]=3;} else if(answer==0) object[0x20]=4; } teleporter_update_orbiting_children(object); diff --git a/src/pal/levels/shared/L02_0042DE18-g16.c b/src/pal/levels/shared/L02_0042DE18-g16.c index 0505bd600..0aa7d071c 100644 --- a/src/pal/levels/shared/L02_0042DE18-g16.c +++ b/src/pal/levels/shared/L02_0042DE18-g16.c @@ -17,7 +17,7 @@ extern int g_spread_shot_count __attribute__((sda)); typedef struct { char pad00[0x54]; float rate; char pad58[0xE0 - 0x58]; } AimEntry; extern AimEntry g_weapon_l00_table[]; extern void moby_init_private_data(char *); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern int FastDecTimer(s16 *); extern int math_fast_float_d(int *); @@ -56,7 +56,7 @@ void tetrabomb_l02_gun_update_pal(unsigned char *object) { int phase; moby_init_private_data(object); - if (((Hero *)g_hero_state)->i[2213] == 1) hero_l00_set_action_pal(29, 1); + if (((Hero *)g_hero_state)->i[2213] == 1) hero_l00_set_move_state_pal(29, 1); if (((Hero *)g_hero_state)->ptr[1300] != 0) ((Hero *)g_hero_state)->ptr[766] = ((Hero *)g_hero_state)->ptr[1300]; if (object[0x42] == object[0x43] && (object[0x60] & 2)) anim_start_blended_with_flags(object, 1, 0, 5, 0); diff --git a/src/pal/levels/shared/L02_0044B234-cc-g8.c b/src/pal/levels/shared/L02_0044B234-cc-g8.c index 361206d7e..05f04abb4 100644 --- a/src/pal/levels/shared/L02_0044B234-cc-g8.c +++ b/src/pal/levels/shared/L02_0044B234-cc-g8.c @@ -41,7 +41,7 @@ extern void vec_scale_to_length(void *, void *, float); extern void make_hit_descriptor(void *, char *, int, void *, float); extern void QueueMobyImpact(char *, void *); extern int StartAttachedEffect_pal(char *, int, char *); -extern s32 hero_l00_set_action_pal(int, int); +extern s32 hero_l00_set_move_state_pal(int, int); extern void vec_clear_128(void *); extern void matrix_mul_vec3(void *, void *, void *); extern void vec_compute_object_to_target(char *, char *, void *, float); @@ -118,7 +118,7 @@ void lava_l02_l00_gun_update_pal(char *object) math_spring_float_to_goal((float *)(state+0x50),(float *)(state+0x54),0,0.072000004f,0.012f,0.15f); *(int *)(state+0x60)=0; } - if (g_hero_state.i[0x2294/4]==1) hero_l00_set_action_pal(29,1); + if (g_hero_state.i[0x2294/4]==1) hero_l00_set_move_state_pal(29,1); moby_transform_joint_to_world(object,0,state); vec_clear_128(vector); vector[1]=-1; matrix_mul_vec3(vector,vector,object+0xc0); diff --git a/src/pal/levels/shared/L03_003DC998-cc-g8.c b/src/pal/levels/shared/L03_003DC998-cc-g8.c index 721c98d4d..d073f43d3 100644 --- a/src/pal/levels/shared/L03_003DC998-cc-g8.c +++ b/src/pal/levels/shared/L03_003DC998-cc-g8.c @@ -65,11 +65,11 @@ extern Moby *g_area_hit_targets[]; extern CollisionResult g_collision_result; extern WeaponEntry g_weapon_l00_table[]; extern Light g_light_table[]; -extern u8 g_charge_sound_records[]; +extern u8 g_lock_on_weapon_rumble_waves[]; extern u8 g_default_vector[] __attribute__((sda)); extern int vec_fast_helper_b(void *); -extern int hero_l03_enter_state_pal(int, int); +extern int hero_l03_set_move_state_pal(int, int); extern int math_fast_float_d(void *); extern void FastVecScale(void *, void *, float); extern void FastVecAdd(void *, void *, void *); @@ -87,13 +87,13 @@ extern int moby_is_in_special_class_range(void *); extern int PlayMobySound(int, int, void *); extern void weapon_spawn_muzzle_burst_pal(void *); extern void anim_start_blended_with_flags(void *, int, int, int, int); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern void matrix_mul_vec3(void *, void *, void *); extern char *pair_choose_owner_for_key(void *, void *, int, int *, int); extern void KeyOwnerTableInsert(void *, void *, int); extern Moby *aimed_projectile_spawn_pal(void *, void *, void *, void *, float, float, float, float); extern int weapon_spend_ammo(int, int); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern void cancel_hero_item_animation_pal(void); extern float IntToFloat(int); extern int part_l00_alloc_effect_slot_2(void *, float, float, float, float, float); @@ -129,7 +129,7 @@ void update_lock_on_weapon_l03_pal(Moby *moby) } vec_fast_helper_b(vars); if (((Hero *)g_hero_state)->i[0x2294 / 4] == 1) - hero_l03_enter_state_pal(0x1D, 1); + hero_l03_set_move_state_pal(0x1D, 1); ready = 1; if (((Hero *)g_hero_state)->i[0x2294 / 4] == 0x1D) { if (math_fast_float_d(&((Hero *)g_hero_state)->i[0x2534 / 4]) == 0) @@ -215,7 +215,7 @@ void update_lock_on_weapon_l03_pal(Moby *moby) weapon_spawn_muzzle_burst_pal(moby); anim_start_blended_with_flags(moby, 2, 0, 1, 0); moby->scale = 0.9f; - vars->sound = slot_copy_records_to_free(g_charge_sound_records); + vars->sound = actuator_play_waves(g_lock_on_weapon_rumble_waves); *(Quad *)offset = 0; offset[0] = 0.513000011f; offset[1] = -1.0f; @@ -250,7 +250,7 @@ void update_lock_on_weapon_l03_pal(Moby *moby) } if (!(g_pad_state[0x1A0 / 4] & ((Hero *)g_hero_state)->u[0x1230 / 4]) || ((Hero *)g_hero_state)->b[0x22B8] == 0) { if (vars->sound >= 0) { - slot_reset_active(vars->sound); + actuator_end_looping_waves(vars->sound); vars->sound = -1; cancel_hero_item_animation_pal(); } diff --git a/src/pal/levels/shared/L03_003E8C80-cc-g8.c b/src/pal/levels/shared/L03_003E8C80-cc-g8.c index ffc6a8f97..2350a0dc1 100644 --- a/src/pal/levels/shared/L03_003E8C80-cc-g8.c +++ b/src/pal/levels/shared/L03_003E8C80-cc-g8.c @@ -51,7 +51,7 @@ extern void infiltrator_ball_spawn_for_moby(char *),moby_update_attached_child(c extern int ForceClaimNotice(int,int,int); extern int load_is_class_cached(int); extern void LoadClassIntoFreeCacheSlot(int),hero_start_loader_state(int); -extern int hero_l03_enter_state_pal(int,int); +extern int hero_l03_set_move_state_pal(int,int); extern void matrix_mul_vec3(void *,void *,void *),FastVecAdd(void *,void *,void *),FastVecSub(void *,void *,void *); extern float FastAddRotations(float,float),mat_fast_helper_a(float,float),vec_distance_xy(void *,void *); extern void hero_start_target_state(void *,int,float); @@ -152,7 +152,7 @@ void infiltrator_lock_update_pal(char *moby) { case 3: if (flag_set_first_pending(moby)) { PlayMobySound(0,0,moby); - hero_l03_enter_state_pal(0x6F,0);set_hero_animation_pal(0x54,0,17.0f); + hero_l03_set_move_state_pal(0x6F,0);set_hero_animation_pal(0x54,0,17.0f); FastVecSub(vec,g_camera_pose_buffer,g_hero_state.position); matrix_mul_vec3(vec,vec,g_hero_state.matrix40); SetCamera5Pose(g_camera_pose_buffer,g_camera_pose_buffer,3,100,0); diff --git a/src/pal/levels/shared/L03_00431370-cc-g8.c b/src/pal/levels/shared/L03_00431370-cc-g8.c index 220980f72..1742f4077 100644 --- a/src/pal/levels/shared/L03_00431370-cc-g8.c +++ b/src/pal/levels/shared/L03_00431370-cc-g8.c @@ -41,7 +41,7 @@ extern void vec_scale_to_length(void *, void *, float); extern void make_hit_descriptor(void *, char *, int, void *, float); extern void QueueMobyImpact(char *, void *); extern int StartAttachedEffect_pal(char *, int, char *); -extern s32 hero_l12_set_action_pal(int, int); +extern s32 hero_l12_set_move_state_pal(int, int); extern void vec_clear_128(void *); extern void matrix_mul_vec3(void *, void *, void *); extern void vec_compute_object_to_target(char *, char *, void *, float); @@ -118,7 +118,7 @@ void lava_l03_l00_gun_update_pal(char *moby) math_spring_float_to_goal((float *)(state+0x50),(float *)(state+0x54),0,0.072000004f,0.012f,0.15f); *(int *)(state+0x60)=0; } - if (g_hero_state.i[0x2294/4]==1) hero_l12_set_action_pal(29,1); + if (g_hero_state.i[0x2294/4]==1) hero_l12_set_move_state_pal(29,1); moby_transform_joint_to_world(moby,0,state); vec_clear_128(forward); forward[1]=-1; matrix_mul_vec3(forward,forward,moby+0xc0); diff --git a/src/pal/levels/shared/L04_002D9150-flags.c b/src/pal/levels/shared/L04_002D9150-flags.c index 661fe71d2..ffbdd4a3a 100644 --- a/src/pal/levels/shared/L04_002D9150-flags.c +++ b/src/pal/levels/shared/L04_002D9150-flags.c @@ -11,7 +11,7 @@ extern float fade_reduce_value_pal(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(f32 *,f32 *,f32 *); extern void hero_build_relative_point(void *,int,float,float,float); -extern s32 hero_l04_enter_state_pal(int,int); +extern s32 hero_l04_set_move_state_pal(int,int); extern char *part_find_owned_effect_slot(void *,int,int); extern void AdjustPlayerHealth_pal(int); extern int hero_play_sound(int,int); @@ -147,7 +147,7 @@ int hero_check_surface_contact_pal(int update) { if (!GROUND_HERO.b[0x22B4]) { char *moby = GROUND_HERO.p[0x249C / 4]; if (moby && (AH(moby, 0xAA) == 0x4EB || AH(moby, 0xAA) == 0x558)) { - hero_l04_enter_state_pal(0x7D, 1); + hero_l04_set_move_state_pal(0x7D, 1); return 1; } if ((GROUND_HERO.i[0x2294 / 4] == 1 || @@ -155,16 +155,16 @@ int hero_check_surface_contact_pal(int update) { !(AI(surface_entry, 0x24) & 8)) { char *moby = part_find_owned_effect_slot(GROUND_HERO.p[0x2290 / 4], 1, 0); if (moby) AdjustPlayerHealth_pal(FloatToInt(AF(moby, 0x2C))); - if (!GROUND_HERO.i[0x24CC / 4]) hero_l04_enter_state_pal(0x16, 1); + if (!GROUND_HERO.i[0x24CC / 4]) hero_l04_set_move_state_pal(0x16, 1); GROUND_HERO.h[0x1DC / 2] = 0x40; if (!GROUND_HERO.h[0x21C / 2]) GROUND_HERO.h[0x21C / 2] = 0xF; hero_play_sound(20, 0); return 0; } - if (GROUND_HERO.i[0x229C / 4] == 0x12) hero_l04_enter_state_pal(0x72, 1); - else if (GROUND_HERO.i[0x229C / 4] == 0x11) hero_l04_enter_state_pal(0x73, 1); - else if (AI(surface_entry, 0x24) & 8) hero_l04_enter_state_pal(0x8C, 1); - else hero_l04_enter_state_pal(0x16, 1); + if (GROUND_HERO.i[0x229C / 4] == 0x12) hero_l04_set_move_state_pal(0x72, 1); + else if (GROUND_HERO.i[0x229C / 4] == 0x11) hero_l04_set_move_state_pal(0x73, 1); + else if (AI(surface_entry, 0x24) & 8) hero_l04_set_move_state_pal(0x8C, 1); + else hero_l04_set_move_state_pal(0x16, 1); if (GROUND_HERO.i[0x2294 / 4] == 0x8C) { qzero(&push); } else { diff --git a/src/pal/levels/shared/L04_003F2028-g8.c b/src/pal/levels/shared/L04_003F2028-g8.c index a0b7873c1..8cf81376c 100644 --- a/src/pal/levels/shared/L04_003F2028-g8.c +++ b/src/pal/levels/shared/L04_003F2028-g8.c @@ -15,7 +15,7 @@ struct Rac2Native_5f824a0e369ccf7b_src_record { }; extern AimQueryConfig g_nuke_l00_aim_query_config; extern AimTuning g_weapon_l00_table[]; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_mini_nuke_sound_records[]; +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_mini_nuke_rumble_waves[]; extern unsigned char g_hero_state[]; extern unsigned char g_pad_state[]; extern unsigned char g_gravity_bomb_weapon_index[]; @@ -34,11 +34,11 @@ extern int coll_trace_projectile_to_impact_pal(void *, void *, void *, void *, v extern void cancel_hero_item_animation_pal(void); extern int weapon_spend_ammo(int, int); extern void start_equipped_item_animation_pal(void); -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); extern int PlayMobySound(int, int, char *); extern char *mini_nuke_projectile_spawn_pal(int, char *, char *); extern int get_ammo(int); -extern void slot_reset_active(int); +extern void actuator_end_looping_waves(int); extern int vec_fast_helper_b(void *); extern void moby_apply_active_effect_pal(void *); extern void ref_L00_003C2FC8_00(void (*)(void *), void *); @@ -90,7 +90,7 @@ void mini_l04_nuke_update_pal(unsigned char *object) { if (weapon_spend_ammo(-1, 1)) { g_nuke_fire_held = 1; start_equipped_item_animation_pal(); - *(int *)(state + 0x2C) = slot_copy_records_to_free(g_mini_nuke_sound_records); + *(int *)(state + 0x2C) = actuator_play_waves(g_mini_nuke_rumble_waves); anim_start_blended_with_flags(object, 2, 0, 2, 0); mini_nuke_projectile_spawn_pal((int)object, (char *)&position, (char *)&config); PlayMobySound(0, 0, (char *)object); @@ -104,7 +104,7 @@ void mini_l04_nuke_update_pal(unsigned char *object) { } if (!(PAD->u[0x1A0 / 4] & H->u[0x1230 / 4]) || !get_ammo(-1) || !H->b[0x22B8]) { if (*(int *)(state + 0x2C) >= 0) { - slot_reset_active(*(int *)(state + 0x2C)); + actuator_end_looping_waves(*(int *)(state + 0x2C)); *(int *)(state + 0x2C) = -1; } } diff --git a/src/pal/levels/shared/L04_003F2BD0-g16.c b/src/pal/levels/shared/L04_003F2BD0-g16.c index 64f353215..f851d3dd0 100644 --- a/src/pal/levels/shared/L04_003F2BD0-g16.c +++ b/src/pal/levels/shared/L04_003F2BD0-g16.c @@ -14,7 +14,7 @@ extern void moby_init_vars_once(char *); extern void moby_fire_shot(char *, void *); typedef struct { char pad00[0x54]; float rate; char pad58[0xE0 - 0x58]; } AimEntry; extern AimEntry g_weapon_l00_table[]; -extern s32 hero_l00_set_action(int, int); +extern s32 hero_l00_set_move_state(int, int); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern int FastDecTimer(s16 *); extern int math_fast_float_d(int *); @@ -37,9 +37,9 @@ extern int coll_trace_projectile_to_impact(float, void *, void *, void *, void * extern void part_spawn_muzzle_spark_burst(void *, void *, void *); extern int bouncer_spawn_debris(int, int, int); struct Rac2Native_5f824a0e369ccf7b_src_record; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_sound_record; -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); -extern void slot_reset_active(void); +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_rumble_waves; +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern void actuator_end_looping_waves(void); extern void gfx_add_draw_callback_third(void (*)(void *), void *); extern void moby_draw_attached_effect(void *); @@ -59,7 +59,7 @@ void hoverbomb_l04_gun_update_pal(unsigned char *object) { int phase; moby_init_vars_once(object); - if (((Hero *)g_hero_state)->i[2213] == 1) hero_l00_set_action(29, 1); + if (((Hero *)g_hero_state)->i[2213] == 1) hero_l00_set_move_state(29, 1); if (((Hero *)g_hero_state)->ptr[1300] != 0) ((Hero *)g_hero_state)->ptr[766] = ((Hero *)g_hero_state)->ptr[1300]; if (object[0x42] == object[0x43] && (object[0x60] & 2)) anim_start_blended_with_flags(object, 1, 0, 8, 0); diff --git a/src/pal/levels/shared/L04_00413590-cc-g8.c b/src/pal/levels/shared/L04_00413590-cc-g8.c index 8f82efee2..1acf71aec 100644 --- a/src/pal/levels/shared/L04_00413590-cc-g8.c +++ b/src/pal/levels/shared/L04_00413590-cc-g8.c @@ -65,7 +65,7 @@ extern void add_vectors(void *,void *,void *); extern unsigned char *SpawnHomingShot_pal(void *,void *,void *,int); extern int PlayMobySound(int,int,void *); extern unsigned char *bike_find_aim_target(void *,void *,void *,void *,void *,void *,float,float); -extern int queue_copy_record_by_index(int); +extern int actuator_play_pattern(int); extern void * homing_rocket_spawn_pal(void *,void *,void *,float,float,float,float,float); extern void * shield_dome_spawn_pal(void *,void *); /* Handles the racer item use each frame: collects item boxes, then fires the current weapon (shot, @@ -130,7 +130,7 @@ void racer_update_item_use_pal(unsigned char *moby) FastVecSub(delta,origin,target+16); if(func_L00_002EE290(delta)<25) {pitch=aim_pitch;yaw=aim_yaw;} } else {aim_pitch=pitch;aim_yaw=yaw;extra=0.2f;} - queue_copy_record_by_index(47);add_vectors(temp,origin,dir); + actuator_play_pattern(47);add_vectors(temp,origin,dir); homing_rocket_spawn_pal(moby,origin,target,aim_pitch,aim_yaw,extra,pitch,yaw);PlayMobySound(8,0,moby); if(math_fast_float_d(&vars->duration))vars->state=0; }return; } diff --git a/src/pal/levels/shared/L04_00418DE8-cc-g8.c b/src/pal/levels/shared/L04_00418DE8-cc-g8.c index f2c1116f0..26630de9e 100644 --- a/src/pal/levels/shared/L04_00418DE8-cc-g8.c +++ b/src/pal/levels/shared/L04_00418DE8-cc-g8.c @@ -75,7 +75,7 @@ extern int resolve_vehicle_movement_collisions_pal(u8 *, u8 *, u8 *, u8 *, Vec * float, float, float, float, float); extern void anim_start_blended_pal(void *, int, int, int); extern void racer_release_sound_handles(u8 *, u8 *); -extern int queue_copy_record_by_index(int); +extern int actuator_play_pattern(int); extern void * SpawnExplosion_pal(void *, int, int, int, int, int, int, int, float, float, int, int, int, int); extern void level_release_slot_list(void *); extern float math_random_angle(void); @@ -387,7 +387,7 @@ void hoverboard_update_rider_physics_pal(u8 *object, u8 *st) ((L04_HoverCfg *)g_hover_config)->unk_180 = 0.1f; tag = g_effect_default_params; ((L04_HoverCfg *)g_hover_config)->unk_16C = 0; - queue_copy_record_by_index(0x1C); + actuator_play_pattern(0x1C); SpawnExplosion_pal((object + 0x10), 1, 0x19, 0x14, 0x14, 0x14, 0x2D, 1, 0.666f, 20.0f, 1, 1, 0, 0); level_release_slot_list(st + 0x4E0); PlayMobySound(3, 0, object); diff --git a/src/pal/levels/shared/L04_0041E49C-cc-g8.c b/src/pal/levels/shared/L04_0041E49C-cc-g8.c index 44733f3d6..bb98fe1fd 100644 --- a/src/pal/levels/shared/L04_0041E49C-cc-g8.c +++ b/src/pal/levels/shared/L04_0041E49C-cc-g8.c @@ -60,7 +60,7 @@ extern Quad g_collision_quad; extern float g_projection_scale_float NOT_SDA; extern void hero_record_play_counters_pal(void); extern void hero_reset_position_and_direction_pal(void *, void *, int, int); -extern int hero_l04_enter_state_pal(int, int); +extern int hero_l04_set_move_state_pal(int, int); extern void cam_set_transition_frames(float); extern int coll_test_point(void *, int, void *, float); extern void UpdateViewContext(void); @@ -307,7 +307,7 @@ void update_hoverbike_race_pal(u8 *self) I(s, 0x330) = -1; } if (g_current_map_index == 0xCE) { - hero_l04_enter_state_pal(0x86, 1); + hero_l04_set_move_state_pal(0x86, 1); } else { if (I(s, 0x198) != -1) { if (I(s, 0x19C) != -1) { @@ -320,7 +320,7 @@ void update_hoverbike_race_pal(u8 *self) Q(self, 0xd) = Q(NODE(I(s, 0x198)), 0x30); Q(self, 0xF0) = Q(NODE(I(s, 0x198)), 0x70); } - hero_l04_enter_state_pal(0x31, 1); + hero_l04_set_move_state_pal(0x31, 1); load_scene_chunk_pal(1, I(s, 0x488)); I(s, 0x58) |= 1; I(s, 0x340) = 0; diff --git a/src/pal/levels/shared/L05_00448114-cc-g8.c b/src/pal/levels/shared/L05_00448114-cc-g8.c index 384292504..fdc2bbbe6 100644 --- a/src/pal/levels/shared/L05_00448114-cc-g8.c +++ b/src/pal/levels/shared/L05_00448114-cc-g8.c @@ -29,7 +29,7 @@ extern char g_ship_saved_position[] __attribute__((sda)); extern char g_ship_saved_matrix_row0[] __attribute__((sda)); extern char g_ship_saved_matrix_row1[] __attribute__((sda)); extern char g_ship_saved_matrix_row2[] __attribute__((sda)); -extern char g_slot_record_source[]; +extern char g_ship_l05_rumble_waves[]; extern void hero_set_objects_flag_bit(void); extern void UpdateSteeringInput_pal(void *, void *, void *); @@ -39,7 +39,7 @@ extern void UpdateDrivenMobyTransform_pal(void *); extern void euler_rotation_basis(void *, void *); extern void hero_record_play_counters_pal(void); extern void ship_update_record_transform(void *, float); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern void ship_respawn_at_best_saved_slot_pal(void *); extern float hero_get_clamped_stat(void); extern int hero_get_state_value_c(void); @@ -140,7 +140,7 @@ void UpdateTimedTransformState_pal(char *obj) if (g_current_map_index == 20) t = 0.32000002f; ship_update_record_transform(obj, t); if ((((int)(g_ship_crash_recovery_time - 20) * 5 + 2) / 6) < g_ship_transition_timer) { - slot_copy_records_to_free(g_slot_record_source); + actuator_play_waves(g_ship_l05_rumble_waves); } } break; diff --git a/src/pal/levels/shared/L05_004495C8-g8.c b/src/pal/levels/shared/L05_004495C8-g8.c index 9e38b3bd5..116b69ed3 100644 --- a/src/pal/levels/shared/L05_004495C8-g8.c +++ b/src/pal/levels/shared/L05_004495C8-g8.c @@ -7,7 +7,7 @@ typedef struct { int timer, flag; } DriverState; extern DriverState g_feltzin_challenge_state; -extern char g_slot_record_source[]; +extern char g_ship_l05_rumble_waves[]; extern float g_ship_moby_scale_factor __attribute__((sda)); extern float g_ship_forward_offset __attribute__((sda)); extern float g_ship_lift_offset_scale __attribute__((sda)); @@ -30,7 +30,7 @@ extern float math_fabs(float); extern void math_build_axis_angle_quat(void *, void *, float); extern void vec_rotate_by_quaternion(void *, void *, void *); extern int math_fast_float_d(void *); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern void ResolveLinkedMobyMovementCollisions_pal(void *, void *); extern void ship_update_aim_point(void *, void *); extern void moby_sync_equipment_parts(void *); @@ -87,7 +87,7 @@ void UpdateDrivenMobyTransform_pal(char *obj) FastVecAdd(moby + 0x10, moby + 0x10, up_offset); if (g_feltzin_challenge_state.flag) { if (!math_fast_float_d(&g_feltzin_challenge_state.timer)) { - slot_copy_records_to_free(g_slot_record_source); + actuator_play_waves(g_ship_l05_rumble_waves); } else { g_feltzin_challenge_state.flag = 0; g_feltzin_challenge_state.timer = 6; diff --git a/src/pal/levels/shared/L05_00449FF0-g8.c b/src/pal/levels/shared/L05_00449FF0-g8.c index 8a25cae49..579b85642 100644 --- a/src/pal/levels/shared/L05_00449FF0-g8.c +++ b/src/pal/levels/shared/L05_00449FF0-g8.c @@ -8,7 +8,7 @@ typedef union { ShotQuad q; float f[4]; } ShotVector; extern int g_feltzin_mission_index, g_pad_pressed_flags[], g_ship_mode_words[]; typedef struct { int upgrade; char pad[12]; int maximum, ammo; char tail[16]; } WeaponSlot; extern WeaponSlot g_spawn_entry_table[]; -extern char g_sound_state[],g_slot_record_source[]; +extern char g_sound_state[],g_ship_l05_rumble_waves[]; extern float g_ship_aim_length __attribute__((sda)), g_ship_muzzle_speed __attribute__((sda)); extern int g_ship_shot_var_half_a __attribute__((sda)),g_ship_shot_var_half_b __attribute__((sda)),g_ship_shot_var_half_c __attribute__((sda)); extern int g_ship_shot_var_word_a __attribute__((sda)),g_ship_shot_var_word_b __attribute__((sda)),g_ship_shot_voice_id __attribute__((sda)); @@ -22,7 +22,7 @@ extern int PlayMobySound(int,int,void *); extern void slot_subtract_value_clamped(int,int); extern char *moby_spawn_shot_effect_pal(void *,void *,float,void *,int,int,int,int,int); extern char *feltzin_shot_create_pal(void *,void *,int,void *,int),*moby_spawn_directed_effect_pal(void *,void *,int,void *,int),*projectile_spawn_with_target_pal(void *,void *,int,void *,int,int),*projectile_l05_spawn_pal(void *,void *,int,void *,int); -extern int snd_play_from_class_bank(int,int,void *,int),slot_copy_records_to_free(void *); +extern int snd_play_from_class_bank(int,int,void *,int),actuator_play_waves(void *); extern void snd_stop_voice(int); #define F(p,o) (*(float *)((char *)(p)+(o))) #define I(p,o) (*(int *)((char *)(p)+(o))) @@ -195,5 +195,5 @@ void UpdateShipWeapons_pal(char *moby, char *ship) } if (!math_fast_float_d(vars + 0x218)) - I(vars, 0x214) = slot_copy_records_to_free(g_slot_record_source); + I(vars, 0x214) = actuator_play_waves(g_ship_l05_rumble_waves); } diff --git a/src/pal/levels/shared/L05_0044B738-g8.c b/src/pal/levels/shared/L05_0044B738-g8.c index 098196a42..6167237f3 100644 --- a/src/pal/levels/shared/L05_0044B738-g8.c +++ b/src/pal/levels/shared/L05_0044B738-g8.c @@ -37,7 +37,7 @@ extern char *g_path_l05_entry_table; extern Moby *g_feltzin_target_mobys; extern int g_current_map_index MACRO_ADDR; extern Collision g_collision_l05_result; -extern char g_slot_record_source[]; +extern char g_ship_l05_rumble_waves[]; extern int g_feltzin_mission_index; extern float g_ship_hit_value __attribute__((sda)); extern float g_ship_hit_event_amount __attribute__((sda)); @@ -62,7 +62,7 @@ extern int FloatToInt(float); extern int GetCollHitMaterial(void); extern int level_has_pending_inner_flag(void *); extern int hero_is_state_flag_set(void); -extern int slot_copy_records_to_free(void *); +extern int actuator_play_waves(void *); extern void euler_rotation_basis(void *, void *); extern void QueueMobyImpact(void *, void *); extern void gfx_add_draw_callback_third(void (*)(void *), void *); @@ -172,7 +172,7 @@ void ResolveLinkedMobyMovementCollisions_pal(char *obj, void *target) hero_apply_damage_pal(g_ship_hit_damage); *(int *)(record + 0x58) = ((s32)(g_ship_record_word) * 5 + 2) / 6; } - slot_copy_records_to_free(g_slot_record_source); + actuator_play_waves(g_ship_l05_rumble_waves); qcopy(moby->state + 0x90, g_collision_l05_result.hit); gfx_add_draw_callback_third(part_spawn_impact_trail, moby); continue; @@ -192,7 +192,7 @@ void ResolveLinkedMobyMovementCollisions_pal(char *obj, void *target) FastVecAdd(moby->position, moby->position, move); FastVecAdd(obj + 0x30, obj + 0x30, move); qcopy(pos, g_collision_l05_result.position); - slot_copy_records_to_free(g_slot_record_source); + actuator_play_waves(g_ship_l05_rumble_waves); if (!(g_feltzin_mission_index & 3)) { float value = g_ship_hit_value; diff --git a/src/pal/levels/shared/L06_00449A18-g8.c b/src/pal/levels/shared/L06_00449A18-g8.c index 1d5e25727..7161db291 100644 --- a/src/pal/levels/shared/L06_00449A18-g8.c +++ b/src/pal/levels/shared/L06_00449A18-g8.c @@ -28,7 +28,7 @@ extern int g_game_l00_mode; extern int g_bouncer_timer; typedef struct { char pad00[0x54]; float rate; char pad58[0xE0 - 0x58]; } AimEntry; extern AimEntry g_weapon_l00_table[]; -extern s32 hero_l00_set_action_pal(int a0, int a1); +extern s32 hero_l00_set_move_state_pal(int a0, int a1); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern int math_fast_float_d(int *); extern int vec_fast_helper_b(float *); @@ -44,9 +44,9 @@ extern int coll_trace_projectile_to_impact_pal(float, void *, void *, void *, vo extern void part_spawn_muzzle_spark_burst_pal(void *, void *, void *); extern int bouncer_spawn_debris(int, int, int); struct Rac2Native_5f824a0e369ccf7b_src_record; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_sound_record; -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); -extern void slot_reset_active(int); +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_rumble_waves; +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern void actuator_end_looping_waves(int); extern void ref_L00_003FDE48_00(void *, void *); extern void moby_draw_attached_effect_pal(void *); @@ -71,7 +71,7 @@ void bouncer_l06_update_pal(unsigned char *object) { *(int *)(vars + 0x2C) = 0; g_bouncer_timer = 17; } - if (g_hero_state.level == 1) hero_l00_set_action_pal(29, 1); + if (g_hero_state.level == 1) hero_l00_set_move_state_pal(29, 1); if (object[0x42] == object[0x43] && (object[0x60] & 2)) anim_start_blended_with_flags(object, 1, 0, 2, 0); moby_compute_offset_point(object, (char *)origin); target = 0; @@ -104,12 +104,12 @@ void bouncer_l06_update_pal(unsigned char *object) { bouncer_spawn_debris((int)object, (int)origin, (int)aim); start_equipped_item_animation_pal(); *(int *)(vars + 0x2C) = 13; - *(int *)(vars + 0x28) = slot_copy_records_to_free(&g_bouncer_sound_record); + *(int *)(vars + 0x28) = actuator_play_waves(&g_bouncer_rumble_waves); } if (!(g_pad_state.held & g_hero_state.buttons) || !get_ammo(-1) || g_hero_state.f22B8 == 0) { handle = *(int *)(vars + 0x28); if (handle >= 0) { - slot_reset_active(handle); + actuator_end_looping_waves(handle); *(int *)(vars + 0x28) = -1; } } diff --git a/src/pal/levels/shared/L07_0041B7D8-cc-g8.c b/src/pal/levels/shared/L07_0041B7D8-cc-g8.c index c812dc1c1..5646b0086 100644 --- a/src/pal/levels/shared/L07_0041B7D8-cc-g8.c +++ b/src/pal/levels/shared/L07_0041B7D8-cc-g8.c @@ -60,7 +60,7 @@ extern void vec_scale_to_length(void *, void *, float); extern void make_hit_descriptor(void *, void *, int, float, void *); extern void QueueMobyImpact(void *, void *); extern int StartAttachedEffect_pal(void *, int, void *); -extern s32 hero_l07_enter_state_pal(int, int); +extern s32 hero_l07_set_move_state_pal(int, int); extern void vec_clear_128(void *); extern void matrix_mul_vec3(void *, void *, void *); extern void vec_compute_object_to_target(void *, void *, void *, float); @@ -185,7 +185,7 @@ void UpdateHeldBeamWeapon_pal(unsigned char *object) math_spring_float_to_goal((float *)(data + 0x50), (float *)(data + 0x54), 0.0f, 0.072000004f, 0.012f, 0.15f); UI(data, 0x60) = 0; } - if (g_hero_state.weapon == 1) hero_l07_enter_state_pal(0x1D, 1); + if (g_hero_state.weapon == 1) hero_l07_set_move_state_pal(0x1D, 1); moby_transform_joint_to_world(object, 0, data); vec_clear_128(&vector); vector.f[1] = -1.0f; diff --git a/src/pal/levels/shared/L08_003CA508-g8.c b/src/pal/levels/shared/L08_003CA508-g8.c index 2c90d6cbd..957f239ec 100644 --- a/src/pal/levels/shared/L08_003CA508-g8.c +++ b/src/pal/levels/shared/L08_003CA508-g8.c @@ -109,7 +109,7 @@ extern void gfx_start_color_fade_pal(void *, void *); extern void gfx_update_color_fade_pal(void *, void *); extern f32 func_002A0558(void *, void *); extern s32 TryClaimNotice(s32, s32, s32); -extern s32 hero_l08_enter_state_pal(s32, s32); +extern s32 hero_l08_set_move_state_pal(s32, s32); extern void set_hero_animation_pal(int, int, f32); extern int FastDecTimer(void *); extern int math_fast_float_d(void *); @@ -363,7 +363,7 @@ void rideable_moby_update_pal(RideMoby *moby) } } if (fire != 0) { - hero_l08_enter_state_pal(0x31, 0); + hero_l08_set_move_state_pal(0x31, 0); set_hero_animation_pal(g_hover_anim_next, 0, 15.0f); *(TI128 *)(g_hero_state + 0x90) = moby->rot.q; *(TI128 *)(g_hero_state + 0x80) = moby->pos.q; @@ -618,7 +618,7 @@ void rideable_moby_update_pal(RideMoby *moby) case 4: moby->x98 = *(s32 *)(moby->x24 + 0x10); *(s32 *)(((Hero *)g_hero_state)->ptr[0x2290 / 4] + 0x9C) = 0; - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); ((Hero *)g_hero_state)->h[0x1834 / 2] = -1; ((Hero *)g_hero_state)->f[0x108 / 4] = 0.20000002f; ((Hero *)g_hero_state)->ptr[0x1830 / 4] = 0; @@ -634,7 +634,7 @@ void rideable_moby_update_pal(RideMoby *moby) case 5: moby->x98 = *(s32 *)(moby->x24 + 0x10); *(s32 *)(((Hero *)g_hero_state)->ptr[0x2290 / 4] + 0x9C) = 0; - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); moby_transform_joint_to_world(moby, 0, dir); SpawnExplosionEffects_pal(moby, vars, dir, 0.0f, 0.0f, 10, 3, 16, 4.0f, 2.0f, 9.0f, 1.0f, -1, 15.0f, 1, 1, -1, 0, 0x810001); moby->pos.q = vars->x30; diff --git a/src/pal/levels/shared/L08_003D1A30-cc-g8.c b/src/pal/levels/shared/L08_003D1A30-cc-g8.c index 1018b091b..8d0001d0e 100644 --- a/src/pal/levels/shared/L08_003D1A30-cc-g8.c +++ b/src/pal/levels/shared/L08_003D1A30-cc-g8.c @@ -23,7 +23,7 @@ extern void FastVecSub(void *,void *,void *),vec_fast_normalize(void *,void *,vo extern void FastVecScale(void *,void *,float); extern void SpawnExplosionEffects_pal(void *,void *,void *,float,float,int,int,int,float,float,float,float,int,float,int,int,int,int,int); extern int snd_play_from_class_bank(int,int,void *,int),GetCollHitMaterial(void); -extern int hero_l08_enter_state_pal(int,int); +extern int hero_l08_set_move_state_pal(int,int); extern void anim_start_blended_pal(void *,int,int,int),moby_set_state(void *,int,int); extern void moby_place_at_stored_transform(void *),set_hero_animation_pal(int,int,float); @@ -73,7 +73,7 @@ int vehicle_handle_collision_pal(char *object, void *previous) g_vehicle_collision_x=g_vehicle_saved_x; g_vehicle_collision_y=g_vehicle_saved_y; *(int *)(state+0x50)=0; - hero_l08_enter_state_pal(0,1); + hero_l08_set_move_state_pal(0,1); if (*(unsigned char *)(object+0x43)) anim_start_blended_pal(object,0,0,10); index=*(int *)(state+0x6C); if (index>0) { diff --git a/src/pal/levels/shared/L08_003D1E50-g8.c b/src/pal/levels/shared/L08_003D1E50-g8.c index 1473cdf08..c4b1b2165 100644 --- a/src/pal/levels/shared/L08_003D1E50-g8.c +++ b/src/pal/levels/shared/L08_003D1E50-g8.c @@ -120,7 +120,7 @@ extern void hero_reset_speeds_and_vectors(void); extern void hero_record_play_counters_pal(void); extern void set_hero_animation_pal(int, int, float); extern void script_queue_keyed_request(int, int); -extern int hero_l08_enter_state_pal(int, int); +extern int hero_l08_set_move_state_pal(int, int); extern void cam_update_aim_values_pal(void *, void *); extern void hero_move_with_mount_to_transform(void *, void *); extern void hero_save_transform_snap_object(void *, void *); @@ -232,7 +232,7 @@ void hero_npc_update_pal(u8 *obj) if (ok && g_hero_state.target == g_moby_array[DI(0x6C)].bytes && g_hero_state.unk340 != 0 && g_hero_state.unk34E == 0) { u8 *q; - hero_l08_enter_state_pal(0x31, 0); + hero_l08_set_move_state_pal(0x31, 0); set_hero_animation_pal(0x87, 0, 3.0f); ((s32 *)g_hero_state.unk2290)[0x9C / 4] = -1; q = g_moby_array[DI(0x6C)].bytes; @@ -279,7 +279,7 @@ void hero_npc_update_pal(u8 *obj) snd_play_from_class_bank(0, 0, obj, 0x988); } DI(0x50) = (((s32)(g_vehicle_timer_start) * 5 + 2) / 6); - hero_l08_enter_state_pal(0x31, 0); + hero_l08_set_move_state_pal(0x31, 0); set_hero_animation_pal(0x81, 0, 12.0f); ((s32 *)g_hero_state.unk2290)[0x9C / 4] = -1; if (g_vehicle_active_flag != 0) @@ -573,7 +573,7 @@ void hero_npc_update_pal(u8 *obj) g_vehicle_collision_x = g_vehicle_saved_x; g_vehicle_collision_y = g_vehicle_saved_y; DI(0x50) = 0; - hero_l08_enter_state_pal(0, 1); + hero_l08_set_move_state_pal(0, 1); hero_reset_speeds_and_vectors(); SetAnimation(obj, 0, 0, 0xA); if (DI(0x6C) > 0) { diff --git a/src/pal/levels/shared/L08_00423EA0-g8.c b/src/pal/levels/shared/L08_00423EA0-g8.c index e64853bae..1d956877a 100644 --- a/src/pal/levels/shared/L08_00423EA0-g8.c +++ b/src/pal/levels/shared/L08_00423EA0-g8.c @@ -239,7 +239,7 @@ extern float func_002A0558(void *, void *); extern s32 TryClaimNotice(s32, s32, s32); extern s32 level_set_game_state_pair_pal(s32, void *, s32); extern void script_queue_keyed_request(s32, s32); -extern s32 hero_l08_enter_state_pal(s32, s32); +extern s32 hero_l08_set_move_state_pal(s32, s32); extern void set_hero_animation_pal(s32, s32, float); extern void snd_stop_voice(s32); extern s32 snd_play_from_class_bank(s32, s32, void *, s32); @@ -396,7 +396,7 @@ void mining_vehicle_update_pal(VehicleMoby *moby) fresh = 1; level_set_game_state_pair_pal(0, ref_L08_0041EBF8_00, 1); script_queue_keyed_request(vars->f194, vars->f19c); - hero_l08_enter_state_pal(49, 0); + hero_l08_set_move_state_pal(49, 0); set_hero_animation_pal(g_mining_vehicle_hero_animation, 0, 15.0f); qcopy(D_00189E20_14.rotation, moby->rot); qcopy(D_00189E20_14.position, moby->pos); diff --git a/src/pal/levels/shared/L11_003D2E78.c b/src/pal/levels/shared/L11_003D2E78.c index 6a95083e3..01b6660a1 100644 --- a/src/pal/levels/shared/L11_003D2E78.c +++ b/src/pal/levels/shared/L11_003D2E78.c @@ -10,7 +10,7 @@ extern int IsPointInCuboid(void *, int); extern int flag_set_first_pending(char *); extern void cam_lock_entry(int); extern int ForceClaimNotice(int, int, int); -extern int hero_l11_enter_state_pal(int, int); +extern int hero_l11_set_move_state_pal(int, int); extern float FastAddRotations(float, float); /* State 0 opens the trigger; state 1 reacts to the hero being on the object, or being in state @@ -49,7 +49,7 @@ void levitator_l11_pad_update_pal(char *obj) if (*(int *)(other + 0x2294) == 0x82) { level = *(int *)(rig + 8); if (level >= 0 && IsPointInCuboid(other + 0x80, level) != 0) - hero_l11_enter_state_pal(6, 1); + hero_l11_set_move_state_pal(6, 1); } } break; diff --git a/src/pal/levels/shared/L13_002C56D8-deck.c b/src/pal/levels/shared/L13_002C56D8-deck.c index 038de3e52..3d68a9357 100644 --- a/src/pal/levels/shared/L13_002C56D8-deck.c +++ b/src/pal/levels/shared/L13_002C56D8-deck.c @@ -78,7 +78,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed_pal(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction_pal(void); -s32 hero_l13_change_action_us2(s32, s32); +s32 hero_l13_set_move_state_us2(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition_pal(void); s32 hero_try_start_ledge_move(void); @@ -156,7 +156,7 @@ void hero_l13_decide_state_pal(void) { UpdateHeroHeldTarget_pal(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l13_change_action_us2(0x39, 1); + hero_l13_set_move_state_us2(0x39, 1); goto end; } } @@ -191,7 +191,7 @@ void hero_l13_decide_state_pal(void) { hero_apply_pending_change_pal(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l13_height_limit) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l13_change_action_us2(0x74, 1); + hero_l13_set_move_state_us2(0x74, 1); goto end; } } @@ -202,12 +202,12 @@ void hero_l13_decide_state_pal(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l13_change_action_us2(1, 1); + hero_l13_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l13_change_action_us2(0x82, 1); + hero_l13_set_move_state_us2(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -244,7 +244,7 @@ void hero_l13_decide_state_pal(void) { rec = g_hero_l13_state_records + selected_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 5e+01f; if (FLD(rec, s32, 0x44) != 0) { - hero_l13_change_action_us2(0x3C, 1); + hero_l13_set_move_state_us2(0x3C, 1); } else { set_hero_animation_pal(FLD(rec, s32, 0x48), 0, 1e+01f); } @@ -287,12 +287,12 @@ void hero_l13_decide_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l13_change_action_us2(0x76, 1); + hero_l13_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } break; } @@ -313,21 +313,21 @@ void hero_l13_decide_state_pal(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_aim_blocked == 0) && (PadPressedWithin(0x40, 6, NULL) != 0)) { - hero_l13_change_action_us2(0x6E, 1); + hero_l13_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l13_change_action_us2(4, 1); + hero_l13_set_move_state_us2(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l13_change_action_us2(0x2E, 1); + hero_l13_set_move_state_us2(0x2E, 1); break; } { @@ -347,28 +347,28 @@ void hero_l13_decide_state_pal(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust_pal(side, 0, 0, 0x1E); hero_play_footstep_sound_dust_pal(side, 1, 0, 0x1E); - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l13_change_action_us2(1, 1); + hero_l13_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_buttons = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_buttons & 8)) { - hero_l13_change_action_us2(0x3D, 1); + hero_l13_set_move_state_us2(0x3D, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l13_change_action_us2(0x3D, 1); + hero_l13_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } break; case 0x3D: @@ -377,22 +377,22 @@ void hero_l13_decide_state_pal(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer_pal(6, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l13_change_action_us2(4, 1); + hero_l13_set_move_state_us2(4, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); break; } - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -431,25 +431,25 @@ void hero_l13_decide_state_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.040000003f)) { - hero_l13_change_action_us2(0x33, 1); + hero_l13_set_move_state_us2(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12)) { - hero_l13_change_action_us2(0x34, 1); + hero_l13_set_move_state_us2(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l13_change_action_us2(0x32, 1); + hero_l13_set_move_state_us2(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l13_change_action_us2(0x33, 1); + hero_l13_set_move_state_us2(0x33, 1); } } break; @@ -462,81 +462,81 @@ void hero_l13_decide_state_pal(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l13_change_action_us2(0x32, 1); + hero_l13_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l13_change_action_us2(0x34, 1); + hero_l13_set_move_state_us2(0x34, 1); } else { - hero_l13_change_action_us2(0x32, 1); + hero_l13_set_move_state_us2(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l13_change_action_us2(0x12, 1); + hero_l13_set_move_state_us2(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 6, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 6, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l13_change_action_us2(0x32, 1); + hero_l13_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l13_change_action_us2(0x34, 1); + hero_l13_set_move_state_us2(0x34, 1); } else { - hero_l13_change_action_us2(0x32, 1); + hero_l13_set_move_state_us2(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l13_change_action_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l13_set_move_state_us2(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 15.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l13_change_action_us2(0x35, 1); + hero_l13_set_move_state_us2(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l13_change_action_us2(0x12, 1); + hero_l13_set_move_state_us2(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 6, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l13_change_action_us2(0x32, 1); + hero_l13_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l13_change_action_us2(0x34, 1); + hero_l13_set_move_state_us2(0x34, 1); } else { - hero_l13_change_action_us2(0x32, 1); + hero_l13_set_move_state_us2(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l13_change_action_us2(0x70, 0); + hero_l13_set_move_state_us2(0x70, 0); set_hero_animation_pal(0x59, 0, 14.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l13_change_action_us2(0x36, 1); + hero_l13_set_move_state_us2(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l13_change_action_us2(0x67, 1); + hero_l13_set_move_state_us2(0x67, 1); set_hero_animation_pal(0x58, 0x28, 15.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0x33, 1); + hero_l13_set_move_state_us2(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l13_change_action_us2(0x33, 0); + hero_l13_set_move_state_us2(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l13_change_action_us2(0x67, 1); + hero_l13_set_move_state_us2(0x67, 1); set_hero_animation_pal(0x58, 0x25, 15.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l13_change_action_us2(0x36, 0); + hero_l13_set_move_state_us2(0x36, 0); } break; case 0x1: @@ -570,9 +570,9 @@ void hero_l13_decide_state_pal(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l13_change_action_us2(4, 1); + hero_l13_set_move_state_us2(4, 1); } else { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -584,9 +584,9 @@ void hero_l13_decide_state_pal(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); } else { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } } break; @@ -619,7 +619,7 @@ void hero_l13_decide_state_pal(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -628,7 +628,7 @@ void hero_l13_decide_state_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); } break; } @@ -650,7 +650,7 @@ void hero_l13_decide_state_pal(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -663,7 +663,7 @@ void hero_l13_decide_state_pal(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l13_change_action_us2(2, 0); + hero_l13_set_move_state_us2(2, 0); set_hero_animation_pal(3, g_hero_action_anim_table[FLD(g_hero_state, s32, 0x2298)], 11.0f); break; } @@ -674,22 +674,22 @@ void hero_l13_decide_state_pal(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x54) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -706,7 +706,7 @@ void hero_l13_decide_state_pal(void) { } if (PadPressedWithin(0x40, 6, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -715,7 +715,7 @@ void hero_l13_decide_state_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 12.0f); break; } @@ -727,7 +727,7 @@ void hero_l13_decide_state_pal(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } break; case 0x2: @@ -741,11 +741,11 @@ void hero_l13_decide_state_pal(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l13_change_action_us2(0x76, 1); + hero_l13_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead_pal() == 0)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } n = 7; @@ -759,12 +759,12 @@ void hero_l13_decide_state_pal(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l13_change_action_us2(9, 1); + hero_l13_set_move_state_us2(9, 1); } else { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); } } else { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); } break; } @@ -772,11 +772,11 @@ void hero_l13_decide_state_pal(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.040000003f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l13_change_action_us2(1, 1); + hero_l13_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l13_change_action_us2(4, 1); + hero_l13_set_move_state_us2(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -793,25 +793,25 @@ void hero_l13_decide_state_pal(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l13_change_action_us2(0x2E, 1); + hero_l13_set_move_state_us2(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l13_change_action_us2(0x70, 1); + hero_l13_set_move_state_us2(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -822,7 +822,7 @@ void hero_l13_decide_state_pal(void) { if (hero_try_start_grab_pal() != 0) { break; } - if (hero_l13_change_action_us2(0, 0) == 0) { + if (hero_l13_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.030000001f); @@ -839,7 +839,7 @@ void hero_l13_decide_state_pal(void) { hero_update_anim_scale_pal(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l13_change_action_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l13_set_move_state_us2(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 14.0f); } if (FLD(anim_info, u8, 0x43) == 0x37) { @@ -860,7 +860,7 @@ void hero_l13_decide_state_pal(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l13_change_action_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l13_set_move_state_us2(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 14.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 29.166668f; @@ -894,17 +894,17 @@ void hero_l13_decide_state_pal(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x19; - hero_l13_change_action_us2(3, 0); + hero_l13_set_move_state_us2(3, 0); set_hero_animation_pal(6, 4, 9.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l13_change_action_us2(0x77, 1); + hero_l13_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l13_change_action_us2(0x77, 1); + hero_l13_set_move_state_us2(0x77, 1); break; } } @@ -922,11 +922,11 @@ void hero_l13_decide_state_pal(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.054000005f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l13_change_action_us2(0x64, 1); + hero_l13_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.054000005f)) { - hero_l13_change_action_us2(0x63, 1); + hero_l13_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale_pal(); @@ -934,21 +934,21 @@ void hero_l13_decide_state_pal(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0x62, 1); + hero_l13_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l13_change_action_us2(0x62, 1); + hero_l13_set_move_state_us2(0x62, 1); } break; case 0x65: /* switch 2 */ jump_count = FLD(g_hero_state, s32, 0x18C0); if ((jump_count < 3) && (((jump_count * 6) + 0x8) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 6, &out_value_a) != 0)) { - hero_l13_change_action_us2(0x66, 1); + hero_l13_set_move_state_us2(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters_pal(); @@ -991,7 +991,7 @@ void hero_l13_decide_state_pal(void) { return; case 0x6D: if ((f32)g_hero_l13_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } break; case 0x30: @@ -1004,7 +1004,7 @@ void hero_l13_decide_state_pal(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l13_change_action_us2(0, 0) != 0) { + if (hero_l13_set_move_state_us2(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 14.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1012,29 +1012,29 @@ void hero_l13_decide_state_pal(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l13_change_action_us2(1, 1); + hero_l13_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l13_change_action_us2(4, 1); + hero_l13_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 8) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1042,45 +1042,45 @@ void hero_l13_decide_state_pal(void) { } if (hero_get_weapon_or_form_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l13_change_action_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l13_set_move_state_us2(0, 0) != 0)) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 14.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l13_change_action_us2(1, 1); + hero_l13_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xA) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l13_change_action_us2(0x76, 1); + hero_l13_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { break; } if ((PadPressedWithin(0x80, 0xC, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l13_change_action_us2(0x15, 1); + hero_l13_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 8) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1088,17 +1088,17 @@ void hero_l13_decide_state_pal(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l13_change_action_us2(0x8B, 1); + hero_l13_set_move_state_us2(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x4C) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } break; case 0x24: @@ -1124,14 +1124,14 @@ void hero_l13_decide_state_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 25.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l13_change_action_us2(6, 0); + hero_l13_set_move_state_us2(6, 0); } else { - hero_l13_change_action_us2(6, 0); + hero_l13_set_move_state_us2(6, 0); set_hero_animation_pal(0xA, 0, 14.0f); } FLD(g_hero_state, f32, 0xA84) = 0.016800001f; @@ -1147,9 +1147,9 @@ void hero_l13_decide_state_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } else { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1161,7 +1161,7 @@ void hero_l13_decide_state_pal(void) { if (t < 0x21) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l13_change_action_us2(0x2C, 1); + hero_l13_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0028000001f; FLD(g_hero_state, f32, 0xA80) = 0.0108f; } @@ -1225,11 +1225,11 @@ void hero_l13_decide_state_pal(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.26000002f); FLD(g_hero_state, f32, 0x128) = 0.20000002f; - hero_l13_change_action_us2(0x16, 1); + hero_l13_set_move_state_us2(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x3A; FLD(g_hero_state, s16, 0x1D0) = 0x3A; } else { - hero_l13_change_action_us2(0x3E, 1); + hero_l13_set_move_state_us2(0x3E, 1); } break; } @@ -1242,7 +1242,7 @@ void hero_l13_decide_state_pal(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l13_change_action_us2(0x28, 1); + hero_l13_set_move_state_us2(0x28, 1); } break; } @@ -1253,16 +1253,16 @@ void hero_l13_decide_state_pal(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x3A; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l13_change_action_us2(0x74, 1); + hero_l13_set_move_state_us2(0x74, 1); } else { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0x8, NULL) != 0)) { - hero_l13_change_action_us2(0x2A, 1); + hero_l13_set_move_state_us2(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1279,7 +1279,7 @@ void hero_l13_decide_state_pal(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l13_change_action_us2(0x28, 1); + hero_l13_set_move_state_us2(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)vec_b = 0; @@ -1296,7 +1296,7 @@ void hero_l13_decide_state_pal(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 4, NULL) != 0) && ((f32)g_hero_l13_action_table[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l13_change_action_us2(0x28, 1); + hero_l13_set_move_state_us2(0x28, 1); break; } top = 0xE; @@ -1305,19 +1305,19 @@ void hero_l13_decide_state_pal(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0x8, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l13_change_action_us2(0x2A, 1); + hero_l13_set_move_state_us2(0x2A, 1); } break; } if ((f32)g_hero_l13_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 5) || (FLD(g_hero_state, s32, 0x6C8) >= 5)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l13_change_action_us2(0x74, 1); + hero_l13_set_move_state_us2(0x74, 1); } else { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; @@ -1326,11 +1326,11 @@ void hero_l13_decide_state_pal(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 5) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 5) && (g_current_map_index == 0x14)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0x8) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1366,7 +1366,7 @@ void hero_l13_decide_state_pal(void) { find_nearest_path_point(new_path, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), new_path_flags, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l13_change_action_us2(0x29, 1); + hero_l13_set_move_state_us2(0x29, 1); break; } } @@ -1414,7 +1414,7 @@ void hero_l13_decide_state_pal(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x3A; FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; @@ -1422,7 +1422,7 @@ void hero_l13_decide_state_pal(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l13_change_action_us2(0x71, 1); + hero_l13_set_move_state_us2(0x71, 1); break; } { @@ -1434,7 +1434,7 @@ void hero_l13_decide_state_pal(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l13_change_action_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l13_set_move_state_us2(0, 0) != 0)) { set_hero_animation_pal(0xC, 4, 5.0f); } } else if (st == 0x3E) { @@ -1443,24 +1443,24 @@ void hero_l13_decide_state_pal(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)angle_b, 0.5f, -1.0f); } if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s32, 0x340) != 0)) { - if (hero_l13_change_action_us2(0, 0) != 0) { + if (hero_l13_set_move_state_us2(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xD) && (FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l13_change_action_us2(0x18, 0); + hero_l13_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -1469,18 +1469,18 @@ void hero_l13_decide_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab_pal((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 0xE, NULL) != 0) { - hero_l13_change_action_us2(0x1B, 1); + hero_l13_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1489,7 +1489,7 @@ void hero_l13_decide_state_pal(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x97), 1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x97), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l13_change_action_us2(0x19, 1); + hero_l13_set_move_state_us2(0x19, 1); } break; } @@ -1500,7 +1500,7 @@ void hero_l13_decide_state_pal(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l13_change_action_us2(0x1A, 1); + hero_l13_set_move_state_us2(0x1A, 1); } } } @@ -1519,18 +1519,18 @@ void hero_l13_decide_state_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0x18, 1); + hero_l13_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l13_change_action_us2(0x1B, 1); + hero_l13_set_move_state_us2(0x1B, 1); } break; } @@ -1540,9 +1540,9 @@ void hero_l13_decide_state_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } else { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } } break; @@ -1566,12 +1566,12 @@ void hero_l13_decide_state_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l13_change_action_us2(0x39, 1); + hero_l13_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x4B) { - if (hero_l13_change_action_us2(0, 0) != 0) { + if (hero_l13_set_move_state_us2(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } if (low != 0) { @@ -1579,7 +1579,7 @@ void hero_l13_decide_state_pal(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l13_change_action_us2(0, 0) != 0) { + if (hero_l13_set_move_state_us2(0, 0) != 0) { set_hero_animation_pal(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1593,32 +1593,32 @@ void hero_l13_decide_state_pal(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.060000002f) { - if (hero_l13_change_action_us2(3, 0) != 0) { + if (hero_l13_set_move_state_us2(3, 0) != 0) { set_hero_animation_pal(6, 0, 1e+01f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.15400001f); } } else { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l13_change_action_us2(8, 1); + hero_l13_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x12) && (hero_try_start_move_from_buffer_pal((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 5, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l13_change_action_us2(0x17, 1); + hero_l13_set_move_state_us2(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } } @@ -1650,7 +1650,7 @@ void hero_l13_decide_state_pal(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l13_change_action_us2(0, 0) != 0) { + if (hero_l13_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1660,9 +1660,9 @@ void hero_l13_decide_state_pal(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l13_change_action_us2(0x74, 1); + hero_l13_set_move_state_us2(0x74, 1); } else { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } } break; @@ -1675,16 +1675,16 @@ void hero_l13_decide_state_pal(void) { ok = 1; } if (ok != 0) { - hero_l13_change_action_us2(0x11, 1); + hero_l13_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l13_change_action_us2(0x17, 1); + hero_l13_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1695,23 +1695,23 @@ void hero_l13_decide_state_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 3)) { - if (hero_l13_change_action_us2(3, 0) != 0) { + if (hero_l13_set_move_state_us2(3, 0) != 0) { set_hero_animation_pal(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x1C; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l13_change_action_us2(4, 1); + hero_l13_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_state_threshold_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); break; } - hero_l13_change_action_us2(2, 0); + hero_l13_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, 2, 7.0f); @@ -1720,21 +1720,21 @@ void hero_l13_decide_state_pal(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_state_threshold_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); break; } - hero_l13_change_action_us2(2, 0); + hero_l13_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, g_hero_action_anim_id, 1e+01f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l13_change_action_us2(0, 0) != 0) { + if (hero_l13_set_move_state_us2(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l13_change_action_us2(0, 0) != 0) { + } else if (hero_l13_set_move_state_us2(0, 0) != 0) { set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1781,14 +1781,14 @@ void hero_l13_decide_state_pal(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 4, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l13_change_action_us2(0xB, 1); + hero_l13_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x11)) { - hero_l13_change_action_us2(0x82, 1); + hero_l13_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1797,25 +1797,25 @@ void hero_l13_decide_state_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 6) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f)) { - hero_l13_change_action_us2(0xA, 1); + hero_l13_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l13_change_action_us2(0x10, 1); + hero_l13_set_move_state_us2(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.14000002f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l13_change_action_us2(0x77, 1); + hero_l13_set_move_state_us2(0x77, 1); break; } } @@ -1919,7 +1919,7 @@ void hero_l13_decide_state_pal(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l13_change_action_us2(3, 0) != 0) { + if (hero_l13_set_move_state_us2(3, 0) != 0) { set_hero_animation_pal(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1927,13 +1927,13 @@ void hero_l13_decide_state_pal(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_state_threshold_table[0][2])) { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); } else if (g_hero_state_threshold_table[1][1] * 0.017f < FLD(g_hero_state, f32, 0x174)) { - hero_l13_change_action_us2(9, 1); + hero_l13_set_move_state_us2(9, 1); } else { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); } break; } @@ -1941,10 +1941,10 @@ void hero_l13_decide_state_pal(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_l00_choose_next_move_after_landing_pal(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } { @@ -1954,7 +1954,7 @@ void hero_l13_decide_state_pal(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x16)) && (PadPressedWithin(0x40, 6, &out_value_b) != 0) && (out_value_b < FLD(g_hero_state, s32, 0x1B8))) { - hero_l13_change_action_us2(0x11, 1); + hero_l13_set_move_state_us2(0x11, 1); break; } } @@ -1983,7 +1983,7 @@ void hero_l13_decide_state_pal(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xD) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.11600001f)))) { - hero_l13_change_action_us2(0xE, 1); + hero_l13_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1993,32 +1993,32 @@ void hero_l13_decide_state_pal(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l13_change_action_us2(8, 1); + hero_l13_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x576) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l13_change_action_us2(0x17, 1); + hero_l13_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x17) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l13_change_action_us2(0x79, 1); + hero_l13_set_move_state_us2(0x79, 1); } else { - hero_l13_change_action_us2(0x39, 1); + hero_l13_set_move_state_us2(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l13_change_action_us2(0x82, 1); + hero_l13_set_move_state_us2(0x82, 1); } else { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); } } break; @@ -2028,8 +2028,8 @@ void hero_l13_decide_state_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x2B) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l13_change_action_us2(0x39, 1); - } else if (hero_l13_change_action_us2(0, 0) != 0) { + hero_l13_set_move_state_us2(0x39, 1); + } else if (hero_l13_set_move_state_us2(0, 0) != 0) { set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 11.0f); } } @@ -2054,28 +2054,28 @@ void hero_l13_decide_state_pal(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l13_change_action_us2(0x4E, 1); + hero_l13_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l13_change_action_us2(1, 1); + hero_l13_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l13_change_action_us2(0x45, 1); + hero_l13_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l13_change_action_us2(0x4D, 1); + hero_l13_set_move_state_us2(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l13_change_action_us2(0x40, 1); + hero_l13_set_move_state_us2(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -2088,14 +2088,14 @@ void hero_l13_decide_state_pal(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l13_change_action_us2(0x4E, 1); + hero_l13_set_move_state_us2(0x4E, 1); break; } rec = (u8 *)&g_hero_l13_action_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l13_change_action_us2(0x3F, 0); + hero_l13_set_move_state_us2(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -2104,13 +2104,13 @@ void hero_l13_decide_state_pal(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0xD) ? n : 0xC, NULL) != 0) { - hero_l13_change_action_us2(0x4D, 1); + hero_l13_set_move_state_us2(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l13_change_action_us2(0x45, 1); + hero_l13_set_move_state_us2(0x45, 1); } break; } @@ -2173,42 +2173,42 @@ void hero_l13_decide_state_pal(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 3, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { hero_resolve_stick_direction(0, 1.0f); - hero_l13_change_action_us2(0x45, 1); + hero_l13_set_move_state_us2(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_state_threshold_table[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x97)) < 1.5707964f)) { - hero_l13_change_action_us2(0x40, 1); + hero_l13_set_move_state_us2(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xB) { - hero_l13_change_action_us2(0x3F, 1); + hero_l13_set_move_state_us2(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x22)) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 4, NULL) != 0)) { - hero_l13_change_action_us2(0x4D, 1); + hero_l13_set_move_state_us2(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l13_change_action_us2(0x46, 1); + hero_l13_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l13_change_action_us2(0x4B, 1); + hero_l13_set_move_state_us2(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l13_change_action_us2(0x46, 1); + hero_l13_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -2218,11 +2218,11 @@ void hero_l13_decide_state_pal(void) { FLD(g_hero_state, s16, 0x1EE) = 0xA - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l13_change_action_us2(0x40, 1); + hero_l13_set_move_state_us2(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l13_change_action_us2(0x3F, 1); + hero_l13_set_move_state_us2(0x3F, 1); } break; case 0x41: @@ -2234,29 +2234,29 @@ void hero_l13_decide_state_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l13_change_action_us2(0x43, 1); + hero_l13_set_move_state_us2(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l13_change_action_us2(0x40, 1); + hero_l13_set_move_state_us2(0x40, 1); } else { - hero_l13_change_action_us2(0x3F, 1); + hero_l13_set_move_state_us2(0x3F, 1); } } else { - hero_l13_change_action_us2(0x3F, 1); + hero_l13_set_move_state_us2(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l13_change_action_us2(0x46, 1); + hero_l13_set_move_state_us2(0x46, 1); break; } if ((PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l13_change_action_us2(0x4B, 1); + hero_l13_set_move_state_us2(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l13_change_action_us2(0x3F, 1); + hero_l13_set_move_state_us2(0x3F, 1); } break; case 0x4E: @@ -2265,9 +2265,9 @@ void hero_l13_decide_state_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); } else { - hero_l13_change_action_us2(0x3F, 1); + hero_l13_set_move_state_us2(0x3F, 1); } } break; @@ -2277,7 +2277,7 @@ void hero_l13_decide_state_pal(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l13_change_action_us2(0x4E, 1); + hero_l13_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.030000001f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2303,55 +2303,55 @@ void hero_l13_decide_state_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l13_change_action_us2(0x45, 1); + hero_l13_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l13_change_action_us2(0x4D, 1); + hero_l13_set_move_state_us2(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l13_change_action_us2(0x3F, 1); + hero_l13_set_move_state_us2(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1B) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1E) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l13_change_action_us2(0x43, 1); + hero_l13_set_move_state_us2(0x43, 1); } else { - hero_l13_change_action_us2(0x3F, 0); + hero_l13_set_move_state_us2(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0x47, 1); + hero_l13_set_move_state_us2(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)vec_a = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l13_change_action_us2(0x48, 1); + hero_l13_set_move_state_us2(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2360,7 +2360,7 @@ void hero_l13_decide_state_pal(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l13_change_action_us2(0x49, 1); + hero_l13_set_move_state_us2(0x49, 1); } break; } @@ -2371,7 +2371,7 @@ void hero_l13_decide_state_pal(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l13_change_action_us2(0x4A, 1); + hero_l13_set_move_state_us2(0x4A, 1); } } } @@ -2390,17 +2390,17 @@ void hero_l13_decide_state_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0x47, 1); + hero_l13_set_move_state_us2(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l13_change_action_us2(0x48, 1); + hero_l13_set_move_state_us2(0x48, 1); } break; } @@ -2415,7 +2415,7 @@ void hero_l13_decide_state_pal(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -2426,7 +2426,7 @@ void hero_l13_decide_state_pal(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); } break; case 0x22: @@ -2436,12 +2436,12 @@ void hero_l13_decide_state_pal(void) { hero_choose_jump_or_roll_move_pal(); break; } - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); } break; default: diff --git a/src/pal/levels/shared/L13_002C56D8-hero.c b/src/pal/levels/shared/L13_002C56D8-hero.c index 1caee5f2f..818627dfb 100644 --- a/src/pal/levels/shared/L13_002C56D8-hero.c +++ b/src/pal/levels/shared/L13_002C56D8-hero.c @@ -153,7 +153,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -718,7 +718,7 @@ void hero_l13_update_state_machine_pal(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { i_temp17 = ((Hero *)g_hero_state)->i[0x2440/4]; if (i_temp17 != -1) { @@ -1461,7 +1461,7 @@ void hero_l13_update_state_machine_pal(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x2a; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l20_extra_state)->f[0x180/4] = 0.1f; diff --git a/src/pal/levels/shared/L13_002C56D8-sw.c b/src/pal/levels/shared/L13_002C56D8-sw.c index 1ab1b5f4a..ef1be7010 100644 --- a/src/pal/levels/shared/L13_002C56D8-sw.c +++ b/src/pal/levels/shared/L13_002C56D8-sw.c @@ -70,8 +70,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -139,7 +139,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_set_action_state_pal(s32 action, s32 animate) { +s32 hero_l13_set_move_state_pal(s32 action, s32 animate) { f32 dir[4]; u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -187,7 +187,9 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -200,8 +202,8 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_set_action_state_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_set_action_state_pal(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l13_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_or_form_id(0) == 0x51) set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 15.0f); else set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, -1.0f); @@ -348,7 +350,7 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_set_action_state_pal(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l13_set_move_state_pal(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.15400001f) REAL(0x1B4) = 0.15400001f; @@ -394,12 +396,12 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_set_action_state_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_set_action_state_pal(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l13_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state_pal(0x76, 1); return 0; } if (hero_try_start_grab_pal()) return 0; if (hero_get_weapon_or_form_id(0) == 0x51) { if (!animate) goto finish; - if (hero_set_action_state_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 15.0f); + if (hero_l13_set_move_state_pal(0, 0)) set_hero_animation_pal(hero_get_weapon_or_form_id(0), 0, 15.0f); return 0; } if (!animate) goto finish; @@ -424,7 +426,7 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.14000002f) REAL(0x1B4) = 0.14000002f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_set_action_state_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.14000002f); @@ -589,13 +591,13 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_set_action_state_pal(0x81, 1); return 0; + hero_l13_set_move_state_pal(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_aim_blocked) { hero_set_action_state_pal(0x6E, 1); return 0; } + action != 0x38 && !g_hero_aim_blocked) { hero_l13_set_move_state_pal(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_set_action_state_pal(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l13_set_move_state_pal(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -670,9 +672,9 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_map_action_flag) hero_set_action_state_pal(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_set_action_state_pal(0x79, 1); - else hero_set_action_state_pal(0x39, 1); + if (g_current_map_index == 2 && g_hero_map_action_flag) hero_l13_set_move_state_pal(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l13_set_move_state_pal(0x79, 1); + else hero_l13_set_move_state_pal(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -723,7 +725,7 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -752,7 +754,7 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -761,7 +763,7 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4B8) = 0.6f; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -903,7 +905,7 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -994,7 +996,7 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -1006,7 +1008,7 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); @@ -1041,7 +1043,7 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { set_hero_animation_pal(0x11, 0, 7.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_set_action_state_pal(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state_pal(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation_pal(0, 0, 7.0f); goto finish; case 0x4B: @@ -1075,7 +1077,7 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l13_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_set_action_state_pal(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state_pal(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1119,7 +1121,7 @@ s32 hero_set_action_state_pal(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.09f; if (WORD(0x640) > 12 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_set_action_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; + PTR(0x2290)[0xA8] = 255; hero_l13_set_move_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; return 0; } HALF(0x1DC) = 64; REAL(0x69C) = 0.050000004f; diff --git a/src/pal/levels/shared/L13_003C9550.c b/src/pal/levels/shared/L13_003C9550.c index cf93d7241..3d2c26680 100644 --- a/src/pal/levels/shared/L13_003C9550.c +++ b/src/pal/levels/shared/L13_003C9550.c @@ -10,7 +10,7 @@ extern int IsPointInCuboid(void *, int); extern int flag_set_first_pending(char *); extern void cam_lock_entry(int); extern int ForceClaimNotice(int, int, int); -extern int hero_set_action_state_pal(int, int); +extern int hero_l13_set_move_state_pal(int, int); extern float FastAddRotations(float, float); /* State 0 opens the trigger; state 1 reacts to the hero being on the object, or being in state @@ -49,7 +49,7 @@ void warp_ring_trigger_update_pal(char *moby) if (*(int *)(other + 0x2294) == 0x82) { cuboid = *(int *)(vars + 8); if (cuboid >= 0 && IsPointInCuboid(other + 0x80, cuboid) != 0) - hero_set_action_state_pal(6, 1); + hero_l13_set_move_state_pal(6, 1); } } break; diff --git a/src/pal/levels/shared/L16_003984D8-motion-g8.c b/src/pal/levels/shared/L16_003984D8-motion-g8.c index f6ec61446..c9ceaffcf 100644 --- a/src/pal/levels/shared/L16_003984D8-motion-g8.c +++ b/src/pal/levels/shared/L16_003984D8-motion-g8.c @@ -39,7 +39,7 @@ extern int moby_is_spot_free_of_blockers(char *); extern void vec_transform_by_object_or_given(char *,char *,char *,char *); extern void FastVecSub(void *,void *,void *); extern float FastVecDot(void *,void *); -extern s32 hero_l16_enter_state(int,int); +extern s32 hero_l16_set_move_state(int,int); extern void cam_start_blend_to_target(char *); extern float math_fabs(float); extern void cam_set_mode_state(int); @@ -96,7 +96,7 @@ void follow_player_update_pal(u8 *object) direction[2]=zero; vec_scale_to_length(direction,direction,1.0f); vec_scale_to_length(forward,forward,1.0f); - if (FastVecDot(direction,forward)<0.2f) { hero_l16_enter_state(0x37,1); cam_start_blend_to_target((char *)object); } + if (FastVecDot(direction,forward)<0.2f) { hero_l16_set_move_state(0x37,1); cam_start_blend_to_target((char *)object); } moby_set_state(object,2,-1); } } @@ -116,7 +116,7 @@ void follow_player_update_pal(u8 *object) if (F(vars,0x34)>=1.0f) goto leaveActive; if (g_hero_state.field2294==0x37) goto active; leaveActive: - if (g_hero_state.field2294==0x37) hero_l16_enter_state(0,1); + if (g_hero_state.field2294==0x37) hero_l16_set_move_state(0,1); cam_set_mode_state(1); I(vars,0x3C)=20; I(vars,0x58)++; diff --git a/src/pal/levels/shared/L18_002CFC50-qcopy.c b/src/pal/levels/shared/L18_002CFC50-qcopy.c index 12226ac44..449b5234c 100644 --- a/src/pal/levels/shared/L18_002CFC50-qcopy.c +++ b/src/pal/levels/shared/L18_002CFC50-qcopy.c @@ -14,7 +14,7 @@ extern void attachment_reset_all(void); extern void hero_l18_update_speed_targets_pal(void); extern void hero_clear_queued_anim(void); extern void func_002A677C(void *); -extern s32 hero_l18_set_action_pal(s32, s32); +extern s32 hero_l18_set_move_state_pal(s32, s32); extern void set_hero_animation_pal(s32, s32, float); extern u8 g_hero_state[]; extern u8 g_hero_state[]; @@ -62,6 +62,6 @@ void hero_attach_to_object_pal(s32 mode, s32 index, u8 *object) *(s16 *)(g_hero_state + 0x24D4) = *(u16 *)(g_hero_state + 0x24CC); *(s32 *)(g_hero_state + 0x24CC) = 3; } - hero_l18_set_action_pal(index, 2); + hero_l18_set_move_state_pal(index, 2); if (mode == 4) set_hero_animation_pal(15, 0, 4.0f); } diff --git a/src/pal/levels/shared/L18_002CFE30-qcopy.c b/src/pal/levels/shared/L18_002CFE30-qcopy.c index ca69021b5..347430879 100644 --- a/src/pal/levels/shared/L18_002CFE30-qcopy.c +++ b/src/pal/levels/shared/L18_002CFE30-qcopy.c @@ -4,7 +4,7 @@ extern void hero_clear_tracked_slots(void); extern void attachment_reset_all(void); extern void hero_clear_queued_anim(void); -extern s32 hero_l18_set_action_pal(s32, s32); +extern s32 hero_l18_set_move_state_pal(s32, s32); extern u8 g_hero_state[]; extern u8 g_hero_state[]; extern u8 g_anim_entry_table_a[], g_anim_entry_table_b[]; @@ -78,7 +78,7 @@ void hero_detach_from_object_pal(s32 keep) goto done; } reset: - hero_l18_set_action_pal(0, 1); + hero_l18_set_move_state_pal(0, 1); done: if (g_hero_state[0x22B4] == 4) cam_reset_default(); } diff --git a/src/pal/levels/shared/L18_002DF168-timers-g8.c b/src/pal/levels/shared/L18_002DF168-timers-g8.c index 55ea8882c..1018bb238 100644 --- a/src/pal/levels/shared/L18_002DF168-timers-g8.c +++ b/src/pal/levels/shared/L18_002DF168-timers-g8.c @@ -94,7 +94,7 @@ extern int D_L18_001A8F00_abs __asm__("D_L18_001A8F00"); extern float g_hero_l18_reach_timer_b, g_hero_l18_reach_timer_a; extern unsigned char g_hero_event_flags[] __attribute__((sda)); extern void hero_ease_lean_to_upright_pal(void), hero_queue_glow_draw_routine(void), hero_update_landing_slide_pal(void), hero_record_play_counters_pal(void); -extern s32 hero_l18_set_action_pal(int, int); +extern s32 hero_l18_set_move_state_pal(int, int); extern int FastDecTimer(void *), math_fast_float_d(void *); extern void vec_clear_128(void *); extern int moby_is_in_special_class_range(void *), math_random_int_below(int); @@ -176,7 +176,7 @@ void hero_update_timers_reach_pal(void) { if (g_hero_state.field_24CC && !D_L18_001A8F00_abs && g_hero_state.mode == 4 && g_hero_state.field_2294 != 0x6F && (g_pad_state.pressed&0x10)) { g_hero_state.field_1E0 = 0; g_hero_state.field_24CC = 0; - hero_l18_set_action_pal(0x91, 1); + hero_l18_set_move_state_pal(0x91, 1); } if (!D_L18_001A8F00_abs) { if (g_hero_l18_reach_timer_b>0) g_hero_state.field_22A++; diff --git a/src/pal/levels/shared/L18_003FDF30-cc-g8.c b/src/pal/levels/shared/L18_003FDF30-cc-g8.c index 74d87229c..7414f9ecf 100644 --- a/src/pal/levels/shared/L18_003FDF30-cc-g8.c +++ b/src/pal/levels/shared/L18_003FDF30-cc-g8.c @@ -13,7 +13,7 @@ extern void SetCamera5Pose(char *a0, char *a1, s32 a2, s32 a3, s32 t0); extern void SetCamera5Mode(s32 a0, s32 a1); extern void object_copy_vector_to_selected(char *a0); extern void cam_set_state_rotation(char *a0); -extern s32 hero_l18_set_action_pal(s32 a0, s32 a1); +extern s32 hero_l18_set_move_state_pal(s32 a0, s32 a1); /* Points the camera at a stored pose for the object and starts a timed camera mode (PAL: 50 Hz timings). */ void part_start_timed_sequence_pal(char *object) { @@ -24,6 +24,6 @@ void part_start_timed_sequence_pal(char *object) { SetCamera5Mode(2, (((int)(*(s32 *)((char *)&g_camera_mode_table + (*(s16 *)(state + 0xAE) << 2))) * 5 + 2) / 6)); object_copy_vector_to_selected((char *)&g_selected_object_vec_table + (*(s16 *)(state + 0xAE) << 4)); cam_set_state_rotation((char *)&g_camera_rotation_table + (*(s16 *)(state + 0xAE) << 4)); - hero_l18_set_action_pal(0x6F, 1); + hero_l18_set_move_state_pal(0x6F, 1); *(s16 *)(state + 0xAC) = 1; } diff --git a/src/pal/levels/shared/L18_0042C768-update-g8.c b/src/pal/levels/shared/L18_0042C768-update-g8.c index f7edb2bda..52a9a73bc 100644 --- a/src/pal/levels/shared/L18_0042C768-update-g8.c +++ b/src/pal/levels/shared/L18_0042C768-update-g8.c @@ -55,7 +55,7 @@ extern void level_store_value_pair_pal(int,int); extern void SetCamera5Pose(void *,void *,int,int,int); extern void object_copy_vector_to_selected(void *); extern void cam_set_state_rotation(void *); -extern s32 hero_l18_set_action_pal(int,int); +extern s32 hero_l18_set_move_state_pal(int,int); extern float vec_distance_xy(void *,void *); extern void moby_set_flag_bit(void *,int); extern void moby_start_or_forward_anim_pal(void *,int,int,float); @@ -107,7 +107,7 @@ void receiver_bot_update_targeting_pal(u8 *moby) { object_copy_vector_to_selected(&g_camera_l18_position); cam_set_state_rotation(g_camera_l18_position.b+0x10); if (g_hero_state.i[0x2294/4] == 1 || g_hero_state.i[0x2294/4] == 29) - hero_l18_set_action_pal(0, 1); + hero_l18_set_move_state_pal(0, 1); g_hero_state.h[0x1E0/2] = ((s32)(20) * 5 + 2) / 6; vars->f[0x3B8/4] = (vec_distance_xy(moby+0x10,&g_camera_l18_position)-g_receiver_targeting_distance) / (((s32)(g_receiver_targeting_frames) * 5 + 2) / 6); if (g_statistics_table.uh[0x294/2] < 65535) diff --git a/src/pal/levels/shared/L19_003E4048.c b/src/pal/levels/shared/L19_003E4048.c index 5babc6a10..f8907ab35 100644 --- a/src/pal/levels/shared/L19_003E4048.c +++ b/src/pal/levels/shared/L19_003E4048.c @@ -127,7 +127,7 @@ extern void gfx_queue_draw_callback(void *, void *); extern void protopet_start_enter_anim(char *, int); extern void part_spawn_upward_pal(char *); extern void part_spawn_spray_pal(char *); -extern s32 hero_l19_set_state_pal(int, int); +extern s32 hero_l19_set_move_state_pal(int, int); void train_l19_update_pal(char *moby) { @@ -260,7 +260,7 @@ void train_l19_update_pal(char *moby) FastVecScale(vecs[1], moby + 0xC0, -g_train_scale_neg); vecs[1][2] = g_train_scale_neg * 4.0f; vecs[1][3] = 5627.9248f; - hero_l19_set_state_pal(0, 1); + hero_l19_set_move_state_pal(0, 1); force = (f32)g_player_stats[0] * 30.0f; part_queue_impact_effect(target, moby, 0x10001, g_hero_state + 0x80, vecs[1], force > 100.0f ? force : 100.0f); vars->iE0 = (g_train_state_value * 5 + 2) / 6; diff --git a/src/pal/levels/shared/L22_002AA488.c b/src/pal/levels/shared/L22_002AA488.c index e72c1bc9d..f83eaeb3b 100644 --- a/src/pal/levels/shared/L22_002AA488.c +++ b/src/pal/levels/shared/L22_002AA488.c @@ -3,7 +3,7 @@ extern char g_hero_state[]; extern void hero_clear_queued_anim(void); -extern int hero_l22_set_action(int mode, int flag); +extern int hero_l22_set_move_state(int mode, int flag); extern int g_pad_pressed_flags; extern void cancel_hero_item_animation(void); extern void UpdateHeroSlotCallbacks(void); @@ -21,7 +21,7 @@ extern void ref_L22_002B70F8_02(void); typedef unsigned char u8; typedef unsigned short u16; typedef float f32; -extern int hero_l22_set_action(int a0, int a1); +extern int hero_l22_set_move_state(int a0, int a1); /* func_PAL_L22_002AA488, the PAL copy of func_L22_002AA678: the same C, where the fade rates 0.07f and 0.13f become 0.08400001f and 0.156f, the timer 5 becomes 4, and the three call @@ -223,6 +223,6 @@ void hero_restart_in_mode_pal(int mode, int entry_id, void *moby_arg) { break; } } - hero_l22_set_action(entry_id, 2); + hero_l22_set_move_state(entry_id, 2); } diff --git a/src/pal/levels/shared/L22_002B7B08-cc.c b/src/pal/levels/shared/L22_002B7B08-cc.c index 32d7f60b5..0c9868c66 100644 --- a/src/pal/levels/shared/L22_002B7B08-cc.c +++ b/src/pal/levels/shared/L22_002B7B08-cc.c @@ -3,7 +3,7 @@ extern char g_hero_state[]; -extern int hero_l22_set_action(int mode, int flag); +extern int hero_l22_set_move_state(int mode, int flag); /* Loads the level's tuning constants and starts the two subsystems. */ /* func_L22_002A8B98 is defined in L22_002A8B98-init.c. */ @@ -133,7 +133,7 @@ void hero_l22_update_speed_targets_pal(void) { } } -extern int hero_l22_set_action(int a0, int a1); +extern int hero_l22_set_move_state(int a0, int a1); /* plays one of three resident messages, picked by the type byte; the second argument is 1 or 2 depending on the caller's flag */ diff --git a/src/pal/levels/shared/L22_002C8740-sw.c b/src/pal/levels/shared/L22_002C8740-sw.c index 9dc4eebbd..45f2782b1 100644 --- a/src/pal/levels/shared/L22_002C8740-sw.c +++ b/src/pal/levels/shared/L22_002C8740-sw.c @@ -71,8 +71,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -140,7 +140,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l22_set_action_pal(s32 action, s32 animate) { +s32 hero_l22_set_move_state_pal(s32 action, s32 animate) { f32 dir[4]; f32 pos[4]; u8 *object_snapshot; @@ -189,7 +189,9 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects_pal(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -202,8 +204,8 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { text_play_mode_message(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l22_set_action_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_action_pal(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.010000001f) { hero_l22_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (shop_get_entry_for_state(0) == 0x51) set_hero_animation_pal(shop_get_entry_for_state(0), 0, 15.0f); else set_hero_animation_pal(shop_get_entry_for_state(0), 0, -1.0f); @@ -350,7 +352,7 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l22_set_action_pal(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l22_set_move_state_pal(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.15400001f) REAL(0x1B4) = 0.15400001f; @@ -396,12 +398,12 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l22_set_action_pal(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_action_pal(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l22_set_move_state_pal(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state_pal(0x76, 1); return 0; } if (hero_try_start_grab_pal()) return 0; if (shop_get_entry_for_state(0) == 0x51) { if (!animate) goto finish; - if (hero_l22_set_action_pal(0, 0)) set_hero_animation_pal(shop_get_entry_for_state(0), 0, 15.0f); + if (hero_l22_set_move_state_pal(0, 0)) set_hero_animation_pal(shop_get_entry_for_state(0), 0, 15.0f); return 0; } if (!animate) goto finish; @@ -426,7 +428,7 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.14000002f) REAL(0x1B4) = 0.14000002f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_action_pal(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state_pal(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.14000002f); @@ -605,13 +607,13 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l22_set_action_pal(0x81, 1); return 0; + hero_l22_set_move_state_pal(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_flag_b) { hero_l22_set_action_pal(0x6E, 1); return 0; } + action != 0x38 && !g_hero_flag_b) { hero_l22_set_move_state_pal(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l22_set_action_pal(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l22_set_move_state_pal(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -686,9 +688,9 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_map_event_flag) hero_l22_set_action_pal(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l22_set_action_pal(0x79, 1); - else hero_l22_set_action_pal(0x39, 1); + if (g_current_map_index == 2 && g_hero_map_event_flag) hero_l22_set_move_state_pal(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l22_set_move_state_pal(0x79, 1); + else hero_l22_set_move_state_pal(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -743,7 +745,7 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 4; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -772,7 +774,7 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 1e+01f; HALF(0x518) = 10; if (BYTE(0x24DA)) { REAL(0x498) = 0.09800001f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.034f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 67; REAL(0x520) = 0.011600001f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -781,7 +783,7 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 7; REAL(0x4B8) = 0.6f; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x508) = 4.0f; HALF(0x518) = 12; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 100; REAL(0x4A4) = 0.038000003f; HALF(0x526) = 31; if (REAL(0x184) < 0.40000004f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -924,7 +926,7 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation_pal(0x60, 4, -1.0f); anim_start_blended_pal(PTR(0x1220), 3, 4, -1); @@ -1015,7 +1017,7 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { frames = 7.0f; animation_43 = 0x29; { set_hero_animation_pal(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 37; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 37; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.14000002f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -1027,7 +1029,7 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_pal(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_pal(1); @@ -1062,7 +1064,7 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { set_hero_animation_pal(0x11, 0, 7.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_action_pal(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state_pal(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation_pal(0, 0, 7.0f); goto finish; case 0x4B: @@ -1096,7 +1098,7 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l22_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_action_pal(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state_pal(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1181,7 +1183,7 @@ s32 hero_l22_set_action_pal(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.09f; if (WORD(0x640) > 12 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l22_set_action_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; + PTR(0x2290)[0xA8] = 255; hero_l22_set_move_state_pal(0x16, 1); HALF(0x1F4) = 125; HALF(0x1D0) = 58; return 0; } HALF(0x1DC) = 64; REAL(0x69C) = 0.050000004f; diff --git a/src/pal/levels/shared/L22_002D1020-sw.c b/src/pal/levels/shared/L22_002D1020-sw.c index 311106618..a91bc4656 100644 --- a/src/pal/levels/shared/L22_002D1020-sw.c +++ b/src/pal/levels/shared/L22_002D1020-sw.c @@ -78,7 +78,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed_pal(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction_pal(void); -s32 hero_l22_set_action_pal(s32, s32); +s32 hero_l22_set_move_state_pal(s32, s32); void text_play_mode_message(s32 a0); s32 hero_try_start_transition_pal(void); s32 hero_try_start_ledge_move(void); @@ -162,7 +162,7 @@ void hero_update_actions_pal(void) { UpdateHeroHeldTarget_pal(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l22_set_action_pal(0x39, 1); + hero_l22_set_move_state_pal(0x39, 1); goto end; } } @@ -197,7 +197,7 @@ void hero_update_actions_pal(void) { hero_apply_pending_change_pal(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l22_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l22_set_action_pal(0x74, 1); + hero_l22_set_move_state_pal(0x74, 1); goto end; } } @@ -208,12 +208,12 @@ void hero_update_actions_pal(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l22_set_action_pal(1, 1); + hero_l22_set_move_state_pal(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l22_set_action_pal(0x82, 1); + hero_l22_set_move_state_pal(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -250,7 +250,7 @@ void hero_update_actions_pal(void) { rec = g_hero_action_records + record_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 5e+01f; if (FLD(rec, s32, 0x44) != 0) { - hero_l22_set_action_pal(0x3C, 1); + hero_l22_set_move_state_pal(0x3C, 1); } else { set_hero_animation_pal(FLD(rec, s32, 0x48), 0, 1e+01f); } @@ -293,12 +293,12 @@ void hero_update_actions_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l22_set_action_pal(0x76, 1); + hero_l22_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); } break; } @@ -319,21 +319,21 @@ void hero_update_actions_pal(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_flag_b == 0) && (PadPressedWithin(0x40, 6, NULL) != 0)) { - hero_l22_set_action_pal(0x6E, 1); + hero_l22_set_move_state_pal(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l22_set_action_pal(4, 1); + hero_l22_set_move_state_pal(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l22_set_action_pal(0x27, 1); + hero_l22_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l22_set_action_pal(0x2E, 1); + hero_l22_set_move_state_pal(0x2E, 1); break; } { @@ -353,28 +353,28 @@ void hero_update_actions_pal(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust_pal(side, 0, 0, 0x1E); hero_play_footstep_sound_dust_pal(side, 1, 0, 0x1E); - hero_l22_set_action_pal(2, 1); + hero_l22_set_move_state_pal(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l22_set_action_pal(1, 1); + hero_l22_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_bits = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_bits & 8)) { - hero_l22_set_action_pal(0x3D, 1); + hero_l22_set_move_state_pal(0x3D, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l22_set_action_pal(0x3D, 1); + hero_l22_set_move_state_pal(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); } break; case 0x3D: @@ -383,22 +383,22 @@ void hero_update_actions_pal(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); break; } if (hero_try_start_move_from_buffer_pal(6, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l22_set_action_pal(4, 1); + hero_l22_set_move_state_pal(4, 1); break; } hero_update_target_speed_pal(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l22_set_action_pal(2, 1); + hero_l22_set_move_state_pal(2, 1); break; } - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); break; case 0x39: case 0x43: @@ -437,25 +437,25 @@ void hero_update_actions_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.040000003f)) { - hero_l22_set_action_pal(0x33, 1); + hero_l22_set_move_state_pal(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12)) { - hero_l22_set_action_pal(0x34, 1); + hero_l22_set_move_state_pal(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l22_set_action_pal(0x32, 1); + hero_l22_set_move_state_pal(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l22_set_action_pal(0x33, 1); + hero_l22_set_move_state_pal(0x33, 1); } } break; @@ -468,81 +468,81 @@ void hero_update_actions_pal(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l22_set_action_pal(0x32, 1); + hero_l22_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l22_set_action_pal(0x34, 1); + hero_l22_set_move_state_pal(0x34, 1); } else { - hero_l22_set_action_pal(0x32, 1); + hero_l22_set_move_state_pal(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l22_set_action_pal(0x12, 1); + hero_l22_set_move_state_pal(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 6, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 6, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l22_set_action_pal(0x32, 1); + hero_l22_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l22_set_action_pal(0x34, 1); + hero_l22_set_move_state_pal(0x34, 1); } else { - hero_l22_set_action_pal(0x32, 1); + hero_l22_set_move_state_pal(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l22_set_action_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l22_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(shop_get_entry_for_state(0), 0, 15.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0x9)) { - hero_l22_set_action_pal(0x35, 1); + hero_l22_set_move_state_pal(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l22_set_action_pal(0x12, 1); + hero_l22_set_move_state_pal(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 6, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l22_set_action_pal(0x32, 1); + hero_l22_set_move_state_pal(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l22_set_action_pal(0x34, 1); + hero_l22_set_move_state_pal(0x34, 1); } else { - hero_l22_set_action_pal(0x32, 1); + hero_l22_set_move_state_pal(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l22_set_action_pal(0x70, 0); + hero_l22_set_move_state_pal(0x70, 0); set_hero_animation_pal(0x59, 0, 14.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l22_set_action_pal(0x36, 1); + hero_l22_set_move_state_pal(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l22_set_action_pal(0x67, 1); + hero_l22_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x28, 15.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action_pal(0x33, 1); + hero_l22_set_move_state_pal(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l22_set_action_pal(0x33, 0); + hero_l22_set_move_state_pal(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l22_set_action_pal(0x67, 1); + hero_l22_set_move_state_pal(0x67, 1); set_hero_animation_pal(0x58, 0x25, 15.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x2B) { - hero_l22_set_action_pal(0x36, 0); + hero_l22_set_move_state_pal(0x36, 0); } break; case 0x1: @@ -576,9 +576,9 @@ void hero_update_actions_pal(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { text_play_mode_message(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l22_set_action_pal(4, 1); + hero_l22_set_move_state_pal(4, 1); } else { - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); anim = shop_get_entry_for_state(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -590,9 +590,9 @@ void hero_update_actions_pal(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); } else { - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); } } break; @@ -625,7 +625,7 @@ void hero_update_actions_pal(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l22_set_action_pal(7, 1); + hero_l22_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -634,7 +634,7 @@ void hero_update_actions_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); } break; } @@ -656,7 +656,7 @@ void hero_update_actions_pal(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l22_set_action_pal(7, 1); + hero_l22_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -669,7 +669,7 @@ void hero_update_actions_pal(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l22_set_action_pal(2, 0); + hero_l22_set_move_state_pal(2, 0); set_hero_animation_pal(3, g_hero_l22_animation_ids[FLD(g_hero_state, s32, 0x2298)], 11.0f); break; } @@ -680,22 +680,22 @@ void hero_update_actions_pal(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l22_set_action_pal(2, 1); + hero_l22_set_move_state_pal(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x54) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -712,7 +712,7 @@ void hero_update_actions_pal(void) { } if (PadPressedWithin(0x40, 6, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l22_set_action_pal(7, 1); + hero_l22_set_move_state_pal(7, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { @@ -721,7 +721,7 @@ void hero_update_actions_pal(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); set_hero_animation_pal(shop_get_entry_for_state(0), 0, 12.0f); break; } @@ -733,7 +733,7 @@ void hero_update_actions_pal(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); } break; case 0x2: @@ -747,11 +747,11 @@ void hero_update_actions_pal(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l22_set_action_pal(0x76, 1); + hero_l22_set_move_state_pal(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead_pal() == 0)) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); break; } n = 7; @@ -765,12 +765,12 @@ void hero_update_actions_pal(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l22_set_action_pal(9, 1); + hero_l22_set_move_state_pal(9, 1); } else { - hero_l22_set_action_pal(7, 1); + hero_l22_set_move_state_pal(7, 1); } } else { - hero_l22_set_action_pal(7, 1); + hero_l22_set_move_state_pal(7, 1); } break; } @@ -778,11 +778,11 @@ void hero_update_actions_pal(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.040000003f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l22_set_action_pal(1, 1); + hero_l22_set_move_state_pal(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l22_set_action_pal(4, 1); + hero_l22_set_move_state_pal(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -799,25 +799,25 @@ void hero_update_actions_pal(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l22_set_action_pal(0x2E, 1); + hero_l22_set_move_state_pal(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l22_set_action_pal(2, 1); + hero_l22_set_move_state_pal(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l22_set_action_pal(0x70, 1); + hero_l22_set_move_state_pal(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l22_set_action_pal(2, 1); + hero_l22_set_move_state_pal(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l22_set_action_pal(0x27, 1); + hero_l22_set_move_state_pal(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -828,7 +828,7 @@ void hero_update_actions_pal(void) { if (hero_try_start_grab_pal() != 0) { break; } - if (hero_l22_set_action_pal(0, 0) == 0) { + if (hero_l22_set_move_state_pal(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.030000001f); @@ -845,7 +845,7 @@ void hero_update_actions_pal(void) { hero_update_anim_scale_pal(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l22_set_action_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.001f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l22_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(shop_get_entry_for_state(0), 0, 14.0f); } if (FLD(hero_moby, u8, 0x43) == 0x37) { @@ -866,7 +866,7 @@ void hero_update_actions_pal(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l22_set_action_pal(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.064f) && (hero_l22_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(shop_get_entry_for_state(0), 0, 14.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 29.166668f; @@ -900,17 +900,17 @@ void hero_update_actions_pal(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x19; - hero_l22_set_action_pal(3, 0); + hero_l22_set_move_state_pal(3, 0); set_hero_animation_pal(6, 4, 9.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l22_set_action_pal(0x77, 1); + hero_l22_set_move_state_pal(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l22_set_action_pal(0x77, 1); + hero_l22_set_move_state_pal(0x77, 1); break; } } @@ -928,11 +928,11 @@ void hero_update_actions_pal(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.054000005f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l22_set_action_pal(0x64, 1); + hero_l22_set_move_state_pal(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.054000005f)) { - hero_l22_set_action_pal(0x63, 1); + hero_l22_set_move_state_pal(0x63, 1); } } else { hero_update_anim_scale_pal(); @@ -940,21 +940,21 @@ void hero_update_actions_pal(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action_pal(0x62, 1); + hero_l22_set_move_state_pal(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l22_set_action_pal(0x62, 1); + hero_l22_set_move_state_pal(0x62, 1); } break; case 0x65: /* switch 2 */ slot_count = FLD(g_hero_state, s32, 0x18C0); if ((slot_count < 3) && (((slot_count * 6) + 0x8) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 6, &pad_out) != 0)) { - hero_l22_set_action_pal(0x66, 1); + hero_l22_set_move_state_pal(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters_pal(); @@ -997,7 +997,7 @@ void hero_update_actions_pal(void) { return; case 0x6D: if ((f32)g_hero_anim_records[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); } break; case 0x30: @@ -1010,7 +1010,7 @@ void hero_update_actions_pal(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l22_set_action_pal(0, 0) != 0) { + if (hero_l22_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(shop_get_entry_for_state(0), 0, 14.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1018,29 +1018,29 @@ void hero_update_actions_pal(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l22_set_action_pal(1, 1); + hero_l22_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l22_set_action_pal(7, 1); + hero_l22_set_move_state_pal(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l22_set_action_pal(4, 1); + hero_l22_set_move_state_pal(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 8) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l22_set_action_pal(0x27, 1); + hero_l22_set_move_state_pal(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1048,45 +1048,45 @@ void hero_update_actions_pal(void) { } if (shop_get_entry_for_state(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l22_set_action_pal(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 1e+01f) && (hero_l22_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(shop_get_entry_for_state(0), 0, 14.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l22_set_action_pal(2, 1); + hero_l22_set_move_state_pal(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l22_set_action_pal(1, 1); + hero_l22_set_move_state_pal(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xA) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); set_hero_animation_pal(shop_get_entry_for_state(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l22_set_action_pal(0x76, 1); + hero_l22_set_move_state_pal(0x76, 1); break; } if (hero_choose_jump_or_roll_move_pal() != 0) { break; } if ((PadPressedWithin(0x80, 0xC, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l22_set_action_pal(0x15, 1); + hero_l22_set_move_state_pal(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 8) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xC)) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1094,17 +1094,17 @@ void hero_update_actions_pal(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l22_set_action_pal(0x8B, 1); + hero_l22_set_move_state_pal(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x4C) { - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); } break; case 0x24: @@ -1130,14 +1130,14 @@ void hero_update_actions_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); set_hero_animation_pal(shop_get_entry_for_state(0), 0, 25.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l22_set_action_pal(6, 0); + hero_l22_set_move_state_pal(6, 0); } else { - hero_l22_set_action_pal(6, 0); + hero_l22_set_move_state_pal(6, 0); set_hero_animation_pal(0xA, 0, 14.0f); } FLD(g_hero_state, f32, 0xA84) = 0.016800001f; @@ -1153,9 +1153,9 @@ void hero_update_actions_pal(void) { FLD(g_hero_state, f32, 0x1B4) = 0.14000002f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); } else { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1167,7 +1167,7 @@ void hero_update_actions_pal(void) { if (t < 0x21) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l22_set_action_pal(0x2C, 1); + hero_l22_set_move_state_pal(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0028000001f; FLD(g_hero_state, f32, 0xA80) = 0.0108f; } @@ -1231,11 +1231,11 @@ void hero_update_actions_pal(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.26000002f); FLD(g_hero_state, f32, 0x128) = 0.20000002f; - hero_l22_set_action_pal(0x16, 1); + hero_l22_set_move_state_pal(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x3A; FLD(g_hero_state, s16, 0x1D0) = 0x3A; } else { - hero_l22_set_action_pal(0x3E, 1); + hero_l22_set_move_state_pal(0x3E, 1); } break; } @@ -1248,7 +1248,7 @@ void hero_update_actions_pal(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l22_set_action_pal(0x28, 1); + hero_l22_set_move_state_pal(0x28, 1); } break; } @@ -1259,16 +1259,16 @@ void hero_update_actions_pal(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x3A; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l22_set_action_pal(0x74, 1); + hero_l22_set_move_state_pal(0x74, 1); } else { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0x8, NULL) != 0)) { - hero_l22_set_action_pal(0x2A, 1); + hero_l22_set_move_state_pal(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1285,7 +1285,7 @@ void hero_update_actions_pal(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l22_set_action_pal(0x28, 1); + hero_l22_set_move_state_pal(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)vec_b = 0; @@ -1302,7 +1302,7 @@ void hero_update_actions_pal(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 4, NULL) != 0) && ((f32)g_hero_anim_records[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l22_set_action_pal(0x28, 1); + hero_l22_set_move_state_pal(0x28, 1); break; } top = 0xE; @@ -1311,19 +1311,19 @@ void hero_update_actions_pal(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0x8, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l22_set_action_pal(0x2A, 1); + hero_l22_set_move_state_pal(0x2A, 1); } break; } if ((f32)g_hero_anim_records[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l22_set_action_pal(0x27, 1); + hero_l22_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 5) || (FLD(g_hero_state, s32, 0x6C8) >= 5)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l22_set_action_pal(0x74, 1); + hero_l22_set_move_state_pal(0x74, 1); } else { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; @@ -1332,11 +1332,11 @@ void hero_update_actions_pal(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 5) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l22_set_action_pal(0x27, 1); + hero_l22_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 5) && (g_current_map_index == 0x14)) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0x8) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1372,7 +1372,7 @@ void hero_update_actions_pal(void) { find_nearest_path_point(rail_path, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), rail_wrap, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l22_set_action_pal(0x29, 1); + hero_l22_set_move_state_pal(0x29, 1); break; } } @@ -1420,7 +1420,7 @@ void hero_update_actions_pal(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x3A; FLD(g_hero_state, s16, 0x1F4) = 7; FLD(g_hero_state, s16, 0x1D0) = 0x3A; @@ -1428,7 +1428,7 @@ void hero_update_actions_pal(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l22_set_action_pal(0x71, 1); + hero_l22_set_move_state_pal(0x71, 1); break; } { @@ -1440,7 +1440,7 @@ void hero_update_actions_pal(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l22_set_action_pal(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l22_set_move_state_pal(0, 0) != 0)) { set_hero_animation_pal(0xC, 4, 5.0f); } } else if (st == 0x3E) { @@ -1449,17 +1449,17 @@ void hero_update_actions_pal(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)quantized_height_b, 0.5f, -1.0f); } if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s32, 0x340) != 0)) { - if (hero_l22_set_action_pal(0, 0) != 0) { + if (hero_l22_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action_pal(0x27, 1); + hero_l22_set_move_state_pal(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xD) && (FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l22_set_action_pal(0x27, 1); + hero_l22_set_move_state_pal(0x27, 1); } } break; @@ -1475,13 +1475,13 @@ void hero_update_actions_pal(void) { } } if (FLD(g_hero_state, s32, 0x6F0) >= 5) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x204) = 0x19; } break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l22_set_action_pal(0x18, 0); + hero_l22_set_move_state_pal(0x18, 0); } break; case 0x18: @@ -1490,18 +1490,18 @@ void hero_update_actions_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab_pal((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 0xE, NULL) != 0) { - hero_l22_set_action_pal(0x1B, 1); + hero_l22_set_move_state_pal(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1510,7 +1510,7 @@ void hero_update_actions_pal(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x97), 1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x97), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l22_set_action_pal(0x19, 1); + hero_l22_set_move_state_pal(0x19, 1); } break; } @@ -1521,7 +1521,7 @@ void hero_update_actions_pal(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l22_set_action_pal(0x1A, 1); + hero_l22_set_move_state_pal(0x1A, 1); } } } @@ -1540,18 +1540,18 @@ void hero_update_actions_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action_pal(0x18, 1); + hero_l22_set_move_state_pal(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l22_set_action_pal(0x1B, 1); + hero_l22_set_move_state_pal(0x1B, 1); } break; } @@ -1561,9 +1561,9 @@ void hero_update_actions_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); } else { - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); } } break; @@ -1587,12 +1587,12 @@ void hero_update_actions_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l22_set_action_pal(0x39, 1); + hero_l22_set_move_state_pal(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x4B) { - if (hero_l22_set_action_pal(0, 0) != 0) { + if (hero_l22_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 4, 5.0f); } if (low != 0) { @@ -1600,7 +1600,7 @@ void hero_update_actions_pal(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l22_set_action_pal(0, 0) != 0) { + if (hero_l22_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1614,36 +1614,36 @@ void hero_update_actions_pal(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l22_set_action_pal(2, 1); + hero_l22_set_move_state_pal(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.060000002f) { - if (hero_l22_set_action_pal(3, 0) != 0) { + if (hero_l22_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(6, 0, 1e+01f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.15400001f); } } else { - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l22_set_action_pal(8, 1); + hero_l22_set_move_state_pal(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x12) && (hero_try_start_move_from_buffer_pal((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 5, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l22_set_action_pal(0x17, 1); + hero_l22_set_move_state_pal(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l22_set_action_pal(0x27, 1); + hero_l22_set_move_state_pal(0x27, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l22_set_action_pal(0x71, 1); + hero_l22_set_move_state_pal(0x71, 1); } } break; @@ -1674,7 +1674,7 @@ void hero_update_actions_pal(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l22_set_action_pal(0, 0) != 0) { + if (hero_l22_set_move_state_pal(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1684,9 +1684,9 @@ void hero_update_actions_pal(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l22_set_action_pal(0x74, 1); + hero_l22_set_move_state_pal(0x74, 1); } else { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); } } break; @@ -1699,16 +1699,16 @@ void hero_update_actions_pal(void) { ok = 1; } if (ok != 0) { - hero_l22_set_action_pal(0x11, 1); + hero_l22_set_move_state_pal(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l22_set_action_pal(0x17, 1); + hero_l22_set_move_state_pal(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1719,23 +1719,23 @@ void hero_update_actions_pal(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 3)) { - if (hero_l22_set_action_pal(3, 0) != 0) { + if (hero_l22_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x1C; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l22_set_action_pal(4, 1); + hero_l22_set_move_state_pal(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_distance_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l22_set_action_pal(2, 1); + hero_l22_set_move_state_pal(2, 1); break; } - hero_l22_set_action_pal(2, 0); + hero_l22_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, 2, 7.0f); @@ -1744,21 +1744,21 @@ void hero_update_actions_pal(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_distance_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l22_set_action_pal(2, 1); + hero_l22_set_move_state_pal(2, 1); break; } - hero_l22_set_action_pal(2, 0); + hero_l22_set_move_state_pal(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation_pal(4, g_hero_l22_extra_animation_id, 1e+01f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l22_set_action_pal(0, 0) != 0) { + if (hero_l22_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(shop_get_entry_for_state(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l22_set_action_pal(0, 0) != 0) { + } else if (hero_l22_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(7, 0x17, 7.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1806,14 +1806,14 @@ void hero_update_actions_pal(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 4, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l22_set_action_pal(0xB, 1); + hero_l22_set_move_state_pal(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x11)) { - hero_l22_set_action_pal(0x82, 1); + hero_l22_set_move_state_pal(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1822,29 +1822,29 @@ void hero_update_actions_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 6) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f)) { - hero_l22_set_action_pal(0xA, 1); + hero_l22_set_move_state_pal(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.018000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l22_set_action_pal(0x10, 1); + hero_l22_set_move_state_pal(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l22_set_action_pal(0x27, 1); + hero_l22_set_move_state_pal(0x27, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l22_set_action_pal(0x71, 1); + hero_l22_set_move_state_pal(0x71, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.14000002f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l22_set_action_pal(0x77, 1); + hero_l22_set_move_state_pal(0x77, 1); break; } } @@ -1948,7 +1948,7 @@ void hero_update_actions_pal(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l22_set_action_pal(3, 0) != 0) { + if (hero_l22_set_move_state_pal(3, 0) != 0) { set_hero_animation_pal(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1956,13 +1956,13 @@ void hero_update_actions_pal(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_distance_params[0][2])) { - hero_l22_set_action_pal(7, 1); + hero_l22_set_move_state_pal(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l22_set_action_pal(7, 1); + hero_l22_set_move_state_pal(7, 1); } else if (g_hero_distance_params[1][1] * 0.017f < FLD(g_hero_state, f32, 0x174)) { - hero_l22_set_action_pal(9, 1); + hero_l22_set_move_state_pal(9, 1); } else { - hero_l22_set_action_pal(7, 1); + hero_l22_set_move_state_pal(7, 1); } break; } @@ -1970,10 +1970,10 @@ void hero_update_actions_pal(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_l00_choose_next_move_after_landing_pal(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); break; } { @@ -1983,7 +1983,7 @@ void hero_update_actions_pal(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x16)) && (PadPressedWithin(0x40, 6, &pad_out_2) != 0) && (pad_out_2 < FLD(g_hero_state, s32, 0x1B8))) { - hero_l22_set_action_pal(0x11, 1); + hero_l22_set_move_state_pal(0x11, 1); break; } } @@ -2012,7 +2012,7 @@ void hero_update_actions_pal(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xD) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.11600001f)))) { - hero_l22_set_action_pal(0xE, 1); + hero_l22_set_move_state_pal(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -2022,32 +2022,32 @@ void hero_update_actions_pal(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l22_set_action_pal(8, 1); + hero_l22_set_move_state_pal(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x576) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l22_set_action_pal(0x17, 1); + hero_l22_set_move_state_pal(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x17) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l22_set_action_pal(0x79, 1); + hero_l22_set_move_state_pal(0x79, 1); } else { - hero_l22_set_action_pal(0x39, 1); + hero_l22_set_move_state_pal(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l22_set_action_pal(0x82, 1); + hero_l22_set_move_state_pal(0x82, 1); } else { - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); } } break; @@ -2057,8 +2057,8 @@ void hero_update_actions_pal(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x2B) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l22_set_action_pal(0x39, 1); - } else if (hero_l22_set_action_pal(0, 0) != 0) { + hero_l22_set_move_state_pal(0x39, 1); + } else if (hero_l22_set_move_state_pal(0, 0) != 0) { set_hero_animation_pal(shop_get_entry_for_state(0), 0, 11.0f); } } @@ -2083,28 +2083,28 @@ void hero_update_actions_pal(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l22_set_action_pal(0x4E, 1); + hero_l22_set_move_state_pal(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l22_set_action_pal(1, 1); + hero_l22_set_move_state_pal(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l22_set_action_pal(0x41, 1); + hero_l22_set_move_state_pal(0x41, 1); break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l22_set_action_pal(0x45, 1); + hero_l22_set_move_state_pal(0x45, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l22_set_action_pal(0x4D, 1); + hero_l22_set_move_state_pal(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l22_set_action_pal(0x40, 1); + hero_l22_set_move_state_pal(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -2117,14 +2117,14 @@ void hero_update_actions_pal(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l22_set_action_pal(0x4E, 1); + hero_l22_set_move_state_pal(0x4E, 1); break; } rec = (u8 *)&g_hero_anim_records[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l22_set_action_pal(0x3F, 0); + hero_l22_set_move_state_pal(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -2133,13 +2133,13 @@ void hero_update_actions_pal(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0xD) ? n : 0xC, NULL) != 0) { - hero_l22_set_action_pal(0x4D, 1); + hero_l22_set_move_state_pal(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l22_set_action_pal(0x45, 1); + hero_l22_set_move_state_pal(0x45, 1); } break; } @@ -2202,42 +2202,42 @@ void hero_update_actions_pal(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 3, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 3)) { hero_resolve_stick_direction(0, 1.0f); - hero_l22_set_action_pal(0x45, 1); + hero_l22_set_move_state_pal(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_distance_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x97)) < 1.5707964f)) { - hero_l22_set_action_pal(0x40, 1); + hero_l22_set_move_state_pal(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xB) { - hero_l22_set_action_pal(0x3F, 1); + hero_l22_set_move_state_pal(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x22)) { - hero_l22_set_action_pal(0x41, 1); + hero_l22_set_move_state_pal(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 4, NULL) != 0)) { - hero_l22_set_action_pal(0x4D, 1); + hero_l22_set_move_state_pal(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l22_set_action_pal(0x46, 1); + hero_l22_set_move_state_pal(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l22_set_action_pal(0x4B, 1); + hero_l22_set_move_state_pal(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1A) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l22_set_action_pal(0x41, 1); + hero_l22_set_move_state_pal(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l22_set_action_pal(0x46, 1); + hero_l22_set_move_state_pal(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -2247,11 +2247,11 @@ void hero_update_actions_pal(void) { FLD(g_hero_state, s16, 0x1EE) = 0xA - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l22_set_action_pal(0x40, 1); + hero_l22_set_move_state_pal(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l22_set_action_pal(0x3F, 1); + hero_l22_set_move_state_pal(0x3F, 1); } break; case 0x41: @@ -2263,29 +2263,29 @@ void hero_update_actions_pal(void) { FLD(g_hero_state, f32, 0xF8) = -0.18f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l22_set_action_pal(0x43, 1); + hero_l22_set_move_state_pal(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l22_set_action_pal(0x40, 1); + hero_l22_set_move_state_pal(0x40, 1); } else { - hero_l22_set_action_pal(0x3F, 1); + hero_l22_set_move_state_pal(0x3F, 1); } } else { - hero_l22_set_action_pal(0x3F, 1); + hero_l22_set_move_state_pal(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l22_set_action_pal(0x46, 1); + hero_l22_set_move_state_pal(0x46, 1); break; } if ((PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l22_set_action_pal(0x4B, 1); + hero_l22_set_move_state_pal(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l22_set_action_pal(0x3F, 1); + hero_l22_set_move_state_pal(0x3F, 1); } break; case 0x4E: @@ -2294,9 +2294,9 @@ void hero_update_actions_pal(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l22_set_action_pal(0x41, 1); + hero_l22_set_move_state_pal(0x41, 1); } else { - hero_l22_set_action_pal(0x3F, 1); + hero_l22_set_move_state_pal(0x3F, 1); } } break; @@ -2306,7 +2306,7 @@ void hero_update_actions_pal(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l22_set_action_pal(0x4E, 1); + hero_l22_set_move_state_pal(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.030000001f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2332,55 +2332,55 @@ void hero_update_actions_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l22_set_action_pal(0x45, 1); + hero_l22_set_move_state_pal(0x45, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l22_set_action_pal(0x4D, 1); + hero_l22_set_move_state_pal(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l22_set_action_pal(0x41, 1); + hero_l22_set_move_state_pal(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l22_set_action_pal(0x3F, 1); + hero_l22_set_move_state_pal(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1B) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l22_set_action_pal(0x41, 1); + hero_l22_set_move_state_pal(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1E) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l22_set_action_pal(0x43, 1); + hero_l22_set_move_state_pal(0x43, 1); } else { - hero_l22_set_action_pal(0x3F, 0); + hero_l22_set_move_state_pal(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action_pal(0x47, 1); + hero_l22_set_move_state_pal(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)vec_a = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l22_set_action_pal(0x41, 1); + hero_l22_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l22_set_action_pal(0x41, 1); + hero_l22_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x8; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l22_set_action_pal(0x48, 1); + hero_l22_set_move_state_pal(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2389,7 +2389,7 @@ void hero_update_actions_pal(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l22_set_action_pal(0x49, 1); + hero_l22_set_move_state_pal(0x49, 1); } break; } @@ -2400,7 +2400,7 @@ void hero_update_actions_pal(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab_pal((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l22_set_action_pal(0x4A, 1); + hero_l22_set_move_state_pal(0x4A, 1); } } } @@ -2419,17 +2419,17 @@ void hero_update_actions_pal(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab_pal((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action_pal(0x47, 1); + hero_l22_set_move_state_pal(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 7, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l22_set_action_pal(0x41, 1); + hero_l22_set_move_state_pal(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x21; break; } if (PadPressedWithin(0x40, 7, NULL) != 0) { - hero_l22_set_action_pal(0x48, 1); + hero_l22_set_move_state_pal(0x48, 1); } break; } @@ -2450,27 +2450,27 @@ void hero_update_actions_pal(void) { } } if (PadPressedWithin(0x40, 0xC, NULL) != 0) { - hero_l22_set_action_pal(0x5B, 1); + hero_l22_set_move_state_pal(0x5B, 1); break; } if (PadPressedWithin(0x80, 0xC, NULL) != 0) { - hero_l22_set_action_pal(0x5D, 1); + hero_l22_set_move_state_pal(0x5D, 1); break; } if ((PadPressedWithin(0x10, 7, NULL) != 0) && (player_slot_has_object(FLD(g_hero_state, u32, 0x2290)) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x1888), s32, 0xC) != 0) { - hero_l22_set_action_pal(0x5E, 1); + hero_l22_set_move_state_pal(0x5E, 1); FLD(FLD(g_hero_state, u8 *, 0x1888), s32, 0xC)--; } break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 2.0f)) { - hero_l22_set_action_pal(0x58, 1); + hero_l22_set_move_state_pal(0x58, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.22f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l22_set_action_pal(0x57, 1); + hero_l22_set_move_state_pal(0x57, 1); break; } break; @@ -2542,18 +2542,18 @@ void hero_update_actions_pal(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 3, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 0xC)) { hero_resolve_stick_direction(0, 1.0f); - hero_l22_set_action_pal(0x5B, 1); + hero_l22_set_move_state_pal(0x5B, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 0x9) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, u8, 0x49C) >= 0xD)) { - hero_l22_set_action_pal(0x56, 1); + hero_l22_set_move_state_pal(0x56, 1); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_distance_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l22_set_action_pal(0x57, 1); + hero_l22_set_move_state_pal(0x57, 1); break; } } @@ -2566,7 +2566,7 @@ void hero_update_actions_pal(void) { coll_sweep_from_object(FLD(g_hero_state, char *, 0x2290), (char *)vec_a, 0x30000, 0, 3.5f, 2.0f, 1.0f, 1, 0); } if ((FLD(g_hero_state, s16, 0x202) != 0) && (PadPressedWithin(0x40, 0x8, NULL) != 0)) { - hero_l22_set_action_pal(0x5B, 1); + hero_l22_set_move_state_pal(0x5B, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { @@ -2582,13 +2582,13 @@ void hero_update_actions_pal(void) { FLD(g_hero_l22_state_block, s32, 0x168) = 0x19; FLD(g_hero_l22_state_block, s32, 0x16C) = 0; if (FLD(g_hero_state, s32, 0x1874) <= 0) { - hero_l22_set_action_pal(0x5F, 1); + hero_l22_set_move_state_pal(0x5F, 1); break; } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l22_set_action_pal(0x57, 1); + hero_l22_set_move_state_pal(0x57, 1); } else { - hero_l22_set_action_pal(0x56, 1); + hero_l22_set_move_state_pal(0x56, 1); } break; case 0x5D: @@ -2598,28 +2598,28 @@ void hero_update_actions_pal(void) { lim = 25.5f; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > lim) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12) && (PadPressedWithin(0x80, 0xE, NULL) != 0)) { - hero_l22_set_action_pal(0x5D, 1); + hero_l22_set_move_state_pal(0x5D, 1); } if (((FLD(g_hero_state, f32, 0xC38) > 28.5f) && (FLD(g_hero_state, s32, 0xC2C) == 0)) || (FLD(g_hero_state, s32, 0xC28) & 2)) { - hero_l22_set_action_pal(0x56, 0); + hero_l22_set_move_state_pal(0x56, 0); break; } if ((FLD(g_hero_state, f32, 0xC38) > 19.0f) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.75f)) { - hero_l22_set_action_pal(0x57, 0); + hero_l22_set_move_state_pal(0x57, 0); set_hero_animation_pal(3, 0x12, 9.0f); } break; } case 0x5E: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l22_set_action_pal(0x56, 1); + hero_l22_set_move_state_pal(0x56, 1); break; } if (FLD(g_hero_state, s32, 0xC2C) != 0) { break; } if (FLD(g_hero_state, f32, 0xC38) > 32.0f) { - hero_l22_set_action_pal(0x56, 1); + hero_l22_set_move_state_pal(0x56, 1); } break; case 0x57: @@ -2628,40 +2628,40 @@ void hero_update_actions_pal(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if (PadPressedWithin(0x40, 0xC, NULL) != 0) { - hero_l22_set_action_pal(0x5B, 1); + hero_l22_set_move_state_pal(0x5B, 1); break; } if (PadPressedWithin(0x80, 7, NULL) != 0) { - hero_l22_set_action_pal(0x5D, 1); + hero_l22_set_move_state_pal(0x5D, 1); break; } if (PadPressedWithin(0x10, 7, NULL) != 0) { if (FLD(FLD(g_hero_state, u8 *, 0x1888), s32, 0xC) != 0) { - hero_l22_set_action_pal(0x5E, 1); + hero_l22_set_move_state_pal(0x5E, 1); FLD(FLD(g_hero_state, u8 *, 0x1888), s32, 0xC)--; } break; } if ((FLD(g_hero_state, s16, 0x34E) >= 4) && (FLD(g_hero_state, f32, 0x31C) > 1.5f) && ((FLD(g_hero_state, f32, 0x31C) > 1.5f) || (FLD(g_hero_state, f32, 0x320) > 0.87266469f))) { - hero_l22_set_action_pal(0x58, 1); + hero_l22_set_move_state_pal(0x58, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { break; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.17f) && (FLD(g_hero_state, s32, 0x1B8) >= 0x12)) { - hero_l22_set_action_pal(0x56, 1); + hero_l22_set_move_state_pal(0x56, 1); } break; case 0x59: case 0x5A: if ((FLD(g_hero_state, s32, 0x340) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x2B)) { - hero_l22_set_action_pal(0x56, 1); + hero_l22_set_move_state_pal(0x56, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x22) || (FLD(g_hero_state, s32, 0xC28) & 2)) { if (FLD(g_hero_state, s32, 0x1874) <= 0) { - hero_l22_set_action_pal(0x5F, 1); + hero_l22_set_move_state_pal(0x5F, 1); break; } set_hero_animation_pal(0xE, 0, 9.0f); @@ -2678,7 +2678,7 @@ void hero_update_actions_pal(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); anim = shop_get_entry_for_state(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation_pal(anim, 0, 7.0f); @@ -2689,7 +2689,7 @@ void hero_update_actions_pal(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); } break; case 0x22: @@ -2699,12 +2699,12 @@ void hero_update_actions_pal(void) { hero_choose_jump_or_roll_move_pal(); break; } - hero_l22_set_action_pal(7, 1); + hero_l22_set_move_state_pal(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); } break; default: diff --git a/src/pal/levels/shared/L22_0039EBE4-sw.c b/src/pal/levels/shared/L22_0039EBE4-sw.c index d2a74637d..457d4409e 100644 --- a/src/pal/levels/shared/L22_0039EBE4-sw.c +++ b/src/pal/levels/shared/L22_0039EBE4-sw.c @@ -13,7 +13,7 @@ typedef struct { extern char g_hero_state[]; extern u32 g_pad_pressed_flags; extern unsigned int shop_get_entry_for_state(int); -extern unsigned int hero_l22_set_action_pal(int, int); +extern unsigned int hero_l22_set_move_state_pal(int, int); extern void set_hero_animation_pal(int, int, float); extern void hud_add_moby_marker(void *, float, u32, void *, int, float, int, float, int); extern int CollLine(void *, void *, int, void *, void *); @@ -40,7 +40,7 @@ void swingshot_l22_node_update_pal(u8 *moby) f32 probe_pos[4]; if (((Hero *)g_hero_state)->i[0x2294 / 4] == 1) - hero_l22_set_action_pal(0x1D, 1); + hero_l22_set_move_state_pal(0x1D, 1); data = *(FollowVars **)(moby + 0x68); if (data == 0) return; @@ -131,9 +131,9 @@ void swingshot_l22_node_update_pal(u8 *moby) probe_pos[2] += 0.5f; if (CollLine(probe_pos, ((Hero *)g_hero_state)->ptr[0xAA4 / 4] + 0x10, 2, 0, 0) != 0) { if (((Hero *)g_hero_state)->f[0x31C / 4] > 0.5f) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); } else { - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); set_hero_animation_pal(shop_get_entry_for_state(0), 0, 12.0f); } moby[0x20] = 6; @@ -157,9 +157,9 @@ void swingshot_l22_node_update_pal(u8 *moby) link_vec[2] += 0.5f; if (CollLine(link_vec, ((Hero *)g_hero_state)->ptr[0xAA4 / 4] + 0x10, 2, 0, 0) != 0) { if (((Hero *)g_hero_state)->h[0x34E / 2] != 0) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); } else { - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); } moby[0x20] = 6; } else { @@ -173,20 +173,20 @@ void swingshot_l22_node_update_pal(u8 *moby) if (data->target != 0 && fast_vec_dist(data->target + 0x10, &((Hero *)g_hero_state)->q[0x80 / 16]) > 3.5f) { if ((g_pad_pressed_flags & ((Hero *)g_hero_state)->u[0x1230 / 4]) == 0) { ((Hero *)g_hero_state)->i[0xAC8 / 4] = 1; - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); set_hero_animation_pal(shop_get_entry_for_state(0), 0, 12.0f); moby[0x20] = 6; } else { PlayMobySound(2, 0, (char *)moby); if (((Hero *)g_hero_state)->i[0xAB8 / 4] != 0) { - hero_l22_set_action_pal(0x25, 1); + hero_l22_set_move_state_pal(0x25, 1); } else { - hero_l22_set_action_pal(0x24, 1); + hero_l22_set_move_state_pal(0x24, 1); } moby[0x20] = 5; } } else { - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); moby[0x20] = 6; } } @@ -303,9 +303,9 @@ void swingshot_l22_node_update_pal(u8 *moby) link_vec[2] += 0.5f; if (CollLine(link_vec, ((Hero *)g_hero_state)->ptr[0xB10 / 4] + 0x10, 2, 0, 0) != 0) { if (((Hero *)g_hero_state)->f[0x31C / 4] > 0.5f) { - hero_l22_set_action_pal(6, 1); + hero_l22_set_move_state_pal(6, 1); } else { - hero_l22_set_action_pal(0, 0); + hero_l22_set_move_state_pal(0, 0); set_hero_animation_pal(shop_get_entry_for_state(0), 0, 12.0f); } moby[0x20] = 0x13; diff --git a/src/pal/levels/shared/L22_003A0A08-main-g8.c b/src/pal/levels/shared/L22_003A0A08-main-g8.c index 98ccf9ade..cadcac30b 100644 --- a/src/pal/levels/shared/L22_003A0A08-main-g8.c +++ b/src/pal/levels/shared/L22_003A0A08-main-g8.c @@ -112,7 +112,7 @@ extern void object_copy_vector_to_selected(void *); extern void cam_set_state_rotation(void *); extern void SetCamera5Pose(void *, void *, int, int, int); extern void cancel_hero_item_animation_pal(void); -extern int queue_copy_record_by_index(int); +extern int actuator_play_pattern(int); extern void release_moby_animation_slot(void *, void *); extern void moby_set_flag_bit(void *, int); extern int snd_start_in_slot(int, int, int); @@ -127,7 +127,7 @@ extern int moby_call_helper_with_blocks_pal(void *); extern int joba_enemy_apply_source_damage(void *); extern int tribesman_turn_toward_point(void *, void *, float, float, float, float); extern void tribesman_rearm_guard_nodes(void *); -extern int hero_l22_set_action_pal(int, int); +extern int hero_l22_set_move_state_pal(int, int); extern void math_steer_along_direction(void *, void *, void *, void *, float, float, float); extern void moby_update_timed(void *); extern void arena_push_point_out(void *, float); @@ -473,7 +473,7 @@ void space_ship_update_pal(s8 *moby) { cancel_hero_item_animation_pal(); release_moby_animation_slot(M2C_FIELD(game, void **, 0x2290), game + 0x1870); M2C_FIELD(game, s32 *, 0x187C) = 0; - hero_l22_set_action_pal(0, 1); + hero_l22_set_move_state_pal(0, 1); M2C_FIELD(vars, s32 *, 0x344) = 0; } val43 = M2C_FIELD(vars, u16 *, 0x41E); @@ -1024,7 +1024,7 @@ void space_ship_update_pal(s8 *moby) { } if (fast_vec_dist(&scratch[2].q, &scratch[3].q) < g_space_ship_trigger_distance) { - queue_copy_record_by_index(0x2B); + actuator_play_pattern(0x2B); g_space_ship_boost_timer = (g_space_ship_state_default * 5 + 2) / 6; } } diff --git a/src/pal/levels/shared/L22_003A4910-cc-g8.c b/src/pal/levels/shared/L22_003A4910-cc-g8.c index dfa3ba61e..b71d572b6 100644 --- a/src/pal/levels/shared/L22_003A4910-cc-g8.c +++ b/src/pal/levels/shared/L22_003A4910-cc-g8.c @@ -190,7 +190,7 @@ extern void moby_update_ground_check(void *),func_002A0F48(void *); extern void cam_compute_view_direction(void *,void *,int), vec_negate_and_forward(void *,void *,int); extern int moby_apply_damage_to_object_pal(void *,void *,int); extern void moby_set_state(void *,int,int), cancel_hero_item_animation_pal(void), release_moby_animation_slot(void *,void *); -extern s32 hero_l22_set_action_pal(int,int); +extern s32 hero_l22_set_move_state_pal(int,int); /* Space ship setup and upkeep (PAL: 50 Hz tuning). Sets the record up on the first update (health scaled by difficulty, the object table scan, then the tuning block) and keeps the three child objects in step. The tuning @@ -330,7 +330,7 @@ void space_ship_init_and_update_pal(Obj_15D0 *obj) { } else if(g_space_ship_timer<30) { g_hero_state.field2294=0; cancel_hero_item_animation_pal(); release_moby_animation_slot(g_hero_state.field2290,&g_hero_state.field1870); - g_hero_state.field187C=0; hero_l22_set_action_pal(0,1); + g_hero_state.field187C=0; hero_l22_set_move_state_pal(0,1); } } else if(g_hero_state.health<=0 && obj->f95!=1) { vars->f350=0; vars->f3E4=vars->f3E8=0.0f; diff --git a/src/us2/levels/01_oozla/L01_002BA3C8-sw.c b/src/us2/levels/01_oozla/L01_002BA3C8-sw.c index 5550cca38..0f844bed4 100644 --- a/src/us2/levels/01_oozla/L01_002BA3C8-sw.c +++ b/src/us2/levels/01_oozla/L01_002BA3C8-sw.c @@ -133,7 +133,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -724,7 +724,7 @@ void hero_l01_update_state_machine_us2(void) { coll_process_hit(0.4f, (s32)((TI128*)vec_0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec_20)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_drive_settings)->f[0x180/4] = 0.1f; diff --git a/src/us2/levels/01_oozla/L01_002BEEA8-sw.c b/src/us2/levels/01_oozla/L01_002BEEA8-sw.c index e085c6852..ff68676f8 100644 --- a/src/us2/levels/01_oozla/L01_002BEEA8-sw.c +++ b/src/us2/levels/01_oozla/L01_002BEEA8-sw.c @@ -55,8 +55,8 @@ extern int hero_play_sound(int, int); extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -118,7 +118,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_set_move_state_us2(s32 action, s32 animate) { +s32 SetHeroMoveState_us2(s32 action, s32 animate) { u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 old_step; @@ -165,7 +165,9 @@ s32 hero_set_move_state_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -178,7 +180,7 @@ s32 hero_set_move_state_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_set_move_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { SetHeroMoveState_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_anim_id(0) == 0x51) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_anim_id(0), 0, -1.0f); @@ -229,7 +231,7 @@ s32 hero_set_move_state_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_set_move_state_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { SetHeroMoveState_us2(0x76, 1); return 0; } } WORD(0x2298) = 0; BYTE(0x40C) = 0; BYTE(0x40E) = 0; @@ -265,11 +267,11 @@ s32 hero_set_move_state_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_set_move_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { SetHeroMoveState_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_anim_id(0) == 0x51) { if (!animate) goto finish; - if (hero_set_move_state_us2(0, 0)) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); + if (SetHeroMoveState_us2(0, 0)) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -294,7 +296,7 @@ s32 hero_set_move_state_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_set_move_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { SetHeroMoveState_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -376,13 +378,13 @@ s32 hero_set_move_state_us2(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_set_move_state_us2(0x81, 1); return 0; + SetHeroMoveState_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_input_lock_alt) { hero_set_move_state_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_input_lock_alt) { SetHeroMoveState_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_set_move_state_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { SetHeroMoveState_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -459,7 +461,7 @@ s32 hero_set_move_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -485,7 +487,7 @@ s32 hero_set_move_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -494,7 +496,7 @@ s32 hero_set_move_state_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -626,7 +628,7 @@ s32 hero_set_move_state_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -696,7 +698,7 @@ s32 hero_set_move_state_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -708,7 +710,7 @@ s32 hero_set_move_state_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -742,7 +744,7 @@ s32 hero_set_move_state_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; SetHeroMoveState_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/01_oozla/L01_002C1D90-action-g8.c b/src/us2/levels/01_oozla/L01_002C1D90-action-g8.c index 4154e294a..446d342d8 100644 --- a/src/us2/levels/01_oozla/L01_002C1D90-action-g8.c +++ b/src/us2/levels/01_oozla/L01_002C1D90-action-g8.c @@ -98,7 +98,7 @@ extern ActionTableEntry g_action_table[]; extern unsigned int PadPressedWithin(unsigned int, int, int *); extern int moby_is_class_71(unsigned char *); extern void hero_setup_attached_object_transform(void); -extern int hero_set_move_state_us2(int, int); +extern int SetHeroMoveState_us2(int, int); extern int get_ammo(int); extern int snd_play_from_class_bank(int, int, char *, int); extern int PlayMobySound(int, int, char *); @@ -155,9 +155,9 @@ int hero_process_item_action_input_us2(void) hero_setup_attached_object_transform(); goto clear_pending; } - hero_set_move_state_us2(0x15, 1); + SetHeroMoveState_us2(0x15, 1); } else { - hero_set_move_state_us2(0x13, 1); + SetHeroMoveState_us2(0x13, 1); } } } else { @@ -174,9 +174,9 @@ int hero_process_item_action_input_us2(void) (g_hero_state.high_attack && g_hero_state.height > 0.57f) || (g_hero_state.action == 8 && g_hero_state.height > 0.57f)) { if (!g_hero_state.attack_block && !g_hero_state.pending_attack) - hero_set_move_state_us2(0x14, 1); + SetHeroMoveState_us2(0x14, 1); } else { - hero_set_move_state_us2(0x13, 1); + SetHeroMoveState_us2(0x13, 1); } goto clear_pending; } @@ -188,7 +188,7 @@ int hero_process_item_action_input_us2(void) if (g_hero_state.animation_lock) goto clear_pending; if ((float)*(int *)(timing + 0x10) <= g_hero_state.animation_frame && (g_pad_state.buttons.word.buffered & 8) && PadPressedWithin(mask, 15, 0)) { - hero_set_move_state_us2(0x15, 1); + SetHeroMoveState_us2(0x15, 1); goto complete; } } @@ -201,9 +201,9 @@ int hero_process_item_action_input_us2(void) window = window > 0 ? window : 1; if (PadPressedWithin(mask, window < 16 ? window : 15, 0)) { if (g_pad_state.buttons.word.buffered & 8) - hero_set_move_state_us2(0x15, 1); + SetHeroMoveState_us2(0x15, 1); else - hero_set_move_state_us2(0x13, 1); + SetHeroMoveState_us2(0x13, 1); goto clear_pending; } } @@ -222,7 +222,7 @@ int hero_process_item_action_input_us2(void) (g_hero_state.queued_action && g_hero_state.queued_action != 22 && g_hero_state.queued_action != 65)) break; if (!(g_pad_state.buttons.word.buffered & 0x20) || g_hero_state.action_age < 23) break; if (get_ammo(request)) { - hero_set_move_state_us2(0x83, 1); + SetHeroMoveState_us2(0x83, 1); goto complete; } if (g_pad_state.buttons.word.pressed & 0x20) @@ -271,7 +271,7 @@ int hero_process_item_action_input_us2(void) if (get_ammo(-1)) { if (g_hero_state.motion == 12 || g_hero_state.motion == 0 || g_hero_state.action == 3 || (g_hero_state.motion == 1 && g_hero_state.blend < 0.7f)) { - hero_set_move_state_us2(0x22, 1); + SetHeroMoveState_us2(0x22, 1); goto complete; } start_equipped_item_animation(); @@ -291,7 +291,7 @@ int hero_process_item_action_input_us2(void) wrench_window = 10; if (wrench_age < 10) wrench_window = wrench_age; if (PadPressedWithin(mask, wrench_window, &scratch.wrench_buffered) && g_hero_state.action_object) { - hero_set_move_state_us2(31, 1); + SetHeroMoveState_us2(31, 1); if (g_hero_state.action_object) PlayMobySound(0, 0, g_hero_state.action_object); } } @@ -308,7 +308,7 @@ int hero_process_item_action_input_us2(void) if (g_hero_action_timer && (g_hero_state.motion < 2 || g_hero_state.motion == 12 || ((g_hero_state.motion == 2 || g_hero_state.motion == 4) && g_hero_state.platformMode)) && (g_pad_state.buttons.both & 0x800000008UL) == 0x800000008UL) - hero_set_move_state_us2(0x7B, 1); + SetHeroMoveState_us2(0x7B, 1); if (g_pad_state.buttons.word.pressed & 8) g_hero_action_timer = 30; } } diff --git a/src/us2/levels/01_oozla/L01_002C3B08-sw.c b/src/us2/levels/01_oozla/L01_002C3B08-sw.c index afd474c50..772d7a18c 100644 --- a/src/us2/levels/01_oozla/L01_002C3B08-sw.c +++ b/src/us2/levels/01_oozla/L01_002C3B08-sw.c @@ -72,7 +72,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_refresh_speed_from_timer(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_set_move_state_us2(s32, s32); +s32 SetHeroMoveState_us2(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -146,7 +146,7 @@ void hero_l01_update_state_transitions_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_set_move_state_us2(0x39, 1); + SetHeroMoveState_us2(0x39, 1); goto end; } } @@ -175,7 +175,7 @@ void hero_l01_update_state_transitions_us2(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l01_speed_threshold_2) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_set_move_state_us2(0x74, 1); + SetHeroMoveState_us2(0x74, 1); goto end; } } @@ -185,12 +185,12 @@ void hero_l01_update_state_transitions_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_set_move_state_us2(1, 1); + SetHeroMoveState_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_set_move_state_us2(0x82, 1); + SetHeroMoveState_us2(0x82, 1); break; } { @@ -226,7 +226,7 @@ void hero_l01_update_state_transitions_us2(void) { rec = g_sound_l01_record_table + stack_40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_set_move_state_us2(0x3C, 1); + SetHeroMoveState_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -269,12 +269,12 @@ void hero_l01_update_state_transitions_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_set_move_state_us2(0x76, 1); + SetHeroMoveState_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); } break; } @@ -295,12 +295,12 @@ void hero_l01_update_state_transitions_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_input_lock_alt == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_set_move_state_us2(0x6E, 1); + SetHeroMoveState_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_set_move_state_us2(4, 1); + SetHeroMoveState_us2(4, 1); break; } } @@ -321,28 +321,28 @@ void hero_l01_update_state_transitions_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_set_move_state_us2(2, 1); + SetHeroMoveState_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_set_move_state_us2(1, 1); + SetHeroMoveState_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_set_move_state_us2(0x3D, 1); + SetHeroMoveState_us2(0x3D, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_set_move_state_us2(0x3D, 1); + SetHeroMoveState_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_set_move_state_us2(0, 1); + SetHeroMoveState_us2(0, 1); } break; case 0x3D: @@ -351,22 +351,22 @@ void hero_l01_update_state_transitions_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_set_move_state_us2(4, 1); + SetHeroMoveState_us2(4, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_set_move_state_us2(2, 1); + SetHeroMoveState_us2(2, 1); break; } - hero_set_move_state_us2(0, 1); + SetHeroMoveState_us2(0, 1); break; case 0x39: case 0x43: @@ -416,9 +416,9 @@ void hero_l01_update_state_transitions_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_set_move_state_us2(4, 1); + SetHeroMoveState_us2(4, 1); } else { - hero_set_move_state_us2(0, 0); + SetHeroMoveState_us2(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -430,9 +430,9 @@ void hero_l01_update_state_transitions_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_set_move_state_us2(0, 0); + SetHeroMoveState_us2(0, 0); } else { - hero_set_move_state_us2(0, 1); + SetHeroMoveState_us2(0, 1); } } break; @@ -465,7 +465,7 @@ void hero_l01_update_state_transitions_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_set_move_state_us2(7, 1); + SetHeroMoveState_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -474,7 +474,7 @@ void hero_l01_update_state_transitions_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_set_move_state_us2(0, 0); + SetHeroMoveState_us2(0, 0); } break; } @@ -496,7 +496,7 @@ void hero_l01_update_state_transitions_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_set_move_state_us2(7, 1); + SetHeroMoveState_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -509,7 +509,7 @@ void hero_l01_update_state_transitions_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_set_move_state_us2(2, 0); + SetHeroMoveState_us2(2, 0); set_hero_animation(3, g_hero_l01_animation_table[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -520,22 +520,22 @@ void hero_l01_update_state_transitions_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_set_move_state_us2(2, 1); + SetHeroMoveState_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_set_move_state_us2(0, 0); + SetHeroMoveState_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_move_state_us2(0, 0); + SetHeroMoveState_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_set_move_state_us2(0, 1); + SetHeroMoveState_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -552,7 +552,7 @@ void hero_l01_update_state_transitions_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_set_move_state_us2(7, 1); + SetHeroMoveState_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -561,7 +561,7 @@ void hero_l01_update_state_transitions_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_set_move_state_us2(0, 0); + SetHeroMoveState_us2(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, 15.0f); break; } @@ -573,7 +573,7 @@ void hero_l01_update_state_transitions_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_move_state_us2(0, 1); + SetHeroMoveState_us2(0, 1); } break; case 0x2: @@ -587,11 +587,11 @@ void hero_l01_update_state_transitions_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_set_move_state_us2(0x76, 1); + SetHeroMoveState_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); break; } n = 9; @@ -605,12 +605,12 @@ void hero_l01_update_state_transitions_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_set_move_state_us2(9, 1); + SetHeroMoveState_us2(9, 1); } else { - hero_set_move_state_us2(7, 1); + SetHeroMoveState_us2(7, 1); } } else { - hero_set_move_state_us2(7, 1); + SetHeroMoveState_us2(7, 1); } break; } @@ -618,11 +618,11 @@ void hero_l01_update_state_transitions_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_set_move_state_us2(1, 1); + SetHeroMoveState_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_set_move_state_us2(4, 1); + SetHeroMoveState_us2(4, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -633,7 +633,7 @@ void hero_l01_update_state_transitions_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_set_move_state_us2(0, 0) == 0) { + if (SetHeroMoveState_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -673,17 +673,17 @@ void hero_l01_update_state_transitions_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_set_move_state_us2(3, 0); + SetHeroMoveState_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_set_move_state_us2(0x77, 1); + SetHeroMoveState_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_set_move_state_us2(0x77, 1); + SetHeroMoveState_us2(0x77, 1); break; } } @@ -701,11 +701,11 @@ void hero_l01_update_state_transitions_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_set_move_state_us2(0x64, 1); + SetHeroMoveState_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_set_move_state_us2(0x63, 1); + SetHeroMoveState_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -713,22 +713,22 @@ void hero_l01_update_state_transitions_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_move_state_us2(0x62, 1); + SetHeroMoveState_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_set_move_state_us2(0, 1); + SetHeroMoveState_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_set_move_state_us2(0x62, 1); + SetHeroMoveState_us2(0x62, 1); } break; case 0x65: { s32 n = FLD(g_hero_state, s32, 0x18C0); if ((n < 3) && (((n * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40, 7, &stack_44) != 0)) { - hero_set_move_state_us2(0x66, 1); + SetHeroMoveState_us2(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -756,7 +756,7 @@ void hero_l01_update_state_transitions_us2(void) { s32 off = FLD(g_hero_state, s16, 0xBFC) * 0x2C; rec -= -off; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_set_move_state_us2(0, 1); + SetHeroMoveState_us2(0, 1); } break; } @@ -770,7 +770,7 @@ void hero_l01_update_state_transitions_us2(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_set_move_state_us2(0, 0) != 0) { + if (SetHeroMoveState_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 17.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -778,25 +778,25 @@ void hero_l01_update_state_transitions_us2(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_set_move_state_us2(1, 1); + SetHeroMoveState_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_set_move_state_us2(7, 1); + SetHeroMoveState_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_set_move_state_us2(4, 1); + SetHeroMoveState_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_move_state_us2(0, 1); + SetHeroMoveState_us2(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -804,45 +804,45 @@ void hero_l01_update_state_transitions_us2(void) { } if (hero_get_weapon_anim_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_set_move_state_us2(0, 0); + SetHeroMoveState_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_set_move_state_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (SetHeroMoveState_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_set_move_state_us2(2, 1); + SetHeroMoveState_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_set_move_state_us2(1, 1); + SetHeroMoveState_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_set_move_state_us2(0, 0); + SetHeroMoveState_us2(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_set_move_state_us2(0x76, 1); + SetHeroMoveState_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_set_move_state_us2(0x15, 1); + SetHeroMoveState_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); } } break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_set_move_state_us2(0x18, 0); + SetHeroMoveState_us2(0x18, 0); } break; case 0x18: @@ -851,18 +851,18 @@ void hero_l01_update_state_transitions_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_set_move_state_us2(0x1B, 1); + SetHeroMoveState_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -871,7 +871,7 @@ void hero_l01_update_state_transitions_us2(void) { vec_10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_set_move_state_us2(0x19, 1); + SetHeroMoveState_us2(0x19, 1); } break; } @@ -882,7 +882,7 @@ void hero_l01_update_state_transitions_us2(void) { vec_10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_set_move_state_us2(0x1A, 1); + SetHeroMoveState_us2(0x1A, 1); } } } @@ -901,18 +901,18 @@ void hero_l01_update_state_transitions_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_move_state_us2(0x18, 1); + SetHeroMoveState_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_set_move_state_us2(0x1B, 1); + SetHeroMoveState_us2(0x1B, 1); } break; } @@ -922,9 +922,9 @@ void hero_l01_update_state_transitions_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); } else { - hero_set_move_state_us2(0, 1); + SetHeroMoveState_us2(0, 1); } } break; @@ -948,12 +948,12 @@ void hero_l01_update_state_transitions_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_set_move_state_us2(0x39, 1); + SetHeroMoveState_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_set_move_state_us2(0, 0) != 0) { + if (SetHeroMoveState_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -961,7 +961,7 @@ void hero_l01_update_state_transitions_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_set_move_state_us2(0, 0) != 0) { + if (SetHeroMoveState_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -975,28 +975,28 @@ void hero_l01_update_state_transitions_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_set_move_state_us2(2, 1); + SetHeroMoveState_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_set_move_state_us2(3, 0) != 0) { + if (SetHeroMoveState_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_set_move_state_us2(0, 1); + SetHeroMoveState_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_set_move_state_us2(8, 1); + SetHeroMoveState_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_set_move_state_us2(0x17, 1); + SetHeroMoveState_us2(0x17, 1); break; } } @@ -1028,7 +1028,7 @@ void hero_l01_update_state_transitions_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_set_move_state_us2(0, 0) != 0) { + if (SetHeroMoveState_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1039,12 +1039,12 @@ void hero_l01_update_state_transitions_us2(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_set_move_state_us2(0x74, 1); + SetHeroMoveState_us2(0x74, 1); } else { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); } } else { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); } } break; @@ -1057,16 +1057,16 @@ void hero_l01_update_state_transitions_us2(void) { ok = 1; } if (ok != 0) { - hero_set_move_state_us2(0x11, 1); + SetHeroMoveState_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_set_move_state_us2(0x17, 1); + SetHeroMoveState_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1077,23 +1077,23 @@ void hero_l01_update_state_transitions_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_set_move_state_us2(3, 0) != 0) { + if (SetHeroMoveState_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_set_move_state_us2(4, 1); + SetHeroMoveState_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_param_table[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_set_move_state_us2(2, 1); + SetHeroMoveState_us2(2, 1); break; } - hero_set_move_state_us2(2, 0); + SetHeroMoveState_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1102,21 +1102,21 @@ void hero_l01_update_state_transitions_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_param_table[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_set_move_state_us2(2, 1); + SetHeroMoveState_us2(2, 1); break; } - hero_set_move_state_us2(2, 0); + SetHeroMoveState_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l01_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_set_move_state_us2(0, 0) != 0) { + if (SetHeroMoveState_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_set_move_state_us2(0, 0) != 0) { + } else if (SetHeroMoveState_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1162,14 +1162,14 @@ void hero_l01_update_state_transitions_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_set_move_state_us2(0xB, 1); + SetHeroMoveState_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_set_move_state_us2(0x82, 1); + SetHeroMoveState_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1178,21 +1178,21 @@ void hero_l01_update_state_transitions_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_set_move_state_us2(0xA, 1); + SetHeroMoveState_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_set_move_state_us2(0x10, 1); + SetHeroMoveState_us2(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_set_move_state_us2(0x77, 1); + SetHeroMoveState_us2(0x77, 1); break; } } @@ -1296,7 +1296,7 @@ void hero_l01_update_state_transitions_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_set_move_state_us2(3, 0) != 0) { + if (SetHeroMoveState_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1304,13 +1304,13 @@ void hero_l01_update_state_transitions_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_param_table[0][2])) { - hero_set_move_state_us2(7, 1); + SetHeroMoveState_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_set_move_state_us2(7, 1); + SetHeroMoveState_us2(7, 1); } else if (g_hero_speed_param_table[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_set_move_state_us2(9, 1); + SetHeroMoveState_us2(9, 1); } else { - hero_set_move_state_us2(7, 1); + SetHeroMoveState_us2(7, 1); } break; } @@ -1318,10 +1318,10 @@ void hero_l01_update_state_transitions_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_action(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); break; } { @@ -1331,7 +1331,7 @@ void hero_l01_update_state_transitions_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &stack_6c) != 0) && (stack_6c < FLD(g_hero_state, s32, 0x1B8))) { - hero_set_move_state_us2(0x11, 1); + SetHeroMoveState_us2(0x11, 1); break; } } @@ -1360,7 +1360,7 @@ void hero_l01_update_state_transitions_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_set_move_state_us2(0xE, 1); + SetHeroMoveState_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1370,28 +1370,28 @@ void hero_l01_update_state_transitions_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_set_move_state_us2(8, 1); + SetHeroMoveState_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_set_move_state_us2(0x17, 1); + SetHeroMoveState_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_set_move_state_us2(6, 1); + SetHeroMoveState_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_set_move_state_us2(0x39, 1); + SetHeroMoveState_us2(0x39, 1); } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_set_move_state_us2(0x82, 1); + SetHeroMoveState_us2(0x82, 1); } else { - hero_set_move_state_us2(0, 0); + SetHeroMoveState_us2(0, 0); } } break; @@ -1401,8 +1401,8 @@ void hero_l01_update_state_transitions_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_set_move_state_us2(0x39, 1); - } else if (hero_set_move_state_us2(0, 0) != 0) { + SetHeroMoveState_us2(0x39, 1); + } else if (SetHeroMoveState_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 13.0f); } } @@ -1423,7 +1423,7 @@ void hero_l01_update_state_transitions_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_set_move_state_us2(0, 0); + SetHeroMoveState_us2(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1434,7 +1434,7 @@ void hero_l01_update_state_transitions_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_set_move_state_us2(0, 0); + SetHeroMoveState_us2(0, 0); } break; case 0x22: @@ -1444,12 +1444,12 @@ void hero_l01_update_state_transitions_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_set_move_state_us2(7, 1); + SetHeroMoveState_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_set_move_state_us2(0, 0); + SetHeroMoveState_us2(0, 0); } break; default: diff --git a/src/us2/levels/01_oozla/L01_003C1CA8.c b/src/us2/levels/01_oozla/L01_003C1CA8.c index 882311793..ee6e557a3 100644 --- a/src/us2/levels/01_oozla/L01_003C1CA8.c +++ b/src/us2/levels/01_oozla/L01_003C1CA8.c @@ -3,7 +3,7 @@ #include "common.h" extern char g_hero_state[]; -extern int hero_set_move_state_us2(int, int); +extern int SetHeroMoveState_us2(int, int); extern void set_hero_animation(int, int, float); extern void moby_transform_joint_to_world(void *, int, void *); extern void FastVecSub(void *, void *, void *), vec_clamp_length(void *, float); @@ -24,7 +24,7 @@ void swamp_monster_hold_hero_us2(char *object) if (*(int *)(hero + 0x2294) != 0x6F) { saved_flag = *(unsigned char *)(hero + 0x22B5) != 0; *(int *)(object + 0x98) = 0; - hero_set_move_state_us2(0x6F, 1); + SetHeroMoveState_us2(0x6F, 1); set_hero_animation(10, 0, 10.0f); *(unsigned char *)(hero + 0x22B5) = saved_flag; } diff --git a/src/us2/levels/01_oozla/L01_003C1DB8-g8.c b/src/us2/levels/01_oozla/L01_003C1DB8-g8.c index f2bf64967..9af50b891 100644 --- a/src/us2/levels/01_oozla/L01_003C1DB8-g8.c +++ b/src/us2/levels/01_oozla/L01_003C1DB8-g8.c @@ -68,7 +68,7 @@ extern void * cam_alloc_override_slot(s32 size); extern void cam_end_override(char *); extern void load_scene_chunk(int, int); extern f32 weapon_compute_shot_launch_speed(f32 *a, f32 *b, f32 *out, f32 d, f32 e); -extern s32 hero_set_move_state_us2(s32 action, s32 animate); +extern s32 SetHeroMoveState_us2(s32 action, s32 animate); extern int moby_start_effect_from_entry(void *, float); extern void script_queue_keyed_request(int, int); extern float level_get_water_height(void); @@ -603,7 +603,7 @@ void swamp_monster_update_us2(u8 *moby) { } if (((UView *)(ptr_val_s4))->b[0x2F4] != 0) { if (float_val_23 > 33.0f) { - hero_set_move_state_us2(0x16, 1); + SetHeroMoveState_us2(0x16, 1); ((Hero *)g_hero_state)->i[0x2294 / 4] = 0x6F; ((Hero *)g_hero_state)->i[0x24A0 / 4] = 0; ((Hero *)g_hero_state)->i[0x229C / 4] = 9; @@ -627,7 +627,7 @@ void swamp_monster_update_us2(u8 *moby) { ((UView *)(moby))->i[0x27] = (s32) (((UView *)(moby))->i[0x27] & ~0x30); *(s32 *)(moby + 0x98) = (s32) *(s32 *)(((u8 *)((UView *)(moby))->p[0x9]) + 0x10); if (g_game_mode == 0x6F) { - hero_set_move_state_us2(0x16, 1); + SetHeroMoveState_us2(0x16, 1); } } if (((UView *)(moby))->b[0x60] & 2) { @@ -636,7 +636,7 @@ void swamp_monster_update_us2(u8 *moby) { moby_set_animation_and_speed(moby, 0xC, 0, 0x14); moby_set_state(moby, 0, 5); if (g_game_mode == 0x6F) { - hero_set_move_state_us2(0x16, 1); + SetHeroMoveState_us2(0x16, 1); } } } else { @@ -676,7 +676,7 @@ void swamp_monster_update_us2(u8 *moby) { ptr_val_v0_5 = SpawnGoldBolt(ptr_val_s1, 1, -1, -1); ((u8 *)((UView *)(ptr_val_s4))->p[0xC0]) = ptr_val_v0_5; if (ptr_val_v0_5 != NULL) { - hero_set_move_state_us2(0x6F, 1); + SetHeroMoveState_us2(0x6F, 1); ptr_val_s0_2 = ptr_val_s4 + 0x2A0; ptr_val_v0_6 = ((u8 *)((UView *)(ptr_val_s4))->p[0xC0]); *(f32 *)(ptr_val_v0_6 + 0x18) = (f32) (*(f32 *)(ptr_val_v0_6 + 0x18) - 0.5f); diff --git a/src/us2/levels/03_endako/L03_002B8910.c b/src/us2/levels/03_endako/L03_002B8910.c index 77792e498..8831dc797 100644 --- a/src/us2/levels/03_endako/L03_002B8910.c +++ b/src/us2/levels/03_endako/L03_002B8910.c @@ -62,7 +62,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l03_enter_state_us2(s32, s32); +extern s32 hero_l03_set_move_state_us2(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_us2(s32); extern int hero_play_sound(s32, s32); @@ -138,7 +138,7 @@ s32 hero_l03_apply_contact_push_us2(s32 apply_push) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB || *(s16 *)(other + 0xAA) == 0x558)) { - hero_l03_enter_state_us2(0x7D, 1); + hero_l03_set_move_state_us2(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -149,7 +149,7 @@ s32 hero_l03_apply_contact_push_us2(s32 apply_push) { AdjustPlayerHealth_us2(FloatToInt(*(float *)(effect + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l03_enter_state_us2(0x16, 1); + hero_l03_set_move_state_us2(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -159,9 +159,9 @@ s32 hero_l03_apply_contact_push_us2(s32 apply_push) { return 0; } if (entry->f24 & 8) { - hero_l03_enter_state_us2(0x8C, 1); + hero_l03_set_move_state_us2(0x8C, 1); } else { - hero_l03_enter_state_us2(0x16, 1); + hero_l03_set_move_state_us2(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&push_vec); @@ -173,7 +173,7 @@ s32 hero_l03_apply_contact_push_us2(s32 apply_push) { } break; case 1: - hero_l03_enter_state_us2(0x42, 1); + hero_l03_set_move_state_us2(0x42, 1); hero_flatten_push_vector(&push_vec, flag, 0.083333336f, 0.050000004f); break; } diff --git a/src/us2/levels/03_endako/L03_002BFAF8-sw.c b/src/us2/levels/03_endako/L03_002BFAF8-sw.c index a252aa9b8..844c1b7d3 100644 --- a/src/us2/levels/03_endako/L03_002BFAF8-sw.c +++ b/src/us2/levels/03_endako/L03_002BFAF8-sw.c @@ -141,7 +141,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -979,7 +979,7 @@ void hero_l03_update_state_machine_us2(void) { coll_process_hit(0.4f, (s32)((TI128*)vec0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l03_state_alias)->f[0x180/4] = 0.1f; diff --git a/src/us2/levels/03_endako/L03_002BFAF8-sw2.c b/src/us2/levels/03_endako/L03_002BFAF8-sw2.c index f2afae8fc..d2d93ed70 100644 --- a/src/us2/levels/03_endako/L03_002BFAF8-sw2.c +++ b/src/us2/levels/03_endako/L03_002BFAF8-sw2.c @@ -60,8 +60,8 @@ extern int hero_play_sound(int, int); extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -128,7 +128,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l03_enter_state_us2(s32 action, s32 animate) { +s32 hero_l03_set_move_state_us2(s32 action, s32 animate) { f32 dir[4]; u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -176,7 +176,9 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -189,7 +191,7 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_gadget_value(0) == 0x51) set_hero_animation(hero_get_gadget_value(0), 0, 18.0f); else set_hero_animation(hero_get_gadget_value(0), 0, -1.0f); @@ -240,7 +242,7 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l03_enter_state_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l03_set_move_state_us2(0x76, 1); return 0; } } WORD(0x2298) = 0; BYTE(0x40C) = 0; BYTE(0x40E) = 0; @@ -270,11 +272,11 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_gadget_value(0) == 0x51) { if (!animate) goto finish; - if (hero_l03_enter_state_us2(0, 0)) set_hero_animation(hero_get_gadget_value(0), 0, 18.0f); + if (hero_l03_set_move_state_us2(0, 0)) set_hero_animation(hero_get_gadget_value(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -299,7 +301,7 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -464,13 +466,13 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l03_enter_state_us2(0x81, 1); return 0; + hero_l03_set_move_state_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l03_lock_flag) { hero_l03_enter_state_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l03_lock_flag) { hero_l03_set_move_state_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l03_enter_state_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l03_set_move_state_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -529,9 +531,9 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_special_flag) hero_l03_enter_state_us2(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l03_enter_state_us2(0x79, 1); - else hero_l03_enter_state_us2(0x39, 1); + if (g_current_map_index == 2 && g_hero_special_flag) hero_l03_set_move_state_us2(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l03_set_move_state_us2(0x79, 1); + else hero_l03_set_move_state_us2(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -576,7 +578,7 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -605,7 +607,7 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -614,7 +616,7 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -754,7 +756,7 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -830,7 +832,7 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -842,7 +844,7 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -865,7 +867,7 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { set_hero_animation(0x11, 0, 8.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state_us2(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state_us2(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation(0, 0, 9.0f); goto finish; case 0x4B: @@ -899,7 +901,7 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l03_float_sequences[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_enter_state_us2(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l03_set_move_state_us2(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -943,7 +945,7 @@ s32 hero_l03_enter_state_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l03_enter_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l03_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/03_endako/L03_002BFAF8-sw3.c b/src/us2/levels/03_endako/L03_002BFAF8-sw3.c index 5af821cb5..7722fbf89 100644 --- a/src/us2/levels/03_endako/L03_002BFAF8-sw3.c +++ b/src/us2/levels/03_endako/L03_002BFAF8-sw3.c @@ -76,7 +76,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_refresh_speed_from_timer(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l03_enter_state_us2(s32, s32); +s32 hero_l03_set_move_state_us2(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -154,7 +154,7 @@ void hero_l03_decide_state_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l03_enter_state_us2(0x39, 1); + hero_l03_set_move_state_us2(0x39, 1); goto end; } } @@ -189,7 +189,7 @@ void hero_l03_decide_state_us2(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l03_decide_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l03_enter_state_us2(0x74, 1); + hero_l03_set_move_state_us2(0x74, 1); goto end; } } @@ -199,16 +199,16 @@ void hero_l03_decide_state_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state_us2(1, 1); + hero_l03_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l03_enter_state_us2(0x82, 1); + hero_l03_set_move_state_us2(0x82, 1); break; } if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l03_enter_state_us2(0x82, 1); + hero_l03_set_move_state_us2(0x82, 1); break; } { @@ -244,7 +244,7 @@ void hero_l03_decide_state_us2(void) { rec = g_hero_decide_records + selected_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l03_enter_state_us2(0x3C, 1); + hero_l03_set_move_state_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -287,12 +287,12 @@ void hero_l03_decide_state_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l03_enter_state_us2(0x76, 1); + hero_l03_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); } break; } @@ -313,17 +313,17 @@ void hero_l03_decide_state_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l03_lock_flag == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l03_enter_state_us2(0x6E, 1); + hero_l03_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l03_enter_state_us2(4, 1); + hero_l03_set_move_state_us2(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state_us2(0x27, 1); + hero_l03_set_move_state_us2(0x27, 1); break; } { @@ -343,28 +343,28 @@ void hero_l03_decide_state_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l03_enter_state_us2(2, 1); + hero_l03_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state_us2(1, 1); + hero_l03_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_buttons = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_buttons & 8)) { - hero_l03_enter_state_us2(0x3D, 1); + hero_l03_set_move_state_us2(0x3D, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l03_enter_state_us2(0x3D, 1); + hero_l03_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l03_enter_state_us2(0, 1); + hero_l03_set_move_state_us2(0, 1); } break; case 0x3D: @@ -373,22 +373,22 @@ void hero_l03_decide_state_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state_us2(4, 1); + hero_l03_set_move_state_us2(4, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l03_enter_state_us2(2, 1); + hero_l03_set_move_state_us2(2, 1); break; } - hero_l03_enter_state_us2(0, 1); + hero_l03_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -438,9 +438,9 @@ void hero_l03_decide_state_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state_us2(4, 1); + hero_l03_set_move_state_us2(4, 1); } else { - hero_l03_enter_state_us2(0, 0); + hero_l03_set_move_state_us2(0, 0); anim = hero_get_gadget_value(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -452,9 +452,9 @@ void hero_l03_decide_state_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l03_enter_state_us2(0, 0); + hero_l03_set_move_state_us2(0, 0); } else { - hero_l03_enter_state_us2(0, 1); + hero_l03_set_move_state_us2(0, 1); } } break; @@ -487,7 +487,7 @@ void hero_l03_decide_state_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state_us2(7, 1); + hero_l03_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -496,7 +496,7 @@ void hero_l03_decide_state_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l03_enter_state_us2(0, 0); + hero_l03_set_move_state_us2(0, 0); } break; } @@ -518,7 +518,7 @@ void hero_l03_decide_state_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state_us2(7, 1); + hero_l03_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -531,7 +531,7 @@ void hero_l03_decide_state_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l03_enter_state_us2(2, 0); + hero_l03_set_move_state_us2(2, 0); set_hero_animation(3, g_hero_l03_animation_table[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -542,22 +542,22 @@ void hero_l03_decide_state_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l03_enter_state_us2(2, 1); + hero_l03_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l03_enter_state_us2(0, 0); + hero_l03_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_us2(0, 0); + hero_l03_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l03_enter_state_us2(0, 1); + hero_l03_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -574,7 +574,7 @@ void hero_l03_decide_state_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state_us2(7, 1); + hero_l03_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -583,7 +583,7 @@ void hero_l03_decide_state_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l03_enter_state_us2(0, 0); + hero_l03_set_move_state_us2(0, 0); set_hero_animation(hero_get_gadget_value(0), 0, 15.0f); break; } @@ -595,7 +595,7 @@ void hero_l03_decide_state_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_us2(0, 1); + hero_l03_set_move_state_us2(0, 1); } break; case 0x2: @@ -609,11 +609,11 @@ void hero_l03_decide_state_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l03_enter_state_us2(0x76, 1); + hero_l03_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); break; } n = 9; @@ -627,12 +627,12 @@ void hero_l03_decide_state_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l03_enter_state_us2(9, 1); + hero_l03_set_move_state_us2(9, 1); } else { - hero_l03_enter_state_us2(7, 1); + hero_l03_set_move_state_us2(7, 1); } } else { - hero_l03_enter_state_us2(7, 1); + hero_l03_set_move_state_us2(7, 1); } break; } @@ -640,15 +640,15 @@ void hero_l03_decide_state_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state_us2(1, 1); + hero_l03_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state_us2(4, 1); + hero_l03_set_move_state_us2(4, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state_us2(0x27, 1); + hero_l03_set_move_state_us2(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -659,7 +659,7 @@ void hero_l03_decide_state_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l03_enter_state_us2(0, 0) == 0) { + if (hero_l03_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -699,17 +699,17 @@ void hero_l03_decide_state_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l03_enter_state_us2(3, 0); + hero_l03_set_move_state_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l03_enter_state_us2(0x77, 1); + hero_l03_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l03_enter_state_us2(0x77, 1); + hero_l03_set_move_state_us2(0x77, 1); break; } } @@ -727,11 +727,11 @@ void hero_l03_decide_state_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l03_enter_state_us2(0x64, 1); + hero_l03_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l03_enter_state_us2(0x63, 1); + hero_l03_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -739,15 +739,15 @@ void hero_l03_decide_state_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_us2(0x62, 1); + hero_l03_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l03_enter_state_us2(0, 1); + hero_l03_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l03_enter_state_us2(0x62, 1); + hero_l03_set_move_state_us2(0x62, 1); } break; case 0x79: /* switch 2 */ @@ -772,29 +772,29 @@ void hero_l03_decide_state_us2(void) { return; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state_us2(1, 1); + hero_l03_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l03_enter_state_us2(7, 1); + hero_l03_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state_us2(4, 1); + hero_l03_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_us2(0, 1); + hero_l03_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state_us2(0x27, 1); + hero_l03_set_move_state_us2(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -802,45 +802,45 @@ void hero_l03_decide_state_us2(void) { } if (hero_get_gadget_value(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l03_enter_state_us2(0, 0); + hero_l03_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l03_enter_state_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l03_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_gadget_value(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l03_enter_state_us2(2, 1); + hero_l03_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state_us2(1, 1); + hero_l03_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state_us2(0, 0); + hero_l03_set_move_state_us2(0, 0); set_hero_animation(hero_get_gadget_value(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l03_enter_state_us2(0x76, 1); + hero_l03_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l03_enter_state_us2(0x15, 1); + hero_l03_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l03_enter_state_us2(0, 1); + hero_l03_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -848,17 +848,17 @@ void hero_l03_decide_state_us2(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l03_enter_state_us2(0x8B, 1); + hero_l03_set_move_state_us2(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l03_enter_state_us2(0, 1); + hero_l03_set_move_state_us2(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l03_enter_state_us2(0, 1); + hero_l03_set_move_state_us2(0, 1); } break; case 0x24: @@ -884,14 +884,14 @@ void hero_l03_decide_state_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l03_enter_state_us2(0, 0); + hero_l03_set_move_state_us2(0, 0); set_hero_animation(hero_get_gadget_value(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l03_enter_state_us2(6, 0); + hero_l03_set_move_state_us2(6, 0); } else { - hero_l03_enter_state_us2(6, 0); + hero_l03_set_move_state_us2(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -907,9 +907,9 @@ void hero_l03_decide_state_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l03_enter_state_us2(0, 1); + hero_l03_set_move_state_us2(0, 1); } else { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -921,7 +921,7 @@ void hero_l03_decide_state_us2(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l03_enter_state_us2(0x2C, 1); + hero_l03_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -985,11 +985,11 @@ void hero_l03_decide_state_us2(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.21666668f); FLD(g_hero_state, f32, 0x128) = 0.16666667f; - hero_l03_enter_state_us2(0x16, 1); + hero_l03_set_move_state_us2(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x46; FLD(g_hero_state, s16, 0x1D0) = 0x46; } else { - hero_l03_enter_state_us2(0x3E, 1); + hero_l03_set_move_state_us2(0x3E, 1); } break; } @@ -1002,7 +1002,7 @@ void hero_l03_decide_state_us2(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l03_enter_state_us2(0x28, 1); + hero_l03_set_move_state_us2(0x28, 1); } break; } @@ -1013,16 +1013,16 @@ void hero_l03_decide_state_us2(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x46; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l03_enter_state_us2(0x74, 1); + hero_l03_set_move_state_us2(0x74, 1); } else { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { - hero_l03_enter_state_us2(0x2A, 1); + hero_l03_set_move_state_us2(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1039,7 +1039,7 @@ void hero_l03_decide_state_us2(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l03_enter_state_us2(0x28, 1); + hero_l03_set_move_state_us2(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)point_b = 0; @@ -1056,7 +1056,7 @@ void hero_l03_decide_state_us2(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 5, NULL) != 0) && ((f32)g_hero_state_params[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l03_enter_state_us2(0x28, 1); + hero_l03_set_move_state_us2(0x28, 1); break; } top = 0xE; @@ -1065,19 +1065,19 @@ void hero_l03_decide_state_us2(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l03_enter_state_us2(0x2A, 1); + hero_l03_set_move_state_us2(0x2A, 1); } break; } if ((f32)g_hero_state_params[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l03_enter_state_us2(0x27, 1); + hero_l03_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x6C8) >= 6)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l03_enter_state_us2(0x74, 1); + hero_l03_set_move_state_us2(0x74, 1); } else { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1086,11 +1086,11 @@ void hero_l03_decide_state_us2(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l03_enter_state_us2(0x27, 1); + hero_l03_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) && (g_current_map_index == 0x14)) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0xA) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1126,7 +1126,7 @@ void hero_l03_decide_state_us2(void) { find_nearest_path_point(new_path, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), new_path_count, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l03_enter_state_us2(0x29, 1); + hero_l03_set_move_state_us2(0x29, 1); break; } } @@ -1174,7 +1174,7 @@ void hero_l03_decide_state_us2(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x46; FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1182,7 +1182,7 @@ void hero_l03_decide_state_us2(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l03_enter_state_us2(0x71, 1); + hero_l03_set_move_state_us2(0x71, 1); break; } { @@ -1194,7 +1194,7 @@ void hero_l03_decide_state_us2(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l03_enter_state_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l03_set_move_state_us2(0, 0) != 0)) { set_hero_animation(0xC, 4, 6.0f); } } else if (st == 0x3E) { @@ -1203,24 +1203,24 @@ void hero_l03_decide_state_us2(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)dust_kind_b, 0.5f, -1.0f); } if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s32, 0x340) != 0)) { - if (hero_l03_enter_state_us2(0, 0) != 0) { + if (hero_l03_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_us2(0x27, 1); + hero_l03_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x10) && (FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l03_enter_state_us2(0x27, 1); + hero_l03_set_move_state_us2(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l03_enter_state_us2(0x18, 0); + hero_l03_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -1229,18 +1229,18 @@ void hero_l03_decide_state_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l03_enter_state_us2(0x1B, 1); + hero_l03_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1249,7 +1249,7 @@ void hero_l03_decide_state_us2(void) { point_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; point_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l03_enter_state_us2(0x19, 1); + hero_l03_set_move_state_us2(0x19, 1); } break; } @@ -1260,7 +1260,7 @@ void hero_l03_decide_state_us2(void) { point_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; point_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l03_enter_state_us2(0x1A, 1); + hero_l03_set_move_state_us2(0x1A, 1); } } } @@ -1279,18 +1279,18 @@ void hero_l03_decide_state_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_us2(0x18, 1); + hero_l03_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l03_enter_state_us2(0x1B, 1); + hero_l03_set_move_state_us2(0x1B, 1); } break; } @@ -1300,9 +1300,9 @@ void hero_l03_decide_state_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); } else { - hero_l03_enter_state_us2(0, 1); + hero_l03_set_move_state_us2(0, 1); } } break; @@ -1326,12 +1326,12 @@ void hero_l03_decide_state_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l03_enter_state_us2(0x39, 1); + hero_l03_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l03_enter_state_us2(0, 0) != 0) { + if (hero_l03_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1339,7 +1339,7 @@ void hero_l03_decide_state_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l03_enter_state_us2(0, 0) != 0) { + if (hero_l03_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1353,32 +1353,32 @@ void hero_l03_decide_state_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l03_enter_state_us2(2, 1); + hero_l03_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l03_enter_state_us2(3, 0) != 0) { + if (hero_l03_set_move_state_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l03_enter_state_us2(0, 1); + hero_l03_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l03_enter_state_us2(8, 1); + hero_l03_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state_us2(0x17, 1); + hero_l03_set_move_state_us2(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state_us2(0x27, 1); + hero_l03_set_move_state_us2(0x27, 1); break; } } @@ -1410,7 +1410,7 @@ void hero_l03_decide_state_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == MOBY_CLASS_LEVITATOR_PAD)) { - if (hero_l03_enter_state_us2(0, 0) != 0) { + if (hero_l03_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1420,9 +1420,9 @@ void hero_l03_decide_state_us2(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l03_enter_state_us2(0x74, 1); + hero_l03_set_move_state_us2(0x74, 1); } else { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); } } break; @@ -1435,16 +1435,16 @@ void hero_l03_decide_state_us2(void) { ok = 1; } if (ok != 0) { - hero_l03_enter_state_us2(0x11, 1); + hero_l03_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state_us2(0x17, 1); + hero_l03_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1455,23 +1455,23 @@ void hero_l03_decide_state_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l03_enter_state_us2(3, 0) != 0) { + if (hero_l03_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l03_enter_state_us2(4, 1); + hero_l03_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_l03_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l03_enter_state_us2(2, 1); + hero_l03_set_move_state_us2(2, 1); break; } - hero_l03_enter_state_us2(2, 0); + hero_l03_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1480,21 +1480,21 @@ void hero_l03_decide_state_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_l03_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l03_enter_state_us2(2, 1); + hero_l03_set_move_state_us2(2, 1); break; } - hero_l03_enter_state_us2(2, 0); + hero_l03_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l03_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l03_enter_state_us2(0, 0) != 0) { + if (hero_l03_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_gadget_value(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l03_enter_state_us2(0, 0) != 0) { + } else if (hero_l03_set_move_state_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1541,14 +1541,14 @@ void hero_l03_decide_state_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state_us2(0xB, 1); + hero_l03_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l03_enter_state_us2(0x82, 1); + hero_l03_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1557,25 +1557,25 @@ void hero_l03_decide_state_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l03_enter_state_us2(0xA, 1); + hero_l03_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l03_enter_state_us2(0x10, 1); + hero_l03_set_move_state_us2(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l03_enter_state_us2(0x27, 1); + hero_l03_set_move_state_us2(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l03_enter_state_us2(0x77, 1); + hero_l03_set_move_state_us2(0x77, 1); break; } } @@ -1679,7 +1679,7 @@ void hero_l03_decide_state_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l03_enter_state_us2(3, 0) != 0) { + if (hero_l03_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1687,13 +1687,13 @@ void hero_l03_decide_state_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l03_speed_params[0][2])) { - hero_l03_enter_state_us2(7, 1); + hero_l03_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l03_enter_state_us2(7, 1); + hero_l03_set_move_state_us2(7, 1); } else if (g_hero_l03_speed_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l03_enter_state_us2(9, 1); + hero_l03_set_move_state_us2(9, 1); } else { - hero_l03_enter_state_us2(7, 1); + hero_l03_set_move_state_us2(7, 1); } break; } @@ -1701,10 +1701,10 @@ void hero_l03_decide_state_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_action(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); break; } { @@ -1714,7 +1714,7 @@ void hero_l03_decide_state_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &unused_slot6_c) != 0) && (unused_slot6_c < FLD(g_hero_state, s32, 0x1B8))) { - hero_l03_enter_state_us2(0x11, 1); + hero_l03_set_move_state_us2(0x11, 1); break; } } @@ -1743,7 +1743,7 @@ void hero_l03_decide_state_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l03_enter_state_us2(0xE, 1); + hero_l03_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1753,32 +1753,32 @@ void hero_l03_decide_state_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l03_enter_state_us2(8, 1); + hero_l03_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l03_enter_state_us2(0x17, 1); + hero_l03_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l03_enter_state_us2(6, 1); + hero_l03_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l03_enter_state_us2(0x79, 1); + hero_l03_set_move_state_us2(0x79, 1); } else { - hero_l03_enter_state_us2(0x39, 1); + hero_l03_set_move_state_us2(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l03_enter_state_us2(0x82, 1); + hero_l03_set_move_state_us2(0x82, 1); } else { - hero_l03_enter_state_us2(0, 0); + hero_l03_set_move_state_us2(0, 0); } } break; @@ -1788,8 +1788,8 @@ void hero_l03_decide_state_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l03_enter_state_us2(0x39, 1); - } else if (hero_l03_enter_state_us2(0, 0) != 0) { + hero_l03_set_move_state_us2(0x39, 1); + } else if (hero_l03_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_gadget_value(0), 0, 13.0f); } } @@ -1814,28 +1814,28 @@ void hero_l03_decide_state_us2(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l03_enter_state_us2(0x4E, 1); + hero_l03_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l03_enter_state_us2(1, 1); + hero_l03_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l03_enter_state_us2(0x41, 1); + hero_l03_set_move_state_us2(0x41, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l03_enter_state_us2(0x45, 1); + hero_l03_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l03_enter_state_us2(0x4D, 1); + hero_l03_set_move_state_us2(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l03_enter_state_us2(0x40, 1); + hero_l03_set_move_state_us2(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -1848,14 +1848,14 @@ void hero_l03_decide_state_us2(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l03_enter_state_us2(0x4E, 1); + hero_l03_set_move_state_us2(0x4E, 1); break; } rec = (u8 *)&g_hero_state_params[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l03_enter_state_us2(0x3F, 0); + hero_l03_set_move_state_us2(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -1864,13 +1864,13 @@ void hero_l03_decide_state_us2(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0x10) ? n : 0xF, NULL) != 0) { - hero_l03_enter_state_us2(0x4D, 1); + hero_l03_set_move_state_us2(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l03_enter_state_us2(0x45, 1); + hero_l03_set_move_state_us2(0x45, 1); } break; } @@ -1933,42 +1933,42 @@ void hero_l03_decide_state_us2(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l03_enter_state_us2(0x45, 1); + hero_l03_set_move_state_us2(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l03_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l03_enter_state_us2(0x40, 1); + hero_l03_set_move_state_us2(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l03_enter_state_us2(0x3F, 1); + hero_l03_set_move_state_us2(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l03_enter_state_us2(0x41, 1); + hero_l03_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 5, NULL) != 0)) { - hero_l03_enter_state_us2(0x4D, 1); + hero_l03_set_move_state_us2(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state_us2(0x46, 1); + hero_l03_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l03_enter_state_us2(0x4B, 1); + hero_l03_set_move_state_us2(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l03_enter_state_us2(0x41, 1); + hero_l03_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state_us2(0x46, 1); + hero_l03_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -1978,11 +1978,11 @@ void hero_l03_decide_state_us2(void) { FLD(g_hero_state, s16, 0x1EE) = 0xC - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l03_enter_state_us2(0x40, 1); + hero_l03_set_move_state_us2(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l03_enter_state_us2(0x3F, 1); + hero_l03_set_move_state_us2(0x3F, 1); } break; case 0x41: @@ -1994,29 +1994,29 @@ void hero_l03_decide_state_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l03_enter_state_us2(0x43, 1); + hero_l03_set_move_state_us2(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l03_enter_state_us2(0x40, 1); + hero_l03_set_move_state_us2(0x40, 1); } else { - hero_l03_enter_state_us2(0x3F, 1); + hero_l03_set_move_state_us2(0x3F, 1); } } else { - hero_l03_enter_state_us2(0x3F, 1); + hero_l03_set_move_state_us2(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l03_enter_state_us2(0x46, 1); + hero_l03_set_move_state_us2(0x46, 1); break; } if ((PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l03_enter_state_us2(0x4B, 1); + hero_l03_set_move_state_us2(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l03_enter_state_us2(0x3F, 1); + hero_l03_set_move_state_us2(0x3F, 1); } break; case 0x4E: @@ -2025,9 +2025,9 @@ void hero_l03_decide_state_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l03_enter_state_us2(0x41, 1); + hero_l03_set_move_state_us2(0x41, 1); } else { - hero_l03_enter_state_us2(0x3F, 1); + hero_l03_set_move_state_us2(0x3F, 1); } } break; @@ -2037,7 +2037,7 @@ void hero_l03_decide_state_us2(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l03_enter_state_us2(0x4E, 1); + hero_l03_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.025000002f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2063,55 +2063,55 @@ void hero_l03_decide_state_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l03_enter_state_us2(0x45, 1); + hero_l03_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l03_enter_state_us2(0x4D, 1); + hero_l03_set_move_state_us2(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l03_enter_state_us2(0x41, 1); + hero_l03_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l03_enter_state_us2(0x3F, 1); + hero_l03_set_move_state_us2(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l03_enter_state_us2(0x41, 1); + hero_l03_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x24) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l03_enter_state_us2(0x43, 1); + hero_l03_set_move_state_us2(0x43, 1); } else { - hero_l03_enter_state_us2(0x3F, 0); + hero_l03_set_move_state_us2(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_us2(0x47, 1); + hero_l03_set_move_state_us2(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)point_a = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l03_enter_state_us2(0x41, 1); + hero_l03_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l03_enter_state_us2(0x41, 1); + hero_l03_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l03_enter_state_us2(0x48, 1); + hero_l03_set_move_state_us2(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2120,7 +2120,7 @@ void hero_l03_decide_state_us2(void) { point_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; point_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)point_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l03_enter_state_us2(0x49, 1); + hero_l03_set_move_state_us2(0x49, 1); } break; } @@ -2131,7 +2131,7 @@ void hero_l03_decide_state_us2(void) { point_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; point_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)point_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l03_enter_state_us2(0x4A, 1); + hero_l03_set_move_state_us2(0x4A, 1); } } } @@ -2150,17 +2150,17 @@ void hero_l03_decide_state_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)point_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l03_enter_state_us2(0x47, 1); + hero_l03_set_move_state_us2(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l03_enter_state_us2(0x41, 1); + hero_l03_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l03_enter_state_us2(0x48, 1); + hero_l03_set_move_state_us2(0x48, 1); } break; } @@ -2175,7 +2175,7 @@ void hero_l03_decide_state_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l03_enter_state_us2(0, 0); + hero_l03_set_move_state_us2(0, 0); anim = hero_get_gadget_value(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -2186,7 +2186,7 @@ void hero_l03_decide_state_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l03_enter_state_us2(0, 0); + hero_l03_set_move_state_us2(0, 0); } break; case 0x22: @@ -2196,12 +2196,12 @@ void hero_l03_decide_state_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_l03_enter_state_us2(7, 1); + hero_l03_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l03_enter_state_us2(0, 0); + hero_l03_set_move_state_us2(0, 0); } break; default: diff --git a/src/us2/levels/03_endako/L03_003CC9A0-sw.c b/src/us2/levels/03_endako/L03_003CC9A0-sw.c index 14062bbeb..d7064f5cb 100644 --- a/src/us2/levels/03_endako/L03_003CC9A0-sw.c +++ b/src/us2/levels/03_endako/L03_003CC9A0-sw.c @@ -12,7 +12,7 @@ extern void hero_start_target_state(void *, int, float); extern int coll_sweep_from_object(void *, void *, int, int, int, int, float, float, float); extern int flag_is_third_pending_set(void *); extern int hero_get_target_state_kind(void); -extern s32 hero_l03_enter_state_us2(int, int); +extern s32 hero_l03_set_move_state_us2(int, int); extern void FastVecSub(void *, void *, void *); extern float FastVecDot(void *, void *); extern void hero_start_loader_state(int); @@ -117,7 +117,7 @@ void tube_start_update_us2(char *moby) g_hero_state.interactionLock=1; if (hero_get_target_state_kind()==2) { moby_set_state(moby,3,-1); - hero_l03_enter_state_us2(0x6F,1); + hero_l03_set_move_state_us2(0x6F,1); } else { timer = H(moby,0x96); old_timer = timer++; diff --git a/src/us2/levels/04_barlow/L04_002E06B0-sw.c b/src/us2/levels/04_barlow/L04_002E06B0-sw.c index 922cdd853..52441b139 100644 --- a/src/us2/levels/04_barlow/L04_002E06B0-sw.c +++ b/src/us2/levels/04_barlow/L04_002E06B0-sw.c @@ -138,7 +138,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -695,7 +695,7 @@ void hero_l04_update_state_machine_us2(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { value21 = ((Hero *)g_hero_state)->i[0x2440/4]; if (value21 != -1) { @@ -1419,7 +1419,7 @@ void hero_l04_update_state_machine_us2(void) { coll_process_hit(0.4f, (s32)((TI128*)vec0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l04_state)->f[0x180/4] = 0.1f; diff --git a/src/us2/levels/04_barlow/L04_002E06B0-sw2.c b/src/us2/levels/04_barlow/L04_002E06B0-sw2.c index 2036ac952..74bd40158 100644 --- a/src/us2/levels/04_barlow/L04_002E06B0-sw2.c +++ b/src/us2/levels/04_barlow/L04_002E06B0-sw2.c @@ -55,8 +55,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -122,7 +122,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l04_enter_state_us2(s32 action, s32 animate) { +s32 hero_l04_set_move_state_us2(s32 action, s32 animate) { u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 old_step; @@ -169,7 +169,9 @@ s32 hero_l04_enter_state_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -182,8 +184,8 @@ s32 hero_l04_enter_state_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l04_enter_state_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l04_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_animation_id(0) == 0x51) set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_animation_id(0), 0, -1.0f); @@ -321,7 +323,7 @@ s32 hero_l04_enter_state_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l04_enter_state_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l04_set_move_state_us2(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -361,12 +363,12 @@ s32 hero_l04_enter_state_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l04_enter_state_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l04_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_set_move_state_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_animation_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l04_enter_state_us2(0, 0)) set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); + if (hero_l04_set_move_state_us2(0, 0)) set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -391,7 +393,7 @@ s32 hero_l04_enter_state_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l04_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -533,13 +535,13 @@ s32 hero_l04_enter_state_us2(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l04_enter_state_us2(0x81, 1); return 0; + hero_l04_set_move_state_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l04_lock_flag_b) { hero_l04_enter_state_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l04_lock_flag_b) { hero_l04_set_move_state_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l04_enter_state_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l04_set_move_state_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -624,7 +626,7 @@ s32 hero_l04_enter_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -650,7 +652,7 @@ s32 hero_l04_enter_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -659,7 +661,7 @@ s32 hero_l04_enter_state_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -791,7 +793,7 @@ s32 hero_l04_enter_state_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -846,7 +848,7 @@ s32 hero_l04_enter_state_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -858,7 +860,7 @@ s32 hero_l04_enter_state_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -880,7 +882,7 @@ s32 hero_l04_enter_state_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l04_enter_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l04_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/04_barlow/L04_002EDF10-sw.c b/src/us2/levels/04_barlow/L04_002EDF10-sw.c index 560e1ac2a..3ff14ce49 100644 --- a/src/us2/levels/04_barlow/L04_002EDF10-sw.c +++ b/src/us2/levels/04_barlow/L04_002EDF10-sw.c @@ -70,7 +70,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l04_enter_state_us2(s32, s32); +s32 hero_l04_set_move_state_us2(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -145,7 +145,7 @@ void hero_l04_decide_state_transition_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l04_enter_state_us2(0x39, 1); + hero_l04_set_move_state_us2(0x39, 1); goto end; } } @@ -174,7 +174,7 @@ void hero_l04_decide_state_transition_us2(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l04_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l04_enter_state_us2(0x74, 1); + hero_l04_set_move_state_us2(0x74, 1); goto end; } } @@ -185,12 +185,12 @@ void hero_l04_decide_state_transition_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state_us2(1, 1); + hero_l04_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l04_enter_state_us2(0x82, 1); + hero_l04_set_move_state_us2(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -227,7 +227,7 @@ void hero_l04_decide_state_transition_us2(void) { rec = g_hero_transition_records + spill1 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l04_enter_state_us2(0x3C, 1); + hero_l04_set_move_state_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -270,12 +270,12 @@ void hero_l04_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l04_enter_state_us2(0x76, 1); + hero_l04_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); } break; } @@ -296,17 +296,17 @@ void hero_l04_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l04_lock_flag_b == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l04_enter_state_us2(0x6E, 1); + hero_l04_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l04_enter_state_us2(4, 1); + hero_l04_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l04_enter_state_us2(0x2E, 1); + hero_l04_set_move_state_us2(0x2E, 1); break; } { @@ -326,28 +326,28 @@ void hero_l04_decide_state_transition_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l04_enter_state_us2(2, 1); + hero_l04_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state_us2(1, 1); + hero_l04_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l04_enter_state_us2(0x3D, 1); + hero_l04_set_move_state_us2(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l04_enter_state_us2(0x3D, 1); + hero_l04_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l04_enter_state_us2(0, 1); + hero_l04_set_move_state_us2(0, 1); } break; case 0x3D: @@ -356,22 +356,22 @@ void hero_l04_decide_state_transition_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state_us2(4, 1); + hero_l04_set_move_state_us2(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l04_enter_state_us2(2, 1); + hero_l04_set_move_state_us2(2, 1); break; } - hero_l04_enter_state_us2(0, 1); + hero_l04_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -410,25 +410,25 @@ void hero_l04_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l04_enter_state_us2(0x33, 1); + hero_l04_set_move_state_us2(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l04_enter_state_us2(0x34, 1); + hero_l04_set_move_state_us2(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l04_enter_state_us2(0x32, 1); + hero_l04_set_move_state_us2(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l04_enter_state_us2(0x33, 1); + hero_l04_set_move_state_us2(0x33, 1); } } break; @@ -441,81 +441,81 @@ void hero_l04_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l04_enter_state_us2(0x32, 1); + hero_l04_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l04_enter_state_us2(0x34, 1); + hero_l04_set_move_state_us2(0x34, 1); } else { - hero_l04_enter_state_us2(0x32, 1); + hero_l04_set_move_state_us2(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l04_enter_state_us2(0x12, 1); + hero_l04_set_move_state_us2(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l04_enter_state_us2(0x32, 1); + hero_l04_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l04_enter_state_us2(0x34, 1); + hero_l04_set_move_state_us2(0x34, 1); } else { - hero_l04_enter_state_us2(0x32, 1); + hero_l04_set_move_state_us2(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l04_enter_state_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l04_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l04_enter_state_us2(0x35, 1); + hero_l04_set_move_state_us2(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l04_enter_state_us2(0x12, 1); + hero_l04_set_move_state_us2(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l04_enter_state_us2(0x32, 1); + hero_l04_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l04_enter_state_us2(0x34, 1); + hero_l04_set_move_state_us2(0x34, 1); } else { - hero_l04_enter_state_us2(0x32, 1); + hero_l04_set_move_state_us2(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l04_enter_state_us2(0x70, 0); + hero_l04_set_move_state_us2(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l04_enter_state_us2(0x36, 1); + hero_l04_set_move_state_us2(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state_us2(0x67, 1); + hero_l04_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state_us2(0x33, 1); + hero_l04_set_move_state_us2(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l04_enter_state_us2(0x33, 0); + hero_l04_set_move_state_us2(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state_us2(0x67, 1); + hero_l04_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l04_enter_state_us2(0x36, 0); + hero_l04_set_move_state_us2(0x36, 0); } break; case 0x1: @@ -549,9 +549,9 @@ void hero_l04_decide_state_transition_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state_us2(4, 1); + hero_l04_set_move_state_us2(4, 1); } else { - hero_l04_enter_state_us2(0, 0); + hero_l04_set_move_state_us2(0, 0); anim = hero_get_weapon_animation_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -563,9 +563,9 @@ void hero_l04_decide_state_transition_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l04_enter_state_us2(0, 0); + hero_l04_set_move_state_us2(0, 0); } else { - hero_l04_enter_state_us2(0, 1); + hero_l04_set_move_state_us2(0, 1); } } break; @@ -598,7 +598,7 @@ void hero_l04_decide_state_transition_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state_us2(7, 1); + hero_l04_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -607,7 +607,7 @@ void hero_l04_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l04_enter_state_us2(0, 0); + hero_l04_set_move_state_us2(0, 0); } break; } @@ -629,7 +629,7 @@ void hero_l04_decide_state_transition_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state_us2(7, 1); + hero_l04_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -642,7 +642,7 @@ void hero_l04_decide_state_transition_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l04_enter_state_us2(2, 0); + hero_l04_set_move_state_us2(2, 0); set_hero_animation(3, g_hero_l04_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -653,22 +653,22 @@ void hero_l04_decide_state_transition_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l04_enter_state_us2(2, 1); + hero_l04_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l04_enter_state_us2(0, 0); + hero_l04_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state_us2(0, 0); + hero_l04_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l04_enter_state_us2(0, 1); + hero_l04_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -685,7 +685,7 @@ void hero_l04_decide_state_transition_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state_us2(7, 1); + hero_l04_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -694,7 +694,7 @@ void hero_l04_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l04_enter_state_us2(0, 0); + hero_l04_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_animation_id(0), 0, 15.0f); break; } @@ -706,7 +706,7 @@ void hero_l04_decide_state_transition_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state_us2(0, 1); + hero_l04_set_move_state_us2(0, 1); } break; case 0x2: @@ -720,11 +720,11 @@ void hero_l04_decide_state_transition_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l04_enter_state_us2(0x76, 1); + hero_l04_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); break; } n = 9; @@ -738,12 +738,12 @@ void hero_l04_decide_state_transition_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l04_enter_state_us2(9, 1); + hero_l04_set_move_state_us2(9, 1); } else { - hero_l04_enter_state_us2(7, 1); + hero_l04_set_move_state_us2(7, 1); } } else { - hero_l04_enter_state_us2(7, 1); + hero_l04_set_move_state_us2(7, 1); } break; } @@ -751,11 +751,11 @@ void hero_l04_decide_state_transition_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state_us2(1, 1); + hero_l04_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state_us2(4, 1); + hero_l04_set_move_state_us2(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -772,21 +772,21 @@ void hero_l04_decide_state_transition_us2(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l04_enter_state_us2(0x2E, 1); + hero_l04_set_move_state_us2(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l04_enter_state_us2(2, 1); + hero_l04_set_move_state_us2(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l04_enter_state_us2(0x70, 1); + hero_l04_set_move_state_us2(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l04_enter_state_us2(2, 1); + hero_l04_set_move_state_us2(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -797,7 +797,7 @@ void hero_l04_decide_state_transition_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l04_enter_state_us2(0, 0) == 0) { + if (hero_l04_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -814,7 +814,7 @@ void hero_l04_decide_state_transition_us2(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l04_enter_state_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l04_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 17.0f); } if (FLD(hero_moby, u8, 0x43) == 0x37) { @@ -835,7 +835,7 @@ void hero_l04_decide_state_transition_us2(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l04_enter_state_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l04_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -869,17 +869,17 @@ void hero_l04_decide_state_transition_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l04_enter_state_us2(3, 0); + hero_l04_set_move_state_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l04_enter_state_us2(0x77, 1); + hero_l04_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l04_enter_state_us2(0x77, 1); + hero_l04_set_move_state_us2(0x77, 1); break; } } @@ -897,11 +897,11 @@ void hero_l04_decide_state_transition_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l04_enter_state_us2(0x64, 1); + hero_l04_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l04_enter_state_us2(0x63, 1); + hero_l04_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -909,38 +909,38 @@ void hero_l04_decide_state_transition_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state_us2(0x62, 1); + hero_l04_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l04_enter_state_us2(0, 1); + hero_l04_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l04_enter_state_us2(0x62, 1); + hero_l04_set_move_state_us2(0x62, 1); } break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state_us2(1, 1); + hero_l04_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l04_enter_state_us2(7, 1); + hero_l04_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state_us2(4, 1); + hero_l04_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state_us2(0, 1); + hero_l04_set_move_state_us2(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -948,45 +948,45 @@ void hero_l04_decide_state_transition_us2(void) { } if (hero_get_weapon_animation_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l04_enter_state_us2(0, 0); + hero_l04_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l04_enter_state_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l04_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l04_enter_state_us2(2, 1); + hero_l04_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l04_enter_state_us2(1, 1); + hero_l04_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state_us2(0, 0); + hero_l04_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_animation_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l04_enter_state_us2(0x76, 1); + hero_l04_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l04_enter_state_us2(0x15, 1); + hero_l04_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l04_enter_state_us2(0, 1); + hero_l04_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -994,17 +994,17 @@ void hero_l04_decide_state_transition_us2(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l04_enter_state_us2(0x8B, 1); + hero_l04_set_move_state_us2(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l04_enter_state_us2(0, 1); + hero_l04_set_move_state_us2(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l04_enter_state_us2(0, 1); + hero_l04_set_move_state_us2(0, 1); } break; case 0x24: @@ -1030,14 +1030,14 @@ void hero_l04_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l04_enter_state_us2(0, 0); + hero_l04_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_animation_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l04_enter_state_us2(6, 0); + hero_l04_set_move_state_us2(6, 0); } else { - hero_l04_enter_state_us2(6, 0); + hero_l04_set_move_state_us2(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1053,9 +1053,9 @@ void hero_l04_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l04_enter_state_us2(0, 1); + hero_l04_set_move_state_us2(0, 1); } else { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1067,7 +1067,7 @@ void hero_l04_decide_state_transition_us2(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l04_enter_state_us2(0x2C, 1); + hero_l04_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1075,7 +1075,7 @@ void hero_l04_decide_state_transition_us2(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l04_enter_state_us2(0x18, 0); + hero_l04_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -1084,18 +1084,18 @@ void hero_l04_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l04_enter_state_us2(0x1B, 1); + hero_l04_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1104,7 +1104,7 @@ void hero_l04_decide_state_transition_us2(void) { vec10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)vec10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l04_enter_state_us2(0x19, 1); + hero_l04_set_move_state_us2(0x19, 1); } break; } @@ -1115,7 +1115,7 @@ void hero_l04_decide_state_transition_us2(void) { vec10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)vec10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l04_enter_state_us2(0x1A, 1); + hero_l04_set_move_state_us2(0x1A, 1); } } } @@ -1134,18 +1134,18 @@ void hero_l04_decide_state_transition_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)vec10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l04_enter_state_us2(0x18, 1); + hero_l04_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l04_enter_state_us2(0x1B, 1); + hero_l04_set_move_state_us2(0x1B, 1); } break; } @@ -1155,9 +1155,9 @@ void hero_l04_decide_state_transition_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); } else { - hero_l04_enter_state_us2(0, 1); + hero_l04_set_move_state_us2(0, 1); } } break; @@ -1181,12 +1181,12 @@ void hero_l04_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state_us2(0x39, 1); + hero_l04_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l04_enter_state_us2(0, 0) != 0) { + if (hero_l04_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1194,7 +1194,7 @@ void hero_l04_decide_state_transition_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l04_enter_state_us2(0, 0) != 0) { + if (hero_l04_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1208,28 +1208,28 @@ void hero_l04_decide_state_transition_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l04_enter_state_us2(2, 1); + hero_l04_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l04_enter_state_us2(3, 0) != 0) { + if (hero_l04_set_move_state_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l04_enter_state_us2(0, 1); + hero_l04_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l04_enter_state_us2(8, 1); + hero_l04_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l04_enter_state_us2(0x17, 1); + hero_l04_set_move_state_us2(0x17, 1); break; } } @@ -1261,7 +1261,7 @@ void hero_l04_decide_state_transition_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == MOBY_CLASS_LEVITATOR_PAD)) { - if (hero_l04_enter_state_us2(0, 0) != 0) { + if (hero_l04_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1272,12 +1272,12 @@ void hero_l04_decide_state_transition_us2(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l04_enter_state_us2(0x74, 1); + hero_l04_set_move_state_us2(0x74, 1); } else { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); } } else { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); } } break; @@ -1290,16 +1290,16 @@ void hero_l04_decide_state_transition_us2(void) { ok = 1; } if (ok != 0) { - hero_l04_enter_state_us2(0x11, 1); + hero_l04_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l04_enter_state_us2(0x17, 1); + hero_l04_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1310,23 +1310,23 @@ void hero_l04_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l04_enter_state_us2(3, 0) != 0) { + if (hero_l04_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l04_enter_state_us2(4, 1); + hero_l04_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l04_speed_params[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l04_enter_state_us2(2, 1); + hero_l04_set_move_state_us2(2, 1); break; } - hero_l04_enter_state_us2(2, 0); + hero_l04_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1335,21 +1335,21 @@ void hero_l04_decide_state_transition_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l04_speed_params[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l04_enter_state_us2(2, 1); + hero_l04_set_move_state_us2(2, 1); break; } - hero_l04_enter_state_us2(2, 0); + hero_l04_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l04_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l04_enter_state_us2(0, 0) != 0) { + if (hero_l04_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_animation_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l04_enter_state_us2(0, 0) != 0) { + } else if (hero_l04_set_move_state_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1395,14 +1395,14 @@ void hero_l04_decide_state_transition_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l04_enter_state_us2(0xB, 1); + hero_l04_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l04_enter_state_us2(0x82, 1); + hero_l04_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1411,21 +1411,21 @@ void hero_l04_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l04_enter_state_us2(0xA, 1); + hero_l04_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l04_enter_state_us2(0x10, 1); + hero_l04_set_move_state_us2(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l04_enter_state_us2(0x77, 1); + hero_l04_set_move_state_us2(0x77, 1); break; } } @@ -1529,7 +1529,7 @@ void hero_l04_decide_state_transition_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l04_enter_state_us2(3, 0) != 0) { + if (hero_l04_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1537,13 +1537,13 @@ void hero_l04_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l04_speed_params[0][2])) { - hero_l04_enter_state_us2(7, 1); + hero_l04_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l04_enter_state_us2(7, 1); + hero_l04_set_move_state_us2(7, 1); } else if (g_hero_l04_speed_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l04_enter_state_us2(9, 1); + hero_l04_set_move_state_us2(9, 1); } else { - hero_l04_enter_state_us2(7, 1); + hero_l04_set_move_state_us2(7, 1); } break; } @@ -1551,10 +1551,10 @@ void hero_l04_decide_state_transition_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); break; } { @@ -1564,7 +1564,7 @@ void hero_l04_decide_state_transition_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &spill11) != 0) && (spill11 < FLD(g_hero_state, s32, 0x1B8))) { - hero_l04_enter_state_us2(0x11, 1); + hero_l04_set_move_state_us2(0x11, 1); break; } } @@ -1593,7 +1593,7 @@ void hero_l04_decide_state_transition_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l04_enter_state_us2(0xE, 1); + hero_l04_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1603,28 +1603,28 @@ void hero_l04_decide_state_transition_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l04_enter_state_us2(8, 1); + hero_l04_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l04_enter_state_us2(0x17, 1); + hero_l04_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l04_enter_state_us2(6, 1); + hero_l04_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state_us2(0x39, 1); + hero_l04_set_move_state_us2(0x39, 1); } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l04_enter_state_us2(0x82, 1); + hero_l04_set_move_state_us2(0x82, 1); } else { - hero_l04_enter_state_us2(0, 0); + hero_l04_set_move_state_us2(0, 0); } } break; @@ -1634,8 +1634,8 @@ void hero_l04_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l04_enter_state_us2(0x39, 1); - } else if (hero_l04_enter_state_us2(0, 0) != 0) { + hero_l04_set_move_state_us2(0x39, 1); + } else if (hero_l04_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 13.0f); } } @@ -1656,7 +1656,7 @@ void hero_l04_decide_state_transition_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l04_enter_state_us2(0, 0); + hero_l04_set_move_state_us2(0, 0); anim = hero_get_weapon_animation_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1667,7 +1667,7 @@ void hero_l04_decide_state_transition_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l04_enter_state_us2(0, 0); + hero_l04_set_move_state_us2(0, 0); } break; case 0x22: @@ -1677,12 +1677,12 @@ void hero_l04_decide_state_transition_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_l04_enter_state_us2(7, 1); + hero_l04_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l04_enter_state_us2(0, 0); + hero_l04_set_move_state_us2(0, 0); } break; default: diff --git a/src/us2/levels/05_feltzin_system/L05_0041EFBC-g8.c b/src/us2/levels/05_feltzin_system/L05_0041EFBC-g8.c index 0537bd7a1..f3b05b363 100644 --- a/src/us2/levels/05_feltzin_system/L05_0041EFBC-g8.c +++ b/src/us2/levels/05_feltzin_system/L05_0041EFBC-g8.c @@ -33,7 +33,7 @@ extern float g_screen_l05_scale[] __attribute__((sda)); extern char *g_feltzin_target_mobys[] __attribute__((sda)); extern void hero_set_state_value_a(int), hero_set_state_value_b(int), level_select_random_object(void); extern void level_store_pair_with_increment(int, int), moby_set_flag_bit(void *, int); -extern int hero_l00_change_action_us2(int, int); +extern int hero_l00_set_move_state_us2(int, int); extern void hero_set_state_value_c(int); extern int LockedEntryMenuInput_us2(void); extern void ship_save_transform_state(void); @@ -148,7 +148,7 @@ void feltzin_challenge_controller_update_us2(char *moby) g_feltzin_frame_counter = 0; } if (g_feltzin_frame_counter++ < 5 || g_game_mode_a[0] == 2) break; - hero_l00_change_action_us2(0x31,0); + hero_l00_set_move_state_us2(0x31,0); if (g_feltzin_needs_reset) { hero_set_state_value_c(1); g_feltzin_menu_mode = LockedEntryMenuInput_us2(); diff --git a/src/us2/levels/07_siberius/L07_002B8720-sw.c b/src/us2/levels/07_siberius/L07_002B8720-sw.c index 40eb1d1d2..fc273c31b 100644 --- a/src/us2/levels/07_siberius/L07_002B8720-sw.c +++ b/src/us2/levels/07_siberius/L07_002B8720-sw.c @@ -138,7 +138,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -1011,7 +1011,7 @@ void hero_l07_update_state_machine_us2(void) { coll_process_hit(0.4f, (s32)((TI128*)vec_00), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec_10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l07_state_block)->f[0x180/4] = 0.1f; diff --git a/src/us2/levels/07_siberius/L07_002B8720-sw2.c b/src/us2/levels/07_siberius/L07_002B8720-sw2.c index 032828459..daf04076b 100644 --- a/src/us2/levels/07_siberius/L07_002B8720-sw2.c +++ b/src/us2/levels/07_siberius/L07_002B8720-sw2.c @@ -55,8 +55,8 @@ extern int hero_play_sound(int, int); extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -118,7 +118,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l07_enter_state_us2(s32 action, s32 animate) { +s32 hero_l07_set_move_state_us2(s32 action, s32 animate) { u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 old_step; @@ -165,7 +165,9 @@ s32 hero_l07_enter_state_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -178,7 +180,7 @@ s32 hero_l07_enter_state_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_anim_id(0) == 0x51) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_anim_id(0), 0, -1.0f); @@ -237,7 +239,7 @@ s32 hero_l07_enter_state_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l07_enter_state_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l07_set_move_state_us2(0x76, 1); return 0; } } WORD(0x2298) = 0; BYTE(0x40C) = 0; BYTE(0x40E) = 0; @@ -273,11 +275,11 @@ s32 hero_l07_enter_state_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_set_move_state_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_anim_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l07_enter_state_us2(0, 0)) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); + if (hero_l07_set_move_state_us2(0, 0)) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -302,7 +304,7 @@ s32 hero_l07_enter_state_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l07_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -444,13 +446,13 @@ s32 hero_l07_enter_state_us2(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l07_enter_state_us2(0x81, 1); return 0; + hero_l07_set_move_state_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l07_busy_flag) { hero_l07_enter_state_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l07_busy_flag) { hero_l07_set_move_state_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l07_enter_state_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l07_set_move_state_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -527,7 +529,7 @@ s32 hero_l07_enter_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -553,7 +555,7 @@ s32 hero_l07_enter_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -562,7 +564,7 @@ s32 hero_l07_enter_state_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -694,7 +696,7 @@ s32 hero_l07_enter_state_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -764,7 +766,7 @@ s32 hero_l07_enter_state_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -776,7 +778,7 @@ s32 hero_l07_enter_state_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -810,7 +812,7 @@ s32 hero_l07_enter_state_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l07_enter_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l07_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/07_siberius/L07_002C3F00-sw.c b/src/us2/levels/07_siberius/L07_002C3F00-sw.c index 6e4f386c9..949557b5f 100644 --- a/src/us2/levels/07_siberius/L07_002C3F00-sw.c +++ b/src/us2/levels/07_siberius/L07_002C3F00-sw.c @@ -72,7 +72,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_refresh_speed_from_timer(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l07_enter_state_us2(s32, s32); +s32 hero_l07_set_move_state_us2(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -147,7 +147,7 @@ void hero_l07_decide_state_transition_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l07_enter_state_us2(0x39, 1); + hero_l07_set_move_state_us2(0x39, 1); goto end; } } @@ -176,7 +176,7 @@ void hero_l07_decide_state_transition_us2(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l07_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l07_enter_state_us2(0x74, 1); + hero_l07_set_move_state_us2(0x74, 1); goto end; } } @@ -186,12 +186,12 @@ void hero_l07_decide_state_transition_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state_us2(1, 1); + hero_l07_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l07_enter_state_us2(0x82, 1); + hero_l07_set_move_state_us2(0x82, 1); break; } { @@ -227,7 +227,7 @@ void hero_l07_decide_state_transition_us2(void) { rec = g_hero_move_table + int_1 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l07_enter_state_us2(0x3C, 1); + hero_l07_set_move_state_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -270,12 +270,12 @@ void hero_l07_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l07_enter_state_us2(0x76, 1); + hero_l07_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); } break; } @@ -296,12 +296,12 @@ void hero_l07_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l07_busy_flag == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l07_enter_state_us2(0x6E, 1); + hero_l07_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l07_enter_state_us2(4, 1); + hero_l07_set_move_state_us2(4, 1); break; } } @@ -322,28 +322,28 @@ void hero_l07_decide_state_transition_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l07_enter_state_us2(2, 1); + hero_l07_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state_us2(1, 1); + hero_l07_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l07_enter_state_us2(0x3D, 1); + hero_l07_set_move_state_us2(0x3D, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l07_enter_state_us2(0x3D, 1); + hero_l07_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l07_enter_state_us2(0, 1); + hero_l07_set_move_state_us2(0, 1); } break; case 0x3D: @@ -352,22 +352,22 @@ void hero_l07_decide_state_transition_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state_us2(4, 1); + hero_l07_set_move_state_us2(4, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l07_enter_state_us2(2, 1); + hero_l07_set_move_state_us2(2, 1); break; } - hero_l07_enter_state_us2(0, 1); + hero_l07_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -423,9 +423,9 @@ void hero_l07_decide_state_transition_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state_us2(4, 1); + hero_l07_set_move_state_us2(4, 1); } else { - hero_l07_enter_state_us2(0, 0); + hero_l07_set_move_state_us2(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -437,9 +437,9 @@ void hero_l07_decide_state_transition_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l07_enter_state_us2(0, 0); + hero_l07_set_move_state_us2(0, 0); } else { - hero_l07_enter_state_us2(0, 1); + hero_l07_set_move_state_us2(0, 1); } } break; @@ -472,7 +472,7 @@ void hero_l07_decide_state_transition_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state_us2(7, 1); + hero_l07_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -481,7 +481,7 @@ void hero_l07_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l07_enter_state_us2(0, 0); + hero_l07_set_move_state_us2(0, 0); } break; } @@ -503,7 +503,7 @@ void hero_l07_decide_state_transition_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state_us2(7, 1); + hero_l07_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -516,7 +516,7 @@ void hero_l07_decide_state_transition_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l07_enter_state_us2(2, 0); + hero_l07_set_move_state_us2(2, 0); set_hero_animation(3, g_hero_l07_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -527,22 +527,22 @@ void hero_l07_decide_state_transition_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l07_enter_state_us2(2, 1); + hero_l07_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l07_enter_state_us2(0, 0); + hero_l07_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state_us2(0, 0); + hero_l07_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l07_enter_state_us2(0, 1); + hero_l07_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -559,7 +559,7 @@ void hero_l07_decide_state_transition_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state_us2(7, 1); + hero_l07_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -568,7 +568,7 @@ void hero_l07_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l07_enter_state_us2(0, 0); + hero_l07_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, 15.0f); break; } @@ -580,7 +580,7 @@ void hero_l07_decide_state_transition_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state_us2(0, 1); + hero_l07_set_move_state_us2(0, 1); } break; case 0x2: @@ -594,11 +594,11 @@ void hero_l07_decide_state_transition_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l07_enter_state_us2(0x76, 1); + hero_l07_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); break; } n = 9; @@ -612,12 +612,12 @@ void hero_l07_decide_state_transition_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l07_enter_state_us2(9, 1); + hero_l07_set_move_state_us2(9, 1); } else { - hero_l07_enter_state_us2(7, 1); + hero_l07_set_move_state_us2(7, 1); } } else { - hero_l07_enter_state_us2(7, 1); + hero_l07_set_move_state_us2(7, 1); } break; } @@ -625,11 +625,11 @@ void hero_l07_decide_state_transition_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state_us2(1, 1); + hero_l07_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state_us2(4, 1); + hero_l07_set_move_state_us2(4, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -640,7 +640,7 @@ void hero_l07_decide_state_transition_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l07_enter_state_us2(0, 0) == 0) { + if (hero_l07_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -680,17 +680,17 @@ void hero_l07_decide_state_transition_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l07_enter_state_us2(3, 0); + hero_l07_set_move_state_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l07_enter_state_us2(0x77, 1); + hero_l07_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l07_enter_state_us2(0x77, 1); + hero_l07_set_move_state_us2(0x77, 1); break; } } @@ -708,11 +708,11 @@ void hero_l07_decide_state_transition_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l07_enter_state_us2(0x64, 1); + hero_l07_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l07_enter_state_us2(0x63, 1); + hero_l07_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -720,22 +720,22 @@ void hero_l07_decide_state_transition_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state_us2(0x62, 1); + hero_l07_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l07_enter_state_us2(0, 1); + hero_l07_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l07_enter_state_us2(0x62, 1); + hero_l07_set_move_state_us2(0x62, 1); } break; case 0x65: { s32 n = FLD(g_hero_state, s32, 0x18C0); if ((n < 3) && (((n * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40, 7, &int_2) != 0)) { - hero_l07_enter_state_us2(0x66, 1); + hero_l07_set_move_state_us2(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -763,7 +763,7 @@ void hero_l07_decide_state_transition_us2(void) { s32 off = FLD(g_hero_state, s16, 0xBFC) * 0x2C; rec -= -off; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l07_enter_state_us2(0, 1); + hero_l07_set_move_state_us2(0, 1); } break; } @@ -777,7 +777,7 @@ void hero_l07_decide_state_transition_us2(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l07_enter_state_us2(0, 0) != 0) { + if (hero_l07_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 17.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -785,25 +785,25 @@ void hero_l07_decide_state_transition_us2(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state_us2(1, 1); + hero_l07_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l07_enter_state_us2(7, 1); + hero_l07_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state_us2(4, 1); + hero_l07_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state_us2(0, 1); + hero_l07_set_move_state_us2(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -811,45 +811,45 @@ void hero_l07_decide_state_transition_us2(void) { } if (hero_get_weapon_anim_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l07_enter_state_us2(0, 0); + hero_l07_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l07_enter_state_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l07_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l07_enter_state_us2(2, 1); + hero_l07_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l07_enter_state_us2(1, 1); + hero_l07_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state_us2(0, 0); + hero_l07_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l07_enter_state_us2(0x76, 1); + hero_l07_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l07_enter_state_us2(0x15, 1); + hero_l07_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l07_enter_state_us2(0, 1); + hero_l07_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -857,17 +857,17 @@ void hero_l07_decide_state_transition_us2(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l07_enter_state_us2(0x8B, 1); + hero_l07_set_move_state_us2(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l07_enter_state_us2(0, 1); + hero_l07_set_move_state_us2(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l07_enter_state_us2(0, 1); + hero_l07_set_move_state_us2(0, 1); } break; case 0x24: @@ -893,14 +893,14 @@ void hero_l07_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l07_enter_state_us2(0, 0); + hero_l07_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l07_enter_state_us2(6, 0); + hero_l07_set_move_state_us2(6, 0); } else { - hero_l07_enter_state_us2(6, 0); + hero_l07_set_move_state_us2(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -916,9 +916,9 @@ void hero_l07_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l07_enter_state_us2(0, 1); + hero_l07_set_move_state_us2(0, 1); } else { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -930,7 +930,7 @@ void hero_l07_decide_state_transition_us2(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l07_enter_state_us2(0x2C, 1); + hero_l07_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -938,7 +938,7 @@ void hero_l07_decide_state_transition_us2(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l07_enter_state_us2(0x18, 0); + hero_l07_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -947,18 +947,18 @@ void hero_l07_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l07_enter_state_us2(0x1B, 1); + hero_l07_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -967,7 +967,7 @@ void hero_l07_decide_state_transition_us2(void) { vec_10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l07_enter_state_us2(0x19, 1); + hero_l07_set_move_state_us2(0x19, 1); } break; } @@ -978,7 +978,7 @@ void hero_l07_decide_state_transition_us2(void) { vec_10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l07_enter_state_us2(0x1A, 1); + hero_l07_set_move_state_us2(0x1A, 1); } } } @@ -997,18 +997,18 @@ void hero_l07_decide_state_transition_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l07_enter_state_us2(0x18, 1); + hero_l07_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l07_enter_state_us2(0x1B, 1); + hero_l07_set_move_state_us2(0x1B, 1); } break; } @@ -1018,9 +1018,9 @@ void hero_l07_decide_state_transition_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); } else { - hero_l07_enter_state_us2(0, 1); + hero_l07_set_move_state_us2(0, 1); } } break; @@ -1044,12 +1044,12 @@ void hero_l07_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l07_enter_state_us2(0x39, 1); + hero_l07_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l07_enter_state_us2(0, 0) != 0) { + if (hero_l07_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1057,7 +1057,7 @@ void hero_l07_decide_state_transition_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l07_enter_state_us2(0, 0) != 0) { + if (hero_l07_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1071,28 +1071,28 @@ void hero_l07_decide_state_transition_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l07_enter_state_us2(2, 1); + hero_l07_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l07_enter_state_us2(3, 0) != 0) { + if (hero_l07_set_move_state_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l07_enter_state_us2(0, 1); + hero_l07_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l07_enter_state_us2(8, 1); + hero_l07_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l07_enter_state_us2(0x17, 1); + hero_l07_set_move_state_us2(0x17, 1); break; } } @@ -1124,7 +1124,7 @@ void hero_l07_decide_state_transition_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l07_enter_state_us2(0, 0) != 0) { + if (hero_l07_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1135,12 +1135,12 @@ void hero_l07_decide_state_transition_us2(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l07_enter_state_us2(0x74, 1); + hero_l07_set_move_state_us2(0x74, 1); } else { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); } } else { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); } } break; @@ -1153,16 +1153,16 @@ void hero_l07_decide_state_transition_us2(void) { ok = 1; } if (ok != 0) { - hero_l07_enter_state_us2(0x11, 1); + hero_l07_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l07_enter_state_us2(0x17, 1); + hero_l07_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1173,23 +1173,23 @@ void hero_l07_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l07_enter_state_us2(3, 0) != 0) { + if (hero_l07_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l07_enter_state_us2(4, 1); + hero_l07_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l07_speed_thresholds[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l07_enter_state_us2(2, 1); + hero_l07_set_move_state_us2(2, 1); break; } - hero_l07_enter_state_us2(2, 0); + hero_l07_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1198,21 +1198,21 @@ void hero_l07_decide_state_transition_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l07_speed_thresholds[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l07_enter_state_us2(2, 1); + hero_l07_set_move_state_us2(2, 1); break; } - hero_l07_enter_state_us2(2, 0); + hero_l07_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l07_extra_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l07_enter_state_us2(0, 0) != 0) { + if (hero_l07_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l07_enter_state_us2(0, 0) != 0) { + } else if (hero_l07_set_move_state_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1258,14 +1258,14 @@ void hero_l07_decide_state_transition_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l07_enter_state_us2(0xB, 1); + hero_l07_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l07_enter_state_us2(0x82, 1); + hero_l07_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1274,21 +1274,21 @@ void hero_l07_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l07_enter_state_us2(0xA, 1); + hero_l07_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l07_enter_state_us2(0x10, 1); + hero_l07_set_move_state_us2(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l07_enter_state_us2(0x77, 1); + hero_l07_set_move_state_us2(0x77, 1); break; } } @@ -1392,7 +1392,7 @@ void hero_l07_decide_state_transition_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l07_enter_state_us2(3, 0) != 0) { + if (hero_l07_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1400,13 +1400,13 @@ void hero_l07_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l07_speed_thresholds[0][2])) { - hero_l07_enter_state_us2(7, 1); + hero_l07_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l07_enter_state_us2(7, 1); + hero_l07_set_move_state_us2(7, 1); } else if (g_hero_l07_speed_thresholds[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l07_enter_state_us2(9, 1); + hero_l07_set_move_state_us2(9, 1); } else { - hero_l07_enter_state_us2(7, 1); + hero_l07_set_move_state_us2(7, 1); } break; } @@ -1414,10 +1414,10 @@ void hero_l07_decide_state_transition_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_action(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); break; } { @@ -1427,7 +1427,7 @@ void hero_l07_decide_state_transition_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &int_8) != 0) && (int_8 < FLD(g_hero_state, s32, 0x1B8))) { - hero_l07_enter_state_us2(0x11, 1); + hero_l07_set_move_state_us2(0x11, 1); break; } } @@ -1456,7 +1456,7 @@ void hero_l07_decide_state_transition_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l07_enter_state_us2(0xE, 1); + hero_l07_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1466,28 +1466,28 @@ void hero_l07_decide_state_transition_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l07_enter_state_us2(8, 1); + hero_l07_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l07_enter_state_us2(0x17, 1); + hero_l07_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l07_enter_state_us2(6, 1); + hero_l07_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l07_enter_state_us2(0x39, 1); + hero_l07_set_move_state_us2(0x39, 1); } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l07_enter_state_us2(0x82, 1); + hero_l07_set_move_state_us2(0x82, 1); } else { - hero_l07_enter_state_us2(0, 0); + hero_l07_set_move_state_us2(0, 0); } } break; @@ -1497,8 +1497,8 @@ void hero_l07_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l07_enter_state_us2(0x39, 1); - } else if (hero_l07_enter_state_us2(0, 0) != 0) { + hero_l07_set_move_state_us2(0x39, 1); + } else if (hero_l07_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 13.0f); } } @@ -1519,7 +1519,7 @@ void hero_l07_decide_state_transition_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l07_enter_state_us2(0, 0); + hero_l07_set_move_state_us2(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1530,7 +1530,7 @@ void hero_l07_decide_state_transition_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l07_enter_state_us2(0, 0); + hero_l07_set_move_state_us2(0, 0); } break; case 0x22: @@ -1540,12 +1540,12 @@ void hero_l07_decide_state_transition_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_l07_enter_state_us2(7, 1); + hero_l07_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l07_enter_state_us2(0, 0); + hero_l07_set_move_state_us2(0, 0); } break; default: diff --git a/src/us2/levels/08_tabora/L08_002CB8F0-sw.c b/src/us2/levels/08_tabora/L08_002CB8F0-sw.c index e7a1d6d18..f26f9779c 100644 --- a/src/us2/levels/08_tabora/L08_002CB8F0-sw.c +++ b/src/us2/levels/08_tabora/L08_002CB8F0-sw.c @@ -138,7 +138,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -695,7 +695,7 @@ void hero_l08_update_state_machine_us2(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { int_24 = ((Hero *)g_hero_state)->i[0x2440/4]; if (int_24 != -1) { @@ -1419,7 +1419,7 @@ void hero_l08_update_state_machine_us2(void) { coll_process_hit(0.4f, (s32)((TI128*)vec_00), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec_10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l08_extra_state)->f[0x180/4] = 0.1f; diff --git a/src/us2/levels/08_tabora/L08_002CB8F0-sw2.c b/src/us2/levels/08_tabora/L08_002CB8F0-sw2.c index 938a65477..5f09f8396 100644 --- a/src/us2/levels/08_tabora/L08_002CB8F0-sw2.c +++ b/src/us2/levels/08_tabora/L08_002CB8F0-sw2.c @@ -55,8 +55,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -122,7 +122,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l08_enter_state_us2(s32 action, s32 animate) { +s32 hero_l08_set_move_state_us2(s32 action, s32 animate) { u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 old_step; @@ -169,7 +169,9 @@ s32 hero_l08_enter_state_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -182,8 +184,8 @@ s32 hero_l08_enter_state_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l08_enter_state_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l08_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_animation_id(0) == 0x51) set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_animation_id(0), 0, -1.0f); @@ -321,7 +323,7 @@ s32 hero_l08_enter_state_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l08_enter_state_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l08_set_move_state_us2(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -361,12 +363,12 @@ s32 hero_l08_enter_state_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l08_enter_state_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l08_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_set_move_state_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_animation_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l08_enter_state_us2(0, 0)) set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); + if (hero_l08_set_move_state_us2(0, 0)) set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -391,7 +393,7 @@ s32 hero_l08_enter_state_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l08_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -533,13 +535,13 @@ s32 hero_l08_enter_state_us2(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l08_enter_state_us2(0x81, 1); return 0; + hero_l08_set_move_state_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_action_blocked) { hero_l08_enter_state_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_action_blocked) { hero_l08_set_move_state_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l08_enter_state_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l08_set_move_state_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -631,7 +633,7 @@ s32 hero_l08_enter_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -657,7 +659,7 @@ s32 hero_l08_enter_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -666,7 +668,7 @@ s32 hero_l08_enter_state_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -799,7 +801,7 @@ s32 hero_l08_enter_state_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -869,7 +871,7 @@ s32 hero_l08_enter_state_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -881,7 +883,7 @@ s32 hero_l08_enter_state_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -915,7 +917,7 @@ s32 hero_l08_enter_state_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l08_enter_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l08_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/08_tabora/L08_002D9410-sw.c b/src/us2/levels/08_tabora/L08_002D9410-sw.c index c57cdd95d..f819dbc7d 100644 --- a/src/us2/levels/08_tabora/L08_002D9410-sw.c +++ b/src/us2/levels/08_tabora/L08_002D9410-sw.c @@ -70,7 +70,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l08_enter_state_us2(s32, s32); +s32 hero_l08_set_move_state_us2(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -145,7 +145,7 @@ void hero_l08_update_state_transitions_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l08_enter_state_us2(0x39, 1); + hero_l08_set_move_state_us2(0x39, 1); goto end; } } @@ -174,7 +174,7 @@ void hero_l08_update_state_transitions_us2(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l08_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l08_enter_state_us2(0x74, 1); + hero_l08_set_move_state_us2(0x74, 1); goto end; } } @@ -185,12 +185,12 @@ void hero_l08_update_state_transitions_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state_us2(1, 1); + hero_l08_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l08_enter_state_us2(0x82, 1); + hero_l08_set_move_state_us2(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -227,7 +227,7 @@ void hero_l08_update_state_transitions_us2(void) { rec = g_hero_item_records + int_1 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l08_enter_state_us2(0x3C, 1); + hero_l08_set_move_state_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -270,12 +270,12 @@ void hero_l08_update_state_transitions_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l08_enter_state_us2(0x76, 1); + hero_l08_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); } break; } @@ -296,17 +296,17 @@ void hero_l08_update_state_transitions_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_action_blocked == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l08_enter_state_us2(0x6E, 1); + hero_l08_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l08_enter_state_us2(4, 1); + hero_l08_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l08_enter_state_us2(0x2E, 1); + hero_l08_set_move_state_us2(0x2E, 1); break; } { @@ -326,28 +326,28 @@ void hero_l08_update_state_transitions_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l08_enter_state_us2(2, 1); + hero_l08_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state_us2(1, 1); + hero_l08_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l08_enter_state_us2(0x3D, 1); + hero_l08_set_move_state_us2(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l08_enter_state_us2(0x3D, 1); + hero_l08_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); } break; case 0x3D: @@ -356,22 +356,22 @@ void hero_l08_update_state_transitions_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state_us2(4, 1); + hero_l08_set_move_state_us2(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l08_enter_state_us2(2, 1); + hero_l08_set_move_state_us2(2, 1); break; } - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -410,25 +410,25 @@ void hero_l08_update_state_transitions_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l08_enter_state_us2(0x33, 1); + hero_l08_set_move_state_us2(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l08_enter_state_us2(0x34, 1); + hero_l08_set_move_state_us2(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l08_enter_state_us2(0x32, 1); + hero_l08_set_move_state_us2(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l08_enter_state_us2(0x33, 1); + hero_l08_set_move_state_us2(0x33, 1); } } break; @@ -441,81 +441,81 @@ void hero_l08_update_state_transitions_us2(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l08_enter_state_us2(0x32, 1); + hero_l08_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l08_enter_state_us2(0x34, 1); + hero_l08_set_move_state_us2(0x34, 1); } else { - hero_l08_enter_state_us2(0x32, 1); + hero_l08_set_move_state_us2(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l08_enter_state_us2(0x12, 1); + hero_l08_set_move_state_us2(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l08_enter_state_us2(0x32, 1); + hero_l08_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l08_enter_state_us2(0x34, 1); + hero_l08_set_move_state_us2(0x34, 1); } else { - hero_l08_enter_state_us2(0x32, 1); + hero_l08_set_move_state_us2(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l08_enter_state_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l08_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l08_enter_state_us2(0x35, 1); + hero_l08_set_move_state_us2(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l08_enter_state_us2(0x12, 1); + hero_l08_set_move_state_us2(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l08_enter_state_us2(0x32, 1); + hero_l08_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l08_enter_state_us2(0x34, 1); + hero_l08_set_move_state_us2(0x34, 1); } else { - hero_l08_enter_state_us2(0x32, 1); + hero_l08_set_move_state_us2(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l08_enter_state_us2(0x70, 0); + hero_l08_set_move_state_us2(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l08_enter_state_us2(0x36, 1); + hero_l08_set_move_state_us2(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state_us2(0x67, 1); + hero_l08_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state_us2(0x33, 1); + hero_l08_set_move_state_us2(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l08_enter_state_us2(0x33, 0); + hero_l08_set_move_state_us2(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state_us2(0x67, 1); + hero_l08_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l08_enter_state_us2(0x36, 0); + hero_l08_set_move_state_us2(0x36, 0); } break; case 0x1: @@ -549,9 +549,9 @@ void hero_l08_update_state_transitions_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state_us2(4, 1); + hero_l08_set_move_state_us2(4, 1); } else { - hero_l08_enter_state_us2(0, 0); + hero_l08_set_move_state_us2(0, 0); anim = hero_get_weapon_animation_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -563,9 +563,9 @@ void hero_l08_update_state_transitions_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l08_enter_state_us2(0, 0); + hero_l08_set_move_state_us2(0, 0); } else { - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); } } break; @@ -598,7 +598,7 @@ void hero_l08_update_state_transitions_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state_us2(7, 1); + hero_l08_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -607,7 +607,7 @@ void hero_l08_update_state_transitions_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l08_enter_state_us2(0, 0); + hero_l08_set_move_state_us2(0, 0); } break; } @@ -629,7 +629,7 @@ void hero_l08_update_state_transitions_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state_us2(7, 1); + hero_l08_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -642,7 +642,7 @@ void hero_l08_update_state_transitions_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l08_enter_state_us2(2, 0); + hero_l08_set_move_state_us2(2, 0); set_hero_animation(3, g_hero_l08_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -653,22 +653,22 @@ void hero_l08_update_state_transitions_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l08_enter_state_us2(2, 1); + hero_l08_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l08_enter_state_us2(0, 0); + hero_l08_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state_us2(0, 0); + hero_l08_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -685,7 +685,7 @@ void hero_l08_update_state_transitions_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state_us2(7, 1); + hero_l08_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -694,7 +694,7 @@ void hero_l08_update_state_transitions_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l08_enter_state_us2(0, 0); + hero_l08_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_animation_id(0), 0, 15.0f); break; } @@ -706,7 +706,7 @@ void hero_l08_update_state_transitions_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); } break; case 0x2: @@ -720,11 +720,11 @@ void hero_l08_update_state_transitions_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l08_enter_state_us2(0x76, 1); + hero_l08_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); break; } n = 9; @@ -738,12 +738,12 @@ void hero_l08_update_state_transitions_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l08_enter_state_us2(9, 1); + hero_l08_set_move_state_us2(9, 1); } else { - hero_l08_enter_state_us2(7, 1); + hero_l08_set_move_state_us2(7, 1); } } else { - hero_l08_enter_state_us2(7, 1); + hero_l08_set_move_state_us2(7, 1); } break; } @@ -751,11 +751,11 @@ void hero_l08_update_state_transitions_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state_us2(1, 1); + hero_l08_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state_us2(4, 1); + hero_l08_set_move_state_us2(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -772,21 +772,21 @@ void hero_l08_update_state_transitions_us2(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l08_enter_state_us2(0x2E, 1); + hero_l08_set_move_state_us2(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l08_enter_state_us2(2, 1); + hero_l08_set_move_state_us2(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l08_enter_state_us2(0x70, 1); + hero_l08_set_move_state_us2(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l08_enter_state_us2(2, 1); + hero_l08_set_move_state_us2(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -797,7 +797,7 @@ void hero_l08_update_state_transitions_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l08_enter_state_us2(0, 0) == 0) { + if (hero_l08_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -814,7 +814,7 @@ void hero_l08_update_state_transitions_us2(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l08_enter_state_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l08_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 17.0f); } if (FLD(ptr_4, u8, 0x43) == 0x37) { @@ -835,7 +835,7 @@ void hero_l08_update_state_transitions_us2(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l08_enter_state_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l08_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -869,17 +869,17 @@ void hero_l08_update_state_transitions_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l08_enter_state_us2(3, 0); + hero_l08_set_move_state_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l08_enter_state_us2(0x77, 1); + hero_l08_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l08_enter_state_us2(0x77, 1); + hero_l08_set_move_state_us2(0x77, 1); break; } } @@ -897,11 +897,11 @@ void hero_l08_update_state_transitions_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l08_enter_state_us2(0x64, 1); + hero_l08_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l08_enter_state_us2(0x63, 1); + hero_l08_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -909,22 +909,22 @@ void hero_l08_update_state_transitions_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state_us2(0x62, 1); + hero_l08_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l08_enter_state_us2(0x62, 1); + hero_l08_set_move_state_us2(0x62, 1); } break; case 0x65: { s32 n = FLD(g_hero_state, s32, 0x18C0); if ((n < 3) && (((n * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40, 7, &int_2) != 0)) { - hero_l08_enter_state_us2(0x66, 1); + hero_l08_set_move_state_us2(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -952,31 +952,31 @@ void hero_l08_update_state_transitions_us2(void) { s32 off = FLD(g_hero_state, s16, 0xBFC) * 0x2C; rec -= -off; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); } break; } case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state_us2(1, 1); + hero_l08_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l08_enter_state_us2(7, 1); + hero_l08_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state_us2(4, 1); + hero_l08_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -984,45 +984,45 @@ void hero_l08_update_state_transitions_us2(void) { } if (hero_get_weapon_animation_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l08_enter_state_us2(0, 0); + hero_l08_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l08_enter_state_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l08_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l08_enter_state_us2(2, 1); + hero_l08_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l08_enter_state_us2(1, 1); + hero_l08_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state_us2(0, 0); + hero_l08_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_animation_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l08_enter_state_us2(0x76, 1); + hero_l08_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l08_enter_state_us2(0x15, 1); + hero_l08_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1030,17 +1030,17 @@ void hero_l08_update_state_transitions_us2(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l08_enter_state_us2(0x8B, 1); + hero_l08_set_move_state_us2(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); } break; case 0x24: @@ -1066,14 +1066,14 @@ void hero_l08_update_state_transitions_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l08_enter_state_us2(0, 0); + hero_l08_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_animation_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l08_enter_state_us2(6, 0); + hero_l08_set_move_state_us2(6, 0); } else { - hero_l08_enter_state_us2(6, 0); + hero_l08_set_move_state_us2(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1089,9 +1089,9 @@ void hero_l08_update_state_transitions_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); } else { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1103,7 +1103,7 @@ void hero_l08_update_state_transitions_us2(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l08_enter_state_us2(0x2C, 1); + hero_l08_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1111,7 +1111,7 @@ void hero_l08_update_state_transitions_us2(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l08_enter_state_us2(0x18, 0); + hero_l08_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -1120,18 +1120,18 @@ void hero_l08_update_state_transitions_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l08_enter_state_us2(0x1B, 1); + hero_l08_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1140,7 +1140,7 @@ void hero_l08_update_state_transitions_us2(void) { vec_10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l08_enter_state_us2(0x19, 1); + hero_l08_set_move_state_us2(0x19, 1); } break; } @@ -1151,7 +1151,7 @@ void hero_l08_update_state_transitions_us2(void) { vec_10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l08_enter_state_us2(0x1A, 1); + hero_l08_set_move_state_us2(0x1A, 1); } } } @@ -1170,18 +1170,18 @@ void hero_l08_update_state_transitions_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l08_enter_state_us2(0x18, 1); + hero_l08_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l08_enter_state_us2(0x1B, 1); + hero_l08_set_move_state_us2(0x1B, 1); } break; } @@ -1191,9 +1191,9 @@ void hero_l08_update_state_transitions_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); } else { - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); } } break; @@ -1217,12 +1217,12 @@ void hero_l08_update_state_transitions_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state_us2(0x39, 1); + hero_l08_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l08_enter_state_us2(0, 0) != 0) { + if (hero_l08_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1230,7 +1230,7 @@ void hero_l08_update_state_transitions_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l08_enter_state_us2(0, 0) != 0) { + if (hero_l08_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1244,28 +1244,28 @@ void hero_l08_update_state_transitions_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l08_enter_state_us2(2, 1); + hero_l08_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l08_enter_state_us2(3, 0) != 0) { + if (hero_l08_set_move_state_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l08_enter_state_us2(8, 1); + hero_l08_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l08_enter_state_us2(0x17, 1); + hero_l08_set_move_state_us2(0x17, 1); break; } } @@ -1297,7 +1297,7 @@ void hero_l08_update_state_transitions_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l08_enter_state_us2(0, 0) != 0) { + if (hero_l08_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1308,12 +1308,12 @@ void hero_l08_update_state_transitions_us2(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l08_enter_state_us2(0x74, 1); + hero_l08_set_move_state_us2(0x74, 1); } else { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); } } else { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); } } break; @@ -1326,16 +1326,16 @@ void hero_l08_update_state_transitions_us2(void) { ok = 1; } if (ok != 0) { - hero_l08_enter_state_us2(0x11, 1); + hero_l08_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l08_enter_state_us2(0x17, 1); + hero_l08_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1346,23 +1346,23 @@ void hero_l08_update_state_transitions_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l08_enter_state_us2(3, 0) != 0) { + if (hero_l08_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l08_enter_state_us2(4, 1); + hero_l08_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l08_speed_params[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l08_enter_state_us2(2, 1); + hero_l08_set_move_state_us2(2, 1); break; } - hero_l08_enter_state_us2(2, 0); + hero_l08_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1371,21 +1371,21 @@ void hero_l08_update_state_transitions_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l08_speed_params[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l08_enter_state_us2(2, 1); + hero_l08_set_move_state_us2(2, 1); break; } - hero_l08_enter_state_us2(2, 0); + hero_l08_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l08_animation_id_extra, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l08_enter_state_us2(0, 0) != 0) { + if (hero_l08_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_animation_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l08_enter_state_us2(0, 0) != 0) { + } else if (hero_l08_set_move_state_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1431,14 +1431,14 @@ void hero_l08_update_state_transitions_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l08_enter_state_us2(0xB, 1); + hero_l08_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l08_enter_state_us2(0x82, 1); + hero_l08_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1447,21 +1447,21 @@ void hero_l08_update_state_transitions_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l08_enter_state_us2(0xA, 1); + hero_l08_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l08_enter_state_us2(0x10, 1); + hero_l08_set_move_state_us2(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l08_enter_state_us2(0x77, 1); + hero_l08_set_move_state_us2(0x77, 1); break; } } @@ -1565,7 +1565,7 @@ void hero_l08_update_state_transitions_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l08_enter_state_us2(3, 0) != 0) { + if (hero_l08_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1573,13 +1573,13 @@ void hero_l08_update_state_transitions_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l08_speed_params[0][2])) { - hero_l08_enter_state_us2(7, 1); + hero_l08_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l08_enter_state_us2(7, 1); + hero_l08_set_move_state_us2(7, 1); } else if (g_hero_l08_speed_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l08_enter_state_us2(9, 1); + hero_l08_set_move_state_us2(9, 1); } else { - hero_l08_enter_state_us2(7, 1); + hero_l08_set_move_state_us2(7, 1); } break; } @@ -1587,10 +1587,10 @@ void hero_l08_update_state_transitions_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); break; } { @@ -1600,7 +1600,7 @@ void hero_l08_update_state_transitions_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &int_8) != 0) && (int_8 < FLD(g_hero_state, s32, 0x1B8))) { - hero_l08_enter_state_us2(0x11, 1); + hero_l08_set_move_state_us2(0x11, 1); break; } } @@ -1629,7 +1629,7 @@ void hero_l08_update_state_transitions_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l08_enter_state_us2(0xE, 1); + hero_l08_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1639,28 +1639,28 @@ void hero_l08_update_state_transitions_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l08_enter_state_us2(8, 1); + hero_l08_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l08_enter_state_us2(0x17, 1); + hero_l08_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l08_enter_state_us2(6, 1); + hero_l08_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state_us2(0x39, 1); + hero_l08_set_move_state_us2(0x39, 1); } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l08_enter_state_us2(0x82, 1); + hero_l08_set_move_state_us2(0x82, 1); } else { - hero_l08_enter_state_us2(0, 0); + hero_l08_set_move_state_us2(0, 0); } } break; @@ -1670,8 +1670,8 @@ void hero_l08_update_state_transitions_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l08_enter_state_us2(0x39, 1); - } else if (hero_l08_enter_state_us2(0, 0) != 0) { + hero_l08_set_move_state_us2(0x39, 1); + } else if (hero_l08_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_animation_id(0), 0, 13.0f); } } @@ -1692,7 +1692,7 @@ void hero_l08_update_state_transitions_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l08_enter_state_us2(0, 0); + hero_l08_set_move_state_us2(0, 0); anim = hero_get_weapon_animation_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1703,7 +1703,7 @@ void hero_l08_update_state_transitions_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l08_enter_state_us2(0, 0); + hero_l08_set_move_state_us2(0, 0); } break; case 0x22: @@ -1713,12 +1713,12 @@ void hero_l08_update_state_transitions_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_l08_enter_state_us2(7, 1); + hero_l08_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l08_enter_state_us2(0, 0); + hero_l08_set_move_state_us2(0, 0); } break; default: diff --git a/src/us2/levels/09_dobbo/L09_002BC618-sw.c b/src/us2/levels/09_dobbo/L09_002BC618-sw.c index 9b5aba1be..f2b513e1d 100644 --- a/src/us2/levels/09_dobbo/L09_002BC618-sw.c +++ b/src/us2/levels/09_dobbo/L09_002BC618-sw.c @@ -135,7 +135,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -651,7 +651,7 @@ void hero_l09_update_state_machine_us2(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { temp_a2 = ((Hero *)g_hero_state)->i[0x2440/4]; if (temp_a2 != -1) { @@ -1354,7 +1354,7 @@ void hero_l09_update_state_machine_us2(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l09_aux_state)->f[0x180/4] = 0.1f; diff --git a/src/us2/levels/09_dobbo/L09_002BC618-sw2.c b/src/us2/levels/09_dobbo/L09_002BC618-sw2.c index ed9e2eee2..6d28388d9 100644 --- a/src/us2/levels/09_dobbo/L09_002BC618-sw2.c +++ b/src/us2/levels/09_dobbo/L09_002BC618-sw2.c @@ -55,8 +55,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -123,7 +123,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l09_set_state_us2(s32 action, s32 animate) { +s32 hero_l09_set_move_state_us2(s32 action, s32 animate) { u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 old_step; @@ -170,7 +170,9 @@ s32 hero_l09_set_state_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -183,7 +185,7 @@ s32 hero_l09_set_state_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_anim_id(0) == 0x51) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_anim_id(0), 0, -1.0f); @@ -318,7 +320,7 @@ s32 hero_l09_set_state_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l09_set_state_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l09_set_move_state_us2(0x76, 1); return 0; } } if (BYTE(0x22B9) || WORD(0x2294) == 0x70) { WORD(0x2294) = 0x70; set_hero_animation(0x59, 0, 8.0f); goto finish; @@ -351,11 +353,11 @@ s32 hero_l09_set_state_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_move_state_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_anim_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l09_set_state_us2(0, 0)) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); + if (hero_l09_set_move_state_us2(0, 0)) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -380,7 +382,7 @@ s32 hero_l09_set_state_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l09_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -522,13 +524,13 @@ s32 hero_l09_set_state_us2(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l09_set_state_us2(0x81, 1); return 0; + hero_l09_set_move_state_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l09_lock_flag_b) { hero_l09_set_state_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l09_lock_flag_b) { hero_l09_set_move_state_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l09_set_state_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l09_set_move_state_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -603,9 +605,9 @@ s32 hero_l09_set_state_us2(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_l09_special_state_flag) hero_l09_set_state_us2(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l09_set_state_us2(0x79, 1); - else hero_l09_set_state_us2(0x39, 1); + if (g_current_map_index == 2 && g_hero_l09_special_state_flag) hero_l09_set_move_state_us2(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l09_set_move_state_us2(0x79, 1); + else hero_l09_set_move_state_us2(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -639,7 +641,7 @@ s32 hero_l09_set_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -665,7 +667,7 @@ s32 hero_l09_set_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -674,7 +676,7 @@ s32 hero_l09_set_state_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -808,7 +810,7 @@ s32 hero_l09_set_state_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -863,7 +865,7 @@ s32 hero_l09_set_state_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -875,7 +877,7 @@ s32 hero_l09_set_state_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -914,7 +916,7 @@ s32 hero_l09_set_state_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l09_set_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l09_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/09_dobbo/L09_002C99F8-sw.c b/src/us2/levels/09_dobbo/L09_002C99F8-sw.c index 033256e0e..5932aa268 100644 --- a/src/us2/levels/09_dobbo/L09_002C99F8-sw.c +++ b/src/us2/levels/09_dobbo/L09_002C99F8-sw.c @@ -70,7 +70,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l09_set_state_us2(s32, s32); +s32 hero_l09_set_move_state_us2(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -145,7 +145,7 @@ void hero_l09_decide_state_transition_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l09_set_state_us2(0x39, 1); + hero_l09_set_move_state_us2(0x39, 1); goto end; } } @@ -174,7 +174,7 @@ void hero_l09_decide_state_transition_us2(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_height_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l09_set_state_us2(0x74, 1); + hero_l09_set_move_state_us2(0x74, 1); goto end; } } @@ -184,12 +184,12 @@ void hero_l09_decide_state_transition_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state_us2(1, 1); + hero_l09_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l09_set_state_us2(0x82, 1); + hero_l09_set_move_state_us2(0x82, 1); break; } { @@ -225,7 +225,7 @@ void hero_l09_decide_state_transition_us2(void) { rec = g_hero_l09_state_records + sp40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l09_set_state_us2(0x3C, 1); + hero_l09_set_move_state_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -268,12 +268,12 @@ void hero_l09_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l09_set_state_us2(0x76, 1); + hero_l09_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); } break; } @@ -294,12 +294,12 @@ void hero_l09_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l09_lock_flag_b == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l09_set_state_us2(0x6E, 1); + hero_l09_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l09_set_state_us2(4, 1); + hero_l09_set_move_state_us2(4, 1); break; } } @@ -320,28 +320,28 @@ void hero_l09_decide_state_transition_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l09_set_state_us2(2, 1); + hero_l09_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state_us2(1, 1); + hero_l09_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l09_set_state_us2(0x3D, 1); + hero_l09_set_move_state_us2(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l09_set_state_us2(0x3D, 1); + hero_l09_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l09_set_state_us2(0, 1); + hero_l09_set_move_state_us2(0, 1); } break; case 0x3D: @@ -350,22 +350,22 @@ void hero_l09_decide_state_transition_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state_us2(4, 1); + hero_l09_set_move_state_us2(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l09_set_state_us2(2, 1); + hero_l09_set_move_state_us2(2, 1); break; } - hero_l09_set_state_us2(0, 1); + hero_l09_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -398,25 +398,25 @@ void hero_l09_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l09_set_state_us2(0x33, 1); + hero_l09_set_move_state_us2(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l09_set_state_us2(0x34, 1); + hero_l09_set_move_state_us2(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l09_set_state_us2(0x32, 1); + hero_l09_set_move_state_us2(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l09_set_state_us2(0x33, 1); + hero_l09_set_move_state_us2(0x33, 1); } } break; @@ -429,81 +429,81 @@ void hero_l09_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l09_set_state_us2(0x32, 1); + hero_l09_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l09_set_state_us2(0x34, 1); + hero_l09_set_move_state_us2(0x34, 1); } else { - hero_l09_set_state_us2(0x32, 1); + hero_l09_set_move_state_us2(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l09_set_state_us2(0x12, 1); + hero_l09_set_move_state_us2(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l09_set_state_us2(0x32, 1); + hero_l09_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l09_set_state_us2(0x34, 1); + hero_l09_set_move_state_us2(0x34, 1); } else { - hero_l09_set_state_us2(0x32, 1); + hero_l09_set_move_state_us2(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l09_set_state_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l09_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l09_set_state_us2(0x35, 1); + hero_l09_set_move_state_us2(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l09_set_state_us2(0x12, 1); + hero_l09_set_move_state_us2(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l09_set_state_us2(0x32, 1); + hero_l09_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l09_set_state_us2(0x34, 1); + hero_l09_set_move_state_us2(0x34, 1); } else { - hero_l09_set_state_us2(0x32, 1); + hero_l09_set_move_state_us2(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l09_set_state_us2(0x70, 0); + hero_l09_set_move_state_us2(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l09_set_state_us2(0x36, 1); + hero_l09_set_move_state_us2(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l09_set_state_us2(0x67, 1); + hero_l09_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state_us2(0x33, 1); + hero_l09_set_move_state_us2(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l09_set_state_us2(0x33, 0); + hero_l09_set_move_state_us2(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l09_set_state_us2(0x67, 1); + hero_l09_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l09_set_state_us2(0x36, 0); + hero_l09_set_move_state_us2(0x36, 0); } break; case 0x1: @@ -537,9 +537,9 @@ void hero_l09_decide_state_transition_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state_us2(4, 1); + hero_l09_set_move_state_us2(4, 1); } else { - hero_l09_set_state_us2(0, 0); + hero_l09_set_move_state_us2(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -551,9 +551,9 @@ void hero_l09_decide_state_transition_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l09_set_state_us2(0, 0); + hero_l09_set_move_state_us2(0, 0); } else { - hero_l09_set_state_us2(0, 1); + hero_l09_set_move_state_us2(0, 1); } } break; @@ -586,7 +586,7 @@ void hero_l09_decide_state_transition_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state_us2(7, 1); + hero_l09_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -595,7 +595,7 @@ void hero_l09_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l09_set_state_us2(0, 0); + hero_l09_set_move_state_us2(0, 0); } break; } @@ -617,7 +617,7 @@ void hero_l09_decide_state_transition_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state_us2(7, 1); + hero_l09_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -630,7 +630,7 @@ void hero_l09_decide_state_transition_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l09_set_state_us2(2, 0); + hero_l09_set_move_state_us2(2, 0); set_hero_animation(3, g_hero_l09_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -641,22 +641,22 @@ void hero_l09_decide_state_transition_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l09_set_state_us2(2, 1); + hero_l09_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l09_set_state_us2(0, 0); + hero_l09_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state_us2(0, 0); + hero_l09_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l09_set_state_us2(0, 1); + hero_l09_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -673,7 +673,7 @@ void hero_l09_decide_state_transition_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state_us2(7, 1); + hero_l09_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -682,7 +682,7 @@ void hero_l09_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l09_set_state_us2(0, 0); + hero_l09_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, 15.0f); break; } @@ -694,7 +694,7 @@ void hero_l09_decide_state_transition_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state_us2(0, 1); + hero_l09_set_move_state_us2(0, 1); } break; case 0x2: @@ -708,11 +708,11 @@ void hero_l09_decide_state_transition_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l09_set_state_us2(0x76, 1); + hero_l09_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); break; } n = 9; @@ -726,12 +726,12 @@ void hero_l09_decide_state_transition_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l09_set_state_us2(9, 1); + hero_l09_set_move_state_us2(9, 1); } else { - hero_l09_set_state_us2(7, 1); + hero_l09_set_move_state_us2(7, 1); } } else { - hero_l09_set_state_us2(7, 1); + hero_l09_set_move_state_us2(7, 1); } break; } @@ -739,21 +739,21 @@ void hero_l09_decide_state_transition_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state_us2(1, 1); + hero_l09_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state_us2(4, 1); + hero_l09_set_move_state_us2(4, 1); break; } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l09_set_state_us2(0x70, 1); + hero_l09_set_move_state_us2(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l09_set_state_us2(2, 1); + hero_l09_set_move_state_us2(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -764,7 +764,7 @@ void hero_l09_decide_state_transition_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l09_set_state_us2(0, 0) == 0) { + if (hero_l09_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -781,7 +781,7 @@ void hero_l09_decide_state_transition_us2(void) { hero_update_anim_scale(); } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l09_set_state_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l09_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -815,17 +815,17 @@ void hero_l09_decide_state_transition_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l09_set_state_us2(3, 0); + hero_l09_set_move_state_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l09_set_state_us2(0x77, 1); + hero_l09_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l09_set_state_us2(0x77, 1); + hero_l09_set_move_state_us2(0x77, 1); break; } } @@ -843,11 +843,11 @@ void hero_l09_decide_state_transition_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l09_set_state_us2(0x64, 1); + hero_l09_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l09_set_state_us2(0x63, 1); + hero_l09_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -855,22 +855,22 @@ void hero_l09_decide_state_transition_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state_us2(0x62, 1); + hero_l09_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l09_set_state_us2(0, 1); + hero_l09_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l09_set_state_us2(0x62, 1); + hero_l09_set_move_state_us2(0x62, 1); } break; case 0x65: { s32 n = FLD(g_hero_state, s32, 0x18C0); if ((n < 3) && (((n * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40, 7, &sp44) != 0)) { - hero_l09_set_state_us2(0x66, 1); + hero_l09_set_move_state_us2(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -904,25 +904,25 @@ void hero_l09_decide_state_transition_us2(void) { return; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state_us2(1, 1); + hero_l09_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l09_set_state_us2(7, 1); + hero_l09_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state_us2(4, 1); + hero_l09_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state_us2(0, 1); + hero_l09_set_move_state_us2(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -930,45 +930,45 @@ void hero_l09_decide_state_transition_us2(void) { } if (hero_get_weapon_anim_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l09_set_state_us2(0, 0); + hero_l09_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l09_set_state_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l09_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l09_set_state_us2(2, 1); + hero_l09_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l09_set_state_us2(1, 1); + hero_l09_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state_us2(0, 0); + hero_l09_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l09_set_state_us2(0x76, 1); + hero_l09_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l09_set_state_us2(0x15, 1); + hero_l09_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l09_set_state_us2(0, 1); + hero_l09_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -976,17 +976,17 @@ void hero_l09_decide_state_transition_us2(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l09_set_state_us2(0x8B, 1); + hero_l09_set_move_state_us2(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l09_set_state_us2(0, 1); + hero_l09_set_move_state_us2(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l09_set_state_us2(0, 1); + hero_l09_set_move_state_us2(0, 1); } break; case 0x24: @@ -1012,14 +1012,14 @@ void hero_l09_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l09_set_state_us2(0, 0); + hero_l09_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l09_set_state_us2(6, 0); + hero_l09_set_move_state_us2(6, 0); } else { - hero_l09_set_state_us2(6, 0); + hero_l09_set_move_state_us2(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1035,9 +1035,9 @@ void hero_l09_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l09_set_state_us2(0, 1); + hero_l09_set_move_state_us2(0, 1); } else { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1049,7 +1049,7 @@ void hero_l09_decide_state_transition_us2(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l09_set_state_us2(0x2C, 1); + hero_l09_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1057,7 +1057,7 @@ void hero_l09_decide_state_transition_us2(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l09_set_state_us2(0x18, 0); + hero_l09_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -1066,18 +1066,18 @@ void hero_l09_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l09_set_state_us2(0x1B, 1); + hero_l09_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1086,7 +1086,7 @@ void hero_l09_decide_state_transition_us2(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l09_set_state_us2(0x19, 1); + hero_l09_set_move_state_us2(0x19, 1); } break; } @@ -1097,7 +1097,7 @@ void hero_l09_decide_state_transition_us2(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l09_set_state_us2(0x1A, 1); + hero_l09_set_move_state_us2(0x1A, 1); } } } @@ -1116,18 +1116,18 @@ void hero_l09_decide_state_transition_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l09_set_state_us2(0x18, 1); + hero_l09_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l09_set_state_us2(0x1B, 1); + hero_l09_set_move_state_us2(0x1B, 1); } break; } @@ -1137,9 +1137,9 @@ void hero_l09_decide_state_transition_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); } else { - hero_l09_set_state_us2(0, 1); + hero_l09_set_move_state_us2(0, 1); } } break; @@ -1163,12 +1163,12 @@ void hero_l09_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l09_set_state_us2(0x39, 1); + hero_l09_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l09_set_state_us2(0, 0) != 0) { + if (hero_l09_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1176,7 +1176,7 @@ void hero_l09_decide_state_transition_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l09_set_state_us2(0, 0) != 0) { + if (hero_l09_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1190,28 +1190,28 @@ void hero_l09_decide_state_transition_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l09_set_state_us2(2, 1); + hero_l09_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l09_set_state_us2(3, 0) != 0) { + if (hero_l09_set_move_state_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l09_set_state_us2(0, 1); + hero_l09_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l09_set_state_us2(8, 1); + hero_l09_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l09_set_state_us2(0x17, 1); + hero_l09_set_move_state_us2(0x17, 1); break; } } @@ -1243,7 +1243,7 @@ void hero_l09_decide_state_transition_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l09_set_state_us2(0, 0) != 0) { + if (hero_l09_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1254,12 +1254,12 @@ void hero_l09_decide_state_transition_us2(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l09_set_state_us2(0x74, 1); + hero_l09_set_move_state_us2(0x74, 1); } else { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); } } else { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); } } break; @@ -1272,16 +1272,16 @@ void hero_l09_decide_state_transition_us2(void) { ok = 1; } if (ok != 0) { - hero_l09_set_state_us2(0x11, 1); + hero_l09_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l09_set_state_us2(0x17, 1); + hero_l09_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1292,23 +1292,23 @@ void hero_l09_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l09_set_state_us2(3, 0) != 0) { + if (hero_l09_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l09_set_state_us2(4, 1); + hero_l09_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l09_speed_thresholds[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l09_set_state_us2(2, 1); + hero_l09_set_move_state_us2(2, 1); break; } - hero_l09_set_state_us2(2, 0); + hero_l09_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1317,21 +1317,21 @@ void hero_l09_decide_state_transition_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l09_speed_thresholds[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l09_set_state_us2(2, 1); + hero_l09_set_move_state_us2(2, 1); break; } - hero_l09_set_state_us2(2, 0); + hero_l09_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l09_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l09_set_state_us2(0, 0) != 0) { + if (hero_l09_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l09_set_state_us2(0, 0) != 0) { + } else if (hero_l09_set_move_state_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1377,14 +1377,14 @@ void hero_l09_decide_state_transition_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l09_set_state_us2(0xB, 1); + hero_l09_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l09_set_state_us2(0x82, 1); + hero_l09_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1393,21 +1393,21 @@ void hero_l09_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l09_set_state_us2(0xA, 1); + hero_l09_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l09_set_state_us2(0x10, 1); + hero_l09_set_move_state_us2(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l09_set_state_us2(0x77, 1); + hero_l09_set_move_state_us2(0x77, 1); break; } } @@ -1511,7 +1511,7 @@ void hero_l09_decide_state_transition_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l09_set_state_us2(3, 0) != 0) { + if (hero_l09_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1519,13 +1519,13 @@ void hero_l09_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l09_speed_thresholds[0][2])) { - hero_l09_set_state_us2(7, 1); + hero_l09_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l09_set_state_us2(7, 1); + hero_l09_set_move_state_us2(7, 1); } else if (g_hero_l09_speed_thresholds[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l09_set_state_us2(9, 1); + hero_l09_set_move_state_us2(9, 1); } else { - hero_l09_set_state_us2(7, 1); + hero_l09_set_move_state_us2(7, 1); } break; } @@ -1533,10 +1533,10 @@ void hero_l09_decide_state_transition_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_action(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); break; } { @@ -1546,7 +1546,7 @@ void hero_l09_decide_state_transition_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l09_set_state_us2(0x11, 1); + hero_l09_set_move_state_us2(0x11, 1); break; } } @@ -1575,7 +1575,7 @@ void hero_l09_decide_state_transition_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l09_set_state_us2(0xE, 1); + hero_l09_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1585,32 +1585,32 @@ void hero_l09_decide_state_transition_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l09_set_state_us2(8, 1); + hero_l09_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l09_set_state_us2(0x17, 1); + hero_l09_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l09_set_state_us2(6, 1); + hero_l09_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l09_set_state_us2(0x79, 1); + hero_l09_set_move_state_us2(0x79, 1); } else { - hero_l09_set_state_us2(0x39, 1); + hero_l09_set_move_state_us2(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l09_set_state_us2(0x82, 1); + hero_l09_set_move_state_us2(0x82, 1); } else { - hero_l09_set_state_us2(0, 0); + hero_l09_set_move_state_us2(0, 0); } } break; @@ -1620,8 +1620,8 @@ void hero_l09_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l09_set_state_us2(0x39, 1); - } else if (hero_l09_set_state_us2(0, 0) != 0) { + hero_l09_set_move_state_us2(0x39, 1); + } else if (hero_l09_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 13.0f); } } @@ -1642,7 +1642,7 @@ void hero_l09_decide_state_transition_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l09_set_state_us2(0, 0); + hero_l09_set_move_state_us2(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1653,7 +1653,7 @@ void hero_l09_decide_state_transition_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l09_set_state_us2(0, 0); + hero_l09_set_move_state_us2(0, 0); } break; case 0x22: @@ -1663,12 +1663,12 @@ void hero_l09_decide_state_transition_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_l09_set_state_us2(7, 1); + hero_l09_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l09_set_state_us2(0, 0); + hero_l09_set_move_state_us2(0, 0); } break; default: diff --git a/src/us2/levels/10_hrugis_cloud/L10_00422824-g8.c b/src/us2/levels/10_hrugis_cloud/L10_00422824-g8.c index 61bcb0f7f..91f7a58ea 100644 --- a/src/us2/levels/10_hrugis_cloud/L10_00422824-g8.c +++ b/src/us2/levels/10_hrugis_cloud/L10_00422824-g8.c @@ -110,7 +110,7 @@ extern void hero_set_state_value_b(s32 value); extern void level_select_random_object(void); extern void level_store_pair_with_increment(s32 a0, s32 a1); extern void moby_set_flag_bit(Moby *moby, s32 enabled); -extern s32 hero_l00_change_action_us2(s32 action, s32 animate); +extern s32 hero_l00_set_move_state_us2(s32 action, s32 animate); extern void hero_set_state_value_c(s32 value); extern s32 LockedEntryMenuInput_us2(void); extern void ship_save_transform_state(void); @@ -216,7 +216,7 @@ void hrugis_controller_update_us2(Moby *moby) if (g_state_frame_count++ < 5 || g_mission_reward_state == 2) break; - hero_l00_change_action_us2(0x31, 0); + hero_l00_set_move_state_us2(0x31, 0); if (g_kind_choosing_flag) { hero_set_state_value_c(on); g_selected_mission_kind = LockedEntryMenuInput_us2(); diff --git a/src/us2/levels/11_joba/L11_002CB338-flags.c b/src/us2/levels/11_joba/L11_002CB338-flags.c index 56c1222a8..cf5750664 100644 --- a/src/us2/levels/11_joba/L11_002CB338-flags.c +++ b/src/us2/levels/11_joba/L11_002CB338-flags.c @@ -62,7 +62,7 @@ extern int g_arena_state __attribute__((sda)); extern u8 g_hero_input_enabled __attribute__((sda)); extern u8 g_bolt_multiplier __attribute__((sda)); extern u8 g_contact_hit_flag __attribute__((sda)); -extern int hero_l11_enter_state_us2(int, int); +extern int hero_l11_set_move_state_us2(int, int); extern float fade_get_value(void); extern float fade_reduce_value(float); extern void hero_clear_tracked_slots(void); @@ -114,18 +114,18 @@ int hero_handle_contact_hit_us2(long apply) case 0: contact = g_hero_state.contact; if (contact && (*(short *)(contact+0xaa) == 0x4eb || *(short *)(contact+0xaa) == 0x558)) { - hero_l11_enter_state_us2(0x7d, 1); return 1; + hero_l11_set_move_state_us2(0x7d, 1); return 1; } if ((g_hero_state.state == 1 || g_hero_state.state == 0x1d || g_hero_state.interrupted) && !(entry->flags & 8)) { u8 *hit = part_find_owned_effect_slot(g_hero_state.object, 1, 0); if (hit) AdjustPlayerHealth_us2(FloatToInt(*(float *)(hit+0x2c))); - if (!g_hero_state.health) hero_l11_enter_state_us2(0x16, 1); + if (!g_hero_state.health) hero_l11_set_move_state_us2(0x16, 1); g_hero_state.timer = 0x4d; if (!g_hero_state.sound_timer) g_hero_state.sound_timer = 0x12; hero_play_sound(0x14, 0); return 0; } - if (entry->flags & 8) hero_l11_enter_state_us2(0x8c, 1); - else hero_l11_enter_state_us2(0x16, 1); + if (entry->flags & 8) hero_l11_set_move_state_us2(0x8c, 1); + else hero_l11_set_move_state_us2(0x16, 1); if (g_hero_state.state == 0x8c) qzero(&direction); else { hero_flatten_push_vector((int)&direction, special, g_hero_state.jump_pressed ? 0.0f : 0.055000003f, 0.028333336f); @@ -133,7 +133,7 @@ int hero_handle_contact_hit_us2(long apply) } break; case 1: - hero_l11_enter_state_us2(0x42, 1); + hero_l11_set_move_state_us2(0x42, 1); hero_flatten_push_vector((int)&direction, special, 0.083333336f, 0.050000004f); break; } diff --git a/src/us2/levels/11_joba/L11_002D24D0-sw.c b/src/us2/levels/11_joba/L11_002D24D0-sw.c index f6a5da14b..0bfd65007 100644 --- a/src/us2/levels/11_joba/L11_002D24D0-sw.c +++ b/src/us2/levels/11_joba/L11_002D24D0-sw.c @@ -136,7 +136,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -998,7 +998,7 @@ void hero_l11_update_state_machine_us2(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l11_state_block)->f[0x180/4] = 0.1f; diff --git a/src/us2/levels/11_joba/L11_002D24D0-sw2.c b/src/us2/levels/11_joba/L11_002D24D0-sw2.c index 893368793..e52884656 100644 --- a/src/us2/levels/11_joba/L11_002D24D0-sw2.c +++ b/src/us2/levels/11_joba/L11_002D24D0-sw2.c @@ -60,8 +60,8 @@ extern int hero_play_sound(int, int); extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -129,7 +129,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l11_enter_state_us2(s32 action, s32 animate) { +s32 hero_l11_set_move_state_us2(s32 action, s32 animate) { f32 dir[4]; u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -177,7 +177,9 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -190,7 +192,7 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_gadget_value(0) == 0x51) set_hero_animation(hero_get_gadget_value(0), 0, 18.0f); else set_hero_animation(hero_get_gadget_value(0), 0, -1.0f); @@ -245,7 +247,7 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l11_enter_state_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l11_set_move_state_us2(0x76, 1); return 0; } } WORD(0x2298) = 0; BYTE(0x40C) = 0; BYTE(0x40E) = 0; @@ -275,11 +277,11 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_gadget_value(0) == 0x51) { if (!animate) goto finish; - if (hero_l11_enter_state_us2(0, 0)) set_hero_animation(hero_get_gadget_value(0), 0, 18.0f); + if (hero_l11_set_move_state_us2(0, 0)) set_hero_animation(hero_get_gadget_value(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -304,7 +306,7 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -463,13 +465,13 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l11_enter_state_us2(0x81, 1); return 0; + hero_l11_set_move_state_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l11_input_blocked) { hero_l11_enter_state_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l11_input_blocked) { hero_l11_set_move_state_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l11_enter_state_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l11_set_move_state_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -529,9 +531,9 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_arena_l11_active_flag) hero_l11_enter_state_us2(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l11_enter_state_us2(0x79, 1); - else hero_l11_enter_state_us2(0x39, 1); + if (g_current_map_index == 2 && g_arena_l11_active_flag) hero_l11_set_move_state_us2(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l11_set_move_state_us2(0x79, 1); + else hero_l11_set_move_state_us2(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -568,7 +570,7 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -597,7 +599,7 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -606,7 +608,7 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -741,7 +743,7 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -822,7 +824,7 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -834,7 +836,7 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -869,7 +871,7 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { set_hero_animation(0x11, 0, 8.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state_us2(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state_us2(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation(0, 0, 9.0f); goto finish; case 0x4B: @@ -903,7 +905,7 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l11_float_sequences[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_enter_state_us2(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l11_set_move_state_us2(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -947,7 +949,7 @@ s32 hero_l11_enter_state_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l11_enter_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l11_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/11_joba/L11_002DED18-sw.c b/src/us2/levels/11_joba/L11_002DED18-sw.c index d36203b99..0b9e59927 100644 --- a/src/us2/levels/11_joba/L11_002DED18-sw.c +++ b/src/us2/levels/11_joba/L11_002DED18-sw.c @@ -74,7 +74,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_refresh_speed_from_timer(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l11_enter_state_us2(s32, s32); +s32 hero_l11_set_move_state_us2(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -151,7 +151,7 @@ void hero_decide_next_state_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l11_enter_state_us2(0x39, 1); + hero_l11_set_move_state_us2(0x39, 1); goto end; } } @@ -186,7 +186,7 @@ void hero_decide_next_state_us2(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_proximity_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l11_enter_state_us2(0x74, 1); + hero_l11_set_move_state_us2(0x74, 1); goto end; } } @@ -196,12 +196,12 @@ void hero_decide_next_state_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state_us2(1, 1); + hero_l11_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l11_enter_state_us2(0x82, 1); + hero_l11_set_move_state_us2(0x82, 1); break; } { @@ -237,7 +237,7 @@ void hero_decide_next_state_us2(void) { rec = g_hero_idle_choice_table + sp40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l11_enter_state_us2(0x3C, 1); + hero_l11_set_move_state_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -280,12 +280,12 @@ void hero_decide_next_state_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l11_enter_state_us2(0x76, 1); + hero_l11_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); } break; } @@ -306,12 +306,12 @@ void hero_decide_next_state_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_action_blocked_flag == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l11_enter_state_us2(0x6E, 1); + hero_l11_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l11_enter_state_us2(4, 1); + hero_l11_set_move_state_us2(4, 1); break; } } @@ -332,28 +332,28 @@ void hero_decide_next_state_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l11_enter_state_us2(2, 1); + hero_l11_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state_us2(1, 1); + hero_l11_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l11_enter_state_us2(0x3D, 1); + hero_l11_set_move_state_us2(0x3D, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l11_enter_state_us2(0x3D, 1); + hero_l11_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l11_enter_state_us2(0, 1); + hero_l11_set_move_state_us2(0, 1); } break; case 0x3D: @@ -362,22 +362,22 @@ void hero_decide_next_state_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state_us2(4, 1); + hero_l11_set_move_state_us2(4, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l11_enter_state_us2(2, 1); + hero_l11_set_move_state_us2(2, 1); break; } - hero_l11_enter_state_us2(0, 1); + hero_l11_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -427,9 +427,9 @@ void hero_decide_next_state_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state_us2(4, 1); + hero_l11_set_move_state_us2(4, 1); } else { - hero_l11_enter_state_us2(0, 0); + hero_l11_set_move_state_us2(0, 0); anim = hero_get_gadget_value(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -441,9 +441,9 @@ void hero_decide_next_state_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l11_enter_state_us2(0, 0); + hero_l11_set_move_state_us2(0, 0); } else { - hero_l11_enter_state_us2(0, 1); + hero_l11_set_move_state_us2(0, 1); } } break; @@ -476,7 +476,7 @@ void hero_decide_next_state_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state_us2(7, 1); + hero_l11_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -485,7 +485,7 @@ void hero_decide_next_state_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l11_enter_state_us2(0, 0); + hero_l11_set_move_state_us2(0, 0); } break; } @@ -507,7 +507,7 @@ void hero_decide_next_state_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state_us2(7, 1); + hero_l11_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -520,7 +520,7 @@ void hero_decide_next_state_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l11_enter_state_us2(2, 0); + hero_l11_set_move_state_us2(2, 0); set_hero_animation(3, g_hero_anim_ids_by_mode[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -531,22 +531,22 @@ void hero_decide_next_state_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l11_enter_state_us2(2, 1); + hero_l11_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l11_enter_state_us2(0, 0); + hero_l11_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state_us2(0, 0); + hero_l11_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l11_enter_state_us2(0, 1); + hero_l11_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -563,7 +563,7 @@ void hero_decide_next_state_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state_us2(7, 1); + hero_l11_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -572,7 +572,7 @@ void hero_decide_next_state_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l11_enter_state_us2(0, 0); + hero_l11_set_move_state_us2(0, 0); set_hero_animation(hero_get_gadget_value(0), 0, 15.0f); break; } @@ -584,7 +584,7 @@ void hero_decide_next_state_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state_us2(0, 1); + hero_l11_set_move_state_us2(0, 1); } break; case 0x2: @@ -598,11 +598,11 @@ void hero_decide_next_state_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l11_enter_state_us2(0x76, 1); + hero_l11_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); break; } n = 9; @@ -616,12 +616,12 @@ void hero_decide_next_state_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l11_enter_state_us2(9, 1); + hero_l11_set_move_state_us2(9, 1); } else { - hero_l11_enter_state_us2(7, 1); + hero_l11_set_move_state_us2(7, 1); } } else { - hero_l11_enter_state_us2(7, 1); + hero_l11_set_move_state_us2(7, 1); } break; } @@ -629,11 +629,11 @@ void hero_decide_next_state_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state_us2(1, 1); + hero_l11_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state_us2(4, 1); + hero_l11_set_move_state_us2(4, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -644,7 +644,7 @@ void hero_decide_next_state_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l11_enter_state_us2(0, 0) == 0) { + if (hero_l11_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -684,17 +684,17 @@ void hero_decide_next_state_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l11_enter_state_us2(3, 0); + hero_l11_set_move_state_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l11_enter_state_us2(0x77, 1); + hero_l11_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l11_enter_state_us2(0x77, 1); + hero_l11_set_move_state_us2(0x77, 1); break; } } @@ -712,11 +712,11 @@ void hero_decide_next_state_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l11_enter_state_us2(0x64, 1); + hero_l11_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l11_enter_state_us2(0x63, 1); + hero_l11_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -724,21 +724,21 @@ void hero_decide_next_state_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state_us2(0x62, 1); + hero_l11_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l11_enter_state_us2(0, 1); + hero_l11_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l11_enter_state_us2(0x62, 1); + hero_l11_set_move_state_us2(0x62, 1); } break; case 0x65: /* switch 2 */ temp_a0_11 = FLD(g_hero_state, s32, 0x18C0); if ((temp_a0_11 < 3) && (((temp_a0_11 * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 7, &sp44) != 0)) { - hero_l11_enter_state_us2(0x66, 1); + hero_l11_set_move_state_us2(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -781,30 +781,30 @@ void hero_decide_next_state_us2(void) { return; case 0x6D: if ((f32)g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l11_enter_state_us2(0, 1); + hero_l11_set_move_state_us2(0, 1); } break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state_us2(1, 1); + hero_l11_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l11_enter_state_us2(7, 1); + hero_l11_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state_us2(4, 1); + hero_l11_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state_us2(0, 1); + hero_l11_set_move_state_us2(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -812,45 +812,45 @@ void hero_decide_next_state_us2(void) { } if (hero_get_gadget_value(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l11_enter_state_us2(0, 0); + hero_l11_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l11_enter_state_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l11_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_gadget_value(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l11_enter_state_us2(2, 1); + hero_l11_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state_us2(1, 1); + hero_l11_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state_us2(0, 0); + hero_l11_set_move_state_us2(0, 0); set_hero_animation(hero_get_gadget_value(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l11_enter_state_us2(0x76, 1); + hero_l11_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l11_enter_state_us2(0x15, 1); + hero_l11_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l11_enter_state_us2(0, 1); + hero_l11_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -858,17 +858,17 @@ void hero_decide_next_state_us2(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l11_enter_state_us2(0x8B, 1); + hero_l11_set_move_state_us2(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l11_enter_state_us2(0, 1); + hero_l11_set_move_state_us2(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l11_enter_state_us2(0, 1); + hero_l11_set_move_state_us2(0, 1); } break; case 0x24: @@ -894,14 +894,14 @@ void hero_decide_next_state_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l11_enter_state_us2(0, 0); + hero_l11_set_move_state_us2(0, 0); set_hero_animation(hero_get_gadget_value(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l11_enter_state_us2(6, 0); + hero_l11_set_move_state_us2(6, 0); } else { - hero_l11_enter_state_us2(6, 0); + hero_l11_set_move_state_us2(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -917,9 +917,9 @@ void hero_decide_next_state_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l11_enter_state_us2(0, 1); + hero_l11_set_move_state_us2(0, 1); } else { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -931,7 +931,7 @@ void hero_decide_next_state_us2(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l11_enter_state_us2(0x2C, 1); + hero_l11_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -948,13 +948,13 @@ void hero_decide_next_state_us2(void) { } } if (FLD(g_hero_state, s32, 0x6F0) >= 6) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x204) = 0x1E; } break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l11_enter_state_us2(0x18, 0); + hero_l11_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -963,18 +963,18 @@ void hero_decide_next_state_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l11_enter_state_us2(0x1B, 1); + hero_l11_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -983,7 +983,7 @@ void hero_decide_next_state_us2(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l11_enter_state_us2(0x19, 1); + hero_l11_set_move_state_us2(0x19, 1); } break; } @@ -994,7 +994,7 @@ void hero_decide_next_state_us2(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l11_enter_state_us2(0x1A, 1); + hero_l11_set_move_state_us2(0x1A, 1); } } } @@ -1013,18 +1013,18 @@ void hero_decide_next_state_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state_us2(0x18, 1); + hero_l11_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l11_enter_state_us2(0x1B, 1); + hero_l11_set_move_state_us2(0x1B, 1); } break; } @@ -1034,9 +1034,9 @@ void hero_decide_next_state_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); } else { - hero_l11_enter_state_us2(0, 1); + hero_l11_set_move_state_us2(0, 1); } } break; @@ -1060,12 +1060,12 @@ void hero_decide_next_state_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l11_enter_state_us2(0x39, 1); + hero_l11_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l11_enter_state_us2(0, 0) != 0) { + if (hero_l11_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1073,7 +1073,7 @@ void hero_decide_next_state_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l11_enter_state_us2(0, 0) != 0) { + if (hero_l11_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1087,32 +1087,32 @@ void hero_decide_next_state_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l11_enter_state_us2(2, 1); + hero_l11_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l11_enter_state_us2(3, 0) != 0) { + if (hero_l11_set_move_state_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l11_enter_state_us2(0, 1); + hero_l11_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l11_enter_state_us2(8, 1); + hero_l11_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state_us2(0x17, 1); + hero_l11_set_move_state_us2(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l11_enter_state_us2(0x71, 1); + hero_l11_set_move_state_us2(0x71, 1); } } break; @@ -1143,7 +1143,7 @@ void hero_decide_next_state_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l11_enter_state_us2(0, 0) != 0) { + if (hero_l11_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1153,9 +1153,9 @@ void hero_decide_next_state_us2(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l11_enter_state_us2(0x74, 1); + hero_l11_set_move_state_us2(0x74, 1); } else { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); } } break; @@ -1168,16 +1168,16 @@ void hero_decide_next_state_us2(void) { ok = 1; } if (ok != 0) { - hero_l11_enter_state_us2(0x11, 1); + hero_l11_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state_us2(0x17, 1); + hero_l11_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1188,23 +1188,23 @@ void hero_decide_next_state_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l11_enter_state_us2(3, 0) != 0) { + if (hero_l11_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l11_enter_state_us2(4, 1); + hero_l11_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_anim_range_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l11_enter_state_us2(2, 1); + hero_l11_set_move_state_us2(2, 1); break; } - hero_l11_enter_state_us2(2, 0); + hero_l11_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1213,21 +1213,21 @@ void hero_decide_next_state_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_anim_range_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l11_enter_state_us2(2, 1); + hero_l11_set_move_state_us2(2, 1); break; } - hero_l11_enter_state_us2(2, 0); + hero_l11_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_landing_anim_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l11_enter_state_us2(0, 0) != 0) { + if (hero_l11_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_gadget_value(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l11_enter_state_us2(0, 0) != 0) { + } else if (hero_l11_set_move_state_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1275,14 +1275,14 @@ void hero_decide_next_state_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state_us2(0xB, 1); + hero_l11_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l11_enter_state_us2(0x82, 1); + hero_l11_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1291,25 +1291,25 @@ void hero_decide_next_state_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l11_enter_state_us2(0xA, 1); + hero_l11_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l11_enter_state_us2(0x10, 1); + hero_l11_set_move_state_us2(0x10, 1); } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l11_enter_state_us2(0x71, 1); + hero_l11_set_move_state_us2(0x71, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l11_enter_state_us2(0x77, 1); + hero_l11_set_move_state_us2(0x77, 1); break; } } @@ -1413,7 +1413,7 @@ void hero_decide_next_state_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l11_enter_state_us2(3, 0) != 0) { + if (hero_l11_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1421,13 +1421,13 @@ void hero_decide_next_state_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_anim_range_table[0][2])) { - hero_l11_enter_state_us2(7, 1); + hero_l11_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l11_enter_state_us2(7, 1); + hero_l11_set_move_state_us2(7, 1); } else if (g_hero_anim_range_table[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l11_enter_state_us2(9, 1); + hero_l11_set_move_state_us2(9, 1); } else { - hero_l11_enter_state_us2(7, 1); + hero_l11_set_move_state_us2(7, 1); } break; } @@ -1435,10 +1435,10 @@ void hero_decide_next_state_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_action(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); break; } { @@ -1448,7 +1448,7 @@ void hero_decide_next_state_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l11_enter_state_us2(0x11, 1); + hero_l11_set_move_state_us2(0x11, 1); break; } } @@ -1477,7 +1477,7 @@ void hero_decide_next_state_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l11_enter_state_us2(0xE, 1); + hero_l11_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1487,32 +1487,32 @@ void hero_decide_next_state_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l11_enter_state_us2(8, 1); + hero_l11_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l11_enter_state_us2(0x17, 1); + hero_l11_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l11_enter_state_us2(0x79, 1); + hero_l11_set_move_state_us2(0x79, 1); } else { - hero_l11_enter_state_us2(0x39, 1); + hero_l11_set_move_state_us2(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l11_enter_state_us2(0x82, 1); + hero_l11_set_move_state_us2(0x82, 1); } else { - hero_l11_enter_state_us2(0, 0); + hero_l11_set_move_state_us2(0, 0); } } break; @@ -1522,8 +1522,8 @@ void hero_decide_next_state_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l11_enter_state_us2(0x39, 1); - } else if (hero_l11_enter_state_us2(0, 0) != 0) { + hero_l11_set_move_state_us2(0x39, 1); + } else if (hero_l11_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_gadget_value(0), 0, 13.0f); } } @@ -1548,28 +1548,28 @@ void hero_decide_next_state_us2(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l11_enter_state_us2(0x4E, 1); + hero_l11_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l11_enter_state_us2(1, 1); + hero_l11_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l11_enter_state_us2(0x41, 1); + hero_l11_set_move_state_us2(0x41, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l11_enter_state_us2(0x45, 1); + hero_l11_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l11_enter_state_us2(0x4D, 1); + hero_l11_set_move_state_us2(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l11_enter_state_us2(0x40, 1); + hero_l11_set_move_state_us2(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -1582,14 +1582,14 @@ void hero_decide_next_state_us2(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l11_enter_state_us2(0x4E, 1); + hero_l11_set_move_state_us2(0x4E, 1); break; } rec = (u8 *)&g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l11_enter_state_us2(0x3F, 0); + hero_l11_set_move_state_us2(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -1598,13 +1598,13 @@ void hero_decide_next_state_us2(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0x10) ? n : 0xF, NULL) != 0) { - hero_l11_enter_state_us2(0x4D, 1); + hero_l11_set_move_state_us2(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l11_enter_state_us2(0x45, 1); + hero_l11_set_move_state_us2(0x45, 1); } break; } @@ -1667,42 +1667,42 @@ void hero_decide_next_state_us2(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l11_enter_state_us2(0x45, 1); + hero_l11_set_move_state_us2(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_anim_range_table[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l11_enter_state_us2(0x40, 1); + hero_l11_set_move_state_us2(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l11_enter_state_us2(0x3F, 1); + hero_l11_set_move_state_us2(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l11_enter_state_us2(0x41, 1); + hero_l11_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 5, NULL) != 0)) { - hero_l11_enter_state_us2(0x4D, 1); + hero_l11_set_move_state_us2(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state_us2(0x46, 1); + hero_l11_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l11_enter_state_us2(0x4B, 1); + hero_l11_set_move_state_us2(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l11_enter_state_us2(0x41, 1); + hero_l11_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state_us2(0x46, 1); + hero_l11_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -1712,11 +1712,11 @@ void hero_decide_next_state_us2(void) { FLD(g_hero_state, s16, 0x1EE) = 0xC - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l11_enter_state_us2(0x40, 1); + hero_l11_set_move_state_us2(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l11_enter_state_us2(0x3F, 1); + hero_l11_set_move_state_us2(0x3F, 1); } break; case 0x41: @@ -1728,29 +1728,29 @@ void hero_decide_next_state_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l11_enter_state_us2(0x43, 1); + hero_l11_set_move_state_us2(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l11_enter_state_us2(0x40, 1); + hero_l11_set_move_state_us2(0x40, 1); } else { - hero_l11_enter_state_us2(0x3F, 1); + hero_l11_set_move_state_us2(0x3F, 1); } } else { - hero_l11_enter_state_us2(0x3F, 1); + hero_l11_set_move_state_us2(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l11_enter_state_us2(0x46, 1); + hero_l11_set_move_state_us2(0x46, 1); break; } if ((PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l11_enter_state_us2(0x4B, 1); + hero_l11_set_move_state_us2(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l11_enter_state_us2(0x3F, 1); + hero_l11_set_move_state_us2(0x3F, 1); } break; case 0x4E: @@ -1759,9 +1759,9 @@ void hero_decide_next_state_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l11_enter_state_us2(0x41, 1); + hero_l11_set_move_state_us2(0x41, 1); } else { - hero_l11_enter_state_us2(0x3F, 1); + hero_l11_set_move_state_us2(0x3F, 1); } } break; @@ -1771,7 +1771,7 @@ void hero_decide_next_state_us2(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l11_enter_state_us2(0x4E, 1); + hero_l11_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.025000002f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -1797,55 +1797,55 @@ void hero_decide_next_state_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l11_enter_state_us2(0x45, 1); + hero_l11_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l11_enter_state_us2(0x4D, 1); + hero_l11_set_move_state_us2(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l11_enter_state_us2(0x41, 1); + hero_l11_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l11_enter_state_us2(0x3F, 1); + hero_l11_set_move_state_us2(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l11_enter_state_us2(0x41, 1); + hero_l11_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x24) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l11_enter_state_us2(0x43, 1); + hero_l11_set_move_state_us2(0x43, 1); } else { - hero_l11_enter_state_us2(0x3F, 0); + hero_l11_set_move_state_us2(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state_us2(0x47, 1); + hero_l11_set_move_state_us2(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)v10 = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l11_enter_state_us2(0x41, 1); + hero_l11_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l11_enter_state_us2(0x41, 1); + hero_l11_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l11_enter_state_us2(0x48, 1); + hero_l11_set_move_state_us2(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1854,7 +1854,7 @@ void hero_decide_next_state_us2(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l11_enter_state_us2(0x49, 1); + hero_l11_set_move_state_us2(0x49, 1); } break; } @@ -1865,7 +1865,7 @@ void hero_decide_next_state_us2(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l11_enter_state_us2(0x4A, 1); + hero_l11_set_move_state_us2(0x4A, 1); } } } @@ -1884,17 +1884,17 @@ void hero_decide_next_state_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l11_enter_state_us2(0x47, 1); + hero_l11_set_move_state_us2(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l11_enter_state_us2(0x41, 1); + hero_l11_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l11_enter_state_us2(0x48, 1); + hero_l11_set_move_state_us2(0x48, 1); } break; } @@ -1909,7 +1909,7 @@ void hero_decide_next_state_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l11_enter_state_us2(0, 0); + hero_l11_set_move_state_us2(0, 0); anim = hero_get_gadget_value(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1920,7 +1920,7 @@ void hero_decide_next_state_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l11_enter_state_us2(0, 0); + hero_l11_set_move_state_us2(0, 0); } break; case 0x22: @@ -1930,12 +1930,12 @@ void hero_decide_next_state_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_l11_enter_state_us2(7, 1); + hero_l11_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l11_enter_state_us2(0, 0); + hero_l11_set_move_state_us2(0, 0); } break; default: diff --git a/src/us2/levels/11_joba/L11_0043F9DC-main-g64.c b/src/us2/levels/11_joba/L11_0043F9DC-main-g64.c index 3afe18f9b..578e95af5 100644 --- a/src/us2/levels/11_joba/L11_0043F9DC-main-g64.c +++ b/src/us2/levels/11_joba/L11_0043F9DC-main-g64.c @@ -219,7 +219,7 @@ extern void global_object_start(char *, int); extern void script_queue_keyed_request(s32, s32); extern s32 moby_has_free_child_slot_state2(u8 *); extern void moby_try_alloc_enter_state2(void *); -extern s32 hero_l11_enter_state(s32, s32); +extern s32 hero_l11_set_move_state(s32, s32); extern int arena_get_challenge_display_id(unsigned int); extern int arena_get_challenge_flag_index(unsigned int); extern void arena_end_frame(u8 *); @@ -773,10 +773,10 @@ void arena_controller_update_us2(u8 *obj) { ((Hero *)g_hero_state)->i[0xF4 / 4] = 0; if (((Hero *)g_hero_state)->i[0x2294 / 4] != 7) { if (((Hero *)g_hero_state)->i[0x2294 / 4] != 0x81) { - hero_l11_enter_state(7, 1); + hero_l11_set_move_state(7, 1); } } else { - hero_l11_enter_state(0x81, 1); + hero_l11_set_move_state(0x81, 1); } if (vec_distance_xy(&((Hero *)g_hero_state)->f[0x80 / 4], lt1->pos) < 0.01f) { ((Hero *)g_hero_state)->f[0x84 / 4] += 0.01f; @@ -898,7 +898,7 @@ void arena_controller_update_us2(u8 *obj) { arena_queue_voice_line(obj, 4); } } else { - hero_l11_enter_state(0x6F, 1); + hero_l11_set_move_state(0x6F, 1); OBJ->phase = 2; st->mode = 4; OBJ->timer = 0; @@ -933,7 +933,7 @@ void arena_controller_update_us2(u8 *obj) { if (OBJ->timer >= 0xB5) { ((Hero *)g_hero_state)->h[0x348 / 2] = 0; g_hero_speed_param = 5.0f; - hero_l11_enter_state(0x81, 1); + hero_l11_set_move_state(0x81, 1); OBJ->phase = 3; } } else if (OBJ->phase == 3) { diff --git a/src/us2/levels/12_todano/L12_002B86E8.c b/src/us2/levels/12_todano/L12_002B86E8.c index ec3ba89a1..ce5936168 100644 --- a/src/us2/levels/12_todano/L12_002B86E8.c +++ b/src/us2/levels/12_todano/L12_002B86E8.c @@ -62,7 +62,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l12_set_action_us2(s32, s32); +extern s32 hero_l12_set_move_state_us2(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_us2(s32); extern int hero_play_sound(s32, s32); @@ -133,7 +133,7 @@ s32 hero_l12_apply_contact_push_us2(s32 apply_response) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB || *(s16 *)(other + 0xAA) == 0x558)) { - hero_l12_set_action_us2(0x7D, 1); + hero_l12_set_move_state_us2(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -144,7 +144,7 @@ s32 hero_l12_apply_contact_push_us2(s32 apply_response) { AdjustPlayerHealth_us2(FloatToInt(*(float *)(r + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l12_set_action_us2(0x16, 1); + hero_l12_set_move_state_us2(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -154,13 +154,13 @@ s32 hero_l12_apply_contact_push_us2(s32 apply_response) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l12_set_action_us2(0x72, 1); + hero_l12_set_move_state_us2(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l12_set_action_us2(0x73, 1); + hero_l12_set_move_state_us2(0x73, 1); } else if (entry->f24 & 8) { - hero_l12_set_action_us2(0x8C, 1); + hero_l12_set_move_state_us2(0x8C, 1); } else { - hero_l12_set_action_us2(0x16, 1); + hero_l12_set_move_state_us2(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&push); @@ -172,7 +172,7 @@ s32 hero_l12_apply_contact_push_us2(s32 apply_response) { } break; case 1: - hero_l12_set_action_us2(0x42, 1); + hero_l12_set_move_state_us2(0x42, 1); hero_flatten_push_vector(&push, flag, 0.083333336f, 0.050000004f); break; } diff --git a/src/us2/levels/12_todano/L12_002C0110-sw.c b/src/us2/levels/12_todano/L12_002C0110-sw.c index a043acacb..e8ea06911 100644 --- a/src/us2/levels/12_todano/L12_002C0110-sw.c +++ b/src/us2/levels/12_todano/L12_002C0110-sw.c @@ -147,7 +147,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -716,7 +716,7 @@ void hero_l12_update_state_machine_us2(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { temp_a2 = ((Hero *)g_hero_state)->i[0x2440/4]; if (temp_a2 != -1) { @@ -1459,7 +1459,7 @@ void hero_l12_update_state_machine_us2(void) { coll_process_hit(0.4f, (s32)((TI128*)vec_a), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec_b)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_state_copy_a)->f[0x180/4] = 0.1f; diff --git a/src/us2/levels/12_todano/L12_002C0110-sw2.c b/src/us2/levels/12_todano/L12_002C0110-sw2.c index 8a16b6c44..a90e8bd07 100644 --- a/src/us2/levels/12_todano/L12_002C0110-sw2.c +++ b/src/us2/levels/12_todano/L12_002C0110-sw2.c @@ -78,8 +78,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -148,7 +148,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u /* Changes the player's action, initializes its movement parameters and selects animation. */ /* Changes the player's action, initializes its movement parameters and selects animation. (USA v2.00) */ -s32 hero_l12_set_action_us2(s32 action, s32 animate) { +s32 hero_l12_set_move_state_us2(s32 action, s32 animate) { f32 dir[4]; u8 *objectSnapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -196,7 +196,9 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -209,8 +211,8 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l12_set_action_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action_us2(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l12_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_or_form_id(0) == 0x51) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_or_form_id(0), 0, -1.0f); @@ -357,7 +359,7 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l12_set_action_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l12_set_move_state_us2(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -403,12 +405,12 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l12_set_action_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action_us2(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l12_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_or_form_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l12_set_action_us2(0, 0)) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); + if (hero_l12_set_move_state_us2(0, 0)) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -433,7 +435,7 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -592,13 +594,13 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l12_set_action_us2(0x81, 1); return 0; + hero_l12_set_move_state_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l12_action_block_flag) { hero_l12_set_action_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l12_action_block_flag) { hero_l12_set_move_state_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l12_set_action_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l12_set_move_state_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -673,9 +675,9 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_condition_flag) hero_l12_set_action_us2(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l12_set_action_us2(0x79, 1); - else hero_l12_set_action_us2(0x39, 1); + if (g_current_map_index == 2 && g_hero_condition_flag) hero_l12_set_move_state_us2(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l12_set_move_state_us2(0x79, 1); + else hero_l12_set_move_state_us2(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -712,7 +714,7 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -741,7 +743,7 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -750,7 +752,7 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -886,7 +888,7 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -967,7 +969,7 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -979,7 +981,7 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -1014,7 +1016,7 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { set_hero_animation(0x11, 0, 8.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action_us2(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state_us2(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation(0, 0, 9.0f); goto finish; case 0x4B: @@ -1048,7 +1050,7 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l12_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_action_us2(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l12_set_move_state_us2(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1092,7 +1094,7 @@ s32 hero_l12_set_action_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l12_set_action_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l12_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/12_todano/L12_002CF9E0-sw.c b/src/us2/levels/12_todano/L12_002CF9E0-sw.c index 8d484484f..39a76efc5 100644 --- a/src/us2/levels/12_todano/L12_002CF9E0-sw.c +++ b/src/us2/levels/12_todano/L12_002CF9E0-sw.c @@ -76,7 +76,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l12_set_action_us2(s32, s32); +s32 hero_l12_set_move_state_us2(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -152,7 +152,7 @@ void hero_decide_todano_state_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l12_set_action_us2(0x39, 1); + hero_l12_set_move_state_us2(0x39, 1); goto end; } } @@ -187,7 +187,7 @@ void hero_decide_todano_state_us2(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_todano_hero_height_limit) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l12_set_action_us2(0x74, 1); + hero_l12_set_move_state_us2(0x74, 1); goto end; } } @@ -198,12 +198,12 @@ void hero_decide_todano_state_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action_us2(1, 1); + hero_l12_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l12_set_action_us2(0x82, 1); + hero_l12_set_move_state_us2(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -240,7 +240,7 @@ void hero_decide_todano_state_us2(void) { rec = g_item_l12_record_table + selected_slot * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l12_set_action_us2(0x3C, 1); + hero_l12_set_move_state_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -283,12 +283,12 @@ void hero_decide_todano_state_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l12_set_action_us2(0x76, 1); + hero_l12_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); } break; } @@ -309,17 +309,17 @@ void hero_decide_todano_state_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l12_action_block_flag == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l12_set_action_us2(0x6E, 1); + hero_l12_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l12_set_action_us2(4, 1); + hero_l12_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l12_set_action_us2(0x2E, 1); + hero_l12_set_move_state_us2(0x2E, 1); break; } { @@ -339,28 +339,28 @@ void hero_decide_todano_state_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l12_set_action_us2(2, 1); + hero_l12_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action_us2(1, 1); + hero_l12_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l12_set_action_us2(0x3D, 1); + hero_l12_set_move_state_us2(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l12_set_action_us2(0x3D, 1); + hero_l12_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l12_set_action_us2(0, 1); + hero_l12_set_move_state_us2(0, 1); } break; case 0x3D: @@ -369,22 +369,22 @@ void hero_decide_todano_state_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action_us2(4, 1); + hero_l12_set_move_state_us2(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l12_set_action_us2(2, 1); + hero_l12_set_move_state_us2(2, 1); break; } - hero_l12_set_action_us2(0, 1); + hero_l12_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -423,25 +423,25 @@ void hero_decide_todano_state_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l12_set_action_us2(0x33, 1); + hero_l12_set_move_state_us2(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l12_set_action_us2(0x34, 1); + hero_l12_set_move_state_us2(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l12_set_action_us2(0x32, 1); + hero_l12_set_move_state_us2(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l12_set_action_us2(0x33, 1); + hero_l12_set_move_state_us2(0x33, 1); } } break; @@ -454,81 +454,81 @@ void hero_decide_todano_state_us2(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l12_set_action_us2(0x32, 1); + hero_l12_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l12_set_action_us2(0x34, 1); + hero_l12_set_move_state_us2(0x34, 1); } else { - hero_l12_set_action_us2(0x32, 1); + hero_l12_set_move_state_us2(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l12_set_action_us2(0x12, 1); + hero_l12_set_move_state_us2(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l12_set_action_us2(0x32, 1); + hero_l12_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l12_set_action_us2(0x34, 1); + hero_l12_set_move_state_us2(0x34, 1); } else { - hero_l12_set_action_us2(0x32, 1); + hero_l12_set_move_state_us2(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l12_set_action_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l12_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l12_set_action_us2(0x35, 1); + hero_l12_set_move_state_us2(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l12_set_action_us2(0x12, 1); + hero_l12_set_move_state_us2(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l12_set_action_us2(0x32, 1); + hero_l12_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l12_set_action_us2(0x34, 1); + hero_l12_set_move_state_us2(0x34, 1); } else { - hero_l12_set_action_us2(0x32, 1); + hero_l12_set_move_state_us2(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l12_set_action_us2(0x70, 0); + hero_l12_set_move_state_us2(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l12_set_action_us2(0x36, 1); + hero_l12_set_move_state_us2(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action_us2(0x67, 1); + hero_l12_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_us2(0x33, 1); + hero_l12_set_move_state_us2(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l12_set_action_us2(0x33, 0); + hero_l12_set_move_state_us2(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action_us2(0x67, 1); + hero_l12_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l12_set_action_us2(0x36, 0); + hero_l12_set_move_state_us2(0x36, 0); } break; case 0x1: @@ -562,9 +562,9 @@ void hero_decide_todano_state_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action_us2(4, 1); + hero_l12_set_move_state_us2(4, 1); } else { - hero_l12_set_action_us2(0, 0); + hero_l12_set_move_state_us2(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -576,9 +576,9 @@ void hero_decide_todano_state_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l12_set_action_us2(0, 0); + hero_l12_set_move_state_us2(0, 0); } else { - hero_l12_set_action_us2(0, 1); + hero_l12_set_move_state_us2(0, 1); } } break; @@ -611,7 +611,7 @@ void hero_decide_todano_state_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action_us2(7, 1); + hero_l12_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -620,7 +620,7 @@ void hero_decide_todano_state_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l12_set_action_us2(0, 0); + hero_l12_set_move_state_us2(0, 0); } break; } @@ -642,7 +642,7 @@ void hero_decide_todano_state_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action_us2(7, 1); + hero_l12_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -655,7 +655,7 @@ void hero_decide_todano_state_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l12_set_action_us2(2, 0); + hero_l12_set_move_state_us2(2, 0); set_hero_animation(3, g_hero_l12_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -666,22 +666,22 @@ void hero_decide_todano_state_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l12_set_action_us2(2, 1); + hero_l12_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l12_set_action_us2(0, 0); + hero_l12_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_us2(0, 0); + hero_l12_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l12_set_action_us2(0, 1); + hero_l12_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -698,7 +698,7 @@ void hero_decide_todano_state_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action_us2(7, 1); + hero_l12_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -707,7 +707,7 @@ void hero_decide_todano_state_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l12_set_action_us2(0, 0); + hero_l12_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, 15.0f); break; } @@ -719,7 +719,7 @@ void hero_decide_todano_state_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_us2(0, 1); + hero_l12_set_move_state_us2(0, 1); } break; case 0x2: @@ -733,11 +733,11 @@ void hero_decide_todano_state_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l12_set_action_us2(0x76, 1); + hero_l12_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); break; } n = 9; @@ -751,12 +751,12 @@ void hero_decide_todano_state_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l12_set_action_us2(9, 1); + hero_l12_set_move_state_us2(9, 1); } else { - hero_l12_set_action_us2(7, 1); + hero_l12_set_move_state_us2(7, 1); } } else { - hero_l12_set_action_us2(7, 1); + hero_l12_set_move_state_us2(7, 1); } break; } @@ -764,11 +764,11 @@ void hero_decide_todano_state_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action_us2(1, 1); + hero_l12_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action_us2(4, 1); + hero_l12_set_move_state_us2(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -785,21 +785,21 @@ void hero_decide_todano_state_us2(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l12_set_action_us2(0x2E, 1); + hero_l12_set_move_state_us2(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l12_set_action_us2(2, 1); + hero_l12_set_move_state_us2(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l12_set_action_us2(0x70, 1); + hero_l12_set_move_state_us2(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l12_set_action_us2(2, 1); + hero_l12_set_move_state_us2(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -810,7 +810,7 @@ void hero_decide_todano_state_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l12_set_action_us2(0, 0) == 0) { + if (hero_l12_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -827,7 +827,7 @@ void hero_decide_todano_state_us2(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l12_set_action_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l12_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } if (FLD(cur_move, u8, 0x43) == 0x37) { @@ -848,7 +848,7 @@ void hero_decide_todano_state_us2(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l12_set_action_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l12_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -882,17 +882,17 @@ void hero_decide_todano_state_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l12_set_action_us2(3, 0); + hero_l12_set_move_state_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l12_set_action_us2(0x77, 1); + hero_l12_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l12_set_action_us2(0x77, 1); + hero_l12_set_move_state_us2(0x77, 1); break; } } @@ -910,11 +910,11 @@ void hero_decide_todano_state_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l12_set_action_us2(0x64, 1); + hero_l12_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l12_set_action_us2(0x63, 1); + hero_l12_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -922,21 +922,21 @@ void hero_decide_todano_state_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_us2(0x62, 1); + hero_l12_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l12_set_action_us2(0, 1); + hero_l12_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l12_set_action_us2(0x62, 1); + hero_l12_set_move_state_us2(0x62, 1); } break; case 0x65: /* switch 2 */ spawn_count = FLD(g_hero_state, s32, 0x18C0); if ((spawn_count < 3) && (((spawn_count * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 7, &spawn_slot) != 0)) { - hero_l12_set_action_us2(0x66, 1); + hero_l12_set_move_state_us2(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -979,7 +979,7 @@ void hero_decide_todano_state_us2(void) { return; case 0x6D: if ((f32)g_hero_l12_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l12_set_action_us2(0, 1); + hero_l12_set_move_state_us2(0, 1); } break; case 0x30: @@ -992,7 +992,7 @@ void hero_decide_todano_state_us2(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l12_set_action_us2(0, 0) != 0) { + if (hero_l12_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1000,25 +1000,25 @@ void hero_decide_todano_state_us2(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action_us2(1, 1); + hero_l12_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l12_set_action_us2(7, 1); + hero_l12_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action_us2(4, 1); + hero_l12_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_us2(0, 1); + hero_l12_set_move_state_us2(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1026,45 +1026,45 @@ void hero_decide_todano_state_us2(void) { } if (hero_get_weapon_or_form_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l12_set_action_us2(0, 0); + hero_l12_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l12_set_action_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l12_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l12_set_action_us2(2, 1); + hero_l12_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action_us2(1, 1); + hero_l12_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action_us2(0, 0); + hero_l12_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l12_set_action_us2(0x76, 1); + hero_l12_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l12_set_action_us2(0x15, 1); + hero_l12_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l12_set_action_us2(0, 1); + hero_l12_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1072,17 +1072,17 @@ void hero_decide_todano_state_us2(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l12_set_action_us2(0x8B, 1); + hero_l12_set_move_state_us2(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l12_set_action_us2(0, 1); + hero_l12_set_move_state_us2(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l12_set_action_us2(0, 1); + hero_l12_set_move_state_us2(0, 1); } break; case 0x24: @@ -1108,14 +1108,14 @@ void hero_decide_todano_state_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l12_set_action_us2(0, 0); + hero_l12_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l12_set_action_us2(6, 0); + hero_l12_set_move_state_us2(6, 0); } else { - hero_l12_set_action_us2(6, 0); + hero_l12_set_move_state_us2(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1131,9 +1131,9 @@ void hero_decide_todano_state_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l12_set_action_us2(0, 1); + hero_l12_set_move_state_us2(0, 1); } else { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1145,7 +1145,7 @@ void hero_decide_todano_state_us2(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l12_set_action_us2(0x2C, 1); + hero_l12_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1162,13 +1162,13 @@ void hero_decide_todano_state_us2(void) { } } if (FLD(g_hero_state, s32, 0x6F0) >= 6) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x204) = 0x1E; } break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l12_set_action_us2(0x18, 0); + hero_l12_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -1177,18 +1177,18 @@ void hero_decide_todano_state_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l12_set_action_us2(0x1B, 1); + hero_l12_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1197,7 +1197,7 @@ void hero_decide_todano_state_us2(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l12_set_action_us2(0x19, 1); + hero_l12_set_move_state_us2(0x19, 1); } break; } @@ -1208,7 +1208,7 @@ void hero_decide_todano_state_us2(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l12_set_action_us2(0x1A, 1); + hero_l12_set_move_state_us2(0x1A, 1); } } } @@ -1227,18 +1227,18 @@ void hero_decide_todano_state_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_us2(0x18, 1); + hero_l12_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l12_set_action_us2(0x1B, 1); + hero_l12_set_move_state_us2(0x1B, 1); } break; } @@ -1248,9 +1248,9 @@ void hero_decide_todano_state_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); } else { - hero_l12_set_action_us2(0, 1); + hero_l12_set_move_state_us2(0, 1); } } break; @@ -1274,12 +1274,12 @@ void hero_decide_todano_state_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action_us2(0x39, 1); + hero_l12_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l12_set_action_us2(0, 0) != 0) { + if (hero_l12_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1287,7 +1287,7 @@ void hero_decide_todano_state_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l12_set_action_us2(0, 0) != 0) { + if (hero_l12_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1301,32 +1301,32 @@ void hero_decide_todano_state_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l12_set_action_us2(2, 1); + hero_l12_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l12_set_action_us2(3, 0) != 0) { + if (hero_l12_set_move_state_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l12_set_action_us2(0, 1); + hero_l12_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l12_set_action_us2(8, 1); + hero_l12_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action_us2(0x17, 1); + hero_l12_set_move_state_us2(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l12_set_action_us2(0x71, 1); + hero_l12_set_move_state_us2(0x71, 1); } } break; @@ -1357,7 +1357,7 @@ void hero_decide_todano_state_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == MOBY_CLASS_LEVITATOR_PAD)) { - if (hero_l12_set_action_us2(0, 0) != 0) { + if (hero_l12_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1367,9 +1367,9 @@ void hero_decide_todano_state_us2(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l12_set_action_us2(0x74, 1); + hero_l12_set_move_state_us2(0x74, 1); } else { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); } } break; @@ -1382,16 +1382,16 @@ void hero_decide_todano_state_us2(void) { ok = 1; } if (ok != 0) { - hero_l12_set_action_us2(0x11, 1); + hero_l12_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action_us2(0x17, 1); + hero_l12_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1402,23 +1402,23 @@ void hero_decide_todano_state_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l12_set_action_us2(3, 0) != 0) { + if (hero_l12_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l12_set_action_us2(4, 1); + hero_l12_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_l12_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l12_set_action_us2(2, 1); + hero_l12_set_move_state_us2(2, 1); break; } - hero_l12_set_action_us2(2, 0); + hero_l12_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1427,21 +1427,21 @@ void hero_decide_todano_state_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_l12_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l12_set_action_us2(2, 1); + hero_l12_set_move_state_us2(2, 1); break; } - hero_l12_set_action_us2(2, 0); + hero_l12_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l12_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l12_set_action_us2(0, 0) != 0) { + if (hero_l12_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l12_set_action_us2(0, 0) != 0) { + } else if (hero_l12_set_move_state_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1489,14 +1489,14 @@ void hero_decide_todano_state_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action_us2(0xB, 1); + hero_l12_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l12_set_action_us2(0x82, 1); + hero_l12_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1505,25 +1505,25 @@ void hero_decide_todano_state_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l12_set_action_us2(0xA, 1); + hero_l12_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l12_set_action_us2(0x10, 1); + hero_l12_set_move_state_us2(0x10, 1); } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l12_set_action_us2(0x71, 1); + hero_l12_set_move_state_us2(0x71, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l12_set_action_us2(0x77, 1); + hero_l12_set_move_state_us2(0x77, 1); break; } } @@ -1627,7 +1627,7 @@ void hero_decide_todano_state_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l12_set_action_us2(3, 0) != 0) { + if (hero_l12_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1635,13 +1635,13 @@ void hero_decide_todano_state_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l12_speed_params[0][2])) { - hero_l12_set_action_us2(7, 1); + hero_l12_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l12_set_action_us2(7, 1); + hero_l12_set_move_state_us2(7, 1); } else if (g_hero_l12_speed_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l12_set_action_us2(9, 1); + hero_l12_set_move_state_us2(9, 1); } else { - hero_l12_set_action_us2(7, 1); + hero_l12_set_move_state_us2(7, 1); } break; } @@ -1649,10 +1649,10 @@ void hero_decide_todano_state_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); break; } { @@ -1662,7 +1662,7 @@ void hero_decide_todano_state_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &tmp_d) != 0) && (tmp_d < FLD(g_hero_state, s32, 0x1B8))) { - hero_l12_set_action_us2(0x11, 1); + hero_l12_set_move_state_us2(0x11, 1); break; } } @@ -1691,7 +1691,7 @@ void hero_decide_todano_state_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l12_set_action_us2(0xE, 1); + hero_l12_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1701,32 +1701,32 @@ void hero_decide_todano_state_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l12_set_action_us2(8, 1); + hero_l12_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l12_set_action_us2(0x17, 1); + hero_l12_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l12_set_action_us2(6, 1); + hero_l12_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l12_set_action_us2(0x79, 1); + hero_l12_set_move_state_us2(0x79, 1); } else { - hero_l12_set_action_us2(0x39, 1); + hero_l12_set_move_state_us2(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l12_set_action_us2(0x82, 1); + hero_l12_set_move_state_us2(0x82, 1); } else { - hero_l12_set_action_us2(0, 0); + hero_l12_set_move_state_us2(0, 0); } } break; @@ -1736,8 +1736,8 @@ void hero_decide_todano_state_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action_us2(0x39, 1); - } else if (hero_l12_set_action_us2(0, 0) != 0) { + hero_l12_set_move_state_us2(0x39, 1); + } else if (hero_l12_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 13.0f); } } @@ -1762,28 +1762,28 @@ void hero_decide_todano_state_us2(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l12_set_action_us2(0x4E, 1); + hero_l12_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l12_set_action_us2(1, 1); + hero_l12_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l12_set_action_us2(0x41, 1); + hero_l12_set_move_state_us2(0x41, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l12_set_action_us2(0x45, 1); + hero_l12_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l12_set_action_us2(0x4D, 1); + hero_l12_set_move_state_us2(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l12_set_action_us2(0x40, 1); + hero_l12_set_move_state_us2(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -1796,14 +1796,14 @@ void hero_decide_todano_state_us2(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l12_set_action_us2(0x4E, 1); + hero_l12_set_move_state_us2(0x4E, 1); break; } rec = (u8 *)&g_hero_l12_action_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l12_set_action_us2(0x3F, 0); + hero_l12_set_move_state_us2(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -1812,13 +1812,13 @@ void hero_decide_todano_state_us2(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0x10) ? n : 0xF, NULL) != 0) { - hero_l12_set_action_us2(0x4D, 1); + hero_l12_set_move_state_us2(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l12_set_action_us2(0x45, 1); + hero_l12_set_move_state_us2(0x45, 1); } break; } @@ -1881,42 +1881,42 @@ void hero_decide_todano_state_us2(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l12_set_action_us2(0x45, 1); + hero_l12_set_move_state_us2(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l12_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l12_set_action_us2(0x40, 1); + hero_l12_set_move_state_us2(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l12_set_action_us2(0x3F, 1); + hero_l12_set_move_state_us2(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l12_set_action_us2(0x41, 1); + hero_l12_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 5, NULL) != 0)) { - hero_l12_set_action_us2(0x4D, 1); + hero_l12_set_move_state_us2(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action_us2(0x46, 1); + hero_l12_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l12_set_action_us2(0x4B, 1); + hero_l12_set_move_state_us2(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l12_set_action_us2(0x41, 1); + hero_l12_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action_us2(0x46, 1); + hero_l12_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -1926,11 +1926,11 @@ void hero_decide_todano_state_us2(void) { FLD(g_hero_state, s16, 0x1EE) = 0xC - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l12_set_action_us2(0x40, 1); + hero_l12_set_move_state_us2(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l12_set_action_us2(0x3F, 1); + hero_l12_set_move_state_us2(0x3F, 1); } break; case 0x41: @@ -1942,29 +1942,29 @@ void hero_decide_todano_state_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action_us2(0x43, 1); + hero_l12_set_move_state_us2(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l12_set_action_us2(0x40, 1); + hero_l12_set_move_state_us2(0x40, 1); } else { - hero_l12_set_action_us2(0x3F, 1); + hero_l12_set_move_state_us2(0x3F, 1); } } else { - hero_l12_set_action_us2(0x3F, 1); + hero_l12_set_move_state_us2(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l12_set_action_us2(0x46, 1); + hero_l12_set_move_state_us2(0x46, 1); break; } if ((PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l12_set_action_us2(0x4B, 1); + hero_l12_set_move_state_us2(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l12_set_action_us2(0x3F, 1); + hero_l12_set_move_state_us2(0x3F, 1); } break; case 0x4E: @@ -1973,9 +1973,9 @@ void hero_decide_todano_state_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l12_set_action_us2(0x41, 1); + hero_l12_set_move_state_us2(0x41, 1); } else { - hero_l12_set_action_us2(0x3F, 1); + hero_l12_set_move_state_us2(0x3F, 1); } } break; @@ -1985,7 +1985,7 @@ void hero_decide_todano_state_us2(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l12_set_action_us2(0x4E, 1); + hero_l12_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.025000002f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2011,55 +2011,55 @@ void hero_decide_todano_state_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l12_set_action_us2(0x45, 1); + hero_l12_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l12_set_action_us2(0x4D, 1); + hero_l12_set_move_state_us2(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l12_set_action_us2(0x41, 1); + hero_l12_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l12_set_action_us2(0x3F, 1); + hero_l12_set_move_state_us2(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l12_set_action_us2(0x41, 1); + hero_l12_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x24) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l12_set_action_us2(0x43, 1); + hero_l12_set_move_state_us2(0x43, 1); } else { - hero_l12_set_action_us2(0x3F, 0); + hero_l12_set_move_state_us2(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_us2(0x47, 1); + hero_l12_set_move_state_us2(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)vec_a = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l12_set_action_us2(0x41, 1); + hero_l12_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l12_set_action_us2(0x41, 1); + hero_l12_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l12_set_action_us2(0x48, 1); + hero_l12_set_move_state_us2(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2068,7 +2068,7 @@ void hero_decide_todano_state_us2(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l12_set_action_us2(0x49, 1); + hero_l12_set_move_state_us2(0x49, 1); } break; } @@ -2079,7 +2079,7 @@ void hero_decide_todano_state_us2(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l12_set_action_us2(0x4A, 1); + hero_l12_set_move_state_us2(0x4A, 1); } } } @@ -2098,17 +2098,17 @@ void hero_decide_todano_state_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l12_set_action_us2(0x47, 1); + hero_l12_set_move_state_us2(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l12_set_action_us2(0x41, 1); + hero_l12_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l12_set_action_us2(0x48, 1); + hero_l12_set_move_state_us2(0x48, 1); } break; } @@ -2123,7 +2123,7 @@ void hero_decide_todano_state_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l12_set_action_us2(0, 0); + hero_l12_set_move_state_us2(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -2134,7 +2134,7 @@ void hero_decide_todano_state_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l12_set_action_us2(0, 0); + hero_l12_set_move_state_us2(0, 0); } break; case 0x22: @@ -2144,12 +2144,12 @@ void hero_decide_todano_state_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_l12_set_action_us2(7, 1); + hero_l12_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l12_set_action_us2(0, 0); + hero_l12_set_move_state_us2(0, 0); } break; default: diff --git a/src/us2/levels/15_gorn/L15_0042F288-g8.c b/src/us2/levels/15_gorn/L15_0042F288-g8.c index e06d20510..f87614261 100644 --- a/src/us2/levels/15_gorn/L15_0042F288-g8.c +++ b/src/us2/levels/15_gorn/L15_0042F288-g8.c @@ -100,7 +100,7 @@ extern void hero_set_state_value_b(s32 value); extern void level_select_random_object(void); extern void level_store_pair_with_increment(s32 a0, s32 a1); extern void moby_set_flag_bit(Moby *moby, s32 enabled); -extern s32 hero_l00_change_action_us2(s32 action, s32 animate); +extern s32 hero_l00_set_move_state_us2(s32 action, s32 animate); extern void hero_set_state_value_c(s32 value); extern s32 LockedEntryMenuInput_us2(void); extern void ship_save_transform_state(void); @@ -199,7 +199,7 @@ void gorn_controller_update_us2(Moby *moby) if (g_gorn_message_counter++ < 5 || g_challenge_mode == 2) break; - hero_l00_change_action_us2(0x31, 0); + hero_l00_set_move_state_us2(0x31, 0); if (g_gorn_enabled_flag) { hero_set_state_value_c(on); g_challenge_menu_choice = LockedEntryMenuInput_us2(); diff --git a/src/us2/levels/16_snivelak/L16_002B3358-cc.c b/src/us2/levels/16_snivelak/L16_002B3358-cc.c index 4bf0ef2bb..158d78a95 100644 --- a/src/us2/levels/16_snivelak/L16_002B3358-cc.c +++ b/src/us2/levels/16_snivelak/L16_002B3358-cc.c @@ -67,7 +67,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l16_enter_state_us2(unsigned long, unsigned long); +extern s32 hero_l16_set_move_state_us2(unsigned long, unsigned long); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_us2(s32); extern int hero_play_sound(s32, s32); @@ -143,7 +143,7 @@ s32 hero_handle_contact_reaction_us2(s32 apply_reaction) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB || *(s16 *)(other + 0xAA) == 0x558)) { - hero_l16_enter_state_us2(0x7D, 1); + hero_l16_set_move_state_us2(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -154,7 +154,7 @@ s32 hero_handle_contact_reaction_us2(s32 apply_reaction) { AdjustPlayerHealth_us2(FloatToInt(*(float *)(r + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l16_enter_state_us2(0x16, 1); + hero_l16_set_move_state_us2(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -164,9 +164,9 @@ s32 hero_handle_contact_reaction_us2(s32 apply_reaction) { return 0; } if (entry->f24 & 8) { - hero_l16_enter_state_us2(0x8C, 1); + hero_l16_set_move_state_us2(0x8C, 1); } else { - hero_l16_enter_state_us2(0x16, 1); + hero_l16_set_move_state_us2(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&vec); diff --git a/src/us2/levels/16_snivelak/L16_002BA0F8-sw.c b/src/us2/levels/16_snivelak/L16_002BA0F8-sw.c index d5c293d69..cf5118c16 100644 --- a/src/us2/levels/16_snivelak/L16_002BA0F8-sw.c +++ b/src/us2/levels/16_snivelak/L16_002BA0F8-sw.c @@ -139,7 +139,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -978,7 +978,7 @@ void hero_update_state_handler_us2(void) { coll_process_hit(0.4f, (s32)((TI128*)vec_0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec_10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_snivelak_hero_state)->f[0x180/4] = 0.1f; diff --git a/src/us2/levels/16_snivelak/L16_002BA0F8-sw2.c b/src/us2/levels/16_snivelak/L16_002BA0F8-sw2.c index 2000082ec..c20d16ef9 100644 --- a/src/us2/levels/16_snivelak/L16_002BA0F8-sw2.c +++ b/src/us2/levels/16_snivelak/L16_002BA0F8-sw2.c @@ -58,8 +58,8 @@ extern int hero_play_sound(int, int); extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -126,7 +126,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l16_enter_state_us2(s32 action, s32 animate) { +s32 hero_l16_set_move_state_us2(s32 action, s32 animate) { f32 dir[4]; u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -174,7 +174,9 @@ s32 hero_l16_enter_state_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -187,7 +189,7 @@ s32 hero_l16_enter_state_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_move_state_walk_or_run(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_anim_id(0) == 0x51) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_anim_id(0), 0, -1.0f); @@ -238,7 +240,7 @@ s32 hero_l16_enter_state_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l16_enter_state_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l16_set_move_state_us2(0x76, 1); return 0; } } WORD(0x2298) = 0; BYTE(0x40C) = 0; BYTE(0x40E) = 0; @@ -268,11 +270,11 @@ s32 hero_l16_enter_state_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_set_move_state_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_anim_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l16_enter_state_us2(0, 0)) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); + if (hero_l16_set_move_state_us2(0, 0)) set_hero_animation(hero_get_weapon_anim_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -297,7 +299,7 @@ s32 hero_l16_enter_state_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_enter_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l16_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -461,13 +463,13 @@ s32 hero_l16_enter_state_us2(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l16_enter_state_us2(0x81, 1); return 0; + hero_l16_set_move_state_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_action_lock_flag) { hero_l16_enter_state_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_action_lock_flag) { hero_l16_set_move_state_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l16_enter_state_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l16_set_move_state_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -527,9 +529,9 @@ s32 hero_l16_enter_state_us2(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_special_enter_flag) hero_l16_enter_state_us2(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l16_enter_state_us2(0x79, 1); - else hero_l16_enter_state_us2(0x39, 1); + if (g_current_map_index == 2 && g_hero_special_enter_flag) hero_l16_set_move_state_us2(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l16_set_move_state_us2(0x79, 1); + else hero_l16_set_move_state_us2(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -577,7 +579,7 @@ s32 hero_l16_enter_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -603,7 +605,7 @@ s32 hero_l16_enter_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -612,7 +614,7 @@ s32 hero_l16_enter_state_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -751,7 +753,7 @@ s32 hero_l16_enter_state_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -816,7 +818,7 @@ s32 hero_l16_enter_state_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -828,7 +830,7 @@ s32 hero_l16_enter_state_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -867,7 +869,7 @@ s32 hero_l16_enter_state_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l16_enter_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l16_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/16_snivelak/L16_002BA0F8-sw3.c b/src/us2/levels/16_snivelak/L16_002BA0F8-sw3.c index 85a1a4e89..9a274fab5 100644 --- a/src/us2/levels/16_snivelak/L16_002BA0F8-sw3.c +++ b/src/us2/levels/16_snivelak/L16_002BA0F8-sw3.c @@ -71,7 +71,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_refresh_speed_from_timer(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l16_enter_state_us2(s32, s32); +s32 hero_l16_set_move_state_us2(s32, s32); void hero_start_move_state_walk_or_run(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -152,7 +152,7 @@ void hero_decide_state_snivelak_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l16_enter_state_us2(0x39, 1); + hero_l16_set_move_state_us2(0x39, 1); goto end; } } @@ -181,7 +181,7 @@ void hero_decide_state_snivelak_us2(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_snivelak_hero_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l16_enter_state_us2(0x74, 1); + hero_l16_set_move_state_us2(0x74, 1); goto end; } } @@ -191,12 +191,12 @@ void hero_decide_state_snivelak_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state_us2(1, 1); + hero_l16_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l16_enter_state_us2(0x82, 1); + hero_l16_set_move_state_us2(0x82, 1); break; } { @@ -232,7 +232,7 @@ void hero_decide_state_snivelak_us2(void) { rec = g_hero_record_table + local_40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l16_enter_state_us2(0x3C, 1); + hero_l16_set_move_state_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -275,12 +275,12 @@ void hero_decide_state_snivelak_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l16_enter_state_us2(0x76, 1); + hero_l16_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); } break; } @@ -301,17 +301,17 @@ void hero_decide_state_snivelak_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_action_lock_flag == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l16_enter_state_us2(0x6E, 1); + hero_l16_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l16_enter_state_us2(4, 1); + hero_l16_set_move_state_us2(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state_us2(0x27, 1); + hero_l16_set_move_state_us2(0x27, 1); break; } { @@ -331,28 +331,28 @@ void hero_decide_state_snivelak_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l16_enter_state_us2(2, 1); + hero_l16_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state_us2(1, 1); + hero_l16_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l16_enter_state_us2(0x3D, 1); + hero_l16_set_move_state_us2(0x3D, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l16_enter_state_us2(0x3D, 1); + hero_l16_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l16_enter_state_us2(0, 1); + hero_l16_set_move_state_us2(0, 1); } break; case 0x3D: @@ -361,22 +361,22 @@ void hero_decide_state_snivelak_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state_us2(4, 1); + hero_l16_set_move_state_us2(4, 1); break; } hero_refresh_speed_from_timer(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l16_enter_state_us2(2, 1); + hero_l16_set_move_state_us2(2, 1); break; } - hero_l16_enter_state_us2(0, 1); + hero_l16_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -426,9 +426,9 @@ void hero_decide_state_snivelak_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_move_state_walk_or_run(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state_us2(4, 1); + hero_l16_set_move_state_us2(4, 1); } else { - hero_l16_enter_state_us2(0, 0); + hero_l16_set_move_state_us2(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -440,9 +440,9 @@ void hero_decide_state_snivelak_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l16_enter_state_us2(0, 0); + hero_l16_set_move_state_us2(0, 0); } else { - hero_l16_enter_state_us2(0, 1); + hero_l16_set_move_state_us2(0, 1); } } break; @@ -475,7 +475,7 @@ void hero_decide_state_snivelak_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state_us2(7, 1); + hero_l16_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -484,7 +484,7 @@ void hero_decide_state_snivelak_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l16_enter_state_us2(0, 0); + hero_l16_set_move_state_us2(0, 0); } break; } @@ -506,7 +506,7 @@ void hero_decide_state_snivelak_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state_us2(7, 1); + hero_l16_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -519,7 +519,7 @@ void hero_decide_state_snivelak_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l16_enter_state_us2(2, 0); + hero_l16_set_move_state_us2(2, 0); set_hero_animation(3, g_hero_l16_animation_table[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -530,22 +530,22 @@ void hero_decide_state_snivelak_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l16_enter_state_us2(2, 1); + hero_l16_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l16_enter_state_us2(0, 0); + hero_l16_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state_us2(0, 0); + hero_l16_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l16_enter_state_us2(0, 1); + hero_l16_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -562,7 +562,7 @@ void hero_decide_state_snivelak_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state_us2(7, 1); + hero_l16_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -571,7 +571,7 @@ void hero_decide_state_snivelak_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l16_enter_state_us2(0, 0); + hero_l16_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, 15.0f); break; } @@ -583,7 +583,7 @@ void hero_decide_state_snivelak_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state_us2(0, 1); + hero_l16_set_move_state_us2(0, 1); } break; case 0x2: @@ -597,11 +597,11 @@ void hero_decide_state_snivelak_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l16_enter_state_us2(0x76, 1); + hero_l16_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); break; } n = 9; @@ -615,12 +615,12 @@ void hero_decide_state_snivelak_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l16_enter_state_us2(9, 1); + hero_l16_set_move_state_us2(9, 1); } else { - hero_l16_enter_state_us2(7, 1); + hero_l16_set_move_state_us2(7, 1); } } else { - hero_l16_enter_state_us2(7, 1); + hero_l16_set_move_state_us2(7, 1); } break; } @@ -628,15 +628,15 @@ void hero_decide_state_snivelak_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state_us2(1, 1); + hero_l16_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state_us2(4, 1); + hero_l16_set_move_state_us2(4, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state_us2(0x27, 1); + hero_l16_set_move_state_us2(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -647,7 +647,7 @@ void hero_decide_state_snivelak_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l16_enter_state_us2(0, 0) == 0) { + if (hero_l16_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -687,17 +687,17 @@ void hero_decide_state_snivelak_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l16_enter_state_us2(3, 0); + hero_l16_set_move_state_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l16_enter_state_us2(0x77, 1); + hero_l16_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l16_enter_state_us2(0x77, 1); + hero_l16_set_move_state_us2(0x77, 1); break; } } @@ -715,11 +715,11 @@ void hero_decide_state_snivelak_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l16_enter_state_us2(0x64, 1); + hero_l16_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l16_enter_state_us2(0x63, 1); + hero_l16_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -727,22 +727,22 @@ void hero_decide_state_snivelak_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state_us2(0x62, 1); + hero_l16_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l16_enter_state_us2(0, 1); + hero_l16_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l16_enter_state_us2(0x62, 1); + hero_l16_set_move_state_us2(0x62, 1); } break; case 0x65: { s32 n = FLD(g_hero_state, s32, 0x18C0); if ((n < 3) && (((n * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40, 7, &local_44) != 0)) { - hero_l16_enter_state_us2(0x66, 1); + hero_l16_set_move_state_us2(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -776,29 +776,29 @@ void hero_decide_state_snivelak_us2(void) { return; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state_us2(1, 1); + hero_l16_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l16_enter_state_us2(7, 1); + hero_l16_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state_us2(4, 1); + hero_l16_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state_us2(0, 1); + hero_l16_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state_us2(0x27, 1); + hero_l16_set_move_state_us2(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -806,45 +806,45 @@ void hero_decide_state_snivelak_us2(void) { } if (hero_get_weapon_anim_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l16_enter_state_us2(0, 0); + hero_l16_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l16_enter_state_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l16_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l16_enter_state_us2(2, 1); + hero_l16_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l16_enter_state_us2(1, 1); + hero_l16_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state_us2(0, 0); + hero_l16_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l16_enter_state_us2(0x76, 1); + hero_l16_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l16_enter_state_us2(0x15, 1); + hero_l16_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l16_enter_state_us2(0, 1); + hero_l16_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -852,17 +852,17 @@ void hero_decide_state_snivelak_us2(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l16_enter_state_us2(0x8B, 1); + hero_l16_set_move_state_us2(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l16_enter_state_us2(0, 1); + hero_l16_set_move_state_us2(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l16_enter_state_us2(0, 1); + hero_l16_set_move_state_us2(0, 1); } break; case 0x24: @@ -888,14 +888,14 @@ void hero_decide_state_snivelak_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l16_enter_state_us2(0, 0); + hero_l16_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_anim_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l16_enter_state_us2(6, 0); + hero_l16_set_move_state_us2(6, 0); } else { - hero_l16_enter_state_us2(6, 0); + hero_l16_set_move_state_us2(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -911,9 +911,9 @@ void hero_decide_state_snivelak_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l16_enter_state_us2(0, 1); + hero_l16_set_move_state_us2(0, 1); } else { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -925,7 +925,7 @@ void hero_decide_state_snivelak_us2(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l16_enter_state_us2(0x2C, 1); + hero_l16_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -989,11 +989,11 @@ void hero_decide_state_snivelak_us2(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.21666668f); FLD(g_hero_state, f32, 0x128) = 0.16666667f; - hero_l16_enter_state_us2(0x16, 1); + hero_l16_set_move_state_us2(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x46; FLD(g_hero_state, s16, 0x1D0) = 0x46; } else { - hero_l16_enter_state_us2(0x3E, 1); + hero_l16_set_move_state_us2(0x3E, 1); } break; } @@ -1006,7 +1006,7 @@ void hero_decide_state_snivelak_us2(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l16_enter_state_us2(0x28, 1); + hero_l16_set_move_state_us2(0x28, 1); } break; } @@ -1017,16 +1017,16 @@ void hero_decide_state_snivelak_us2(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x46; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l16_enter_state_us2(0x74, 1); + hero_l16_set_move_state_us2(0x74, 1); } else { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { - hero_l16_enter_state_us2(0x2A, 1); + hero_l16_set_move_state_us2(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1043,7 +1043,7 @@ void hero_decide_state_snivelak_us2(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l16_enter_state_us2(0x28, 1); + hero_l16_set_move_state_us2(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)vec_20 = 0; @@ -1060,7 +1060,7 @@ void hero_decide_state_snivelak_us2(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 5, NULL) != 0) && ((f32)g_hero_state_record_table[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l16_enter_state_us2(0x28, 1); + hero_l16_set_move_state_us2(0x28, 1); break; } top = 0xE; @@ -1069,19 +1069,19 @@ void hero_decide_state_snivelak_us2(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l16_enter_state_us2(0x2A, 1); + hero_l16_set_move_state_us2(0x2A, 1); } break; } if ((f32)g_hero_state_record_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l16_enter_state_us2(0x27, 1); + hero_l16_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x6C8) >= 6)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l16_enter_state_us2(0x74, 1); + hero_l16_set_move_state_us2(0x74, 1); } else { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1090,11 +1090,11 @@ void hero_decide_state_snivelak_us2(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l16_enter_state_us2(0x27, 1); + hero_l16_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) && (g_current_map_index == 0x14)) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0xA) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1130,7 +1130,7 @@ void hero_decide_state_snivelak_us2(void) { find_nearest_path_point(local_50, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), local_5c, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l16_enter_state_us2(0x29, 1); + hero_l16_set_move_state_us2(0x29, 1); break; } } @@ -1178,7 +1178,7 @@ void hero_decide_state_snivelak_us2(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x46; FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1186,7 +1186,7 @@ void hero_decide_state_snivelak_us2(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l16_enter_state_us2(0x71, 1); + hero_l16_set_move_state_us2(0x71, 1); break; } { @@ -1198,7 +1198,7 @@ void hero_decide_state_snivelak_us2(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l16_enter_state_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l16_set_move_state_us2(0, 0) != 0)) { set_hero_animation(0xC, 4, 6.0f); } } else if (st == 0x3E) { @@ -1207,24 +1207,24 @@ void hero_decide_state_snivelak_us2(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)local_64, 0.5f, -1.0f); } if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s32, 0x340) != 0)) { - if (hero_l16_enter_state_us2(0, 0) != 0) { + if (hero_l16_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state_us2(0x27, 1); + hero_l16_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x10) && (FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l16_enter_state_us2(0x27, 1); + hero_l16_set_move_state_us2(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l16_enter_state_us2(0x18, 0); + hero_l16_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -1233,18 +1233,18 @@ void hero_decide_state_snivelak_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l16_enter_state_us2(0x1B, 1); + hero_l16_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1253,7 +1253,7 @@ void hero_decide_state_snivelak_us2(void) { vec_10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l16_enter_state_us2(0x19, 1); + hero_l16_set_move_state_us2(0x19, 1); } break; } @@ -1264,7 +1264,7 @@ void hero_decide_state_snivelak_us2(void) { vec_10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l16_enter_state_us2(0x1A, 1); + hero_l16_set_move_state_us2(0x1A, 1); } } } @@ -1283,18 +1283,18 @@ void hero_decide_state_snivelak_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)vec_10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l16_enter_state_us2(0x18, 1); + hero_l16_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l16_enter_state_us2(0x1B, 1); + hero_l16_set_move_state_us2(0x1B, 1); } break; } @@ -1304,9 +1304,9 @@ void hero_decide_state_snivelak_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); } else { - hero_l16_enter_state_us2(0, 1); + hero_l16_set_move_state_us2(0, 1); } } break; @@ -1330,12 +1330,12 @@ void hero_decide_state_snivelak_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l16_enter_state_us2(0x39, 1); + hero_l16_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l16_enter_state_us2(0, 0) != 0) { + if (hero_l16_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1343,7 +1343,7 @@ void hero_decide_state_snivelak_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l16_enter_state_us2(0, 0) != 0) { + if (hero_l16_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1357,32 +1357,32 @@ void hero_decide_state_snivelak_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l16_enter_state_us2(2, 1); + hero_l16_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l16_enter_state_us2(3, 0) != 0) { + if (hero_l16_set_move_state_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l16_enter_state_us2(0, 1); + hero_l16_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l16_enter_state_us2(8, 1); + hero_l16_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l16_enter_state_us2(0x17, 1); + hero_l16_set_move_state_us2(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state_us2(0x27, 1); + hero_l16_set_move_state_us2(0x27, 1); break; } } @@ -1414,7 +1414,7 @@ void hero_decide_state_snivelak_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l16_enter_state_us2(0, 0) != 0) { + if (hero_l16_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1425,12 +1425,12 @@ void hero_decide_state_snivelak_us2(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l16_enter_state_us2(0x74, 1); + hero_l16_set_move_state_us2(0x74, 1); } else { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); } } else { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); } } break; @@ -1443,16 +1443,16 @@ void hero_decide_state_snivelak_us2(void) { ok = 1; } if (ok != 0) { - hero_l16_enter_state_us2(0x11, 1); + hero_l16_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l16_enter_state_us2(0x17, 1); + hero_l16_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1463,23 +1463,23 @@ void hero_decide_state_snivelak_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l16_enter_state_us2(3, 0) != 0) { + if (hero_l16_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l16_enter_state_us2(4, 1); + hero_l16_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l16_speed_params[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l16_enter_state_us2(2, 1); + hero_l16_set_move_state_us2(2, 1); break; } - hero_l16_enter_state_us2(2, 0); + hero_l16_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1488,21 +1488,21 @@ void hero_decide_state_snivelak_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_l16_speed_params[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l16_enter_state_us2(2, 1); + hero_l16_set_move_state_us2(2, 1); break; } - hero_l16_enter_state_us2(2, 0); + hero_l16_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l16_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l16_enter_state_us2(0, 0) != 0) { + if (hero_l16_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l16_enter_state_us2(0, 0) != 0) { + } else if (hero_l16_set_move_state_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1548,14 +1548,14 @@ void hero_decide_state_snivelak_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l16_enter_state_us2(0xB, 1); + hero_l16_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l16_enter_state_us2(0x82, 1); + hero_l16_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1564,25 +1564,25 @@ void hero_decide_state_snivelak_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l16_enter_state_us2(0xA, 1); + hero_l16_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l16_enter_state_us2(0x10, 1); + hero_l16_set_move_state_us2(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l16_enter_state_us2(0x27, 1); + hero_l16_set_move_state_us2(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l16_enter_state_us2(0x77, 1); + hero_l16_set_move_state_us2(0x77, 1); break; } } @@ -1686,7 +1686,7 @@ void hero_decide_state_snivelak_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l16_enter_state_us2(3, 0) != 0) { + if (hero_l16_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1694,13 +1694,13 @@ void hero_decide_state_snivelak_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l16_speed_params[0][2])) { - hero_l16_enter_state_us2(7, 1); + hero_l16_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l16_enter_state_us2(7, 1); + hero_l16_set_move_state_us2(7, 1); } else if (g_hero_l16_speed_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l16_enter_state_us2(9, 1); + hero_l16_set_move_state_us2(9, 1); } else { - hero_l16_enter_state_us2(7, 1); + hero_l16_set_move_state_us2(7, 1); } break; } @@ -1708,10 +1708,10 @@ void hero_decide_state_snivelak_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_action(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); break; } { @@ -1721,7 +1721,7 @@ void hero_decide_state_snivelak_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &local_6c) != 0) && (local_6c < FLD(g_hero_state, s32, 0x1B8))) { - hero_l16_enter_state_us2(0x11, 1); + hero_l16_set_move_state_us2(0x11, 1); break; } } @@ -1750,7 +1750,7 @@ void hero_decide_state_snivelak_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l16_enter_state_us2(0xE, 1); + hero_l16_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1760,32 +1760,32 @@ void hero_decide_state_snivelak_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l16_enter_state_us2(8, 1); + hero_l16_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l16_enter_state_us2(0x17, 1); + hero_l16_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l16_enter_state_us2(6, 1); + hero_l16_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l16_enter_state_us2(0x79, 1); + hero_l16_set_move_state_us2(0x79, 1); } else { - hero_l16_enter_state_us2(0x39, 1); + hero_l16_set_move_state_us2(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l16_enter_state_us2(0x82, 1); + hero_l16_set_move_state_us2(0x82, 1); } else { - hero_l16_enter_state_us2(0, 0); + hero_l16_set_move_state_us2(0, 0); } } break; @@ -1795,8 +1795,8 @@ void hero_decide_state_snivelak_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l16_enter_state_us2(0x39, 1); - } else if (hero_l16_enter_state_us2(0, 0) != 0) { + hero_l16_set_move_state_us2(0x39, 1); + } else if (hero_l16_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_anim_id(0), 0, 13.0f); } } @@ -1817,7 +1817,7 @@ void hero_decide_state_snivelak_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l16_enter_state_us2(0, 0); + hero_l16_set_move_state_us2(0, 0); anim = hero_get_weapon_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1828,7 +1828,7 @@ void hero_decide_state_snivelak_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l16_enter_state_us2(0, 0); + hero_l16_set_move_state_us2(0, 0); } break; case 0x22: @@ -1838,12 +1838,12 @@ void hero_decide_state_snivelak_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_l16_enter_state_us2(7, 1); + hero_l16_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l16_enter_state_us2(0, 0); + hero_l16_set_move_state_us2(0, 0); } break; default: diff --git a/src/us2/levels/17_smolg/L17_00420138-cc-g8.c b/src/us2/levels/17_smolg/L17_00420138-cc-g8.c index 4add8754a..740c7ec46 100644 --- a/src/us2/levels/17_smolg/L17_00420138-cc-g8.c +++ b/src/us2/levels/17_smolg/L17_00420138-cc-g8.c @@ -193,7 +193,7 @@ extern int ForceClaimNotice(s32, s32, s32); extern s32 PlayMobySound(s32, s32, void *); extern void moby_set_flag_bit(void *, s32); extern void cam_lock_entry(s32); -extern s32 hero_l13_change_action_us2(s32, s32); +extern s32 hero_l13_set_move_state_us2(s32, s32); /* func_US2_L17_00420138's state record. */ typedef struct { @@ -267,7 +267,7 @@ void target_pad_update_us2(u8 *obj) } if (vars->cuboid >= 0 && IsPointInCuboid(g_hero_state.pos, vars->cuboid) && g_hero_state.mode == 0x82) - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } /* func_L17_00420E08's state record. */ diff --git a/src/us2/levels/18_damosel/L18_002D02B8.c b/src/us2/levels/18_damosel/L18_002D02B8.c index 02f48fef2..a29b60138 100644 --- a/src/us2/levels/18_damosel/L18_002D02B8.c +++ b/src/us2/levels/18_damosel/L18_002D02B8.c @@ -63,7 +63,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l18_set_action_us2(s32, s32); +extern s32 hero_l18_set_move_state_us2(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_us2(s32); extern int hero_play_sound(s32, s32); @@ -150,7 +150,7 @@ s32 hero_handle_hit_object_contact_us2(s32 apply_push) { case 0: other_moby = g_hero_state.f249C; if (other_moby != 0 && (*(s16 *)(other_moby + 0xAA) == 0x4EB || *(s16 *)(other_moby + 0xAA) == 0x558)) { - hero_l18_set_action_us2(0x7D, 1); + hero_l18_set_move_state_us2(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -161,7 +161,7 @@ s32 hero_handle_hit_object_contact_us2(s32 apply_push) { AdjustPlayerHealth_us2(FloatToInt(*(float *)(effect_slot + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l18_set_action_us2(0x16, 1); + hero_l18_set_move_state_us2(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -171,13 +171,13 @@ s32 hero_handle_hit_object_contact_us2(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l18_set_action_us2(0x72, 1); + hero_l18_set_move_state_us2(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l18_set_action_us2(0x73, 1); + hero_l18_set_move_state_us2(0x73, 1); } else if (contact->f24 & 8) { - hero_l18_set_action_us2(0x8C, 1); + hero_l18_set_move_state_us2(0x8C, 1); } else { - hero_l18_set_action_us2(0x16, 1); + hero_l18_set_move_state_us2(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&push_vector); @@ -189,7 +189,7 @@ s32 hero_handle_hit_object_contact_us2(s32 apply_push) { } break; case 4: - hero_l18_set_action_us2(0x90, 1); + hero_l18_set_move_state_us2(0x90, 1); hero_flatten_push_vector(&push_vector, is_special, 0.083333336f, 0.050000004f); break; } diff --git a/src/us2/levels/18_damosel/L18_002D7758-sw.c b/src/us2/levels/18_damosel/L18_002D7758-sw.c index b6128572d..1e3a1e84b 100644 --- a/src/us2/levels/18_damosel/L18_002D7758-sw.c +++ b/src/us2/levels/18_damosel/L18_002D7758-sw.c @@ -147,7 +147,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -166,7 +166,7 @@ extern s32 shooter_update_ranged_attack(s32); extern s32 hero_get_screen_id(s32); extern void hero_detach_from_object_us2(s32); extern void ClipHeroVelocityAtWall(s32); -extern s32 hero_l18_set_action_us2(s32, s32); +extern s32 hero_l18_set_move_state_us2(s32, s32); extern char g_impact_effect_data[] MACRO_ADDR; extern void moby_raise_state_to_eight(); extern void moby_raise_state_to_eight_copy(); @@ -678,7 +678,7 @@ void hero_l18_update_state_machine_us2(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { hero_word_15 = ((Hero *)g_hero_state)->i[0x2440/4]; if (hero_word_15 != -1) { @@ -1383,7 +1383,7 @@ void hero_l18_update_state_machine_us2(void) { coll_process_hit(0.4f, (s32)((TI128*)vec0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l18_state_extra)->f[0x180/4] = 0.1f; @@ -2777,7 +2777,7 @@ void hero_l18_update_state_machine_us2(void) { } hero_try_surface_push_response(3.7f, 0.0f, 0.35f); if (shooter_update_ranged_attack((s32) hero_moby_2) != 0) { - hero_l18_set_action_us2(0x8D, 1); + hero_l18_set_move_state_us2(0x8D, 1); } } break; diff --git a/src/us2/levels/18_damosel/L18_002E02E8-sw.c b/src/us2/levels/18_damosel/L18_002E02E8-sw.c index 30a9dfd8b..d19ef29e1 100644 --- a/src/us2/levels/18_damosel/L18_002E02E8-sw.c +++ b/src/us2/levels/18_damosel/L18_002E02E8-sw.c @@ -60,8 +60,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -131,7 +131,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l18_set_action_us2(s32 action, s32 animate) { +s32 hero_l18_set_move_state_us2(s32 action, s32 animate) { f32 dir[4]; u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -179,7 +179,9 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -192,8 +194,8 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { snd_start_mode_sound(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l18_set_action_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action_us2(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l18_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_screen_id(0) == 0x51) set_hero_animation(hero_get_screen_id(0), 0, 18.0f); else set_hero_animation(hero_get_screen_id(0), 0, -1.0f); @@ -328,7 +330,7 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l18_set_action_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l18_set_move_state_us2(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -368,12 +370,12 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l18_set_action_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action_us2(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l18_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_screen_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l18_set_action_us2(0, 0)) set_hero_animation(hero_get_screen_id(0), 0, 18.0f); + if (hero_l18_set_move_state_us2(0, 0)) set_hero_animation(hero_get_screen_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -398,7 +400,7 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -552,13 +554,13 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l18_set_action_us2(0x81, 1); return 0; + hero_l18_set_move_state_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_action_lock) { hero_l18_set_action_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_action_lock) { hero_l18_set_move_state_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l18_set_action_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l18_set_move_state_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -665,7 +667,7 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -691,7 +693,7 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -700,7 +702,7 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -838,7 +840,7 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -907,7 +909,7 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -919,7 +921,7 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -930,7 +932,7 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { goto finish; case 0x8D: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action_us2(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state_us2(0x94, 1); return 0; } if (!animate) goto finish; set_hero_animation(13, 0, 9.0f); goto finish; case 0x8F: @@ -951,7 +953,7 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l18_float_sequences[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x8E: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_action_us2(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l18_set_move_state_us2(0x94, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); BYTE(0x40C) = 0; BYTE(0x40F) = 0; if (WORD(0x22A4) == 0) REAL(0x1B4) = vec_length_xy(VEC(0x160)); @@ -980,7 +982,7 @@ s32 hero_l18_set_action_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l18_set_action_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l18_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/18_damosel/L18_002E6B50-sw.c b/src/us2/levels/18_damosel/L18_002E6B50-sw.c index fcc88f859..202c0c360 100644 --- a/src/us2/levels/18_damosel/L18_002E6B50-sw.c +++ b/src/us2/levels/18_damosel/L18_002E6B50-sw.c @@ -73,7 +73,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l18_set_action_us2(s32, s32); +s32 hero_l18_set_move_state_us2(s32, s32); void snd_start_mode_sound(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -153,7 +153,7 @@ void hero_update_state_decider_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l18_set_action_us2(0x39, 1); + hero_l18_set_move_state_us2(0x39, 1); goto end; } } @@ -183,15 +183,15 @@ void hero_update_state_decider_us2(void) { if (FLD(g_hero_state, f32, 0x88) < g_hero_l18_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { if (FLD(g_hero_state, u8, 0x22B4) == 4) { - hero_l18_set_action_us2(0x91, 1); + hero_l18_set_move_state_us2(0x91, 1); goto end; } - hero_l18_set_action_us2(0x74, 1); + hero_l18_set_move_state_us2(0x74, 1); goto end; } } if ((FLD(g_hero_state, u8, 0x22B4) == 4) && (FLD(g_hero_state, f32, 0x88) < FLD(FLD(FLD(g_hero_state, void *, 0x2290), void *, 0x68), f32, 0x3EC))) { - hero_l18_set_action_us2(0x91, 1); + hero_l18_set_move_state_us2(0x91, 1); } switch (FLD(g_hero_state, u32, 0x2294)) { case 0x0: @@ -200,12 +200,12 @@ void hero_update_state_decider_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action_us2(1, 1); + hero_l18_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l18_set_action_us2(0x82, 1); + hero_l18_set_move_state_us2(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -242,7 +242,7 @@ void hero_update_state_decider_us2(void) { rec = g_item_l18_record_table + idle_anim_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l18_set_action_us2(0x3C, 1); + hero_l18_set_move_state_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -285,12 +285,12 @@ void hero_update_state_decider_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l18_set_action_us2(0x76, 1); + hero_l18_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); } break; } @@ -311,21 +311,21 @@ void hero_update_state_decider_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_action_lock == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l18_set_action_us2(0x6E, 1); + hero_l18_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l18_set_action_us2(4, 1); + hero_l18_set_move_state_us2(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action_us2(0x27, 1); + hero_l18_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l18_set_action_us2(0x2E, 1); + hero_l18_set_move_state_us2(0x2E, 1); break; } { @@ -345,28 +345,28 @@ void hero_update_state_decider_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l18_set_action_us2(2, 1); + hero_l18_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action_us2(1, 1); + hero_l18_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l18_set_action_us2(0x3D, 1); + hero_l18_set_move_state_us2(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l18_set_action_us2(0x3D, 1); + hero_l18_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l18_set_action_us2(0, 1); + hero_l18_set_move_state_us2(0, 1); } break; case 0x3D: @@ -375,22 +375,22 @@ void hero_update_state_decider_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action_us2(4, 1); + hero_l18_set_move_state_us2(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l18_set_action_us2(2, 1); + hero_l18_set_move_state_us2(2, 1); break; } - hero_l18_set_action_us2(0, 1); + hero_l18_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -423,25 +423,25 @@ void hero_update_state_decider_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l18_set_action_us2(0x33, 1); + hero_l18_set_move_state_us2(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l18_set_action_us2(0x34, 1); + hero_l18_set_move_state_us2(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l18_set_action_us2(0x32, 1); + hero_l18_set_move_state_us2(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l18_set_action_us2(0x33, 1); + hero_l18_set_move_state_us2(0x33, 1); } } break; @@ -454,81 +454,81 @@ void hero_update_state_decider_us2(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l18_set_action_us2(0x32, 1); + hero_l18_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l18_set_action_us2(0x34, 1); + hero_l18_set_move_state_us2(0x34, 1); } else { - hero_l18_set_action_us2(0x32, 1); + hero_l18_set_move_state_us2(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l18_set_action_us2(0x12, 1); + hero_l18_set_move_state_us2(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l18_set_action_us2(0x32, 1); + hero_l18_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l18_set_action_us2(0x34, 1); + hero_l18_set_move_state_us2(0x34, 1); } else { - hero_l18_set_action_us2(0x32, 1); + hero_l18_set_move_state_us2(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l18_set_action_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l18_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_screen_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l18_set_action_us2(0x35, 1); + hero_l18_set_move_state_us2(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l18_set_action_us2(0x12, 1); + hero_l18_set_move_state_us2(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l18_set_action_us2(0x32, 1); + hero_l18_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l18_set_action_us2(0x34, 1); + hero_l18_set_move_state_us2(0x34, 1); } else { - hero_l18_set_action_us2(0x32, 1); + hero_l18_set_move_state_us2(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l18_set_action_us2(0x70, 0); + hero_l18_set_move_state_us2(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l18_set_action_us2(0x36, 1); + hero_l18_set_move_state_us2(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action_us2(0x67, 1); + hero_l18_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action_us2(0x33, 1); + hero_l18_set_move_state_us2(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l18_set_action_us2(0x33, 0); + hero_l18_set_move_state_us2(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action_us2(0x67, 1); + hero_l18_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l18_set_action_us2(0x36, 0); + hero_l18_set_move_state_us2(0x36, 0); } break; case 0x1: @@ -562,9 +562,9 @@ void hero_update_state_decider_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { snd_start_mode_sound(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action_us2(4, 1); + hero_l18_set_move_state_us2(4, 1); } else { - hero_l18_set_action_us2(0, 0); + hero_l18_set_move_state_us2(0, 0); anim = hero_get_screen_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -576,9 +576,9 @@ void hero_update_state_decider_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l18_set_action_us2(0, 0); + hero_l18_set_move_state_us2(0, 0); } else { - hero_l18_set_action_us2(0, 1); + hero_l18_set_move_state_us2(0, 1); } } break; @@ -611,7 +611,7 @@ void hero_update_state_decider_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action_us2(7, 1); + hero_l18_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -620,7 +620,7 @@ void hero_update_state_decider_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l18_set_action_us2(0, 0); + hero_l18_set_move_state_us2(0, 0); } break; } @@ -642,7 +642,7 @@ void hero_update_state_decider_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action_us2(7, 1); + hero_l18_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -655,7 +655,7 @@ void hero_update_state_decider_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l18_set_action_us2(2, 0); + hero_l18_set_move_state_us2(2, 0); set_hero_animation(3, g_hero_l18_anim_table[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -666,22 +666,22 @@ void hero_update_state_decider_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l18_set_action_us2(2, 1); + hero_l18_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l18_set_action_us2(0, 0); + hero_l18_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action_us2(0, 0); + hero_l18_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l18_set_action_us2(0, 1); + hero_l18_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -698,7 +698,7 @@ void hero_update_state_decider_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action_us2(7, 1); + hero_l18_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -707,7 +707,7 @@ void hero_update_state_decider_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l18_set_action_us2(0, 0); + hero_l18_set_move_state_us2(0, 0); set_hero_animation(hero_get_screen_id(0), 0, 15.0f); break; } @@ -719,7 +719,7 @@ void hero_update_state_decider_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action_us2(0, 1); + hero_l18_set_move_state_us2(0, 1); } break; case 0x2: @@ -733,11 +733,11 @@ void hero_update_state_decider_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l18_set_action_us2(0x76, 1); + hero_l18_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); break; } n = 9; @@ -751,12 +751,12 @@ void hero_update_state_decider_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l18_set_action_us2(9, 1); + hero_l18_set_move_state_us2(9, 1); } else { - hero_l18_set_action_us2(7, 1); + hero_l18_set_move_state_us2(7, 1); } } else { - hero_l18_set_action_us2(7, 1); + hero_l18_set_move_state_us2(7, 1); } break; } @@ -764,11 +764,11 @@ void hero_update_state_decider_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action_us2(1, 1); + hero_l18_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action_us2(4, 1); + hero_l18_set_move_state_us2(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -785,25 +785,25 @@ void hero_update_state_decider_us2(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l18_set_action_us2(0x2E, 1); + hero_l18_set_move_state_us2(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l18_set_action_us2(2, 1); + hero_l18_set_move_state_us2(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l18_set_action_us2(0x70, 1); + hero_l18_set_move_state_us2(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l18_set_action_us2(2, 1); + hero_l18_set_move_state_us2(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action_us2(0x27, 1); + hero_l18_set_move_state_us2(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -814,7 +814,7 @@ void hero_update_state_decider_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l18_set_action_us2(0, 0) == 0) { + if (hero_l18_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -831,7 +831,7 @@ void hero_update_state_decider_us2(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l18_set_action_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l18_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_screen_id(0), 0, 17.0f); } if (FLD(hero_moby, u8, 0x43) == 0x37) { @@ -852,7 +852,7 @@ void hero_update_state_decider_us2(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l18_set_action_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l18_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_screen_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -886,17 +886,17 @@ void hero_update_state_decider_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l18_set_action_us2(3, 0); + hero_l18_set_move_state_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l18_set_action_us2(0x77, 1); + hero_l18_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l18_set_action_us2(0x77, 1); + hero_l18_set_move_state_us2(0x77, 1); break; } } @@ -914,11 +914,11 @@ void hero_update_state_decider_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l18_set_action_us2(0x64, 1); + hero_l18_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l18_set_action_us2(0x63, 1); + hero_l18_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -926,42 +926,42 @@ void hero_update_state_decider_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action_us2(0x62, 1); + hero_l18_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l18_set_action_us2(0, 1); + hero_l18_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l18_set_action_us2(0x62, 1); + hero_l18_set_move_state_us2(0x62, 1); } break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action_us2(1, 1); + hero_l18_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l18_set_action_us2(7, 1); + hero_l18_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action_us2(4, 1); + hero_l18_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action_us2(0, 1); + hero_l18_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action_us2(0x27, 1); + hero_l18_set_move_state_us2(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -969,45 +969,45 @@ void hero_update_state_decider_us2(void) { } if (hero_get_screen_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l18_set_action_us2(0, 0); + hero_l18_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l18_set_action_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l18_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_screen_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l18_set_action_us2(2, 1); + hero_l18_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action_us2(1, 1); + hero_l18_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action_us2(0, 0); + hero_l18_set_move_state_us2(0, 0); set_hero_animation(hero_get_screen_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l18_set_action_us2(0x76, 1); + hero_l18_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l18_set_action_us2(0x15, 1); + hero_l18_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); } } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l18_set_action_us2(0, 1); + hero_l18_set_move_state_us2(0, 1); } break; case 0x24: @@ -1033,14 +1033,14 @@ void hero_update_state_decider_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l18_set_action_us2(0, 0); + hero_l18_set_move_state_us2(0, 0); set_hero_animation(hero_get_screen_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l18_set_action_us2(6, 0); + hero_l18_set_move_state_us2(6, 0); } else { - hero_l18_set_action_us2(6, 0); + hero_l18_set_move_state_us2(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1056,9 +1056,9 @@ void hero_update_state_decider_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l18_set_action_us2(0, 1); + hero_l18_set_move_state_us2(0, 1); } else { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1070,7 +1070,7 @@ void hero_update_state_decider_us2(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l18_set_action_us2(0x2C, 1); + hero_l18_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1134,11 +1134,11 @@ void hero_update_state_decider_us2(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.21666668f); FLD(g_hero_state, f32, 0x128) = 0.16666667f; - hero_l18_set_action_us2(0x16, 1); + hero_l18_set_move_state_us2(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x46; FLD(g_hero_state, s16, 0x1D0) = 0x46; } else { - hero_l18_set_action_us2(0x3E, 1); + hero_l18_set_move_state_us2(0x3E, 1); } break; } @@ -1151,7 +1151,7 @@ void hero_update_state_decider_us2(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l18_set_action_us2(0x28, 1); + hero_l18_set_move_state_us2(0x28, 1); } break; } @@ -1162,16 +1162,16 @@ void hero_update_state_decider_us2(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x46; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l18_set_action_us2(0x74, 1); + hero_l18_set_move_state_us2(0x74, 1); } else { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { - hero_l18_set_action_us2(0x2A, 1); + hero_l18_set_move_state_us2(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1188,7 +1188,7 @@ void hero_update_state_decider_us2(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l18_set_action_us2(0x28, 1); + hero_l18_set_move_state_us2(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)vec20 = 0; @@ -1205,7 +1205,7 @@ void hero_update_state_decider_us2(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 5, NULL) != 0) && ((f32)g_hero_l18_state_records[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l18_set_action_us2(0x28, 1); + hero_l18_set_move_state_us2(0x28, 1); break; } top = 0xE; @@ -1214,19 +1214,19 @@ void hero_update_state_decider_us2(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l18_set_action_us2(0x2A, 1); + hero_l18_set_move_state_us2(0x2A, 1); } break; } if ((f32)g_hero_l18_state_records[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l18_set_action_us2(0x27, 1); + hero_l18_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x6C8) >= 6)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l18_set_action_us2(0x74, 1); + hero_l18_set_move_state_us2(0x74, 1); } else { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1235,11 +1235,11 @@ void hero_update_state_decider_us2(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l18_set_action_us2(0x27, 1); + hero_l18_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) && (g_current_map_index == 0x14)) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0xA) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1275,7 +1275,7 @@ void hero_update_state_decider_us2(void) { find_nearest_path_point(rail_path, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), rail_index, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l18_set_action_us2(0x29, 1); + hero_l18_set_move_state_us2(0x29, 1); break; } } @@ -1323,7 +1323,7 @@ void hero_update_state_decider_us2(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x46; FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1331,7 +1331,7 @@ void hero_update_state_decider_us2(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l18_set_action_us2(0x71, 1); + hero_l18_set_move_state_us2(0x71, 1); break; } { @@ -1343,7 +1343,7 @@ void hero_update_state_decider_us2(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l18_set_action_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l18_set_move_state_us2(0, 0) != 0)) { set_hero_animation(0xC, 4, 6.0f); } } else if (st == 0x3E) { @@ -1352,24 +1352,24 @@ void hero_update_state_decider_us2(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)quantized_height_2, 0.5f, -1.0f); } if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s32, 0x340) != 0)) { - if (hero_l18_set_action_us2(0, 0) != 0) { + if (hero_l18_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action_us2(0x27, 1); + hero_l18_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x10) && (FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l18_set_action_us2(0x27, 1); + hero_l18_set_move_state_us2(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l18_set_action_us2(0x18, 0); + hero_l18_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -1378,18 +1378,18 @@ void hero_update_state_decider_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l18_set_action_us2(0x1B, 1); + hero_l18_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1398,7 +1398,7 @@ void hero_update_state_decider_us2(void) { vec10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)vec10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l18_set_action_us2(0x19, 1); + hero_l18_set_move_state_us2(0x19, 1); } break; } @@ -1409,7 +1409,7 @@ void hero_update_state_decider_us2(void) { vec10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)vec10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l18_set_action_us2(0x1A, 1); + hero_l18_set_move_state_us2(0x1A, 1); } } } @@ -1428,18 +1428,18 @@ void hero_update_state_decider_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)vec10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l18_set_action_us2(0x18, 1); + hero_l18_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l18_set_action_us2(0x1B, 1); + hero_l18_set_move_state_us2(0x1B, 1); } break; } @@ -1449,9 +1449,9 @@ void hero_update_state_decider_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); } else { - hero_l18_set_action_us2(0, 1); + hero_l18_set_move_state_us2(0, 1); } } break; @@ -1475,12 +1475,12 @@ void hero_update_state_decider_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action_us2(0x39, 1); + hero_l18_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l18_set_action_us2(0, 0) != 0) { + if (hero_l18_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1488,7 +1488,7 @@ void hero_update_state_decider_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l18_set_action_us2(0, 0) != 0) { + if (hero_l18_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1502,32 +1502,32 @@ void hero_update_state_decider_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l18_set_action_us2(2, 1); + hero_l18_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l18_set_action_us2(3, 0) != 0) { + if (hero_l18_set_move_state_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l18_set_action_us2(0, 1); + hero_l18_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l18_set_action_us2(8, 1); + hero_l18_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l18_set_action_us2(0x17, 1); + hero_l18_set_move_state_us2(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action_us2(0x27, 1); + hero_l18_set_move_state_us2(0x27, 1); break; } } @@ -1559,7 +1559,7 @@ void hero_update_state_decider_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == MOBY_CLASS_LEVITATOR_PAD)) { - if (hero_l18_set_action_us2(0, 0) != 0) { + if (hero_l18_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1569,9 +1569,9 @@ void hero_update_state_decider_us2(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l18_set_action_us2(0x74, 1); + hero_l18_set_move_state_us2(0x74, 1); } else { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); } } break; @@ -1584,16 +1584,16 @@ void hero_update_state_decider_us2(void) { ok = 1; } if (ok != 0) { - hero_l18_set_action_us2(0x11, 1); + hero_l18_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l18_set_action_us2(0x17, 1); + hero_l18_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1604,23 +1604,23 @@ void hero_update_state_decider_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l18_set_action_us2(3, 0) != 0) { + if (hero_l18_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l18_set_action_us2(4, 1); + hero_l18_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_l18_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l18_set_action_us2(2, 1); + hero_l18_set_move_state_us2(2, 1); break; } - hero_l18_set_action_us2(2, 0); + hero_l18_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1629,21 +1629,21 @@ void hero_update_state_decider_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_l18_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l18_set_action_us2(2, 1); + hero_l18_set_move_state_us2(2, 1); break; } - hero_l18_set_action_us2(2, 0); + hero_l18_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_anim_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l18_set_action_us2(0, 0) != 0) { + if (hero_l18_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_screen_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l18_set_action_us2(0, 0) != 0) { + } else if (hero_l18_set_move_state_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1691,14 +1691,14 @@ void hero_update_state_decider_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l18_set_action_us2(0xB, 1); + hero_l18_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l18_set_action_us2(0x82, 1); + hero_l18_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1707,25 +1707,25 @@ void hero_update_state_decider_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l18_set_action_us2(0xA, 1); + hero_l18_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l18_set_action_us2(0x10, 1); + hero_l18_set_move_state_us2(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l18_set_action_us2(0x27, 1); + hero_l18_set_move_state_us2(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l18_set_action_us2(0x77, 1); + hero_l18_set_move_state_us2(0x77, 1); break; } } @@ -1829,7 +1829,7 @@ void hero_update_state_decider_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l18_set_action_us2(3, 0) != 0) { + if (hero_l18_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1837,13 +1837,13 @@ void hero_update_state_decider_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l18_speed_params[0][2])) { - hero_l18_set_action_us2(7, 1); + hero_l18_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l18_set_action_us2(7, 1); + hero_l18_set_move_state_us2(7, 1); } else if (g_hero_l18_speed_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l18_set_action_us2(9, 1); + hero_l18_set_move_state_us2(9, 1); } else { - hero_l18_set_action_us2(7, 1); + hero_l18_set_move_state_us2(7, 1); } break; } @@ -1851,10 +1851,10 @@ void hero_update_state_decider_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); break; } { @@ -1864,7 +1864,7 @@ void hero_update_state_decider_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &unused_6c) != 0) && (unused_6c < FLD(g_hero_state, s32, 0x1B8))) { - hero_l18_set_action_us2(0x11, 1); + hero_l18_set_move_state_us2(0x11, 1); break; } } @@ -1893,7 +1893,7 @@ void hero_update_state_decider_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l18_set_action_us2(0xE, 1); + hero_l18_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1903,28 +1903,28 @@ void hero_update_state_decider_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l18_set_action_us2(8, 1); + hero_l18_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l18_set_action_us2(0x17, 1); + hero_l18_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l18_set_action_us2(6, 1); + hero_l18_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action_us2(0x39, 1); + hero_l18_set_move_state_us2(0x39, 1); } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l18_set_action_us2(0x82, 1); + hero_l18_set_move_state_us2(0x82, 1); } else { - hero_l18_set_action_us2(0, 0); + hero_l18_set_move_state_us2(0, 0); } } break; @@ -1934,8 +1934,8 @@ void hero_update_state_decider_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action_us2(0x39, 1); - } else if (hero_l18_set_action_us2(0, 0) != 0) { + hero_l18_set_move_state_us2(0x39, 1); + } else if (hero_l18_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_screen_id(0), 0, 13.0f); } } @@ -1952,35 +1952,35 @@ void hero_update_state_decider_us2(void) { set_hero_animation(0xD, 0, 12.0f); } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l18_set_action_us2(0x94, 1); + hero_l18_set_move_state_us2(0x94, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l18_set_action_us2(1, 1); + hero_l18_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l18_set_action_us2(0x8F, 1); + hero_l18_set_move_state_us2(0x8F, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l18_set_action_us2(0x92, 1); + hero_l18_set_move_state_us2(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != MOBY_CLASS_RECEIVER_BOT) && (PadPressedWithin(0x80, 9, NULL) != 0)) { - hero_l18_set_action_us2(0x93, 1); + hero_l18_set_move_state_us2(0x93, 1); break; } hero_resolve_stick_direction(0, 1.0f); turned = hero_is_turned_past_angle(0.17453295f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (turned != 0)) { - hero_l18_set_action_us2(0x8E, 1); + hero_l18_set_move_state_us2(0x8E, 1); } break; } case 0x93: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l18_set_action_us2(0x94, 1); + hero_l18_set_move_state_us2(0x94, 1); } break; case 0x92: @@ -2046,20 +2046,20 @@ void hero_update_state_decider_us2(void) { after_pose: if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l18_set_action_us2(0x92, 1); + hero_l18_set_move_state_us2(0x92, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l18_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l18_set_action_us2(0x8E, 1); + hero_l18_set_move_state_us2(0x8E, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l18_set_action_us2(0x8D, 1); + hero_l18_set_move_state_us2(0x8D, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l18_set_action_us2(0x8F, 1); + hero_l18_set_move_state_us2(0x8F, 1); } break; } @@ -2072,15 +2072,15 @@ void hero_update_state_decider_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action_us2(0x91, 1); + hero_l18_set_move_state_us2(0x91, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l18_set_action_us2(0x8E, 1); + hero_l18_set_move_state_us2(0x8E, 1); } else { - hero_l18_set_action_us2(0x8D, 1); + hero_l18_set_move_state_us2(0x8D, 1); } } else { - hero_l18_set_action_us2(0x8D, 1); + hero_l18_set_move_state_us2(0x8D, 1); } } break; @@ -2090,43 +2090,43 @@ void hero_update_state_decider_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l18_set_action_us2(0x8F, 1); + hero_l18_set_move_state_us2(0x8F, 1); } else { - hero_l18_set_action_us2(0x8D, 1); + hero_l18_set_move_state_us2(0x8D, 1); } } break; case 0x8E: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l18_set_action_us2(0x94, 1); + hero_l18_set_move_state_us2(0x94, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l18_set_action_us2(0x92, 1); + hero_l18_set_move_state_us2(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != MOBY_CLASS_RECEIVER_BOT) && (PadPressedWithin(0x80, 9, NULL) != 0)) { - hero_l18_set_action_us2(0x93, 1); + hero_l18_set_move_state_us2(0x93, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l18_set_action_us2(0x8F, 1); + hero_l18_set_move_state_us2(0x8F, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f) && (FLD(g_hero_state, s16, 0x1454) == 0)) { - hero_l18_set_action_us2(0x8D, 1); + hero_l18_set_move_state_us2(0x8D, 1); } break; case 0x90: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l18_set_action_us2(0x8F, 1); + hero_l18_set_move_state_us2(0x8F, 1); break; } if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x1B8) >= 0x24)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l18_set_action_us2(0x91, 1); + hero_l18_set_move_state_us2(0x91, 1); } else { - hero_l18_set_action_us2(0x8D, 0); + hero_l18_set_move_state_us2(0x8D, 0); } } break; @@ -2141,7 +2141,7 @@ void hero_update_state_decider_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l18_set_action_us2(0, 0); + hero_l18_set_move_state_us2(0, 0); anim = hero_get_screen_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -2152,7 +2152,7 @@ void hero_update_state_decider_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l18_set_action_us2(0, 0); + hero_l18_set_move_state_us2(0, 0); } break; case 0x22: @@ -2162,12 +2162,12 @@ void hero_update_state_decider_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_l18_set_action_us2(7, 1); + hero_l18_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l18_set_action_us2(0, 0); + hero_l18_set_move_state_us2(0, 0); } break; default: diff --git a/src/us2/levels/19_grelbin/L19_002B5CF8.c b/src/us2/levels/19_grelbin/L19_002B5CF8.c index 397f45871..646f9805f 100644 --- a/src/us2/levels/19_grelbin/L19_002B5CF8.c +++ b/src/us2/levels/19_grelbin/L19_002B5CF8.c @@ -63,7 +63,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l19_set_state_us2(s32, s32); +extern s32 hero_l19_set_move_state_us2(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_us2(s32); extern int hero_play_sound(s32, s32); @@ -145,7 +145,7 @@ s32 hero_l19_apply_contact_push_us2(s32 apply_push) { case 0: other_moby = g_hero_state.f249C; if (other_moby != 0 && (*(s16 *)(other_moby + 0xAA) == 0x4EB || *(s16 *)(other_moby + 0xAA) == 0x558)) { - hero_l19_set_state_us2(0x7D, 1); + hero_l19_set_move_state_us2(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -156,7 +156,7 @@ s32 hero_l19_apply_contact_push_us2(s32 apply_push) { AdjustPlayerHealth_us2(FloatToInt(*(float *)(effect_slot + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l19_set_state_us2(0x16, 1); + hero_l19_set_move_state_us2(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -166,13 +166,13 @@ s32 hero_l19_apply_contact_push_us2(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l19_set_state_us2(0x72, 1); + hero_l19_set_move_state_us2(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l19_set_state_us2(0x73, 1); + hero_l19_set_move_state_us2(0x73, 1); } else if (contact->f24 & 8) { - hero_l19_set_state_us2(0x8C, 1); + hero_l19_set_move_state_us2(0x8C, 1); } else { - hero_l19_set_state_us2(0x16, 1); + hero_l19_set_move_state_us2(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&push_vector); @@ -184,7 +184,7 @@ s32 hero_l19_apply_contact_push_us2(s32 apply_push) { } break; case 4: - hero_l19_set_state_us2(0x90, 1); + hero_l19_set_move_state_us2(0x90, 1); hero_flatten_push_vector(&push_vector, is_special, 0.083333336f, 0.050000004f); break; } diff --git a/src/us2/levels/19_grelbin/L19_002BCB58-sw.c b/src/us2/levels/19_grelbin/L19_002BCB58-sw.c index 04b9c009f..bff19b457 100644 --- a/src/us2/levels/19_grelbin/L19_002BCB58-sw.c +++ b/src/us2/levels/19_grelbin/L19_002BCB58-sw.c @@ -141,7 +141,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -156,7 +156,7 @@ extern s32 shooter_update_ranged_attack(s32); extern s32 hero_get_anim_id(s32); extern void hero_detach_from_object_us2(s32); extern void ClipHeroVelocityAtWall(s32); -extern s32 hero_l19_set_state_us2(s32, s32); +extern s32 hero_l19_set_move_state_us2(s32, s32); extern char g_impact_effect_data[] MACRO_ADDR; extern void moby_raise_state_to_eight(); extern void moby_raise_state_to_eight_copy(); @@ -695,7 +695,7 @@ void hero_l19_update_state_machine_us2(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { hero_word_11 = ((Hero *)g_hero_state)->i[0x2440/4]; if (hero_word_11 != -1) { @@ -1417,7 +1417,7 @@ void hero_l19_update_state_machine_us2(void) { coll_process_hit(0.4f, (s32)((TI128*)vec0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)vec10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l19_state_block)->f[0x180/4] = 0.1f; @@ -2424,7 +2424,7 @@ void hero_l19_update_state_machine_us2(void) { } hero_try_surface_push_response(3.7f, 0.0f, 0.35f); if (shooter_update_ranged_attack((s32) hero_moby_3) != 0) { - hero_l19_set_state_us2(0x8D, 1); + hero_l19_set_move_state_us2(0x8D, 1); } } break; diff --git a/src/us2/levels/19_grelbin/L19_002BCB58-sw2.c b/src/us2/levels/19_grelbin/L19_002BCB58-sw2.c index c45505f8b..df433eae5 100644 --- a/src/us2/levels/19_grelbin/L19_002BCB58-sw2.c +++ b/src/us2/levels/19_grelbin/L19_002BCB58-sw2.c @@ -56,8 +56,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -127,7 +127,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l19_set_state_us2(s32 action, s32 animate) { +s32 hero_l19_set_move_state_us2(s32 action, s32 animate) { u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; s32 old_step; @@ -174,7 +174,9 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -187,7 +189,7 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { snd_start_mode_sound(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_anim_id(0) == 0x51) set_hero_animation(hero_get_anim_id(0), 0, 18.0f); else set_hero_animation(hero_get_anim_id(0), 0, -1.0f); @@ -336,7 +338,7 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l19_set_state_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l19_set_move_state_us2(0x76, 1); return 0; } } if (BYTE(0x22B9) || WORD(0x2294) == 0x70) { WORD(0x2294) = 0x70; set_hero_animation(0x59, 0, 8.0f); goto finish; @@ -369,11 +371,11 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_anim_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l19_set_state_us2(0, 0)) set_hero_animation(hero_get_anim_id(0), 0, 18.0f); + if (hero_l19_set_move_state_us2(0, 0)) set_hero_animation(hero_get_anim_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -398,7 +400,7 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -542,13 +544,13 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { case 0x45: case 0x48: case 0x5B: case 0x66: case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l19_set_state_us2(0x81, 1); return 0; + hero_l19_set_move_state_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_aim_block_flag) { hero_l19_set_state_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_aim_block_flag) { hero_l19_set_move_state_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l19_set_state_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l19_set_move_state_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -622,9 +624,9 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_l19_special_state_flag) { hero_l19_set_state_us2(0x7D, 1); return 0; } - if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l19_set_state_us2(0x79, 1); - else hero_l19_set_state_us2(0x39, 1); + if (g_current_map_index == 2 && g_hero_l19_special_state_flag) { hero_l19_set_move_state_us2(0x7D, 1); return 0; } + if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l19_set_move_state_us2(0x79, 1); + else hero_l19_set_move_state_us2(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -664,7 +666,7 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -690,7 +692,7 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -699,7 +701,7 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -832,7 +834,7 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -891,7 +893,7 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -903,7 +905,7 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -919,7 +921,7 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { set_hero_animation(0x6A, 0, 8.0f); goto finish; case 0x8D: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state_us2(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state_us2(0x94, 1); return 0; } if (!animate) goto finish; set_hero_animation(13, 0, 9.0f); goto finish; case 0x8F: @@ -940,7 +942,7 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l19_float_sequences[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x8E: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_state_us2(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l19_set_move_state_us2(0x94, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); BYTE(0x40C) = 0; BYTE(0x40F) = 0; if (WORD(0x22A4) == 0) REAL(0x1B4) = vec_length_xy(VEC(0x160)); @@ -969,7 +971,7 @@ s32 hero_l19_set_state_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l19_set_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l19_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/19_grelbin/L19_002CACE8-sw.c b/src/us2/levels/19_grelbin/L19_002CACE8-sw.c index c1facca1a..76307155a 100644 --- a/src/us2/levels/19_grelbin/L19_002CACE8-sw.c +++ b/src/us2/levels/19_grelbin/L19_002CACE8-sw.c @@ -70,7 +70,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l19_set_state_us2(s32, s32); +s32 hero_l19_set_move_state_us2(s32, s32); void snd_start_mode_sound(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -146,7 +146,7 @@ void hero_l19_decide_state_transition_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l19_set_state_us2(0x39, 1); + hero_l19_set_move_state_us2(0x39, 1); goto end; } } @@ -176,15 +176,15 @@ void hero_l19_decide_state_transition_us2(void) { if (FLD(g_hero_state, f32, 0x88) < g_mover_current_value) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { if (FLD(g_hero_state, u8, 0x22B4) == 4) { - hero_l19_set_state_us2(0x91, 1); + hero_l19_set_move_state_us2(0x91, 1); goto end; } - hero_l19_set_state_us2(0x74, 1); + hero_l19_set_move_state_us2(0x74, 1); goto end; } } if ((FLD(g_hero_state, u8, 0x22B4) == 4) && (FLD(g_hero_state, f32, 0x88) < FLD(FLD(FLD(g_hero_state, void *, 0x2290), void *, 0x68), f32, 0x3EC))) { - hero_l19_set_state_us2(0x91, 1); + hero_l19_set_move_state_us2(0x91, 1); } switch (FLD(g_hero_state, u32, 0x2294)) { case 0x0: @@ -192,12 +192,12 @@ void hero_l19_decide_state_transition_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state_us2(1, 1); + hero_l19_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l19_set_state_us2(0x82, 1); + hero_l19_set_move_state_us2(0x82, 1); break; } { @@ -233,7 +233,7 @@ void hero_l19_decide_state_transition_us2(void) { rec = g_hero_l19_slot_records + idle_anim_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l19_set_state_us2(0x3C, 1); + hero_l19_set_move_state_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -276,12 +276,12 @@ void hero_l19_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l19_set_state_us2(0x76, 1); + hero_l19_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); } break; } @@ -302,12 +302,12 @@ void hero_l19_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_aim_block_flag == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l19_set_state_us2(0x6E, 1); + hero_l19_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l19_set_state_us2(4, 1); + hero_l19_set_move_state_us2(4, 1); break; } } @@ -328,28 +328,28 @@ void hero_l19_decide_state_transition_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l19_set_state_us2(2, 1); + hero_l19_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state_us2(1, 1); + hero_l19_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l19_set_state_us2(0x3D, 1); + hero_l19_set_move_state_us2(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l19_set_state_us2(0x3D, 1); + hero_l19_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l19_set_state_us2(0, 1); + hero_l19_set_move_state_us2(0, 1); } break; case 0x3D: @@ -358,22 +358,22 @@ void hero_l19_decide_state_transition_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state_us2(4, 1); + hero_l19_set_move_state_us2(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l19_set_state_us2(2, 1); + hero_l19_set_move_state_us2(2, 1); break; } - hero_l19_set_state_us2(0, 1); + hero_l19_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -412,25 +412,25 @@ void hero_l19_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l19_set_state_us2(0x33, 1); + hero_l19_set_move_state_us2(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l19_set_state_us2(0x34, 1); + hero_l19_set_move_state_us2(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l19_set_state_us2(0x32, 1); + hero_l19_set_move_state_us2(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l19_set_state_us2(0x33, 1); + hero_l19_set_move_state_us2(0x33, 1); } } break; @@ -443,81 +443,81 @@ void hero_l19_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l19_set_state_us2(0x32, 1); + hero_l19_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l19_set_state_us2(0x34, 1); + hero_l19_set_move_state_us2(0x34, 1); } else { - hero_l19_set_state_us2(0x32, 1); + hero_l19_set_move_state_us2(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l19_set_state_us2(0x12, 1); + hero_l19_set_move_state_us2(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l19_set_state_us2(0x32, 1); + hero_l19_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l19_set_state_us2(0x34, 1); + hero_l19_set_move_state_us2(0x34, 1); } else { - hero_l19_set_state_us2(0x32, 1); + hero_l19_set_move_state_us2(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l19_set_state_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l19_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_anim_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l19_set_state_us2(0x35, 1); + hero_l19_set_move_state_us2(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l19_set_state_us2(0x12, 1); + hero_l19_set_move_state_us2(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l19_set_state_us2(0x32, 1); + hero_l19_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l19_set_state_us2(0x34, 1); + hero_l19_set_move_state_us2(0x34, 1); } else { - hero_l19_set_state_us2(0x32, 1); + hero_l19_set_move_state_us2(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l19_set_state_us2(0x70, 0); + hero_l19_set_move_state_us2(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l19_set_state_us2(0x36, 1); + hero_l19_set_move_state_us2(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state_us2(0x67, 1); + hero_l19_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state_us2(0x33, 1); + hero_l19_set_move_state_us2(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l19_set_state_us2(0x33, 0); + hero_l19_set_move_state_us2(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state_us2(0x67, 1); + hero_l19_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l19_set_state_us2(0x36, 0); + hero_l19_set_move_state_us2(0x36, 0); } break; case 0x1: @@ -551,9 +551,9 @@ void hero_l19_decide_state_transition_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { snd_start_mode_sound(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state_us2(4, 1); + hero_l19_set_move_state_us2(4, 1); } else { - hero_l19_set_state_us2(0, 0); + hero_l19_set_move_state_us2(0, 0); anim = hero_get_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -565,9 +565,9 @@ void hero_l19_decide_state_transition_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l19_set_state_us2(0, 0); + hero_l19_set_move_state_us2(0, 0); } else { - hero_l19_set_state_us2(0, 1); + hero_l19_set_move_state_us2(0, 1); } } break; @@ -600,7 +600,7 @@ void hero_l19_decide_state_transition_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state_us2(7, 1); + hero_l19_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -609,7 +609,7 @@ void hero_l19_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l19_set_state_us2(0, 0); + hero_l19_set_move_state_us2(0, 0); } break; } @@ -631,7 +631,7 @@ void hero_l19_decide_state_transition_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state_us2(7, 1); + hero_l19_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -644,7 +644,7 @@ void hero_l19_decide_state_transition_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l19_set_state_us2(2, 0); + hero_l19_set_move_state_us2(2, 0); set_hero_animation(3, g_hero_l19_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -655,22 +655,22 @@ void hero_l19_decide_state_transition_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l19_set_state_us2(2, 1); + hero_l19_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l19_set_state_us2(0, 0); + hero_l19_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state_us2(0, 0); + hero_l19_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l19_set_state_us2(0, 1); + hero_l19_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -687,7 +687,7 @@ void hero_l19_decide_state_transition_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state_us2(7, 1); + hero_l19_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -696,7 +696,7 @@ void hero_l19_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l19_set_state_us2(0, 0); + hero_l19_set_move_state_us2(0, 0); set_hero_animation(hero_get_anim_id(0), 0, 15.0f); break; } @@ -708,7 +708,7 @@ void hero_l19_decide_state_transition_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state_us2(0, 1); + hero_l19_set_move_state_us2(0, 1); } break; case 0x2: @@ -722,11 +722,11 @@ void hero_l19_decide_state_transition_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l19_set_state_us2(0x76, 1); + hero_l19_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); break; } n = 9; @@ -740,12 +740,12 @@ void hero_l19_decide_state_transition_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l19_set_state_us2(9, 1); + hero_l19_set_move_state_us2(9, 1); } else { - hero_l19_set_state_us2(7, 1); + hero_l19_set_move_state_us2(7, 1); } } else { - hero_l19_set_state_us2(7, 1); + hero_l19_set_move_state_us2(7, 1); } break; } @@ -753,21 +753,21 @@ void hero_l19_decide_state_transition_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state_us2(1, 1); + hero_l19_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state_us2(4, 1); + hero_l19_set_move_state_us2(4, 1); break; } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l19_set_state_us2(0x70, 1); + hero_l19_set_move_state_us2(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l19_set_state_us2(2, 1); + hero_l19_set_move_state_us2(2, 1); } } turned = hero_is_turned_past_angle(0.03490659f); @@ -778,7 +778,7 @@ void hero_l19_decide_state_transition_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l19_set_state_us2(0, 0) == 0) { + if (hero_l19_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -795,7 +795,7 @@ void hero_l19_decide_state_transition_us2(void) { hero_update_anim_scale(); } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l19_set_state_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l19_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_anim_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -829,17 +829,17 @@ void hero_l19_decide_state_transition_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l19_set_state_us2(3, 0); + hero_l19_set_move_state_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l19_set_state_us2(0x77, 1); + hero_l19_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l19_set_state_us2(0x77, 1); + hero_l19_set_move_state_us2(0x77, 1); break; } } @@ -857,11 +857,11 @@ void hero_l19_decide_state_transition_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l19_set_state_us2(0x64, 1); + hero_l19_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l19_set_state_us2(0x63, 1); + hero_l19_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -869,15 +869,15 @@ void hero_l19_decide_state_transition_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state_us2(0x62, 1); + hero_l19_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l19_set_state_us2(0, 1); + hero_l19_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l19_set_state_us2(0x62, 1); + hero_l19_set_move_state_us2(0x62, 1); } break; case 0x79: @@ -892,25 +892,25 @@ void hero_l19_decide_state_transition_us2(void) { return; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state_us2(1, 1); + hero_l19_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l19_set_state_us2(7, 1); + hero_l19_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state_us2(4, 1); + hero_l19_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state_us2(0, 1); + hero_l19_set_move_state_us2(0, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -918,45 +918,45 @@ void hero_l19_decide_state_transition_us2(void) { } if (hero_get_anim_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l19_set_state_us2(0, 0); + hero_l19_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l19_set_state_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l19_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_anim_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l19_set_state_us2(2, 1); + hero_l19_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state_us2(1, 1); + hero_l19_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state_us2(0, 0); + hero_l19_set_move_state_us2(0, 0); set_hero_animation(hero_get_anim_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l19_set_state_us2(0x76, 1); + hero_l19_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l19_set_state_us2(0x15, 1); + hero_l19_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l19_set_state_us2(0, 1); + hero_l19_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -964,17 +964,17 @@ void hero_l19_decide_state_transition_us2(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l19_set_state_us2(0x8B, 1); + hero_l19_set_move_state_us2(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l19_set_state_us2(0, 1); + hero_l19_set_move_state_us2(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l19_set_state_us2(0, 1); + hero_l19_set_move_state_us2(0, 1); } break; case 0x24: @@ -1000,14 +1000,14 @@ void hero_l19_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l19_set_state_us2(0, 0); + hero_l19_set_move_state_us2(0, 0); set_hero_animation(hero_get_anim_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l19_set_state_us2(6, 0); + hero_l19_set_move_state_us2(6, 0); } else { - hero_l19_set_state_us2(6, 0); + hero_l19_set_move_state_us2(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1023,9 +1023,9 @@ void hero_l19_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l19_set_state_us2(0, 1); + hero_l19_set_move_state_us2(0, 1); } else { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1037,7 +1037,7 @@ void hero_l19_decide_state_transition_us2(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l19_set_state_us2(0x2C, 1); + hero_l19_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1045,7 +1045,7 @@ void hero_l19_decide_state_transition_us2(void) { break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l19_set_state_us2(0x18, 0); + hero_l19_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -1054,18 +1054,18 @@ void hero_l19_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (ProbeLedgeGrab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l19_set_state_us2(0x1B, 1); + hero_l19_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1074,7 +1074,7 @@ void hero_l19_decide_state_transition_us2(void) { vec10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)vec10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l19_set_state_us2(0x19, 1); + hero_l19_set_move_state_us2(0x19, 1); } break; } @@ -1085,7 +1085,7 @@ void hero_l19_decide_state_transition_us2(void) { vec10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (ProbeLedgeGrab((s8 *)vec10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l19_set_state_us2(0x1A, 1); + hero_l19_set_move_state_us2(0x1A, 1); } } } @@ -1104,18 +1104,18 @@ void hero_l19_decide_state_transition_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (ProbeLedgeGrab((s8 *)vec10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l19_set_state_us2(0x18, 1); + hero_l19_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l19_set_state_us2(0x1B, 1); + hero_l19_set_move_state_us2(0x1B, 1); } break; } @@ -1125,9 +1125,9 @@ void hero_l19_decide_state_transition_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); } else { - hero_l19_set_state_us2(0, 1); + hero_l19_set_move_state_us2(0, 1); } } break; @@ -1151,12 +1151,12 @@ void hero_l19_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state_us2(0x39, 1); + hero_l19_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l19_set_state_us2(0, 0) != 0) { + if (hero_l19_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1164,7 +1164,7 @@ void hero_l19_decide_state_transition_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l19_set_state_us2(0, 0) != 0) { + if (hero_l19_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1178,28 +1178,28 @@ void hero_l19_decide_state_transition_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l19_set_state_us2(2, 1); + hero_l19_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l19_set_state_us2(3, 0) != 0) { + if (hero_l19_set_move_state_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l19_set_state_us2(0, 1); + hero_l19_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l19_set_state_us2(8, 1); + hero_l19_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l19_set_state_us2(0x17, 1); + hero_l19_set_move_state_us2(0x17, 1); break; } } @@ -1231,7 +1231,7 @@ void hero_l19_decide_state_transition_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == MOBY_CLASS_LEVITATOR_PAD)) { - if (hero_l19_set_state_us2(0, 0) != 0) { + if (hero_l19_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1242,12 +1242,12 @@ void hero_l19_decide_state_transition_us2(void) { if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if (g_current_map_index == 0xD) { if (FLD(g_hero_state, f32, 0x318) < 69.0f) { - hero_l19_set_state_us2(0x74, 1); + hero_l19_set_move_state_us2(0x74, 1); } else { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); } } else { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); } } break; @@ -1260,16 +1260,16 @@ void hero_l19_decide_state_transition_us2(void) { ok = 1; } if (ok != 0) { - hero_l19_set_state_us2(0x11, 1); + hero_l19_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l19_set_state_us2(0x17, 1); + hero_l19_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1280,23 +1280,23 @@ void hero_l19_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l19_set_state_us2(3, 0) != 0) { + if (hero_l19_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l19_set_state_us2(4, 1); + hero_l19_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_limits[0][2]) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l19_set_state_us2(2, 1); + hero_l19_set_move_state_us2(2, 1); break; } - hero_l19_set_state_us2(2, 0); + hero_l19_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1305,21 +1305,21 @@ void hero_l19_decide_state_transition_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_limits[0][2]) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l19_set_state_us2(2, 1); + hero_l19_set_move_state_us2(2, 1); break; } - hero_l19_set_state_us2(2, 0); + hero_l19_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l19_animation_id_extra, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l19_set_state_us2(0, 0) != 0) { + if (hero_l19_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_anim_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l19_set_state_us2(0, 0) != 0) { + } else if (hero_l19_set_move_state_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1365,14 +1365,14 @@ void hero_l19_decide_state_transition_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l19_set_state_us2(0xB, 1); + hero_l19_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l19_set_state_us2(0x82, 1); + hero_l19_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1381,21 +1381,21 @@ void hero_l19_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((st1 = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (st1 != 0xA) && (st1 != 0x12) && (st1 != 0x38) && (st1 != 0x11) && (st1 != 0xE) && (st1 != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l19_set_state_us2(0xA, 1); + hero_l19_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l19_set_state_us2(0x10, 1); + hero_l19_set_move_state_us2(0x10, 1); } } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l19_set_state_us2(0x77, 1); + hero_l19_set_move_state_us2(0x77, 1); break; } } @@ -1499,7 +1499,7 @@ void hero_l19_decide_state_transition_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l19_set_state_us2(3, 0) != 0) { + if (hero_l19_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1507,13 +1507,13 @@ void hero_l19_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_limits[0][2])) { - hero_l19_set_state_us2(7, 1); + hero_l19_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l19_set_state_us2(7, 1); + hero_l19_set_move_state_us2(7, 1); } else if (g_hero_speed_limits[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l19_set_state_us2(9, 1); + hero_l19_set_move_state_us2(9, 1); } else { - hero_l19_set_state_us2(7, 1); + hero_l19_set_move_state_us2(7, 1); } break; } @@ -1521,10 +1521,10 @@ void hero_l19_decide_state_transition_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_action(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); break; } { @@ -1534,7 +1534,7 @@ void hero_l19_decide_state_transition_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &unused_6c) != 0) && (unused_6c < FLD(g_hero_state, s32, 0x1B8))) { - hero_l19_set_state_us2(0x11, 1); + hero_l19_set_move_state_us2(0x11, 1); break; } } @@ -1563,7 +1563,7 @@ void hero_l19_decide_state_transition_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l19_set_state_us2(0xE, 1); + hero_l19_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1573,32 +1573,32 @@ void hero_l19_decide_state_transition_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l19_set_state_us2(8, 1); + hero_l19_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l19_set_state_us2(0x17, 1); + hero_l19_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l19_set_state_us2(6, 1); + hero_l19_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l19_set_state_us2(0x79, 1); + hero_l19_set_move_state_us2(0x79, 1); } else { - hero_l19_set_state_us2(0x39, 1); + hero_l19_set_move_state_us2(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l19_set_state_us2(0x82, 1); + hero_l19_set_move_state_us2(0x82, 1); } else { - hero_l19_set_state_us2(0, 0); + hero_l19_set_move_state_us2(0, 0); } } break; @@ -1608,8 +1608,8 @@ void hero_l19_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state_us2(0x39, 1); - } else if (hero_l19_set_state_us2(0, 0) != 0) { + hero_l19_set_move_state_us2(0x39, 1); + } else if (hero_l19_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_anim_id(0), 0, 13.0f); } } @@ -1626,35 +1626,35 @@ void hero_l19_decide_state_transition_us2(void) { set_hero_animation(0xD, 0, 12.0f); } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l19_set_state_us2(0x94, 1); + hero_l19_set_move_state_us2(0x94, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l19_set_state_us2(1, 1); + hero_l19_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l19_set_state_us2(0x8F, 1); + hero_l19_set_move_state_us2(0x8F, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l19_set_state_us2(0x92, 1); + hero_l19_set_move_state_us2(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != MOBY_CLASS_RECEIVER_BOT) && (PadPressedWithin(0x80, 9, NULL) != 0)) { - hero_l19_set_state_us2(0x93, 1); + hero_l19_set_move_state_us2(0x93, 1); break; } hero_resolve_stick_direction(0, 1.0f); turned = hero_is_turned_past_angle(0.17453295f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (turned != 0)) { - hero_l19_set_state_us2(0x8E, 1); + hero_l19_set_move_state_us2(0x8E, 1); } break; } case 0x93: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l19_set_state_us2(0x94, 1); + hero_l19_set_move_state_us2(0x94, 1); } break; case 0x92: @@ -1720,20 +1720,20 @@ void hero_l19_decide_state_transition_us2(void) { after_pose: if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l19_set_state_us2(0x92, 1); + hero_l19_set_move_state_us2(0x92, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_speed_limits[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l19_set_state_us2(0x8E, 1); + hero_l19_set_move_state_us2(0x8E, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l19_set_state_us2(0x8D, 1); + hero_l19_set_move_state_us2(0x8D, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l19_set_state_us2(0x8F, 1); + hero_l19_set_move_state_us2(0x8F, 1); } break; } @@ -1746,15 +1746,15 @@ void hero_l19_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state_us2(0x91, 1); + hero_l19_set_move_state_us2(0x91, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l19_set_state_us2(0x8E, 1); + hero_l19_set_move_state_us2(0x8E, 1); } else { - hero_l19_set_state_us2(0x8D, 1); + hero_l19_set_move_state_us2(0x8D, 1); } } else { - hero_l19_set_state_us2(0x8D, 1); + hero_l19_set_move_state_us2(0x8D, 1); } } break; @@ -1764,43 +1764,43 @@ void hero_l19_decide_state_transition_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l19_set_state_us2(0x8F, 1); + hero_l19_set_move_state_us2(0x8F, 1); } else { - hero_l19_set_state_us2(0x8D, 1); + hero_l19_set_move_state_us2(0x8D, 1); } } break; case 0x8E: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l19_set_state_us2(0x94, 1); + hero_l19_set_move_state_us2(0x94, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l19_set_state_us2(0x92, 1); + hero_l19_set_move_state_us2(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != MOBY_CLASS_RECEIVER_BOT) && (PadPressedWithin(0x80, 9, NULL) != 0)) { - hero_l19_set_state_us2(0x93, 1); + hero_l19_set_move_state_us2(0x93, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l19_set_state_us2(0x8F, 1); + hero_l19_set_move_state_us2(0x8F, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f) && (FLD(g_hero_state, s16, 0x1454) == 0)) { - hero_l19_set_state_us2(0x8D, 1); + hero_l19_set_move_state_us2(0x8D, 1); } break; case 0x90: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l19_set_state_us2(0x8F, 1); + hero_l19_set_move_state_us2(0x8F, 1); break; } if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x1B8) >= 0x24)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l19_set_state_us2(0x91, 1); + hero_l19_set_move_state_us2(0x91, 1); } else { - hero_l19_set_state_us2(0x8D, 0); + hero_l19_set_move_state_us2(0x8D, 0); } } break; @@ -1815,7 +1815,7 @@ void hero_l19_decide_state_transition_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l19_set_state_us2(0, 0); + hero_l19_set_move_state_us2(0, 0); anim = hero_get_anim_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -1826,7 +1826,7 @@ void hero_l19_decide_state_transition_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l19_set_state_us2(0, 0); + hero_l19_set_move_state_us2(0, 0); } break; case 0x22: @@ -1836,12 +1836,12 @@ void hero_l19_decide_state_transition_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_l19_set_state_us2(7, 1); + hero_l19_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l19_set_state_us2(0, 0); + hero_l19_set_move_state_us2(0, 0); } break; default: diff --git a/src/us2/levels/20_yeedil/L20_002C5B50-qcopy.c b/src/us2/levels/20_yeedil/L20_002C5B50-qcopy.c index e7cfdd2c9..1f9e6946b 100644 --- a/src/us2/levels/20_yeedil/L20_002C5B50-qcopy.c +++ b/src/us2/levels/20_yeedil/L20_002C5B50-qcopy.c @@ -18,7 +18,7 @@ extern void hero_clear_tracked_slots(void); extern void hero_clear_queued_anim(void); extern s32 anim_copy_entry_data(char *, s32, s32, s32); extern void cam_reset_default(void); -extern s32 hero_l20_set_state_us2(s32, s32); +extern s32 hero_l20_set_move_state_us2(s32, s32); /* Apart from the leading state-1 block this is the same code as func_L18_002CFF48 (src/levels/shared/L18_002CFD68-qcopy.c), and it needs the same grouped-copy profile. @@ -94,7 +94,7 @@ void hero_exit_vehicle_mode_us2(s32 keep) goto done; } reset: - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); done: if (g_hero_state[0x22B4] == 4) cam_reset_default(); } diff --git a/src/us2/levels/20_yeedil/L20_002C5B50.c b/src/us2/levels/20_yeedil/L20_002C5B50.c index 6c0a8cceb..2e303849e 100644 --- a/src/us2/levels/20_yeedil/L20_002C5B50.c +++ b/src/us2/levels/20_yeedil/L20_002C5B50.c @@ -64,7 +64,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_l20_set_state_us2(s32, s32); +extern s32 hero_l20_set_move_state_us2(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_us2(s32); extern int hero_play_sound(s32, s32); @@ -151,7 +151,7 @@ s32 hero_handle_hazard_contact_us2(s32 apply_push) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB || *(s16 *)(other + 0xAA) == 0x558)) { - hero_l20_set_state_us2(0x7D, 1); + hero_l20_set_move_state_us2(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -162,7 +162,7 @@ s32 hero_handle_hazard_contact_us2(s32 apply_push) { AdjustPlayerHealth_us2(FloatToInt(*(float *)(effect_slot + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_l20_set_state_us2(0x16, 1); + hero_l20_set_move_state_us2(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -172,13 +172,13 @@ s32 hero_handle_hazard_contact_us2(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_l20_set_state_us2(0x72, 1); + hero_l20_set_move_state_us2(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_l20_set_state_us2(0x73, 1); + hero_l20_set_move_state_us2(0x73, 1); } else if (contact->f24 & 8) { - hero_l20_set_state_us2(0x8C, 1); + hero_l20_set_move_state_us2(0x8C, 1); } else { - hero_l20_set_state_us2(0x16, 1); + hero_l20_set_move_state_us2(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&vec); @@ -190,11 +190,11 @@ s32 hero_handle_hazard_contact_us2(s32 apply_push) { } break; case 1: - hero_l20_set_state_us2(0x42, 1); + hero_l20_set_move_state_us2(0x42, 1); hero_flatten_push_vector(&vec, flag, 0.083333336f, 0.050000004f); break; case 4: - hero_l20_set_state_us2(0x90, 1); + hero_l20_set_move_state_us2(0x90, 1); hero_flatten_push_vector(&vec, flag, 0.083333336f, 0.050000004f); break; } diff --git a/src/us2/levels/20_yeedil/L20_002CDA30-sw.c b/src/us2/levels/20_yeedil/L20_002CDA30-sw.c index 11ec4cbb7..cfa39bb57 100644 --- a/src/us2/levels/20_yeedil/L20_002CDA30-sw.c +++ b/src/us2/levels/20_yeedil/L20_002CDA30-sw.c @@ -154,7 +154,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -173,7 +173,7 @@ extern s32 shooter_update_ranged_attack(s32); extern s32 SelectHeroStateAnimation(s32); extern void hero_exit_vehicle_mode_us2(s32); extern void hero_slide_along_wall(s32); -extern s32 hero_l20_set_state_us2(s32, s32); +extern s32 hero_l20_set_move_state_us2(s32, s32); extern s32 g_hero_sound_flag_4; extern char g_impact_effect_data[] MACRO_ADDR; extern void moby_raise_state_to_eight(); @@ -720,7 +720,7 @@ void hero_l20_update_state_machine_us2(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { temp_a2 = ((Hero *)g_hero_state)->i[0x2440/4]; if (temp_a2 != -1) { @@ -1463,7 +1463,7 @@ void hero_l20_update_state_machine_us2(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l20_extra_state)->f[0x180/4] = 0.1f; @@ -3123,7 +3123,7 @@ void hero_l20_update_state_machine_us2(void) { } hero_try_surface_push_response(3.7f, 0.0f, 0.35f); if (shooter_update_ranged_attack((s32) temp_fp) != 0) { - hero_l20_set_state_us2(0x8D, 1); + hero_l20_set_move_state_us2(0x8D, 1); } } break; diff --git a/src/us2/levels/20_yeedil/L20_002D79B0-sw.c b/src/us2/levels/20_yeedil/L20_002D79B0-sw.c index 93bf1c07b..cdba457bf 100644 --- a/src/us2/levels/20_yeedil/L20_002D79B0-sw.c +++ b/src/us2/levels/20_yeedil/L20_002D79B0-sw.c @@ -72,8 +72,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -144,7 +144,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u /* Changes the player's action, initializes its movement parameters and selects animation. */ /* Changes the hero's action, initialises its movement parameters and selects its animation (USA v2.00). */ -s32 hero_l20_set_state_us2(s32 action, s32 animate) { +s32 hero_l20_set_move_state_us2(s32 action, s32 animate) { f32 dir[4]; u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -192,7 +192,9 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -205,8 +207,8 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_load_state_by_game_mode(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l20_set_state_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state_us2(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l20_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (SelectHeroStateAnimation(0) == 0x51) set_hero_animation(SelectHeroStateAnimation(0), 0, 18.0f); else set_hero_animation(SelectHeroStateAnimation(0), 0, -1.0f); @@ -353,7 +355,7 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l20_set_state_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l20_set_move_state_us2(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -399,12 +401,12 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l20_set_state_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state_us2(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l20_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (SelectHeroStateAnimation(0) == 0x51) { if (!animate) goto finish; - if (hero_l20_set_state_us2(0, 0)) set_hero_animation(SelectHeroStateAnimation(0), 0, 18.0f); + if (hero_l20_set_move_state_us2(0, 0)) set_hero_animation(SelectHeroStateAnimation(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -429,7 +431,7 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -595,13 +597,13 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l20_set_state_us2(0x81, 1); return 0; + hero_l20_set_move_state_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_l20_lock_flag_b) { hero_l20_set_state_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_l20_lock_flag_b) { hero_l20_set_move_state_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l20_set_state_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l20_set_move_state_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -676,9 +678,9 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_special_map_flag) hero_l20_set_state_us2(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l20_set_state_us2(0x79, 1); - else hero_l20_set_state_us2(0x39, 1); + if (g_current_map_index == 2 && g_hero_special_map_flag) hero_l20_set_move_state_us2(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l20_set_move_state_us2(0x79, 1); + else hero_l20_set_move_state_us2(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -741,7 +743,7 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -770,7 +772,7 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -779,7 +781,7 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -922,7 +924,7 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -1017,7 +1019,7 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -1029,7 +1031,7 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -1064,7 +1066,7 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { set_hero_animation(0x11, 0, 8.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state_us2(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state_us2(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation(0, 0, 9.0f); goto finish; case 0x4B: @@ -1098,7 +1100,7 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l20_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state_us2(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state_us2(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1131,7 +1133,7 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { set_hero_animation(12, 0, 6.0f); goto finish; case 0x8D: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state_us2(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state_us2(0x94, 1); return 0; } if (!animate) goto finish; set_hero_animation(13, 0, 9.0f); goto finish; case 0x8F: @@ -1152,7 +1154,7 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l20_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x8E: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_state_us2(0x94, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l20_set_move_state_us2(0x94, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); BYTE(0x40C) = 0; BYTE(0x40F) = 0; if (WORD(0x22A4) == 0) REAL(0x1B4) = vec_length_xy(VEC(0x160)); @@ -1181,7 +1183,7 @@ s32 hero_l20_set_state_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l20_set_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l20_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/20_yeedil/L20_002DEE88-sw.c b/src/us2/levels/20_yeedil/L20_002DEE88-sw.c index 1da01ad9e..a32be7f1c 100644 --- a/src/us2/levels/20_yeedil/L20_002DEE88-sw.c +++ b/src/us2/levels/20_yeedil/L20_002DEE88-sw.c @@ -78,7 +78,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l20_set_state_us2(s32, s32); +s32 hero_l20_set_move_state_us2(s32, s32); void hero_load_state_by_game_mode(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -158,7 +158,7 @@ void hero_l20_decide_state_transition_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l20_set_state_us2(0x39, 1); + hero_l20_set_move_state_us2(0x39, 1); goto end; } } @@ -194,15 +194,15 @@ void hero_l20_decide_state_transition_us2(void) { if (FLD(g_hero_state, f32, 0x88) < g_level_shared_float) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { if (FLD(g_hero_state, u8, 0x22B4) == 4) { - hero_l20_set_state_us2(0x91, 1); + hero_l20_set_move_state_us2(0x91, 1); goto end; } - hero_l20_set_state_us2(0x74, 1); + hero_l20_set_move_state_us2(0x74, 1); goto end; } } if ((FLD(g_hero_state, u8, 0x22B4) == 4) && (FLD(g_hero_state, f32, 0x88) < FLD(FLD(FLD(g_hero_state, void *, 0x2290), void *, 0x68), f32, 0x3EC))) { - hero_l20_set_state_us2(0x91, 1); + hero_l20_set_move_state_us2(0x91, 1); } switch (FLD(g_hero_state, u32, 0x2294)) { case 0x0: @@ -211,12 +211,12 @@ void hero_l20_decide_state_transition_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state_us2(1, 1); + hero_l20_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l20_set_state_us2(0x82, 1); + hero_l20_set_move_state_us2(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -253,7 +253,7 @@ void hero_l20_decide_state_transition_us2(void) { rec = g_hero_decision_records + sp40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l20_set_state_us2(0x3C, 1); + hero_l20_set_move_state_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -296,12 +296,12 @@ void hero_l20_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l20_set_state_us2(0x76, 1); + hero_l20_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); } break; } @@ -322,21 +322,21 @@ void hero_l20_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_l20_lock_flag_b == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l20_set_state_us2(0x6E, 1); + hero_l20_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l20_set_state_us2(4, 1); + hero_l20_set_move_state_us2(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state_us2(0x27, 1); + hero_l20_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l20_set_state_us2(0x2E, 1); + hero_l20_set_move_state_us2(0x2E, 1); break; } { @@ -356,28 +356,28 @@ void hero_l20_decide_state_transition_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l20_set_state_us2(2, 1); + hero_l20_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state_us2(1, 1); + hero_l20_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l20_set_state_us2(0x3D, 1); + hero_l20_set_move_state_us2(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l20_set_state_us2(0x3D, 1); + hero_l20_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); } break; case 0x3D: @@ -386,22 +386,22 @@ void hero_l20_decide_state_transition_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state_us2(4, 1); + hero_l20_set_move_state_us2(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l20_set_state_us2(2, 1); + hero_l20_set_move_state_us2(2, 1); break; } - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -440,25 +440,25 @@ void hero_l20_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l20_set_state_us2(0x33, 1); + hero_l20_set_move_state_us2(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l20_set_state_us2(0x34, 1); + hero_l20_set_move_state_us2(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l20_set_state_us2(0x32, 1); + hero_l20_set_move_state_us2(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l20_set_state_us2(0x33, 1); + hero_l20_set_move_state_us2(0x33, 1); } } break; @@ -471,81 +471,81 @@ void hero_l20_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l20_set_state_us2(0x32, 1); + hero_l20_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l20_set_state_us2(0x34, 1); + hero_l20_set_move_state_us2(0x34, 1); } else { - hero_l20_set_state_us2(0x32, 1); + hero_l20_set_move_state_us2(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l20_set_state_us2(0x12, 1); + hero_l20_set_move_state_us2(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l20_set_state_us2(0x32, 1); + hero_l20_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l20_set_state_us2(0x34, 1); + hero_l20_set_move_state_us2(0x34, 1); } else { - hero_l20_set_state_us2(0x32, 1); + hero_l20_set_move_state_us2(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l20_set_state_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l20_set_move_state_us2(0, 0) != 0)) { set_hero_animation(SelectHeroStateAnimation(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l20_set_state_us2(0x35, 1); + hero_l20_set_move_state_us2(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l20_set_state_us2(0x12, 1); + hero_l20_set_move_state_us2(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l20_set_state_us2(0x32, 1); + hero_l20_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l20_set_state_us2(0x34, 1); + hero_l20_set_move_state_us2(0x34, 1); } else { - hero_l20_set_state_us2(0x32, 1); + hero_l20_set_move_state_us2(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l20_set_state_us2(0x70, 0); + hero_l20_set_move_state_us2(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l20_set_state_us2(0x36, 1); + hero_l20_set_move_state_us2(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_us2(0x67, 1); + hero_l20_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_us2(0x33, 1); + hero_l20_set_move_state_us2(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l20_set_state_us2(0x33, 0); + hero_l20_set_move_state_us2(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_us2(0x67, 1); + hero_l20_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l20_set_state_us2(0x36, 0); + hero_l20_set_move_state_us2(0x36, 0); } break; case 0x1: @@ -579,9 +579,9 @@ void hero_l20_decide_state_transition_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_load_state_by_game_mode(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state_us2(4, 1); + hero_l20_set_move_state_us2(4, 1); } else { - hero_l20_set_state_us2(0, 0); + hero_l20_set_move_state_us2(0, 0); anim = SelectHeroStateAnimation(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -593,9 +593,9 @@ void hero_l20_decide_state_transition_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l20_set_state_us2(0, 0); + hero_l20_set_move_state_us2(0, 0); } else { - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); } } break; @@ -628,7 +628,7 @@ void hero_l20_decide_state_transition_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state_us2(7, 1); + hero_l20_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -637,7 +637,7 @@ void hero_l20_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l20_set_state_us2(0, 0); + hero_l20_set_move_state_us2(0, 0); } break; } @@ -659,7 +659,7 @@ void hero_l20_decide_state_transition_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state_us2(7, 1); + hero_l20_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -672,7 +672,7 @@ void hero_l20_decide_state_transition_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l20_set_state_us2(2, 0); + hero_l20_set_move_state_us2(2, 0); set_hero_animation(3, g_hero_l20_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -683,22 +683,22 @@ void hero_l20_decide_state_transition_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l20_set_state_us2(2, 1); + hero_l20_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l20_set_state_us2(0, 0); + hero_l20_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_us2(0, 0); + hero_l20_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -715,7 +715,7 @@ void hero_l20_decide_state_transition_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state_us2(7, 1); + hero_l20_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -724,7 +724,7 @@ void hero_l20_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l20_set_state_us2(0, 0); + hero_l20_set_move_state_us2(0, 0); set_hero_animation(SelectHeroStateAnimation(0), 0, 15.0f); break; } @@ -736,7 +736,7 @@ void hero_l20_decide_state_transition_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); } break; case 0x2: @@ -750,11 +750,11 @@ void hero_l20_decide_state_transition_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l20_set_state_us2(0x76, 1); + hero_l20_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); break; } n = 9; @@ -768,12 +768,12 @@ void hero_l20_decide_state_transition_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l20_set_state_us2(9, 1); + hero_l20_set_move_state_us2(9, 1); } else { - hero_l20_set_state_us2(7, 1); + hero_l20_set_move_state_us2(7, 1); } } else { - hero_l20_set_state_us2(7, 1); + hero_l20_set_move_state_us2(7, 1); } break; } @@ -781,11 +781,11 @@ void hero_l20_decide_state_transition_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state_us2(1, 1); + hero_l20_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state_us2(4, 1); + hero_l20_set_move_state_us2(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -802,25 +802,25 @@ void hero_l20_decide_state_transition_us2(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l20_set_state_us2(0x2E, 1); + hero_l20_set_move_state_us2(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l20_set_state_us2(2, 1); + hero_l20_set_move_state_us2(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l20_set_state_us2(0x70, 1); + hero_l20_set_move_state_us2(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l20_set_state_us2(2, 1); + hero_l20_set_move_state_us2(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state_us2(0x27, 1); + hero_l20_set_move_state_us2(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -831,7 +831,7 @@ void hero_l20_decide_state_transition_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l20_set_state_us2(0, 0) == 0) { + if (hero_l20_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -848,7 +848,7 @@ void hero_l20_decide_state_transition_us2(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l20_set_state_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l20_set_move_state_us2(0, 0) != 0)) { set_hero_animation(SelectHeroStateAnimation(0), 0, 17.0f); } if (FLD(sp74, u8, 0x43) == 0x37) { @@ -869,7 +869,7 @@ void hero_l20_decide_state_transition_us2(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l20_set_state_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l20_set_move_state_us2(0, 0) != 0)) { set_hero_animation(SelectHeroStateAnimation(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -903,17 +903,17 @@ void hero_l20_decide_state_transition_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l20_set_state_us2(3, 0); + hero_l20_set_move_state_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l20_set_state_us2(0x77, 1); + hero_l20_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l20_set_state_us2(0x77, 1); + hero_l20_set_move_state_us2(0x77, 1); break; } } @@ -931,11 +931,11 @@ void hero_l20_decide_state_transition_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l20_set_state_us2(0x64, 1); + hero_l20_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l20_set_state_us2(0x63, 1); + hero_l20_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -943,21 +943,21 @@ void hero_l20_decide_state_transition_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_us2(0x62, 1); + hero_l20_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l20_set_state_us2(0x62, 1); + hero_l20_set_move_state_us2(0x62, 1); } break; case 0x65: /* switch 2 */ temp_a0_11 = FLD(g_hero_state, s32, 0x18C0); if ((temp_a0_11 < 3) && (((temp_a0_11 * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 7, &sp44) != 0)) { - hero_l20_set_state_us2(0x66, 1); + hero_l20_set_move_state_us2(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -1000,7 +1000,7 @@ void hero_l20_decide_state_transition_us2(void) { return; case 0x6D: if ((f32)g_hero_l20_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); } break; case 0x30: @@ -1013,7 +1013,7 @@ void hero_l20_decide_state_transition_us2(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l20_set_state_us2(0, 0) != 0) { + if (hero_l20_set_move_state_us2(0, 0) != 0) { set_hero_animation(SelectHeroStateAnimation(0), 0, 17.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1021,29 +1021,29 @@ void hero_l20_decide_state_transition_us2(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state_us2(1, 1); + hero_l20_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l20_set_state_us2(7, 1); + hero_l20_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state_us2(4, 1); + hero_l20_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state_us2(0x27, 1); + hero_l20_set_move_state_us2(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1051,45 +1051,45 @@ void hero_l20_decide_state_transition_us2(void) { } if (SelectHeroStateAnimation(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l20_set_state_us2(0, 0); + hero_l20_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l20_set_state_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l20_set_move_state_us2(0, 0) != 0)) { set_hero_animation(SelectHeroStateAnimation(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l20_set_state_us2(2, 1); + hero_l20_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state_us2(1, 1); + hero_l20_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state_us2(0, 0); + hero_l20_set_move_state_us2(0, 0); set_hero_animation(SelectHeroStateAnimation(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l20_set_state_us2(0x76, 1); + hero_l20_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l20_set_state_us2(0x15, 1); + hero_l20_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1097,17 +1097,17 @@ void hero_l20_decide_state_transition_us2(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l20_set_state_us2(0x8B, 1); + hero_l20_set_move_state_us2(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); } break; case 0x24: @@ -1133,14 +1133,14 @@ void hero_l20_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l20_set_state_us2(0, 0); + hero_l20_set_move_state_us2(0, 0); set_hero_animation(SelectHeroStateAnimation(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l20_set_state_us2(6, 0); + hero_l20_set_move_state_us2(6, 0); } else { - hero_l20_set_state_us2(6, 0); + hero_l20_set_move_state_us2(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1156,9 +1156,9 @@ void hero_l20_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); } else { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1170,7 +1170,7 @@ void hero_l20_decide_state_transition_us2(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l20_set_state_us2(0x2C, 1); + hero_l20_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1234,11 +1234,11 @@ void hero_l20_decide_state_transition_us2(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.21666668f); FLD(g_hero_state, f32, 0x128) = 0.16666667f; - hero_l20_set_state_us2(0x16, 1); + hero_l20_set_move_state_us2(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x46; FLD(g_hero_state, s16, 0x1D0) = 0x46; } else { - hero_l20_set_state_us2(0x3E, 1); + hero_l20_set_move_state_us2(0x3E, 1); } break; } @@ -1251,7 +1251,7 @@ void hero_l20_decide_state_transition_us2(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l20_set_state_us2(0x28, 1); + hero_l20_set_move_state_us2(0x28, 1); } break; } @@ -1262,16 +1262,16 @@ void hero_l20_decide_state_transition_us2(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x46; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l20_set_state_us2(0x74, 1); + hero_l20_set_move_state_us2(0x74, 1); } else { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { - hero_l20_set_state_us2(0x2A, 1); + hero_l20_set_move_state_us2(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1288,7 +1288,7 @@ void hero_l20_decide_state_transition_us2(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l20_set_state_us2(0x28, 1); + hero_l20_set_move_state_us2(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)v20 = 0; @@ -1305,7 +1305,7 @@ void hero_l20_decide_state_transition_us2(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 5, NULL) != 0) && ((f32)g_hero_l20_action_table[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l20_set_state_us2(0x28, 1); + hero_l20_set_move_state_us2(0x28, 1); break; } top = 0xE; @@ -1314,19 +1314,19 @@ void hero_l20_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l20_set_state_us2(0x2A, 1); + hero_l20_set_move_state_us2(0x2A, 1); } break; } if ((f32)g_hero_l20_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l20_set_state_us2(0x27, 1); + hero_l20_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x6C8) >= 6)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l20_set_state_us2(0x74, 1); + hero_l20_set_move_state_us2(0x74, 1); } else { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1335,11 +1335,11 @@ void hero_l20_decide_state_transition_us2(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l20_set_state_us2(0x27, 1); + hero_l20_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) && (g_current_map_index == 0x14)) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0xA) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1375,7 +1375,7 @@ void hero_l20_decide_state_transition_us2(void) { find_nearest_path_point(sp50, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), sp5C, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l20_set_state_us2(0x29, 1); + hero_l20_set_move_state_us2(0x29, 1); break; } } @@ -1423,7 +1423,7 @@ void hero_l20_decide_state_transition_us2(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x46; FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1431,7 +1431,7 @@ void hero_l20_decide_state_transition_us2(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l20_set_state_us2(0x71, 1); + hero_l20_set_move_state_us2(0x71, 1); break; } { @@ -1443,7 +1443,7 @@ void hero_l20_decide_state_transition_us2(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l20_set_state_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l20_set_move_state_us2(0, 0) != 0)) { set_hero_animation(0xC, 4, 6.0f); } } else if (st == 0x3E) { @@ -1452,24 +1452,24 @@ void hero_l20_decide_state_transition_us2(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)sp64, 0.5f, -1.0f); } if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s32, 0x340) != 0)) { - if (hero_l20_set_state_us2(0, 0) != 0) { + if (hero_l20_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_us2(0x27, 1); + hero_l20_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x10) && (FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l20_set_state_us2(0x27, 1); + hero_l20_set_move_state_us2(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l20_set_state_us2(0x18, 0); + hero_l20_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -1478,18 +1478,18 @@ void hero_l20_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l20_set_state_us2(0x1B, 1); + hero_l20_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1498,7 +1498,7 @@ void hero_l20_decide_state_transition_us2(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l20_set_state_us2(0x19, 1); + hero_l20_set_move_state_us2(0x19, 1); } break; } @@ -1509,7 +1509,7 @@ void hero_l20_decide_state_transition_us2(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l20_set_state_us2(0x1A, 1); + hero_l20_set_move_state_us2(0x1A, 1); } } } @@ -1528,18 +1528,18 @@ void hero_l20_decide_state_transition_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_us2(0x18, 1); + hero_l20_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l20_set_state_us2(0x1B, 1); + hero_l20_set_move_state_us2(0x1B, 1); } break; } @@ -1549,9 +1549,9 @@ void hero_l20_decide_state_transition_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); } else { - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); } } break; @@ -1575,12 +1575,12 @@ void hero_l20_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_us2(0x39, 1); + hero_l20_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l20_set_state_us2(0, 0) != 0) { + if (hero_l20_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1588,7 +1588,7 @@ void hero_l20_decide_state_transition_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l20_set_state_us2(0, 0) != 0) { + if (hero_l20_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1602,32 +1602,32 @@ void hero_l20_decide_state_transition_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l20_set_state_us2(2, 1); + hero_l20_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l20_set_state_us2(3, 0) != 0) { + if (hero_l20_set_move_state_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l20_set_state_us2(0, 1); + hero_l20_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l20_set_state_us2(8, 1); + hero_l20_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state_us2(0x17, 1); + hero_l20_set_move_state_us2(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state_us2(0x27, 1); + hero_l20_set_move_state_us2(0x27, 1); break; } } @@ -1659,7 +1659,7 @@ void hero_l20_decide_state_transition_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l20_set_state_us2(0, 0) != 0) { + if (hero_l20_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1669,9 +1669,9 @@ void hero_l20_decide_state_transition_us2(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l20_set_state_us2(0x74, 1); + hero_l20_set_move_state_us2(0x74, 1); } else { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); } } break; @@ -1684,16 +1684,16 @@ void hero_l20_decide_state_transition_us2(void) { ok = 1; } if (ok != 0) { - hero_l20_set_state_us2(0x11, 1); + hero_l20_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state_us2(0x17, 1); + hero_l20_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1704,23 +1704,23 @@ void hero_l20_decide_state_transition_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l20_set_state_us2(3, 0) != 0) { + if (hero_l20_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l20_set_state_us2(4, 1); + hero_l20_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_l20_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l20_set_state_us2(2, 1); + hero_l20_set_move_state_us2(2, 1); break; } - hero_l20_set_state_us2(2, 0); + hero_l20_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1729,21 +1729,21 @@ void hero_l20_decide_state_transition_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_l20_speed_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l20_set_state_us2(2, 1); + hero_l20_set_move_state_us2(2, 1); break; } - hero_l20_set_state_us2(2, 0); + hero_l20_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l20_animation_id_extra, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l20_set_state_us2(0, 0) != 0) { + if (hero_l20_set_move_state_us2(0, 0) != 0) { set_hero_animation(SelectHeroStateAnimation(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l20_set_state_us2(0, 0) != 0) { + } else if (hero_l20_set_move_state_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1791,14 +1791,14 @@ void hero_l20_decide_state_transition_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state_us2(0xB, 1); + hero_l20_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l20_set_state_us2(0x82, 1); + hero_l20_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1807,25 +1807,25 @@ void hero_l20_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l20_set_state_us2(0xA, 1); + hero_l20_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l20_set_state_us2(0x10, 1); + hero_l20_set_move_state_us2(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l20_set_state_us2(0x27, 1); + hero_l20_set_move_state_us2(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l20_set_state_us2(0x77, 1); + hero_l20_set_move_state_us2(0x77, 1); break; } } @@ -1929,7 +1929,7 @@ void hero_l20_decide_state_transition_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l20_set_state_us2(3, 0) != 0) { + if (hero_l20_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1937,13 +1937,13 @@ void hero_l20_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_l20_speed_params[0][2])) { - hero_l20_set_state_us2(7, 1); + hero_l20_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l20_set_state_us2(7, 1); + hero_l20_set_move_state_us2(7, 1); } else if (g_hero_l20_speed_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l20_set_state_us2(9, 1); + hero_l20_set_move_state_us2(9, 1); } else { - hero_l20_set_state_us2(7, 1); + hero_l20_set_move_state_us2(7, 1); } break; } @@ -1951,10 +1951,10 @@ void hero_l20_decide_state_transition_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); break; } { @@ -1964,7 +1964,7 @@ void hero_l20_decide_state_transition_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l20_set_state_us2(0x11, 1); + hero_l20_set_move_state_us2(0x11, 1); break; } } @@ -1993,7 +1993,7 @@ void hero_l20_decide_state_transition_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l20_set_state_us2(0xE, 1); + hero_l20_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -2003,32 +2003,32 @@ void hero_l20_decide_state_transition_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l20_set_state_us2(8, 1); + hero_l20_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l20_set_state_us2(0x17, 1); + hero_l20_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l20_set_state_us2(6, 1); + hero_l20_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l20_set_state_us2(0x79, 1); + hero_l20_set_move_state_us2(0x79, 1); } else { - hero_l20_set_state_us2(0x39, 1); + hero_l20_set_move_state_us2(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l20_set_state_us2(0x82, 1); + hero_l20_set_move_state_us2(0x82, 1); } else { - hero_l20_set_state_us2(0, 0); + hero_l20_set_move_state_us2(0, 0); } } break; @@ -2038,8 +2038,8 @@ void hero_l20_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_us2(0x39, 1); - } else if (hero_l20_set_state_us2(0, 0) != 0) { + hero_l20_set_move_state_us2(0x39, 1); + } else if (hero_l20_set_move_state_us2(0, 0) != 0) { set_hero_animation(SelectHeroStateAnimation(0), 0, 13.0f); } } @@ -2064,28 +2064,28 @@ void hero_l20_decide_state_transition_us2(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state_us2(0x4E, 1); + hero_l20_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state_us2(1, 1); + hero_l20_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state_us2(0x41, 1); + hero_l20_set_move_state_us2(0x41, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l20_set_state_us2(0x45, 1); + hero_l20_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l20_set_state_us2(0x4D, 1); + hero_l20_set_move_state_us2(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l20_set_state_us2(0x40, 1); + hero_l20_set_move_state_us2(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -2098,14 +2098,14 @@ void hero_l20_decide_state_transition_us2(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state_us2(0x4E, 1); + hero_l20_set_move_state_us2(0x4E, 1); break; } rec = (u8 *)&g_hero_l20_action_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l20_set_state_us2(0x3F, 0); + hero_l20_set_move_state_us2(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -2114,13 +2114,13 @@ void hero_l20_decide_state_transition_us2(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0x10) ? n : 0xF, NULL) != 0) { - hero_l20_set_state_us2(0x4D, 1); + hero_l20_set_move_state_us2(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l20_set_state_us2(0x45, 1); + hero_l20_set_move_state_us2(0x45, 1); } break; } @@ -2183,42 +2183,42 @@ void hero_l20_decide_state_transition_us2(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l20_set_state_us2(0x45, 1); + hero_l20_set_move_state_us2(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l20_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l20_set_state_us2(0x40, 1); + hero_l20_set_move_state_us2(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l20_set_state_us2(0x3F, 1); + hero_l20_set_move_state_us2(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l20_set_state_us2(0x41, 1); + hero_l20_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 5, NULL) != 0)) { - hero_l20_set_state_us2(0x4D, 1); + hero_l20_set_move_state_us2(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state_us2(0x46, 1); + hero_l20_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l20_set_state_us2(0x4B, 1); + hero_l20_set_move_state_us2(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l20_set_state_us2(0x41, 1); + hero_l20_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state_us2(0x46, 1); + hero_l20_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -2228,11 +2228,11 @@ void hero_l20_decide_state_transition_us2(void) { FLD(g_hero_state, s16, 0x1EE) = 0xC - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l20_set_state_us2(0x40, 1); + hero_l20_set_move_state_us2(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l20_set_state_us2(0x3F, 1); + hero_l20_set_move_state_us2(0x3F, 1); } break; case 0x41: @@ -2244,29 +2244,29 @@ void hero_l20_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_us2(0x43, 1); + hero_l20_set_move_state_us2(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l20_set_state_us2(0x40, 1); + hero_l20_set_move_state_us2(0x40, 1); } else { - hero_l20_set_state_us2(0x3F, 1); + hero_l20_set_move_state_us2(0x3F, 1); } } else { - hero_l20_set_state_us2(0x3F, 1); + hero_l20_set_move_state_us2(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l20_set_state_us2(0x46, 1); + hero_l20_set_move_state_us2(0x46, 1); break; } if ((PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l20_set_state_us2(0x4B, 1); + hero_l20_set_move_state_us2(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l20_set_state_us2(0x3F, 1); + hero_l20_set_move_state_us2(0x3F, 1); } break; case 0x4E: @@ -2275,9 +2275,9 @@ void hero_l20_decide_state_transition_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state_us2(0x41, 1); + hero_l20_set_move_state_us2(0x41, 1); } else { - hero_l20_set_state_us2(0x3F, 1); + hero_l20_set_move_state_us2(0x3F, 1); } } break; @@ -2287,7 +2287,7 @@ void hero_l20_decide_state_transition_us2(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state_us2(0x4E, 1); + hero_l20_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.025000002f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2313,55 +2313,55 @@ void hero_l20_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l20_set_state_us2(0x45, 1); + hero_l20_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l20_set_state_us2(0x4D, 1); + hero_l20_set_move_state_us2(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l20_set_state_us2(0x41, 1); + hero_l20_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l20_set_state_us2(0x3F, 1); + hero_l20_set_move_state_us2(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l20_set_state_us2(0x41, 1); + hero_l20_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x24) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_us2(0x43, 1); + hero_l20_set_move_state_us2(0x43, 1); } else { - hero_l20_set_state_us2(0x3F, 0); + hero_l20_set_move_state_us2(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_us2(0x47, 1); + hero_l20_set_move_state_us2(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)v10 = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l20_set_state_us2(0x41, 1); + hero_l20_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l20_set_state_us2(0x41, 1); + hero_l20_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l20_set_state_us2(0x48, 1); + hero_l20_set_move_state_us2(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2370,7 +2370,7 @@ void hero_l20_decide_state_transition_us2(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l20_set_state_us2(0x49, 1); + hero_l20_set_move_state_us2(0x49, 1); } break; } @@ -2381,7 +2381,7 @@ void hero_l20_decide_state_transition_us2(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l20_set_state_us2(0x4A, 1); + hero_l20_set_move_state_us2(0x4A, 1); } } } @@ -2400,17 +2400,17 @@ void hero_l20_decide_state_transition_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l20_set_state_us2(0x47, 1); + hero_l20_set_move_state_us2(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l20_set_state_us2(0x41, 1); + hero_l20_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l20_set_state_us2(0x48, 1); + hero_l20_set_move_state_us2(0x48, 1); } break; } @@ -2421,35 +2421,35 @@ void hero_l20_decide_state_transition_us2(void) { set_hero_animation(0xD, 0, 12.0f); } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state_us2(0x94, 1); + hero_l20_set_move_state_us2(0x94, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l20_set_state_us2(1, 1); + hero_l20_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state_us2(0x8F, 1); + hero_l20_set_move_state_us2(0x8F, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l20_set_state_us2(0x92, 1); + hero_l20_set_move_state_us2(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != 0xEE1) && (PadPressedWithin(0x80, 9, NULL) != 0)) { - hero_l20_set_state_us2(0x93, 1); + hero_l20_set_move_state_us2(0x93, 1); break; } hero_resolve_stick_direction(0, 1.0f); turned = hero_is_turned_past_angle(0.17453295f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (turned != 0)) { - hero_l20_set_state_us2(0x8E, 1); + hero_l20_set_move_state_us2(0x8E, 1); } break; } case 0x93: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state_us2(0x94, 1); + hero_l20_set_move_state_us2(0x94, 1); } break; case 0x92: @@ -2515,20 +2515,20 @@ void hero_l20_decide_state_transition_us2(void) { after_pose: if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l20_set_state_us2(0x92, 1); + hero_l20_set_move_state_us2(0x92, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_l20_speed_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l20_set_state_us2(0x8E, 1); + hero_l20_set_move_state_us2(0x8E, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l20_set_state_us2(0x8D, 1); + hero_l20_set_move_state_us2(0x8D, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l20_set_state_us2(0x8F, 1); + hero_l20_set_move_state_us2(0x8F, 1); } break; } @@ -2541,15 +2541,15 @@ void hero_l20_decide_state_transition_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_us2(0x91, 1); + hero_l20_set_move_state_us2(0x91, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l20_set_state_us2(0x8E, 1); + hero_l20_set_move_state_us2(0x8E, 1); } else { - hero_l20_set_state_us2(0x8D, 1); + hero_l20_set_move_state_us2(0x8D, 1); } } else { - hero_l20_set_state_us2(0x8D, 1); + hero_l20_set_move_state_us2(0x8D, 1); } } break; @@ -2559,43 +2559,43 @@ void hero_l20_decide_state_transition_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l20_set_state_us2(0x8F, 1); + hero_l20_set_move_state_us2(0x8F, 1); } else { - hero_l20_set_state_us2(0x8D, 1); + hero_l20_set_move_state_us2(0x8D, 1); } } break; case 0x8E: if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l20_set_state_us2(0x94, 1); + hero_l20_set_move_state_us2(0x94, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l20_set_state_us2(0x92, 1); + hero_l20_set_move_state_us2(0x92, 1); break; } if ((FLD(FLD(g_hero_state, u8 *, 0x2290), s16, 0xAA) != 0xEE1) && (PadPressedWithin(0x80, 9, NULL) != 0)) { - hero_l20_set_state_us2(0x93, 1); + hero_l20_set_move_state_us2(0x93, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l20_set_state_us2(0x8F, 1); + hero_l20_set_move_state_us2(0x8F, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f) && (FLD(g_hero_state, s16, 0x1454) == 0)) { - hero_l20_set_state_us2(0x8D, 1); + hero_l20_set_move_state_us2(0x8D, 1); } break; case 0x90: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l20_set_state_us2(0x8F, 1); + hero_l20_set_move_state_us2(0x8F, 1); break; } if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x1B8) >= 0x24)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l20_set_state_us2(0x91, 1); + hero_l20_set_move_state_us2(0x91, 1); } else { - hero_l20_set_state_us2(0x8D, 0); + hero_l20_set_move_state_us2(0x8D, 0); } } break; @@ -2610,7 +2610,7 @@ void hero_l20_decide_state_transition_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l20_set_state_us2(0, 0); + hero_l20_set_move_state_us2(0, 0); anim = SelectHeroStateAnimation(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -2621,7 +2621,7 @@ void hero_l20_decide_state_transition_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l20_set_state_us2(0, 0); + hero_l20_set_move_state_us2(0, 0); } break; case 0x22: @@ -2631,12 +2631,12 @@ void hero_l20_decide_state_transition_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_l20_set_state_us2(7, 1); + hero_l20_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l20_set_state_us2(0, 0); + hero_l20_set_move_state_us2(0, 0); } break; default: diff --git a/src/us2/levels/22_dobbo_orbit/L22_002B7658.c b/src/us2/levels/22_dobbo_orbit/L22_002B7658.c index ece9e9bac..41d75cf87 100644 --- a/src/us2/levels/22_dobbo_orbit/L22_002B7658.c +++ b/src/us2/levels/22_dobbo_orbit/L22_002B7658.c @@ -62,7 +62,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_set_action_us2(s32, s32); +extern s32 hero_l22_set_move_state_us2(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_us2(s32); extern int hero_play_sound(s32, s32); @@ -147,7 +147,7 @@ s32 hero_l22_apply_hazard_contact_us2(s32 apply_push) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB || *(s16 *)(other + 0xAA) == 0x558)) { - hero_set_action_us2(0x7D, 1); + hero_l22_set_move_state_us2(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -158,7 +158,7 @@ s32 hero_l22_apply_hazard_contact_us2(s32 apply_push) { AdjustPlayerHealth_us2(FloatToInt(*(float *)(effect_slot + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_set_action_us2(0x16, 1); + hero_l22_set_move_state_us2(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -168,13 +168,13 @@ s32 hero_l22_apply_hazard_contact_us2(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_set_action_us2(0x72, 1); + hero_l22_set_move_state_us2(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_set_action_us2(0x73, 1); + hero_l22_set_move_state_us2(0x73, 1); } else if (contact->f24 & 8) { - hero_set_action_us2(0x8C, 1); + hero_l22_set_move_state_us2(0x8C, 1); } else { - hero_set_action_us2(0x16, 1); + hero_l22_set_move_state_us2(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&vec); @@ -186,15 +186,15 @@ s32 hero_l22_apply_hazard_contact_us2(s32 apply_push) { } break; case 1: - hero_set_action_us2(0x42, 1); + hero_l22_set_move_state_us2(0x42, 1); hero_flatten_push_vector(&vec, flag, 0.083333336f, 0.050000004f); break; case 2: if ((contact->f24 & 4) || g_hero_state.f1874 <= 0) { if (contact->f20 != 0 && *(s16 *)(contact->f20 + 0xAA) == 0x11DF) { - hero_set_action_us2(0x5A, 1); + hero_l22_set_move_state_us2(0x5A, 1); } else { - hero_set_action_us2(0x59, 1); + hero_l22_set_move_state_us2(0x59, 1); } player_slot_clear_object(g_hero_state.f2290); FastVecScale(&vec, &vec, 0.095f); diff --git a/src/us2/levels/22_dobbo_orbit/L22_002BF2B8-sw.c b/src/us2/levels/22_dobbo_orbit/L22_002BF2B8-sw.c index db06dc171..48d680424 100644 --- a/src/us2/levels/22_dobbo_orbit/L22_002BF2B8-sw.c +++ b/src/us2/levels/22_dobbo_orbit/L22_002BF2B8-sw.c @@ -82,7 +82,7 @@ extern void cam_project_vector_onto_view_plane(void *, void *); extern float cam_get_view_space_vector_length(void *); extern float cam_get_view_space_height(void *); extern void cam_set_view_space_vector_length(void *, void *, float); -extern int queue_copy_record_by_index(unsigned int index); +extern int actuator_play_pattern(unsigned int index); extern void moby_update_transform_history_followers(void *, int); extern float ReadPadFloatHistory(int); extern void UpdateHeroAimTarget(float, float, float); @@ -486,7 +486,7 @@ case 0x32: case 0x33: case 0x34: float old_pitch,steer,minimum_steer,pitch_change,controller_scale,rate,maximum_input,steering_limit; if (H(u32,0x2294)==0x34) { if (H(s32,0x1B8)>70) g_hero_state_machine_word=65535; - snd_update_slot_object(5,H(void*,0x2290),15);queue_copy_record_by_index(22); + snd_update_slot_object(5,H(void*,0x2290),15);actuator_play_pattern(22); } else { int slot=H(s32,0x2440); if (slot!=-1 && FLD(g_sound_state+slot*0x70, void *, 0x88)==H(void*,0x2290) && @@ -1090,7 +1090,7 @@ case 20: coll_process_hit(&workspace.state_14.delta, 0x10, 0.4f, H(void *, 0x2290), workspace.state_14.u.contact); } if (math_is_below_plane_within_depth(25.7f)) { - queue_copy_record_by_index(25); + actuator_play_pattern(25); H(u16, 0x1FA) = 50; if (g_hero_override_flag) { FLD(g_hero_l22_state_block, float, 0x180) = 0.1f; diff --git a/src/us2/levels/23_damosel_orbit/L23_002BBD58.c b/src/us2/levels/23_damosel_orbit/L23_002BBD58.c index 9f7c57798..26257d882 100644 --- a/src/us2/levels/23_damosel_orbit/L23_002BBD58.c +++ b/src/us2/levels/23_damosel_orbit/L23_002BBD58.c @@ -62,7 +62,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_set_action_us2(s32, s32); +extern s32 hero_l22_set_move_state_us2(s32, s32); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_us2(s32); extern int hero_play_sound(s32, s32); @@ -147,7 +147,7 @@ s32 hero_l23_apply_contact_push_us2(s32 apply_push) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB || *(s16 *)(other + 0xAA) == 0x558)) { - hero_set_action_us2(0x7D, 1); + hero_l22_set_move_state_us2(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -158,7 +158,7 @@ s32 hero_l23_apply_contact_push_us2(s32 apply_push) { AdjustPlayerHealth_us2(FloatToInt(*(float *)(effect_slot + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_set_action_us2(0x16, 1); + hero_l22_set_move_state_us2(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -168,13 +168,13 @@ s32 hero_l23_apply_contact_push_us2(s32 apply_push) { return 0; } if (g_hero_state.f229C == 0x12) { - hero_set_action_us2(0x72, 1); + hero_l22_set_move_state_us2(0x72, 1); } else if (g_hero_state.f229C == 0x11) { - hero_set_action_us2(0x73, 1); + hero_l22_set_move_state_us2(0x73, 1); } else if (contact->f24 & 8) { - hero_set_action_us2(0x8C, 1); + hero_l22_set_move_state_us2(0x8C, 1); } else { - hero_set_action_us2(0x16, 1); + hero_l22_set_move_state_us2(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&vec); @@ -186,15 +186,15 @@ s32 hero_l23_apply_contact_push_us2(s32 apply_push) { } break; case 1: - hero_set_action_us2(0x42, 1); + hero_l22_set_move_state_us2(0x42, 1); hero_flatten_push_vector(&vec, flag, 0.083333336f, 0.050000004f); break; case 2: if ((contact->f24 & 4) || g_hero_state.f1874 <= 0) { if (contact->f20 != 0 && *(s16 *)(contact->f20 + 0xAA) == 0x11DF) { - hero_set_action_us2(0x5A, 1); + hero_l22_set_move_state_us2(0x5A, 1); } else { - hero_set_action_us2(0x59, 1); + hero_l22_set_move_state_us2(0x59, 1); } charged_shot_release(g_hero_state.f2290, 0); FastVecScale(&vec, &vec, 0.095f); diff --git a/src/us2/levels/23_damosel_orbit/L23_002C39B8-sw.c b/src/us2/levels/23_damosel_orbit/L23_002C39B8-sw.c index df906ebe0..1158e9959 100644 --- a/src/us2/levels/23_damosel_orbit/L23_002C39B8-sw.c +++ b/src/us2/levels/23_damosel_orbit/L23_002C39B8-sw.c @@ -83,7 +83,7 @@ extern void cam_project_vector_onto_view_plane(void *, void *); extern float cam_get_view_space_vector_length(void *); extern float cam_get_view_space_height(void *); extern void cam_set_view_space_vector_length(void *, void *, float); -extern int queue_copy_record_by_index(unsigned int index); +extern int actuator_play_pattern(unsigned int index); extern void moby_update_transform_history_followers(void *, int); extern float ReadPadFloatHistory(int); extern void UpdateHeroAimTarget(float, float, float); @@ -478,7 +478,7 @@ case 0x32: case 0x33: case 0x34: float old_pitch,steer,minimum_steer,pitch_change,controller_scale,rate,maximum_input,steering_limit; if (H(u32,0x2294)==0x34) { if (H(s32,0x1B8)>70) g_hero_state_machine_word=65535; - snd_update_slot_object(5,H(void*,0x2290),15);queue_copy_record_by_index(22); + snd_update_slot_object(5,H(void*,0x2290),15);actuator_play_pattern(22); } else { int slot=H(s32,0x2440); if (slot!=-1 && FLD(g_sound_state+slot*0x70, void *, 0x88)==H(void*,0x2290) && @@ -1083,7 +1083,7 @@ case 20: coll_process_hit(0.4f, &workspace.state_14.delta, 0x10, H(void *, 0x2290), workspace.state_14.u.contact); } if (math_is_below_plane_within_depth(25.7f)) { - queue_copy_record_by_index(25); + actuator_play_pattern(25); H(u16, 0x1FA) = 50; if (g_hero_override_flag) { FLD(g_hero_l23_state_block, float, 0x180) = 0.1f; diff --git a/src/us2/levels/23_damosel_orbit/L23_003BFE40-sw-g8.c b/src/us2/levels/23_damosel_orbit/L23_003BFE40-sw-g8.c index 4fbe1c986..f6351e646 100644 --- a/src/us2/levels/23_damosel_orbit/L23_003BFE40-sw-g8.c +++ b/src/us2/levels/23_damosel_orbit/L23_003BFE40-sw-g8.c @@ -106,7 +106,7 @@ extern float moby_get_anim_value(char *),math_random_float_range(float,float); extern int math_is_value_within_step_us2(char *,float); extern void *ribbon_trail_create(u8 *,u8 *,u8 *,u8,u8,float,float,float,float,short,short,int,int,int,int,int); extern void moby_transform_joint_to_world(char *,int,char *); -extern int queue_copy_record_by_index(unsigned int); +extern int actuator_play_pattern(unsigned int); /* Per-frame update of the boss-like enemy: checks the hero distance and facing, then runs its state machine (idle, chase, attack, charge, hurt) and finishes with the shared timers (USA v2.00). */ void enemy_update_state_machine_us2(u8 *moby) @@ -301,7 +301,7 @@ void enemy_update_state_machine_us2(u8 *moby) FastVecAdd(point,point,((DispatchState *)vars)->f2A0+0xC0); FastVecScale(point,point,15.0f); point[3]=5627.9248f; part_queue_impact_effect((int)g_hero_moby,(int)moby,0x10007,(int)(moby+0x10),(int)point,g_mothership_impact_param); - queue_copy_record_by_index(43); + actuator_play_pattern(43); SpawnExplosion(g_boss_hit_point,1,10,10,10,10,45,0,1.2f,20.0f,0,1,0,0); ((DispatchState *)vars)->f3BE=1; } @@ -312,7 +312,7 @@ void enemy_update_state_machine_us2(u8 *moby) if (((DispatchState *)vars)->f3B4!=-1) { snd_stop_voice(((DispatchState *)vars)->f3B4); ((DispatchState *)vars)->f3B4=-1; } } else if ((int)U(moby,0x96)>g_enemy_flee_health_threshold) { moby_clear_selected((char *)moby); moby_set_state(moby,5,0); } else { if ((int)U(moby,0x96)>=g_enemy_flee_health_threshold-5 && ((DispatchState *)vars)->f3BE) { - snd_start_in_slot(29,0,0); ((DispatchState *)vars)->f3BE=0; queue_copy_record_by_index(43); + snd_start_in_slot(29,0,0); ((DispatchState *)vars)->f3BE=0; actuator_play_pattern(43); } } break; diff --git a/src/us2/levels/23_damosel_orbit/L23_00417888-sw-g8.c b/src/us2/levels/23_damosel_orbit/L23_00417888-sw-g8.c index 81497e3f2..c9fbb642b 100644 --- a/src/us2/levels/23_damosel_orbit/L23_00417888-sw-g8.c +++ b/src/us2/levels/23_damosel_orbit/L23_00417888-sw-g8.c @@ -105,7 +105,7 @@ extern void moby_store_position_private(u8 *, void *); extern int player_slot_has_object(unsigned int); extern int charged_shot_get_for_owner(int); extern void charged_shot_release(int, int); -extern int queue_copy_record_by_index(unsigned int); +extern int actuator_play_pattern(unsigned int); extern int moby_check_target_point_from_offset(char *, void *); extern void boss_turn_gun_toward_target(char *); extern void mothership_project_point_onto_surface(char *, float); @@ -139,7 +139,7 @@ extern char *SpawnExplosion(char *, int, int, int, int, int, int, int, float, fl extern void FadeToBlack(int); extern void moby_copy_joint_transform_to_object(u8 *, char *, int, int); extern void hero_reset_position_and_direction(char *, char *, int, int); -extern int hero_set_action_us2(int, int); +extern int hero_l22_set_move_state_us2(int, int); extern char *effect_create_attached(char *, char *); extern void build_axis_rotation_quaternion(char *, int, float); typedef struct { int value; } StateInt; @@ -567,7 +567,7 @@ void mothership_boss_part_update_us2(u8 *object) cancel_hero_item_animation(); release_moby_animation_slot((LvlSlotCtx *)PLAYER, &HERO->slotList); HERO->slotCount = 0; - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); g_charged_l23_blast_timer = 0; return; } @@ -637,5 +637,5 @@ void mothership_boss_part_update_us2(u8 *object) } math_fast_float_d((char *)&g_boss_camera_timer[0]); if (g_boss_camera_timer[0]) - queue_copy_record_by_index(0x2b); + actuator_play_pattern(0x2b); } diff --git a/src/us2/levels/23_damosel_orbit/L23_00418CF8-cc-g8.c b/src/us2/levels/23_damosel_orbit/L23_00418CF8-cc-g8.c index 58344e51d..f925ed845 100644 --- a/src/us2/levels/23_damosel_orbit/L23_00418CF8-cc-g8.c +++ b/src/us2/levels/23_damosel_orbit/L23_00418CF8-cc-g8.c @@ -196,7 +196,7 @@ extern int mothership_call_helper_return_true(void); extern int L23_DrawEncounterHud(void); extern void cancel_hero_item_animation(void); extern void release_moby_animation_slot(void *, void *); -extern int hero_set_action_us2(int, int); +extern int hero_l22_set_move_state_us2(int, int); extern char *GetLocalizedString(int); extern int level_l00_call_module_handler_with_arg_9_us2(int, int); extern void cam_compute_view_direction(void *, void *, int); @@ -421,7 +421,7 @@ void mothership_update_us2(L23Moby *moby) { cancel_hero_item_animation(); release_moby_animation_slot(game->f2290, game->f1870); game->f187C = 0; - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); } } cam_compute_view_direction(&moby->pos, state->m410, 0); diff --git a/src/us2/levels/30_insomniac_museum/L30_0040C018-cc-g8.c b/src/us2/levels/30_insomniac_museum/L30_0040C018-cc-g8.c index e1480953c..66812f24e 100644 --- a/src/us2/levels/30_insomniac_museum/L30_0040C018-cc-g8.c +++ b/src/us2/levels/30_insomniac_museum/L30_0040C018-cc-g8.c @@ -45,7 +45,7 @@ extern char *part_find_owned_effect_slot(char *,int,int); extern void gfx_start_color_fade(char *,void *), gfx_update_color_fade(char *,void *); extern float vec_length_xy(void *), func_002A0558(char *,char *), FastAddRotations(float,float), math_fast_sin_or_cos_b(float), fast_vec_dist(void *,void *); extern int TryClaimNotice(int,int,int), math_random_int_below(int), flag_set_first_pending(char *); -extern int hero_l00_change_action_us2(int,int); +extern int hero_l00_set_move_state_us2(int,int); extern void UpdateHoverVehicleMotion(char *,int), set_hero_animation(int,int,float), moby_mark_in_range(char *); extern void moby_set_state(char *,int,int), moby_update_ground_check(char *), gfx_add_draw_callback_third(void (*)(char *),void *); extern void moby_transform_joint_to_world(char *,int,void *); @@ -132,7 +132,7 @@ void MuseumVehicleUpdate_us2(MuseumVehicle *obj) { if (g_pad_state.pressed&16) activate=v; } if (activate) { - hero_l00_change_action_us2(49,0);set_hero_animation(g_vehicle_animation_id,0,15.0f); + hero_l00_set_move_state_us2(49,0);set_hero_animation(g_vehicle_animation_id,0,15.0f); qcopy(g_hero_state.rotation,obj->rotation);qcopy(g_hero_state.position,obj->position); g_hero_state.vehicle=obj;obj->state=3;obj->flags=0;I(g_hero_state.hero,0x9C)=-1; } @@ -152,7 +152,7 @@ void MuseumVehicleUpdate_us2(MuseumVehicle *obj) { break; case 4: if (flag_set_first_pending(obj)) { - g_hero_state.cameraX=0;g_hero_state.cameraY=-1.0f;hero_l00_change_action_us2(11,1); + g_hero_state.cameraX=0;g_hero_state.cameraY=-1.0f;hero_l00_set_move_state_us2(11,1); g_hero_state.vehicle=0;g_hero_state.vehicleId=-1; } obj->flags=0;I(g_hero_state.hero,0x9C)=0;UpdateHoverVehicleMotion(obj,0); @@ -162,7 +162,7 @@ void MuseumVehicleUpdate_us2(MuseumVehicle *obj) { case 6: break; case 5: obj->flags=I(obj->classData,0x10);I(g_hero_state.hero,0x9C)=0; - hero_l00_change_action_us2(0,1);moby_transform_joint_to_world(obj,0,pos); + hero_l00_set_move_state_us2(0,1);moby_transform_joint_to_world(obj,0,pos); SpawnExplosionEffects(obj,vars,pos,0.0f,0.0f,10,3,16,4.0f,2.0f,9.0f,1.0f,-1,15.0f,1,1,-1,0,0x810001); qcopy(obj->position,&vars->spawn);g_hero_state.vehicleId=-1;g_hero_state.vehicle=0;obj->state=0; break; diff --git a/src/us2/levels/30_insomniac_museum/L30_00418008-sw-g8.c b/src/us2/levels/30_insomniac_museum/L30_00418008-sw-g8.c index bb044c1ea..450550900 100644 --- a/src/us2/levels/30_insomniac_museum/L30_00418008-sw-g8.c +++ b/src/us2/levels/30_insomniac_museum/L30_00418008-sw-g8.c @@ -53,7 +53,7 @@ extern void museum_effect_object_spawn(char *),museum_effect_holder_update(char extern int ForceClaimNotice(int,int,int); extern int load_is_class_cached(int); extern void LoadClassIntoFreeCacheSlot(int), hero_start_loader_state(int); -extern s32 hero_l00_change_action_us2(int,int); +extern s32 hero_l00_set_move_state_us2(int,int); extern void matrix_mul_vec3(void *,void *,void *),FastVecAdd(void *,void *,void *),FastVecSub(void *,void *,void *); extern float FastAddRotations(float,float),mat_fast_helper_a(float,float),vec_distance_xy(void *,void *); extern void hero_start_target_state(void *,int,float); @@ -150,7 +150,7 @@ void museum_exhibit_display_update_us2(char *obj) { } case 3: if (flag_set_first_pending(obj)) { - hero_l00_change_action_us2(0x6F,0);set_hero_animation(0x54,0,20.0f); + hero_l00_set_move_state_us2(0x6F,0);set_hero_animation(0x54,0,20.0f); FastVecSub(vec,g_camera_l30_position,g_hero_state.position); matrix_mul_vec3(vec,vec,g_hero_state.matrix40); SetCamera5Pose(g_camera_l30_position,g_camera_l30_position,3,120,0); diff --git a/src/us2/levels/shared/L00_002A3B88-cc-g8.c b/src/us2/levels/shared/L00_002A3B88-cc-g8.c index 14756ea21..3008dedca 100644 --- a/src/us2/levels/shared/L00_002A3B88-cc-g8.c +++ b/src/us2/levels/shared/L00_002A3B88-cc-g8.c @@ -112,7 +112,7 @@ extern void menu_update_pause_us2(void), gfx_call_engine_routine_zero_us2(void), extern void shop_update_purchase_menu_and_preview_us2(void), shop_draw_purchase_menu_scene_us2(void), transition_draw_background_us2(void); extern int UpdatePlaybackScene_us2(void); extern int level_call_helper_d(void), level_call_helper_e(void); -extern void math_trap_always(void), level_decrement_counter_clamped(void), math_add_wrapping_counter(void); +extern void math_trap_always(void), level_decrement_counter_clamped(void), actuator_update(void); extern void mc_update_state_us2(void), map_update_state_machine(void), SetupGifPaging(int); extern void VU1_addGSregister(unsigned int, unsigned long long); extern int GetIconFrame(int, int); @@ -267,7 +267,7 @@ void RunLevelLoop_us2(void) } g_pad_hold_frame_count[0]++; level_decrement_counter_clamped(); - if (!g_game_l00_mode[0]) math_add_wrapping_counter(); + if (!g_game_l00_mode[0]) actuator_update(); mc_update_state_us2(); map_update_state_machine(); if ((unsigned)(g_memcard_state.pressed - 15) < 2 || g_memcard_state.alternate == 15 || g_memcard_input_latch[0]) { @@ -345,7 +345,7 @@ void RunLevelLoop_us2(void) pad_poll_ports(); cutscene_update_frame(); } - math_add_wrapping_counter(); + actuator_update(); sceGsSyncV(0); g_ring_animation_counter[0]++; } else if (g_debug_state == 3) { @@ -361,7 +361,7 @@ void RunLevelLoop_us2(void) pad_poll_ports(); cutscene_update_frame(); } - math_add_wrapping_counter(); + actuator_update(); counter_count_calls_bump(); sceGsSyncV(0); g_ring_animation_counter[0]++; diff --git a/src/us2/levels/shared/L00_002BA8E0-sw.c b/src/us2/levels/shared/L00_002BA8E0-sw.c index 13a5b95c7..5c14ea42c 100644 --- a/src/us2/levels/shared/L00_002BA8E0-sw.c +++ b/src/us2/levels/shared/L00_002BA8E0-sw.c @@ -153,7 +153,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -725,7 +725,7 @@ void hero_update_move_physics_us2(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { temp_a2 = ((Hero *)g_hero_state)->i[0x2440/4]; if (temp_a2 != -1) { @@ -1468,7 +1468,7 @@ void hero_update_move_physics_us2(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l20_extra_state)->f[0x180/4] = 0.1f; diff --git a/src/us2/levels/shared/L00_002C4560-sw.c b/src/us2/levels/shared/L00_002C4560-sw.c index aa53c8168..5fd46a7b7 100644 --- a/src/us2/levels/shared/L00_002C4560-sw.c +++ b/src/us2/levels/shared/L00_002C4560-sw.c @@ -70,8 +70,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -139,7 +139,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l00_change_action_us2(s32 action, s32 animate) { +s32 hero_l00_set_move_state_us2(s32 action, s32 animate) { f32 dir[4]; f32 pos[4]; u8 *objectSnapshot; @@ -188,7 +188,9 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -201,8 +203,8 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l00_change_action_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_change_action_us2(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l00_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_or_form_id(0) == 0x51) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_or_form_id(0), 0, -1.0f); @@ -349,7 +351,7 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l00_change_action_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l00_set_move_state_us2(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -395,12 +397,12 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l00_change_action_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_change_action_us2(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l00_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_or_form_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l00_change_action_us2(0, 0)) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); + if (hero_l00_set_move_state_us2(0, 0)) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -425,7 +427,7 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_change_action_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -604,13 +606,13 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l00_change_action_us2(0x81, 1); return 0; + hero_l00_set_move_state_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_action_blocked_flag) { hero_l00_change_action_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_action_blocked_flag) { hero_l00_set_move_state_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l00_change_action_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l00_set_move_state_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = oldStep; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -685,9 +687,9 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_map_event_flag) hero_l00_change_action_us2(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l00_change_action_us2(0x79, 1); - else hero_l00_change_action_us2(0x39, 1); + if (g_current_map_index == 2 && g_map_event_flag) hero_l00_set_move_state_us2(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l00_set_move_state_us2(0x79, 1); + else hero_l00_set_move_state_us2(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -738,7 +740,7 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -767,7 +769,7 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -776,7 +778,7 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -918,7 +920,7 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -1009,7 +1011,7 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -1021,7 +1023,7 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -1056,7 +1058,7 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { set_hero_animation(0x11, 0, 8.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_change_action_us2(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state_us2(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation(0, 0, 9.0f); goto finish; case 0x4B: @@ -1090,7 +1092,7 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_action_curve_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_change_action_us2(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l00_set_move_state_us2(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1134,7 +1136,7 @@ s32 hero_l00_change_action_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l00_change_action_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l00_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/shared/L00_002C96D0-sw.c b/src/us2/levels/shared/L00_002C96D0-sw.c index b6a001e01..f10c80d08 100644 --- a/src/us2/levels/shared/L00_002C96D0-sw.c +++ b/src/us2/levels/shared/L00_002C96D0-sw.c @@ -104,7 +104,7 @@ extern int PadPressedWithin(u32, int, int *); extern int moby_is_class_71(unsigned char *); extern void hero_setup_attached_object_transform(void); extern int FloatToInt(float); -extern s32 hero_l00_change_action_us2(int, int); +extern s32 hero_l00_set_move_state_us2(int, int); extern int get_ammo(int); extern int snd_play_from_class_bank(int, int, char *, int); extern char *SelectBestEligibleTarget(void *, int, int, float, float, float, float); @@ -163,9 +163,9 @@ int hero_select_context_action_us2(void) if ((g_hero_state.mode == 1 || g_hero_state.mode == 29) && g_hero_state.frame >= 21) hero_setup_attached_object_transform(); else - hero_l00_change_action_us2(21, 1); + hero_l00_set_move_state_us2(21, 1); } else { - hero_l00_change_action_us2(19, 1); + hero_l00_set_move_state_us2(19, 1); } goto clear_action; } @@ -192,9 +192,9 @@ int hero_select_context_action_us2(void) (g_hero_state.fast_attack && g_hero_state.movement > 0.57f) || (g_hero_state.mode == 8 && g_hero_state.movement > 0.57f)) { if (g_hero_state.attack_blocked || g_hero_state.attack_pending) goto clear_action; - hero_l00_change_action_us2(20, 1); + hero_l00_set_move_state_us2(20, 1); } else { - hero_l00_change_action_us2(19, 1); + hero_l00_set_move_state_us2(19, 1); } goto clear_action; @@ -206,7 +206,7 @@ int hero_select_context_action_us2(void) if (g_hero_state.attack_delay) goto clear_action; if ((float)range->trigger_frame <= g_hero_state.animation_frame && (g_pad_state.buttons.word.held & 8) && PadPressedWithin(mask, 15, 0)) { - hero_l00_change_action_us2(21, 1); + hero_l00_set_move_state_us2(21, 1); break; } } @@ -220,10 +220,10 @@ int hero_select_context_action_us2(void) action = action < 16 ? action : 15; if (PadPressedWithin(mask, action, 0)) { if (g_pad_state.buttons.word.held & 8) { - hero_l00_change_action_us2(21, 1); + hero_l00_set_move_state_us2(21, 1); goto clear_action; } - hero_l00_change_action_us2(19, 1); + hero_l00_set_move_state_us2(19, 1); } } } @@ -242,7 +242,7 @@ int hero_select_context_action_us2(void) break; if (!(g_pad_state.buttons.word.held & 32) || g_hero_state.input_window < 23) break; if (get_ammo(state)) { - hero_l00_change_action_us2(131, 1); + hero_l00_set_move_state_us2(131, 1); break; } if (g_pad_state.buttons.word.pressed & 32) { @@ -287,7 +287,7 @@ int hero_select_context_action_us2(void) if (g_hero_state.mode == 39 && (g_hero_state.alternate_target_ready || g_hero_state.nearby_ready)) { if (PadPressedWithin(mask, action, 0) || ((g_pad_state.buttons.word.held & mask) && g_hero_state.input_window >= 16)) { - hero_l00_change_action_us2(40, 1); + hero_l00_set_move_state_us2(40, 1); break; } } @@ -303,16 +303,16 @@ int hero_select_context_action_us2(void) else g_hero_state.alternate_target_ready = 0; } if (g_hero_state.alternate_target_ready && !g_hero_state.control_lock && g_hero_state.mode != 43) { - hero_l00_change_action_us2(43, 1); + hero_l00_set_move_state_us2(43, 1); break; } } if (g_hero_state.nearby_ready && !g_hero_state.control_lock) { - hero_l00_change_action_us2(35, 1); + hero_l00_set_move_state_us2(35, 1); break; } if (g_hero_state.second_target_ready) { - hero_l00_change_action_us2(138, 1); + hero_l00_set_move_state_us2(138, 1); break; } break; @@ -337,7 +337,7 @@ int hero_select_context_action_us2(void) if (get_ammo(-1)) { if (g_hero_state.state == 12 || g_hero_state.state == 0 || g_hero_state.mode == 3 || (g_hero_state.state == 1 && g_hero_state.transition_progress < 0.7f)) { - hero_l00_change_action_us2(34, 1); + hero_l00_set_move_state_us2(34, 1); break; } start_equipped_item_animation(); @@ -357,7 +357,7 @@ int hero_select_context_action_us2(void) action = action < frame_window ? 10 : frame_window; if (!PadPressedWithin(mask, action, &scratch.detach_age)) break; if (g_hero_state.object) { - hero_l00_change_action_us2(31, 1); + hero_l00_set_move_state_us2(31, 1); if (g_hero_state.object) PlayMobySound(0, 0, g_hero_state.object); } } @@ -373,7 +373,7 @@ int hero_select_context_action_us2(void) (g_hero_state.state < 2 || g_hero_state.state == 12 || ((g_hero_state.state == 2 || g_hero_state.state == 4) && g_hero_state.action_ready)) && (g_pad_state.buttons.both & 0x800000008ULL) == 0x800000008ULL) - hero_l00_change_action_us2(123, 1); + hero_l00_set_move_state_us2(123, 1); if (g_pad_state.buttons.word.pressed & 8) g_button_hold_timer = 30; } return g_hero_state.frame < previous_frame; diff --git a/src/us2/levels/shared/L00_002CB650-sw.c b/src/us2/levels/shared/L00_002CB650-sw.c index f24e5bf6f..e0a57813b 100644 --- a/src/us2/levels/shared/L00_002CB650-sw.c +++ b/src/us2/levels/shared/L00_002CB650-sw.c @@ -78,7 +78,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l00_change_action_us2(s32, s32); +s32 hero_l00_set_move_state_us2(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -157,7 +157,7 @@ void hero_l00_update_move_decider_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l00_change_action_us2(0x39, 1); + hero_l00_set_move_state_us2(0x39, 1); goto end; } } @@ -192,7 +192,7 @@ void hero_l00_update_move_decider_us2(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_proximity_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l00_change_action_us2(0x74, 1); + hero_l00_set_move_state_us2(0x74, 1); goto end; } } @@ -203,12 +203,12 @@ void hero_l00_update_move_decider_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_L00_002CB3A8_00() == 0)) { - hero_l00_change_action_us2(1, 1); + hero_l00_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l00_change_action_us2(0x82, 1); + hero_l00_set_move_state_us2(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -245,7 +245,7 @@ void hero_l00_update_move_decider_us2(void) { rec = g_hero_idle_choice_table + sp40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l00_change_action_us2(0x3C, 1); + hero_l00_set_move_state_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -288,12 +288,12 @@ void hero_l00_update_move_decider_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l00_change_action_us2(0x76, 1); + hero_l00_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); } break; } @@ -314,21 +314,21 @@ void hero_l00_update_move_decider_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_action_blocked_flag == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l00_change_action_us2(0x6E, 1); + hero_l00_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l00_change_action_us2(4, 1); + hero_l00_set_move_state_us2(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_change_action_us2(0x27, 1); + hero_l00_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l00_change_action_us2(0x2E, 1); + hero_l00_set_move_state_us2(0x2E, 1); break; } { @@ -348,28 +348,28 @@ void hero_l00_update_move_decider_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l00_change_action_us2(2, 1); + hero_l00_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_L00_002CB3A8_00() == 0)) { - hero_l00_change_action_us2(1, 1); + hero_l00_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l00_change_action_us2(0x3D, 1); + hero_l00_set_move_state_us2(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l00_change_action_us2(0x3D, 1); + hero_l00_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); } break; case 0x3D: @@ -378,22 +378,22 @@ void hero_l00_update_move_decider_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_change_action_us2(4, 1); + hero_l00_set_move_state_us2(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l00_change_action_us2(2, 1); + hero_l00_set_move_state_us2(2, 1); break; } - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -432,25 +432,25 @@ void hero_l00_update_move_decider_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l00_change_action_us2(0x33, 1); + hero_l00_set_move_state_us2(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l00_change_action_us2(0x34, 1); + hero_l00_set_move_state_us2(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l00_change_action_us2(0x32, 1); + hero_l00_set_move_state_us2(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l00_change_action_us2(0x33, 1); + hero_l00_set_move_state_us2(0x33, 1); } } break; @@ -463,81 +463,81 @@ void hero_l00_update_move_decider_us2(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l00_change_action_us2(0x32, 1); + hero_l00_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l00_change_action_us2(0x34, 1); + hero_l00_set_move_state_us2(0x34, 1); } else { - hero_l00_change_action_us2(0x32, 1); + hero_l00_set_move_state_us2(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l00_change_action_us2(0x12, 1); + hero_l00_set_move_state_us2(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l00_change_action_us2(0x32, 1); + hero_l00_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l00_change_action_us2(0x34, 1); + hero_l00_set_move_state_us2(0x34, 1); } else { - hero_l00_change_action_us2(0x32, 1); + hero_l00_set_move_state_us2(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l00_change_action_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l00_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l00_change_action_us2(0x35, 1); + hero_l00_set_move_state_us2(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l00_change_action_us2(0x12, 1); + hero_l00_set_move_state_us2(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l00_change_action_us2(0x32, 1); + hero_l00_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l00_change_action_us2(0x34, 1); + hero_l00_set_move_state_us2(0x34, 1); } else { - hero_l00_change_action_us2(0x32, 1); + hero_l00_set_move_state_us2(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l00_change_action_us2(0x70, 0); + hero_l00_set_move_state_us2(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l00_change_action_us2(0x36, 1); + hero_l00_set_move_state_us2(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_change_action_us2(0x67, 1); + hero_l00_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_change_action_us2(0x33, 1); + hero_l00_set_move_state_us2(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l00_change_action_us2(0x33, 0); + hero_l00_set_move_state_us2(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_change_action_us2(0x67, 1); + hero_l00_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l00_change_action_us2(0x36, 0); + hero_l00_set_move_state_us2(0x36, 0); } break; case 0x1: @@ -571,9 +571,9 @@ void hero_l00_update_move_decider_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_change_action_us2(4, 1); + hero_l00_set_move_state_us2(4, 1); } else { - hero_l00_change_action_us2(0, 0); + hero_l00_set_move_state_us2(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -585,9 +585,9 @@ void hero_l00_update_move_decider_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l00_change_action_us2(0, 0); + hero_l00_set_move_state_us2(0, 0); } else { - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); } } break; @@ -620,7 +620,7 @@ void hero_l00_update_move_decider_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_change_action_us2(7, 1); + hero_l00_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -629,7 +629,7 @@ void hero_l00_update_move_decider_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l00_change_action_us2(0, 0); + hero_l00_set_move_state_us2(0, 0); } break; } @@ -651,7 +651,7 @@ void hero_l00_update_move_decider_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_change_action_us2(7, 1); + hero_l00_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -664,7 +664,7 @@ void hero_l00_update_move_decider_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l00_change_action_us2(2, 0); + hero_l00_set_move_state_us2(2, 0); set_hero_animation(3, g_hero_anim_ids_by_mode[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -675,22 +675,22 @@ void hero_l00_update_move_decider_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l00_change_action_us2(2, 1); + hero_l00_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l00_change_action_us2(0, 0); + hero_l00_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_change_action_us2(0, 0); + hero_l00_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -707,7 +707,7 @@ void hero_l00_update_move_decider_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_change_action_us2(7, 1); + hero_l00_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -716,7 +716,7 @@ void hero_l00_update_move_decider_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l00_change_action_us2(0, 0); + hero_l00_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, 15.0f); break; } @@ -728,7 +728,7 @@ void hero_l00_update_move_decider_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); } break; case 0x2: @@ -742,11 +742,11 @@ void hero_l00_update_move_decider_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l00_change_action_us2(0x76, 1); + hero_l00_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); break; } n = 9; @@ -760,12 +760,12 @@ void hero_l00_update_move_decider_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l00_change_action_us2(9, 1); + hero_l00_set_move_state_us2(9, 1); } else { - hero_l00_change_action_us2(7, 1); + hero_l00_set_move_state_us2(7, 1); } } else { - hero_l00_change_action_us2(7, 1); + hero_l00_set_move_state_us2(7, 1); } break; } @@ -773,11 +773,11 @@ void hero_l00_update_move_decider_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_L00_002CB3A8_00() == 0)) { - hero_l00_change_action_us2(1, 1); + hero_l00_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_change_action_us2(4, 1); + hero_l00_set_move_state_us2(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -794,25 +794,25 @@ void hero_l00_update_move_decider_us2(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l00_change_action_us2(0x2E, 1); + hero_l00_set_move_state_us2(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l00_change_action_us2(2, 1); + hero_l00_set_move_state_us2(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l00_change_action_us2(0x70, 1); + hero_l00_set_move_state_us2(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l00_change_action_us2(2, 1); + hero_l00_set_move_state_us2(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_change_action_us2(0x27, 1); + hero_l00_set_move_state_us2(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -823,7 +823,7 @@ void hero_l00_update_move_decider_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l00_change_action_us2(0, 0) == 0) { + if (hero_l00_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -840,7 +840,7 @@ void hero_l00_update_move_decider_us2(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l00_change_action_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l00_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } if (FLD(sp74, u8, 0x43) == 0x37) { @@ -861,7 +861,7 @@ void hero_l00_update_move_decider_us2(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l00_change_action_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l00_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -895,17 +895,17 @@ void hero_l00_update_move_decider_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l00_change_action_us2(3, 0); + hero_l00_set_move_state_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l00_change_action_us2(0x77, 1); + hero_l00_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l00_change_action_us2(0x77, 1); + hero_l00_set_move_state_us2(0x77, 1); break; } } @@ -923,11 +923,11 @@ void hero_l00_update_move_decider_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l00_change_action_us2(0x64, 1); + hero_l00_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l00_change_action_us2(0x63, 1); + hero_l00_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -935,21 +935,21 @@ void hero_l00_update_move_decider_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_change_action_us2(0x62, 1); + hero_l00_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l00_change_action_us2(0x62, 1); + hero_l00_set_move_state_us2(0x62, 1); } break; case 0x65: /* switch 2 */ temp_a0_11 = FLD(g_hero_state, s32, 0x18C0); if ((temp_a0_11 < 3) && (((temp_a0_11 * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 7, &sp44) != 0)) { - hero_l00_change_action_us2(0x66, 1); + hero_l00_set_move_state_us2(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -992,7 +992,7 @@ void hero_l00_update_move_decider_us2(void) { return; case 0x6D: if ((f32)g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); } break; case 0x30: @@ -1005,7 +1005,7 @@ void hero_l00_update_move_decider_us2(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l00_change_action_us2(0, 0) != 0) { + if (hero_l00_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1013,29 +1013,29 @@ void hero_l00_update_move_decider_us2(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_L00_002CB3A8_00() == 0)) { - hero_l00_change_action_us2(1, 1); + hero_l00_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l00_change_action_us2(7, 1); + hero_l00_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_change_action_us2(4, 1); + hero_l00_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_change_action_us2(0x27, 1); + hero_l00_set_move_state_us2(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1043,45 +1043,45 @@ void hero_l00_update_move_decider_us2(void) { } if (hero_get_weapon_or_form_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l00_change_action_us2(0, 0); + hero_l00_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l00_change_action_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l00_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l00_change_action_us2(2, 1); + hero_l00_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_L00_002CB3A8_00() == 0)) { - hero_l00_change_action_us2(1, 1); + hero_l00_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_change_action_us2(0, 0); + hero_l00_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l00_change_action_us2(0x76, 1); + hero_l00_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l00_change_action_us2(0x15, 1); + hero_l00_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1089,17 +1089,17 @@ void hero_l00_update_move_decider_us2(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l00_change_action_us2(0x8B, 1); + hero_l00_set_move_state_us2(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); } break; case 0x24: @@ -1125,14 +1125,14 @@ void hero_l00_update_move_decider_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l00_change_action_us2(0, 0); + hero_l00_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l00_change_action_us2(6, 0); + hero_l00_set_move_state_us2(6, 0); } else { - hero_l00_change_action_us2(6, 0); + hero_l00_set_move_state_us2(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1148,9 +1148,9 @@ void hero_l00_update_move_decider_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); } else { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1162,7 +1162,7 @@ void hero_l00_update_move_decider_us2(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l00_change_action_us2(0x2C, 1); + hero_l00_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1226,11 +1226,11 @@ void hero_l00_update_move_decider_us2(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.21666668f); FLD(g_hero_state, f32, 0x128) = 0.16666667f; - hero_l00_change_action_us2(0x16, 1); + hero_l00_set_move_state_us2(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x46; FLD(g_hero_state, s16, 0x1D0) = 0x46; } else { - hero_l00_change_action_us2(0x3E, 1); + hero_l00_set_move_state_us2(0x3E, 1); } break; } @@ -1243,7 +1243,7 @@ void hero_l00_update_move_decider_us2(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l00_change_action_us2(0x28, 1); + hero_l00_set_move_state_us2(0x28, 1); } break; } @@ -1254,16 +1254,16 @@ void hero_l00_update_move_decider_us2(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x46; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l00_change_action_us2(0x74, 1); + hero_l00_set_move_state_us2(0x74, 1); } else { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { - hero_l00_change_action_us2(0x2A, 1); + hero_l00_set_move_state_us2(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1280,7 +1280,7 @@ void hero_l00_update_move_decider_us2(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l00_change_action_us2(0x28, 1); + hero_l00_set_move_state_us2(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)v20 = 0; @@ -1297,7 +1297,7 @@ void hero_l00_update_move_decider_us2(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 5, NULL) != 0) && ((f32)g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l00_change_action_us2(0x28, 1); + hero_l00_set_move_state_us2(0x28, 1); break; } top = 0xE; @@ -1306,19 +1306,19 @@ void hero_l00_update_move_decider_us2(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l00_change_action_us2(0x2A, 1); + hero_l00_set_move_state_us2(0x2A, 1); } break; } if ((f32)g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l00_change_action_us2(0x27, 1); + hero_l00_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x6C8) >= 6)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l00_change_action_us2(0x74, 1); + hero_l00_set_move_state_us2(0x74, 1); } else { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1327,11 +1327,11 @@ void hero_l00_update_move_decider_us2(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l00_change_action_us2(0x27, 1); + hero_l00_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) && (g_current_map_index == 0x14)) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0xA) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1367,7 +1367,7 @@ void hero_l00_update_move_decider_us2(void) { find_nearest_path_point(sp50, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), sp5C, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l00_change_action_us2(0x29, 1); + hero_l00_set_move_state_us2(0x29, 1); break; } } @@ -1415,7 +1415,7 @@ void hero_l00_update_move_decider_us2(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x46; FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1423,7 +1423,7 @@ void hero_l00_update_move_decider_us2(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l00_change_action_us2(0x71, 1); + hero_l00_set_move_state_us2(0x71, 1); break; } { @@ -1435,7 +1435,7 @@ void hero_l00_update_move_decider_us2(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l00_change_action_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l00_set_move_state_us2(0, 0) != 0)) { set_hero_animation(0xC, 4, 6.0f); } } else if (st == 0x3E) { @@ -1444,17 +1444,17 @@ void hero_l00_update_move_decider_us2(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)sp64, 0.5f, -1.0f); } if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s32, 0x340) != 0)) { - if (hero_l00_change_action_us2(0, 0) != 0) { + if (hero_l00_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_change_action_us2(0x27, 1); + hero_l00_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x10) && (FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l00_change_action_us2(0x27, 1); + hero_l00_set_move_state_us2(0x27, 1); } } break; @@ -1470,13 +1470,13 @@ void hero_l00_update_move_decider_us2(void) { } } if (FLD(g_hero_state, s32, 0x6F0) >= 6) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x204) = 0x1E; } break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l00_change_action_us2(0x18, 0); + hero_l00_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -1485,18 +1485,18 @@ void hero_l00_update_move_decider_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l00_change_action_us2(0x1B, 1); + hero_l00_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1505,7 +1505,7 @@ void hero_l00_update_move_decider_us2(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l00_change_action_us2(0x19, 1); + hero_l00_set_move_state_us2(0x19, 1); } break; } @@ -1516,7 +1516,7 @@ void hero_l00_update_move_decider_us2(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l00_change_action_us2(0x1A, 1); + hero_l00_set_move_state_us2(0x1A, 1); } } } @@ -1535,18 +1535,18 @@ void hero_l00_update_move_decider_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_change_action_us2(0x18, 1); + hero_l00_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l00_change_action_us2(0x1B, 1); + hero_l00_set_move_state_us2(0x1B, 1); } break; } @@ -1556,9 +1556,9 @@ void hero_l00_update_move_decider_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); } else { - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); } } break; @@ -1582,12 +1582,12 @@ void hero_l00_update_move_decider_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_change_action_us2(0x39, 1); + hero_l00_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l00_change_action_us2(0, 0) != 0) { + if (hero_l00_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1595,7 +1595,7 @@ void hero_l00_update_move_decider_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l00_change_action_us2(0, 0) != 0) { + if (hero_l00_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1609,36 +1609,36 @@ void hero_l00_update_move_decider_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l00_change_action_us2(2, 1); + hero_l00_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l00_change_action_us2(3, 0) != 0) { + if (hero_l00_set_move_state_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l00_change_action_us2(8, 1); + hero_l00_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_change_action_us2(0x17, 1); + hero_l00_set_move_state_us2(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_change_action_us2(0x27, 1); + hero_l00_set_move_state_us2(0x27, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l00_change_action_us2(0x71, 1); + hero_l00_set_move_state_us2(0x71, 1); } } break; @@ -1669,7 +1669,7 @@ void hero_l00_update_move_decider_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l00_change_action_us2(0, 0) != 0) { + if (hero_l00_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1679,9 +1679,9 @@ void hero_l00_update_move_decider_us2(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l00_change_action_us2(0x74, 1); + hero_l00_set_move_state_us2(0x74, 1); } else { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); } } break; @@ -1694,16 +1694,16 @@ void hero_l00_update_move_decider_us2(void) { ok = 1; } if (ok != 0) { - hero_l00_change_action_us2(0x11, 1); + hero_l00_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_change_action_us2(0x17, 1); + hero_l00_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1714,23 +1714,23 @@ void hero_l00_update_move_decider_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l00_change_action_us2(3, 0) != 0) { + if (hero_l00_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l00_change_action_us2(4, 1); + hero_l00_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_anim_range_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l00_change_action_us2(2, 1); + hero_l00_set_move_state_us2(2, 1); break; } - hero_l00_change_action_us2(2, 0); + hero_l00_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1739,21 +1739,21 @@ void hero_l00_update_move_decider_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_anim_range_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l00_change_action_us2(2, 1); + hero_l00_set_move_state_us2(2, 1); break; } - hero_l00_change_action_us2(2, 0); + hero_l00_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_landing_anim_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l00_change_action_us2(0, 0) != 0) { + if (hero_l00_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l00_change_action_us2(0, 0) != 0) { + } else if (hero_l00_set_move_state_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1800,14 +1800,14 @@ void hero_l00_update_move_decider_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_change_action_us2(0xB, 1); + hero_l00_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l00_change_action_us2(0x82, 1); + hero_l00_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1816,29 +1816,29 @@ void hero_l00_update_move_decider_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l00_change_action_us2(0xA, 1); + hero_l00_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l00_change_action_us2(0x10, 1); + hero_l00_set_move_state_us2(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l00_change_action_us2(0x27, 1); + hero_l00_set_move_state_us2(0x27, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l00_change_action_us2(0x71, 1); + hero_l00_set_move_state_us2(0x71, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l00_change_action_us2(0x77, 1); + hero_l00_set_move_state_us2(0x77, 1); break; } } @@ -1942,7 +1942,7 @@ void hero_l00_update_move_decider_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l00_change_action_us2(3, 0) != 0) { + if (hero_l00_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1950,13 +1950,13 @@ void hero_l00_update_move_decider_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_anim_range_table[0][2])) { - hero_l00_change_action_us2(7, 1); + hero_l00_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l00_change_action_us2(7, 1); + hero_l00_set_move_state_us2(7, 1); } else if (g_hero_anim_range_table[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l00_change_action_us2(9, 1); + hero_l00_set_move_state_us2(9, 1); } else { - hero_l00_change_action_us2(7, 1); + hero_l00_set_move_state_us2(7, 1); } break; } @@ -1964,10 +1964,10 @@ void hero_l00_update_move_decider_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); break; } { @@ -1977,7 +1977,7 @@ void hero_l00_update_move_decider_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l00_change_action_us2(0x11, 1); + hero_l00_set_move_state_us2(0x11, 1); break; } } @@ -2006,7 +2006,7 @@ void hero_l00_update_move_decider_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l00_change_action_us2(0xE, 1); + hero_l00_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -2016,32 +2016,32 @@ void hero_l00_update_move_decider_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l00_change_action_us2(8, 1); + hero_l00_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l00_change_action_us2(0x17, 1); + hero_l00_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l00_change_action_us2(6, 1); + hero_l00_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l00_change_action_us2(0x79, 1); + hero_l00_set_move_state_us2(0x79, 1); } else { - hero_l00_change_action_us2(0x39, 1); + hero_l00_set_move_state_us2(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l00_change_action_us2(0x82, 1); + hero_l00_set_move_state_us2(0x82, 1); } else { - hero_l00_change_action_us2(0, 0); + hero_l00_set_move_state_us2(0, 0); } } break; @@ -2051,8 +2051,8 @@ void hero_l00_update_move_decider_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_change_action_us2(0x39, 1); - } else if (hero_l00_change_action_us2(0, 0) != 0) { + hero_l00_set_move_state_us2(0x39, 1); + } else if (hero_l00_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 13.0f); } } @@ -2077,28 +2077,28 @@ void hero_l00_update_move_decider_us2(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l00_change_action_us2(0x4E, 1); + hero_l00_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (ref_L00_002CB3A8_00() == 0)) { - hero_l00_change_action_us2(1, 1); + hero_l00_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l00_change_action_us2(0x41, 1); + hero_l00_set_move_state_us2(0x41, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l00_change_action_us2(0x45, 1); + hero_l00_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l00_change_action_us2(0x4D, 1); + hero_l00_set_move_state_us2(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l00_change_action_us2(0x40, 1); + hero_l00_set_move_state_us2(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -2111,14 +2111,14 @@ void hero_l00_update_move_decider_us2(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l00_change_action_us2(0x4E, 1); + hero_l00_set_move_state_us2(0x4E, 1); break; } rec = (u8 *)&g_hero_l00_action_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l00_change_action_us2(0x3F, 0); + hero_l00_set_move_state_us2(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -2127,13 +2127,13 @@ void hero_l00_update_move_decider_us2(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0x10) ? n : 0xF, NULL) != 0) { - hero_l00_change_action_us2(0x4D, 1); + hero_l00_set_move_state_us2(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l00_change_action_us2(0x45, 1); + hero_l00_set_move_state_us2(0x45, 1); } break; } @@ -2196,42 +2196,42 @@ void hero_l00_update_move_decider_us2(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l00_change_action_us2(0x45, 1); + hero_l00_set_move_state_us2(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_anim_range_table[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l00_change_action_us2(0x40, 1); + hero_l00_set_move_state_us2(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l00_change_action_us2(0x3F, 1); + hero_l00_set_move_state_us2(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l00_change_action_us2(0x41, 1); + hero_l00_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 5, NULL) != 0)) { - hero_l00_change_action_us2(0x4D, 1); + hero_l00_set_move_state_us2(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_change_action_us2(0x46, 1); + hero_l00_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l00_change_action_us2(0x4B, 1); + hero_l00_set_move_state_us2(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l00_change_action_us2(0x41, 1); + hero_l00_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_change_action_us2(0x46, 1); + hero_l00_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -2241,11 +2241,11 @@ void hero_l00_update_move_decider_us2(void) { FLD(g_hero_state, s16, 0x1EE) = 0xC - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l00_change_action_us2(0x40, 1); + hero_l00_set_move_state_us2(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l00_change_action_us2(0x3F, 1); + hero_l00_set_move_state_us2(0x3F, 1); } break; case 0x41: @@ -2257,29 +2257,29 @@ void hero_l00_update_move_decider_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_change_action_us2(0x43, 1); + hero_l00_set_move_state_us2(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l00_change_action_us2(0x40, 1); + hero_l00_set_move_state_us2(0x40, 1); } else { - hero_l00_change_action_us2(0x3F, 1); + hero_l00_set_move_state_us2(0x3F, 1); } } else { - hero_l00_change_action_us2(0x3F, 1); + hero_l00_set_move_state_us2(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l00_change_action_us2(0x46, 1); + hero_l00_set_move_state_us2(0x46, 1); break; } if ((PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l00_change_action_us2(0x4B, 1); + hero_l00_set_move_state_us2(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l00_change_action_us2(0x3F, 1); + hero_l00_set_move_state_us2(0x3F, 1); } break; case 0x4E: @@ -2288,9 +2288,9 @@ void hero_l00_update_move_decider_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l00_change_action_us2(0x41, 1); + hero_l00_set_move_state_us2(0x41, 1); } else { - hero_l00_change_action_us2(0x3F, 1); + hero_l00_set_move_state_us2(0x3F, 1); } } break; @@ -2300,7 +2300,7 @@ void hero_l00_update_move_decider_us2(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l00_change_action_us2(0x4E, 1); + hero_l00_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.025000002f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2326,55 +2326,55 @@ void hero_l00_update_move_decider_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l00_change_action_us2(0x45, 1); + hero_l00_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l00_change_action_us2(0x4D, 1); + hero_l00_set_move_state_us2(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l00_change_action_us2(0x41, 1); + hero_l00_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l00_change_action_us2(0x3F, 1); + hero_l00_set_move_state_us2(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l00_change_action_us2(0x41, 1); + hero_l00_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x24) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l00_change_action_us2(0x43, 1); + hero_l00_set_move_state_us2(0x43, 1); } else { - hero_l00_change_action_us2(0x3F, 0); + hero_l00_set_move_state_us2(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_change_action_us2(0x47, 1); + hero_l00_set_move_state_us2(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)v10 = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l00_change_action_us2(0x41, 1); + hero_l00_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l00_change_action_us2(0x41, 1); + hero_l00_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l00_change_action_us2(0x48, 1); + hero_l00_set_move_state_us2(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2383,7 +2383,7 @@ void hero_l00_update_move_decider_us2(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l00_change_action_us2(0x49, 1); + hero_l00_set_move_state_us2(0x49, 1); } break; } @@ -2394,7 +2394,7 @@ void hero_l00_update_move_decider_us2(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l00_change_action_us2(0x4A, 1); + hero_l00_set_move_state_us2(0x4A, 1); } } } @@ -2413,17 +2413,17 @@ void hero_l00_update_move_decider_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l00_change_action_us2(0x47, 1); + hero_l00_set_move_state_us2(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l00_change_action_us2(0x41, 1); + hero_l00_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l00_change_action_us2(0x48, 1); + hero_l00_set_move_state_us2(0x48, 1); } break; } @@ -2438,7 +2438,7 @@ void hero_l00_update_move_decider_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l00_change_action_us2(0, 0); + hero_l00_set_move_state_us2(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -2449,7 +2449,7 @@ void hero_l00_update_move_decider_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l00_change_action_us2(0, 0); + hero_l00_set_move_state_us2(0, 0); } break; case 0x22: @@ -2459,12 +2459,12 @@ void hero_l00_update_move_decider_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_l00_change_action_us2(7, 1); + hero_l00_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l00_change_action_us2(0, 0); + hero_l00_set_move_state_us2(0, 0); } break; default: diff --git a/src/us2/levels/shared/L00_003C76E0-cc-g8.c b/src/us2/levels/shared/L00_003C76E0-cc-g8.c index 79042109a..5cf870d2c 100644 --- a/src/us2/levels/shared/L00_003C76E0-cc-g8.c +++ b/src/us2/levels/shared/L00_003C76E0-cc-g8.c @@ -59,7 +59,7 @@ extern void anim_start_blended(void *, int, int, int); extern void start_equipped_item_animation(void); extern void cancel_hero_item_animation(void); extern void moby_transform_joint_to_world(void *, int, void *); -extern s32 hero_l00_change_action_us2(int, int); +extern s32 hero_l00_set_move_state_us2(int, int); extern void copy_matrix3x4(void *, void *); extern void matrix_from_basis_rows(void *, void *); extern void transform_vector(void *, void *, void *); @@ -129,7 +129,7 @@ void sheepinator_update_us2(char *gun) } if (!context->timer) context->timer = 15; moby_transform_joint_to_world(gun, 0, context); - if (g_hero_state.state == 1) hero_l00_change_action_us2(29, 1); + if (g_hero_state.state == 1) hero_l00_set_move_state_us2(29, 1); direction.q = 0; if (g_hero_state.state == 29 && (FIELD(g_hero_state.object, unsigned short, 0x34) & 1)) { diff --git a/src/us2/levels/shared/L00_003DEAF8-sw-g8.c b/src/us2/levels/shared/L00_003DEAF8-sw-g8.c index 068d06524..627737dc0 100644 --- a/src/us2/levels/shared/L00_003DEAF8-sw-g8.c +++ b/src/us2/levels/shared/L00_003DEAF8-sw-g8.c @@ -34,7 +34,7 @@ extern void part_steer_effect_direction(char *, char *, int); extern void vec_transform_or_copy(char *, char *), shop_trigger_current_state_effect(char *, char *); extern void vec_add_object_direction_scaled(char *, char *, float); extern void vec_clear_128(char *); -extern s32 hero_l00_change_action_us2(int, int); +extern s32 hero_l00_set_move_state_us2(int, int); extern void part_setup_object_effect_entry(char *, char *, char *); extern void anim_start_blended(char *, int, int, int); extern int PlayMobySound(int, int, char *); @@ -131,7 +131,7 @@ void spider_bot_update_us2(char *spider_bot) qcopy(spider_bot + 0x10, hit_info + 0x20); vec_clear_128(vars); ForceClaimNotice(6, 0, 1); - hero_l00_change_action_us2(28, 1); + hero_l00_set_move_state_us2(28, 1); part_setup_object_effect_entry(spider_bot + 0x10, spider_bot + 0xF0, spider_bot); spider_bot[0x20] = 2; anim_start_blended(spider_bot, 1, 0, 10); @@ -246,7 +246,7 @@ void spider_bot_update_us2(char *spider_bot) break; } case 8: { - if (g_game_mode[0] == 28) hero_l00_change_action_us2(0, 1); + if (g_game_mode[0] == 28) hero_l00_set_move_state_us2(0, 1); if (*(short *)(g_camera_state_ptr[0] + 0x86) == 27) ref_US2_L00_003DEAF8_00(); g_hud_timer_a_state = 0; level_store_value_pair_us2(0, 0); diff --git a/src/us2/levels/shared/L00_003F51EC-g8.c b/src/us2/levels/shared/L00_003F51EC-g8.c index 12373e537..ce371fb21 100644 --- a/src/us2/levels/shared/L00_003F51EC-g8.c +++ b/src/us2/levels/shared/L00_003F51EC-g8.c @@ -19,7 +19,7 @@ extern float g_hk22_speed_scale __attribute__((sda)); extern float g_weapon_effect_scale[]; extern void ReleaseDeadOrExpiredSlots(void *); extern void anim_start_blended_with_flags(void *, int, int, int, int); -extern int hero_l00_change_action_us2(int, int); +extern int hero_l00_set_move_state_us2(int, int); extern void hud_add_moby_marker(void *, unsigned int, int, int, int, int, float, float, float); extern int math_fast_float_d(void *); extern int vec_fast_helper_b(void *); @@ -53,7 +53,7 @@ void hk22_update_us2(unsigned char *hk22) { *(float *)(hk22 + 0x2C) = *(float *)(*(char **)(hk22 + 0x24) + 0x24) * g_hk22_speed_scale; g_weapon_effect_scale[0] = 0.1f; if (((Hero *)g_hero_state)->i[2213] == 1) - hero_l00_change_action_us2(0x1D, 1); + hero_l00_set_move_state_us2(0x1D, 1); if (((Hero *)g_hero_state)->i[2213] == 0x1D) { if (*(float *)vars > 0.0f && get_ammo(-1)) color = 0x600000FF; diff --git a/src/us2/levels/shared/L00_003FF2E4-g8.c b/src/us2/levels/shared/L00_003FF2E4-g8.c index 6886daca4..d141e0e33 100644 --- a/src/us2/levels/shared/L00_003FF2E4-g8.c +++ b/src/us2/levels/shared/L00_003FF2E4-g8.c @@ -28,7 +28,7 @@ extern int g_game_l00_mode; extern int g_bouncer_timer; typedef struct { char pad00[0x54]; float rate; char pad58[0xE0 - 0x58]; } AimEntry; extern AimEntry g_weapon_l00_table[]; -extern s32 hero_l00_change_action_us2(int a0, int a1); +extern s32 hero_l00_set_move_state_us2(int a0, int a1); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern int math_fast_float_d(int *); extern int vec_fast_helper_b(float *); @@ -44,9 +44,9 @@ extern int coll_trace_projectile_to_impact(float, void *, void *, void *, void * extern void part_spawn_muzzle_spark_burst(void *, void *, void *); extern int bouncer_spawn_debris(int, int, int); struct Rac2Native_5f824a0e369ccf7b_src_record; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_sound_record; -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); -extern void slot_reset_active(int); +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_rumble_waves; +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern void actuator_end_looping_waves(int); extern void ref_L00_003FDE48_00(void *, void *); extern void moby_draw_attached_effect(void *); @@ -85,7 +85,7 @@ void bouncer_update_us2(unsigned char *bouncer) { vars->handle = -1; g_bouncer_timer = 20; } - if (g_hero_state.level == 1) hero_l00_change_action_us2(29, 1); + if (g_hero_state.level == 1) hero_l00_set_move_state_us2(29, 1); if (bouncer[0x42] == bouncer[0x43] && (bouncer[0x60] & 2)) anim_start_blended_with_flags(bouncer, 1, 0, 2, 0); moby_compute_offset_point(bouncer, (char *)origin); target = 0; @@ -118,12 +118,12 @@ void bouncer_update_us2(unsigned char *bouncer) { bouncer_spawn_debris((int)bouncer, (int)origin, (int)aim); start_equipped_item_animation(); vars->repeat = 16; - vars->handle = slot_copy_records_to_free(&g_bouncer_sound_record); + vars->handle = actuator_play_waves(&g_bouncer_rumble_waves); } if (!(g_pad_state.held & g_hero_state.buttons) || !get_ammo(-1) || g_hero_state.f22B8 == 0) { handle = vars->handle; if (handle >= 0) { - slot_reset_active(handle); + actuator_end_looping_waves(handle); vars->handle = -1; } } diff --git a/src/us2/levels/shared/L00_004010A0-sw-g8.c b/src/us2/levels/shared/L00_004010A0-sw-g8.c index 23d99cd99..b11d92d7b 100644 --- a/src/us2/levels/shared/L00_004010A0-sw-g8.c +++ b/src/us2/levels/shared/L00_004010A0-sw-g8.c @@ -67,7 +67,7 @@ extern void part_steer_effect_direction(int, void *, int); extern void vec_transform_or_copy(void *, void *); extern void shop_trigger_current_state_effect(void *, void *); extern void vec_add_object_direction_scaled(void *, void *, float); -extern s32 hero_l00_change_action_us2(int, int); +extern s32 hero_l00_set_move_state_us2(int, int); extern void part_setup_object_effect_entry(void *, void *, void *); extern void anim_start_blended(void *, int, int, int); extern int PlayMobySound(int, int, void *); @@ -176,7 +176,7 @@ void UpdateTimedGroundActor_us2(char *actor) break; qcopy(actor + 0x10, &collision->point); ForceClaimNotice(6, 0, 1); - hero_l00_change_action_us2(28, 1); + hero_l00_set_move_state_us2(28, 1); part_setup_object_effect_entry(actor + 0x10, actor + 0xF0, actor); STATE(actor) = 2; anim_start_blended(actor, 1, 0, 10); @@ -278,7 +278,7 @@ void UpdateTimedGroundActor_us2(char *actor) break; case 8: if (g_game_mode == 28) - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); if (*(short *)(g_camera_state_ptr + 0x86) == 27) ref_US2_L00_004010A0_00(); table_clear_entry_flag(update_handle); diff --git a/src/us2/levels/shared/L00_00406CF8-cc-g8.c b/src/us2/levels/shared/L00_00406CF8-cc-g8.c index dcb08a22d..3ab487a12 100644 --- a/src/us2/levels/shared/L00_00406CF8-cc-g8.c +++ b/src/us2/levels/shared/L00_00406CF8-cc-g8.c @@ -48,7 +48,7 @@ extern int FastDecTimer(void *); extern void anim_start_blended(void *,int,int,int); extern void matrix_mul_vec3(void *,void *,void *); extern void FastVecAdd(void *,void *,void *); -extern s32 hero_l00_change_action_us2(int,int); +extern s32 hero_l00_set_move_state_us2(int,int); extern void copy_matrix3x4(void *,void *); extern void matrix_from_basis_rows(void *,void *); extern void transform_vector(void *,void *,void *); @@ -114,7 +114,7 @@ void MorphorayUpdate_us2(char *morphoray) offset.x=0.15f; offset.y=-1.0f; offset.z=0.06f; offset.w=1.0f; matrix_mul_vec3(&offset,&offset,morphoray+0xc0); FastVecAdd(beam,morphoray+0x10,&offset); - if (g_hero_state.current==1) hero_l00_change_action_us2(29,1); + if (g_hero_state.current==1) hero_l00_set_move_state_us2(29,1); *(Quad *)&direction=0; if (g_hero_state.current==29 && (U(g_hero_state.object,0x34)&1)) { copy_matrix3x4(matrix,g_scalar_transition_state); diff --git a/src/us2/levels/shared/L01_002B3990.c b/src/us2/levels/shared/L01_002B3990.c index 383f19409..898e46d78 100644 --- a/src/us2/levels/shared/L01_002B3990.c +++ b/src/us2/levels/shared/L01_002B3990.c @@ -62,7 +62,7 @@ extern s32 FloatToInt(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(void *, void *, void *); extern void hero_build_relative_point(void *, s32, float, float, float); -extern s32 hero_set_move_state_us2(unsigned long, unsigned long); +extern s32 SetHeroMoveState_us2(unsigned long, unsigned long); extern u8 *part_find_owned_effect_slot(u8 *, s32, s32); extern void AdjustPlayerHealth_us2(s32); extern int hero_play_sound(s32, s32); @@ -132,7 +132,7 @@ s32 hero_l01_apply_hazard_contact_us2(s32 apply) { case 0: other = g_hero_state.f249C; if (other != 0 && (*(s16 *)(other + 0xAA) == 0x4EB || *(s16 *)(other + 0xAA) == 0x558)) { - hero_set_move_state_us2(0x7D, 1); + SetHeroMoveState_us2(0x7D, 1); return 1; } if ((g_hero_state.f2294 == 1 || g_hero_state.f2294 == 0x1D || g_hero_state.f1500 != 0) @@ -143,7 +143,7 @@ s32 hero_l01_apply_hazard_contact_us2(s32 apply) { AdjustPlayerHealth_us2(FloatToInt(*(float *)(r + 0x2C))); } if (g_hero_state.f24CC == 0) { - hero_set_move_state_us2(0x16, 1); + SetHeroMoveState_us2(0x16, 1); } g_hero_state.f1DC = 0x4D; if (g_hero_state.f21C == 0) { @@ -153,9 +153,9 @@ s32 hero_l01_apply_hazard_contact_us2(s32 apply) { return 0; } if (entry->f24 & 8) { - hero_set_move_state_us2(0x8C, 1); + SetHeroMoveState_us2(0x8C, 1); } else { - hero_set_move_state_us2(0x16, 1); + SetHeroMoveState_us2(0x16, 1); } if (g_hero_state.f2294 == 0x8C) { qzero(&vec); diff --git a/src/us2/levels/shared/L02_003C3B7C-g16.c b/src/us2/levels/shared/L02_003C3B7C-g16.c index 4c782166d..6cc34b3e6 100644 --- a/src/us2/levels/shared/L02_003C3B7C-g16.c +++ b/src/us2/levels/shared/L02_003C3B7C-g16.c @@ -122,7 +122,7 @@ extern void LoadClassIntoFreeCacheSlot(int); extern int ForceClaimNotice(int, int, int); extern void object_copy_vector_to_selected(const void *), cam_set_state_rotation(const void *); extern void SetCamera5Pose(const void *, const void *, int, int, int); -extern int hero_l00_change_action_us2(int, int); +extern int hero_l00_set_move_state_us2(int, int); extern void set_hero_animation(int, int, float); extern void script_queue_keyed_request(int, int); extern void AdvancePathFollower(char *, int); @@ -261,7 +261,7 @@ void challenge_controller_update_us2(u8 *object) g_hero_state.control_mode = 3; status = hero_get_target_state_kind(); if (status == 2 && g_hero_state.object[0x42] == g_hero_state.object[0x43]) { - hero_l00_change_action_us2(0x6F, 0); + hero_l00_set_move_state_us2(0x6F, 0); set_hero_animation(0x54, 0, 7.0f); position.f[0] = math_fast_sin_or_cos_a(*(float *)(object + 0xF8)) * 3.0f; position.f[1] = math_fast_sin_or_cos_b(*(float *)(object + 0xF8)) * 3.0f; @@ -374,7 +374,7 @@ void challenge_controller_update_us2(u8 *object) char *actors; u16 *list; ForceClaimNotice(1, 0, 1); - hero_l00_change_action_us2(0x6F, 1); + hero_l00_set_move_state_us2(0x6F, 1); record = g_matrix_l02_record_table + state->record * 0x80; if (fast_vec_dist(&g_camera_l02_position.from, record + 0x30) <= 1.0f) { if (g_arena_state_words == 7) { @@ -396,7 +396,7 @@ void challenge_controller_update_us2(u8 *object) break; cam_set_mode_state(3); g_hero_state.camera_request = state->saved_camera; - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); g_hero_state.camera_request = state->saved_camera; if (state->restore_mode != -1) cam_reset_entry(state->restore_mode); @@ -421,7 +421,7 @@ void challenge_controller_update_us2(u8 *object) g_hero_state.camera_request = state->saved_camera; cam_set_mode_state(3); g_hero_state.camera_request = state->saved_camera; - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -495,7 +495,7 @@ void challenge_controller_update_us2(u8 *object) break; cam_set_mode_state(3); g_hero_state.camera_request = state->saved_camera; - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -542,7 +542,7 @@ void challenge_controller_update_us2(u8 *object) } cam_set_mode_state(3); g_hero_state.camera_request = state->saved_camera; - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -574,7 +574,7 @@ void challenge_controller_update_us2(u8 *object) } cam_set_mode_state(3); g_hero_state.camera_request = state->saved_camera; - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -599,7 +599,7 @@ void challenge_controller_update_us2(u8 *object) } else if (g_pad_state.buttons.word.high & 0x10) { cam_set_mode_state(3); g_hero_state.camera_request = state->saved_camera; - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); @@ -646,7 +646,7 @@ void challenge_controller_update_us2(u8 *object) break; cam_set_mode_state(3); g_hero_state.camera_request = state->saved_camera; - hero_l00_change_action_us2(0, 1); + hero_l00_set_move_state_us2(0, 1); object[0x30] = 0x40; if (state->decoration) { moby_mark_spawned(state->decoration); diff --git a/src/us2/levels/shared/L02_00411B98-sw-g8.c b/src/us2/levels/shared/L02_00411B98-sw-g8.c index ff7897ca9..5163fc791 100644 --- a/src/us2/levels/shared/L02_00411B98-sw-g8.c +++ b/src/us2/levels/shared/L02_00411B98-sw-g8.c @@ -23,7 +23,7 @@ extern int PlayMobySound(int,int,char *); extern void hero_start_target_state(Quad *,int,float); extern int coll_sweep_from_object(void *,float,float *,int,float,float,int,int,int); extern int hero_get_target_state_kind(void); -extern int hero_l00_change_action_us2(int,int); +extern int hero_l00_set_move_state_us2(int,int); extern void gfx_add_draw_callback_first(DrawCallback,void *); extern void gfx_add_draw_callback_third(DrawCallback,void *); extern float ApproachValue(float *,float,float); @@ -111,7 +111,7 @@ void teleporter_l02_update_us2(u8 *moby) } else if(state->orbit_b<1.0f) { math_step_value_toward_target(&state->orbit_b,&state->rate_b,1.0f,g_teleporter_orbit_speed*0.00027777778f,g_teleporter_orbit_accel*0.00027777778f,g_teleporter_orbit_rate_limit*0.016666668f); } else if(g_teleporter_state!=11 || !(state->orbit_a>0.25f)) { - if(answer==2) {hero_l00_change_action_us2(0x6F,1);state->timer=1.95f;moby[0x20]=3;} + if(answer==2) {hero_l00_set_move_state_us2(0x6F,1);state->timer=1.95f;moby[0x20]=3;} else if(answer==0) moby[0x20]=4; } teleporter_update_orbiting_children(moby); diff --git a/src/us2/levels/shared/L03_003E5C90-cc-g8.c b/src/us2/levels/shared/L03_003E5C90-cc-g8.c index 459f226ec..31f4ef8f1 100644 --- a/src/us2/levels/shared/L03_003E5C90-cc-g8.c +++ b/src/us2/levels/shared/L03_003E5C90-cc-g8.c @@ -51,7 +51,7 @@ extern void infiltrator_ball_spawn_for_moby(char *),moby_update_attached_child(c extern int ForceClaimNotice(int,int,int); extern int load_is_class_cached(int); extern void LoadClassIntoFreeCacheSlot(int),hero_start_loader_state(int); -extern int hero_l03_enter_state_us2(int,int); +extern int hero_l03_set_move_state_us2(int,int); extern void matrix_mul_vec3(void *,void *,void *),FastVecAdd(void *,void *,void *),FastVecSub(void *,void *,void *); extern float FastAddRotations(float,float),mat_fast_helper_a(float,float),vec_distance_xy(void *,void *); extern void hero_start_target_state(void *,int,float); @@ -152,7 +152,7 @@ void infiltrator_lock_update_us2(char *moby) { case 3: if (flag_set_first_pending(moby)) { PlayMobySound(0,0,moby); - hero_l03_enter_state_us2(0x6F,0);set_hero_animation(0x54,0,20.0f); + hero_l03_set_move_state_us2(0x6F,0);set_hero_animation(0x54,0,20.0f); FastVecSub(vec,g_camera_pose_buffer,g_hero_state.position); matrix_mul_vec3(vec,vec,g_hero_state.matrix40); SetCamera5Pose(g_camera_pose_buffer,g_camera_pose_buffer,3,120,0); diff --git a/src/us2/levels/shared/L04_002D93C0-flags.c b/src/us2/levels/shared/L04_002D93C0-flags.c index 4a00db01a..ead5f0998 100644 --- a/src/us2/levels/shared/L04_002D93C0-flags.c +++ b/src/us2/levels/shared/L04_002D93C0-flags.c @@ -11,7 +11,7 @@ extern float fade_reduce_value(float); extern void hero_clear_tracked_slots(void); extern void FastVecSub(f32 *,f32 *,f32 *); extern void hero_build_relative_point(void *,int,float,float,float); -extern s32 hero_l04_enter_state_us2(int,int); +extern s32 hero_l04_set_move_state_us2(int,int); extern char *part_find_owned_effect_slot(void *,int,int); extern void AdjustPlayerHealth_us2(int); extern int hero_play_sound(int,int); @@ -147,7 +147,7 @@ int hero_check_surface_contact_us2(int update) { if (!GROUND_HERO.b[0x22B4]) { char *surface_moby = GROUND_HERO.p[0x249C / 4]; if (surface_moby && (AH(surface_moby, 0xAA) == 0x4EB || AH(surface_moby, 0xAA) == 0x558)) { - hero_l04_enter_state_us2(0x7D, 1); + hero_l04_set_move_state_us2(0x7D, 1); return 1; } if ((GROUND_HERO.i[0x2294 / 4] == 1 || @@ -155,16 +155,16 @@ int hero_check_surface_contact_us2(int update) { !(AI(entry, 0x24) & 8)) { char *surface_moby = part_find_owned_effect_slot(GROUND_HERO.p[0x2290 / 4], 1, 0); if (surface_moby) AdjustPlayerHealth_us2(FloatToInt(AF(surface_moby, 0x2C))); - if (!GROUND_HERO.i[0x24CC / 4]) hero_l04_enter_state_us2(0x16, 1); + if (!GROUND_HERO.i[0x24CC / 4]) hero_l04_set_move_state_us2(0x16, 1); GROUND_HERO.h[0x1DC / 2] = 0x4D; if (!GROUND_HERO.h[0x21C / 2]) GROUND_HERO.h[0x21C / 2] = 0x12; hero_play_sound(20, 0); return 0; } - if (GROUND_HERO.i[0x229C / 4] == 0x12) hero_l04_enter_state_us2(0x72, 1); - else if (GROUND_HERO.i[0x229C / 4] == 0x11) hero_l04_enter_state_us2(0x73, 1); - else if (AI(entry, 0x24) & 8) hero_l04_enter_state_us2(0x8C, 1); - else hero_l04_enter_state_us2(0x16, 1); + if (GROUND_HERO.i[0x229C / 4] == 0x12) hero_l04_set_move_state_us2(0x72, 1); + else if (GROUND_HERO.i[0x229C / 4] == 0x11) hero_l04_set_move_state_us2(0x73, 1); + else if (AI(entry, 0x24) & 8) hero_l04_set_move_state_us2(0x8C, 1); + else hero_l04_set_move_state_us2(0x16, 1); if (GROUND_HERO.i[0x2294 / 4] == 0x8C) { qzero(&delta); } else { diff --git a/src/us2/levels/shared/L04_0040CF60-g8.c b/src/us2/levels/shared/L04_0040CF60-g8.c index 6942cbff7..325675658 100644 --- a/src/us2/levels/shared/L04_0040CF60-g8.c +++ b/src/us2/levels/shared/L04_0040CF60-g8.c @@ -24,7 +24,7 @@ extern void snd_send_cmd22(int), snd_send_cmd23(int); extern int snd_Pump(void); extern void music_Pause(int), music_Unpause(void); extern void racer_reset_state(char *, int); -extern int hero_l04_enter_state_us2(int,int); +extern int hero_l04_set_move_state_us2(int,int); extern void racer_release_sound_handles(char *, char *), racer_release_link_state(char *,char *); extern int snd_play_from_global_bank(int,int,void *); extern int race_get_course_win_count(int); @@ -47,7 +47,7 @@ void race_selection_menu_update_us2(char *moby, char *racer) g_selected_race_index = g_current_race_index; g_race_select_initialized = 1; } - if (S32_AT(g_hero_state,0x2294) != 0x31) hero_l04_enter_state_us2(0x31,1); + if (S32_AT(g_hero_state,0x2294) != 0x31) hero_l04_set_move_state_us2(0x31,1); U16_AT(moby,0x34) |= 0x41; if (S32_AT(racer,0x1dc) != -1) { slot_moby = g_moby_l04_pool + (S32_AT(racer,0x1dc) << 8); diff --git a/src/us2/levels/shared/L04_0041B01C-g8.c b/src/us2/levels/shared/L04_0041B01C-g8.c index a36777c1a..d949c9e67 100644 --- a/src/us2/levels/shared/L04_0041B01C-g8.c +++ b/src/us2/levels/shared/L04_0041B01C-g8.c @@ -62,7 +62,7 @@ extern Quad g_collision_quad; extern float g_projection_scale_float NOT_SDA; extern void hero_record_play_counters(void); extern void hero_reset_position_and_direction(void *, void *, int, int); -extern int hero_l04_enter_state_us2(int, int); +extern int hero_l04_set_move_state_us2(int, int); extern void cam_set_transition_frames(float); extern int coll_test_point(void *, int, void *, float); extern void UpdateViewContext(void); @@ -310,7 +310,7 @@ void hoverbike_race_update_us2(u8 *moby) I(vars, 0x330) = -1; } if (g_current_map_index == 0xCE) { - hero_l04_enter_state_us2(0x86, 1); + hero_l04_set_move_state_us2(0x86, 1); } else { if (I(vars, 0x198) != -1) { if (I(vars, 0x19C) != -1) { @@ -323,7 +323,7 @@ void hoverbike_race_update_us2(u8 *moby) Q(moby, 0x10) = Q(NODE(I(vars, 0x198)), 0x30); Q(moby, 0xF0) = Q(NODE(I(vars, 0x198)), 0x70); } - hero_l04_enter_state_us2(0x31, 1); + hero_l04_set_move_state_us2(0x31, 1); load_scene_chunk(1, I(vars, 0x488)); I(vars, 0x58) |= 1; I(vars, 0x340) = 0; diff --git a/src/us2/levels/shared/L06_00446438-g8.c b/src/us2/levels/shared/L06_00446438-g8.c index 4a1f3199c..4bf51335c 100644 --- a/src/us2/levels/shared/L06_00446438-g8.c +++ b/src/us2/levels/shared/L06_00446438-g8.c @@ -29,7 +29,7 @@ extern int g_bouncer_timer; typedef struct { float f00[4]; float f10[4]; char pad20[4]; int result; int handle; int timer; } AimState; typedef struct { char pad00[0x54]; float rate; char pad58[0xE0 - 0x58]; } AimEntry; extern AimEntry g_weapon_l00_table[]; -extern s32 hero_l00_change_action_us2(int a0, int a1); +extern s32 hero_l00_set_move_state_us2(int a0, int a1); extern void anim_start_blended_with_flags(void *, int, int, int, int); extern int math_fast_float_d(int *); extern int vec_fast_helper_b(float *); @@ -45,9 +45,9 @@ extern int coll_trace_projectile_to_impact(float, void *, void *, void *, void * extern void part_spawn_muzzle_spark_burst(void *, void *, void *); extern int bouncer_spawn_debris(int, int, int); struct Rac2Native_5f824a0e369ccf7b_src_record; -extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_sound_record; -extern int slot_copy_records_to_free(struct Rac2Native_5f824a0e369ccf7b_src_record *); -extern void slot_reset_active(int); +extern struct Rac2Native_5f824a0e369ccf7b_src_record g_bouncer_rumble_waves; +extern int actuator_play_waves(struct Rac2Native_5f824a0e369ccf7b_src_record *); +extern void actuator_end_looping_waves(int); extern void ref_L00_003FDE48_00(void *, void *); extern void moby_draw_attached_effect(void *); @@ -76,7 +76,7 @@ void bouncer_update_l06_us2(unsigned char *object) { state->handle = -1; g_bouncer_timer = 20; } - if (g_hero_state.level == 1) hero_l00_change_action_us2(29, 1); + if (g_hero_state.level == 1) hero_l00_set_move_state_us2(29, 1); if (object[0x42] == object[0x43] && (object[0x60] & 2)) anim_start_blended_with_flags(object, 1, 0, 2, 0); moby_compute_offset_point(object, (char *)origin); target = 0; @@ -109,12 +109,12 @@ void bouncer_update_l06_us2(unsigned char *object) { bouncer_spawn_debris((int)object, (int)origin, (int)aim); start_equipped_item_animation(); state->timer = 16; - state->handle = slot_copy_records_to_free(&g_bouncer_sound_record); + state->handle = actuator_play_waves(&g_bouncer_rumble_waves); } if (!(g_pad_state.held & g_hero_state.buttons) || !get_ammo(-1) || g_hero_state.f22B8 == 0) { handle = state->handle; if (handle >= 0) { - slot_reset_active(handle); + actuator_end_looping_waves(handle); state->handle = -1; } } diff --git a/src/us2/levels/shared/L08_003C7F00-cc-g8.c b/src/us2/levels/shared/L08_003C7F00-cc-g8.c index 8ef95e201..be33baf15 100644 --- a/src/us2/levels/shared/L08_003C7F00-cc-g8.c +++ b/src/us2/levels/shared/L08_003C7F00-cc-g8.c @@ -104,7 +104,7 @@ extern void gfx_start_color_fade(void *, void *); extern void gfx_update_color_fade(void *, void *); extern f32 func_002A0558(void *, void *); extern s32 TryClaimNotice(s32, s32, s32); -extern s32 hero_l08_enter_state_us2(s32, s32); +extern s32 hero_l08_set_move_state_us2(s32, s32); extern void set_hero_animation(int, int, f32); extern int FastDecTimer(void *); extern int math_fast_float_d(void *); @@ -358,7 +358,7 @@ void RideableMobyUpdate_us2(RideMoby *moby) } } if (fire != 0) { - hero_l08_enter_state_us2(0x31, 0); + hero_l08_set_move_state_us2(0x31, 0); set_hero_animation(g_hover_anim_next, 0, 15.0f); *(TI128 *)(g_hero_state + 0x90) = moby->rot.q; *(TI128 *)(g_hero_state + 0x80) = moby->pos.q; @@ -613,7 +613,7 @@ void RideableMobyUpdate_us2(RideMoby *moby) case 4: moby->x98 = *(s32 *)(moby->x24 + 0x10); *(s32 *)(((Hero *)g_hero_state)->ptr[0x2290 / 4] + 0x9C) = 0; - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); ((Hero *)g_hero_state)->h[0x1834 / 2] = -1; ((Hero *)g_hero_state)->f[0x108 / 4] = 0.16666667f; ((Hero *)g_hero_state)->ptr[0x1830 / 4] = 0; @@ -629,7 +629,7 @@ void RideableMobyUpdate_us2(RideMoby *moby) case 5: moby->x98 = *(s32 *)(moby->x24 + 0x10); *(s32 *)(((Hero *)g_hero_state)->ptr[0x2290 / 4] + 0x9C) = 0; - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); moby_transform_joint_to_world(moby, 0, dir); SpawnExplosionEffects(moby, vars, dir, 0.0f, 0.0f, 10, 3, 16, 4.0f, 2.0f, 9.0f, 1.0f, -1, 15.0f, 1, 1, -1, 0, 0x810001); moby->pos.q = vars->x30; diff --git a/src/us2/levels/shared/L08_003CF3E8-cc-g8.c b/src/us2/levels/shared/L08_003CF3E8-cc-g8.c index eb7209946..6675fd89f 100644 --- a/src/us2/levels/shared/L08_003CF3E8-cc-g8.c +++ b/src/us2/levels/shared/L08_003CF3E8-cc-g8.c @@ -118,7 +118,7 @@ extern void hero_reset_speeds_and_vectors(void); extern void hero_record_play_counters(void); extern void set_hero_animation(int, int, float); extern void script_queue_keyed_request(int, int); -extern int hero_l08_enter_state_us2(int, int); +extern int hero_l08_set_move_state_us2(int, int); extern void cam_update_aim_values(void *, void *); extern void hero_move_with_mount_to_transform(void *, void *); extern void hero_save_transform_snap_object(void *, void *); @@ -230,7 +230,7 @@ void UpdateHeroNpc_us2(u8 *obj) if (ok && g_hero_state.target == g_moby_array[DI(0x6C)].bytes && g_hero_state.unk340 != 0 && g_hero_state.unk34E == 0) { u8 *q; - hero_l08_enter_state_us2(0x31, 0); + hero_l08_set_move_state_us2(0x31, 0); set_hero_animation(0x87, 0, 3.0f); ((s32 *)g_hero_state.unk2290)[0x9C / 4] = -1; q = g_moby_array[DI(0x6C)].bytes; @@ -278,7 +278,7 @@ void UpdateHeroNpc_us2(u8 *obj) snd_play_from_class_bank(0, 0, obj, 0x988); } DI(0x50) = g_vehicle_timer_start; - hero_l08_enter_state_us2(0x31, 0); + hero_l08_set_move_state_us2(0x31, 0); set_hero_animation(0x81, 0, 15.0f); ((s32 *)g_hero_state.unk2290)[0x9C / 4] = -1; if (g_vehicle_active_flag != 0) @@ -580,7 +580,7 @@ void UpdateHeroNpc_us2(u8 *obj) g_vehicle_collision_x = g_vehicle_saved_x; g_vehicle_collision_y = g_vehicle_saved_y; DI(0x50) = 0; - hero_l08_enter_state_us2(0, 1); + hero_l08_set_move_state_us2(0, 1); hero_reset_speeds_and_vectors(); if (OB(0x43) != 0) anim_start_blended(obj, 0, 0, 0xA); diff --git a/src/us2/levels/shared/L11_003D0750.c b/src/us2/levels/shared/L11_003D0750.c index 440784ed4..e1bc17679 100644 --- a/src/us2/levels/shared/L11_003D0750.c +++ b/src/us2/levels/shared/L11_003D0750.c @@ -10,7 +10,7 @@ extern int IsPointInCuboid(void *, int); extern int flag_set_first_pending(char *); extern void cam_lock_entry(int); extern int ForceClaimNotice(int, int, int); -extern int hero_l11_enter_state_us2(int, int); +extern int hero_l11_set_move_state_us2(int, int); extern float FastAddRotations(float, float); /* State 0 opens the trigger; state 1 reacts to the hero being on the object, or being in state @@ -49,7 +49,7 @@ void levitator_l11_pad_update_us2(char *moby) if (*(int *)(other_hero + 0x2294) == 0x82) { cuboid_index = *(int *)(vars + 8); if (cuboid_index >= 0 && IsPointInCuboid(other_hero + 0x80, cuboid_index) != 0) - hero_l11_enter_state_us2(6, 1); + hero_l11_set_move_state_us2(6, 1); } } break; diff --git a/src/us2/levels/shared/L13_002C58E8-sw.c b/src/us2/levels/shared/L13_002C58E8-sw.c index f6e70ec41..2228af1d5 100644 --- a/src/us2/levels/shared/L13_002C58E8-sw.c +++ b/src/us2/levels/shared/L13_002C58E8-sw.c @@ -153,7 +153,7 @@ extern f32 cam_get_view_space_vector_length(s32); extern f32 cam_get_view_space_height(s32); extern void cam_set_view_space_height(s32, s32, f32); extern void cam_set_view_space_vector_length(s32, s32, f32); -extern s32 queue_copy_record_by_index(s32); +extern s32 actuator_play_pattern(s32); extern s32 func_L00_002EE4D8(s32, s32, f32); extern s32 math_lerp_int(s32, s32, f32); extern void level_init_pending_slot(s32, s32); @@ -716,7 +716,7 @@ void hero_l13_update_state_machine_us2(void) { (*(u16*)&g_hero_state_machine_word) = 0xFFFF; } snd_update_slot_object(5, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], 0xF); - queue_copy_record_by_index(0x16); + actuator_play_pattern(0x16); } else { temp_a2 = ((Hero *)g_hero_state)->i[0x2440/4]; if (temp_a2 != -1) { @@ -1459,7 +1459,7 @@ void hero_l13_update_state_machine_us2(void) { coll_process_hit(0.4f, (s32)((TI128*)v0), 0x10, (s32) ((Hero *)g_hero_state)->ptr[0x2290/4], (s32) ((TI128*)v10)); } if (math_is_below_plane_within_depth(25.7f) != 0) { - queue_copy_record_by_index(0x19); + actuator_play_pattern(0x19); ((Hero *)g_hero_state)->h[0x1FA/2] = 0x32; if (g_hero_override_flag != 0) { ((Hero *)g_hero_l20_extra_state)->f[0x180/4] = 0.1f; diff --git a/src/us2/levels/shared/L13_002C58E8-sw2.c b/src/us2/levels/shared/L13_002C58E8-sw2.c index d8c59fcbb..a7547ae7d 100644 --- a/src/us2/levels/shared/L13_002C58E8-sw2.c +++ b/src/us2/levels/shared/L13_002C58E8-sw2.c @@ -70,8 +70,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -139,7 +139,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_l13_change_action_us2(s32 action, s32 animate) { +s32 hero_l13_set_move_state_us2(s32 action, s32 animate) { f32 dir[4]; u8 *object_snapshot; u8 *hit_10, *hit_29, *hit_44, *hit_45, *hit_52; @@ -187,7 +187,9 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -200,8 +202,8 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { hero_start_loader_state(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l13_change_action_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_change_action_us2(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l13_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (hero_get_weapon_or_form_id(0) == 0x51) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); else set_hero_animation(hero_get_weapon_or_form_id(0), 0, -1.0f); @@ -348,7 +350,7 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l13_change_action_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l13_set_move_state_us2(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -394,12 +396,12 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_l13_change_action_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_change_action_us2(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l13_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (hero_get_weapon_or_form_id(0) == 0x51) { if (!animate) goto finish; - if (hero_l13_change_action_us2(0, 0)) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); + if (hero_l13_set_move_state_us2(0, 0)) set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -424,7 +426,7 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_change_action_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -589,13 +591,13 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_l13_change_action_us2(0x81, 1); return 0; + hero_l13_set_move_state_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_aim_blocked) { hero_l13_change_action_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_aim_blocked) { hero_l13_set_move_state_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_l13_change_action_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l13_set_move_state_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -670,9 +672,9 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_map_action_flag) hero_l13_change_action_us2(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l13_change_action_us2(0x79, 1); - else hero_l13_change_action_us2(0x39, 1); + if (g_current_map_index == 2 && g_hero_map_action_flag) hero_l13_set_move_state_us2(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l13_set_move_state_us2(0x79, 1); + else hero_l13_set_move_state_us2(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -723,7 +725,7 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -752,7 +754,7 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -761,7 +763,7 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -903,7 +905,7 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -994,7 +996,7 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -1006,7 +1008,7 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -1041,7 +1043,7 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { set_hero_animation(0x11, 0, 8.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_change_action_us2(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state_us2(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation(0, 0, 9.0f); goto finish; case 0x4B: @@ -1075,7 +1077,7 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l13_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_change_action_us2(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l13_set_move_state_us2(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1119,7 +1121,7 @@ s32 hero_l13_change_action_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_l13_change_action_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l13_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/shared/L13_002C58E8-sw3.c b/src/us2/levels/shared/L13_002C58E8-sw3.c index be947413c..74ae47636 100644 --- a/src/us2/levels/shared/L13_002C58E8-sw3.c +++ b/src/us2/levels/shared/L13_002C58E8-sw3.c @@ -78,7 +78,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_l13_change_action_us2(s32, s32); +s32 hero_l13_set_move_state_us2(s32, s32); void hero_start_loader_state(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -156,7 +156,7 @@ void hero_l13_decide_state_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_l13_change_action_us2(0x39, 1); + hero_l13_set_move_state_us2(0x39, 1); goto end; } } @@ -191,7 +191,7 @@ void hero_l13_decide_state_us2(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l13_height_limit) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_l13_change_action_us2(0x74, 1); + hero_l13_set_move_state_us2(0x74, 1); goto end; } } @@ -202,12 +202,12 @@ void hero_l13_decide_state_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l13_change_action_us2(1, 1); + hero_l13_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l13_change_action_us2(0x82, 1); + hero_l13_set_move_state_us2(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -244,7 +244,7 @@ void hero_l13_decide_state_us2(void) { rec = g_hero_l13_state_records + sp40 * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_l13_change_action_us2(0x3C, 1); + hero_l13_set_move_state_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -287,12 +287,12 @@ void hero_l13_decide_state_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l13_change_action_us2(0x76, 1); + hero_l13_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } break; } @@ -313,21 +313,21 @@ void hero_l13_decide_state_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_aim_blocked == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_l13_change_action_us2(0x6E, 1); + hero_l13_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_l13_change_action_us2(4, 1); + hero_l13_set_move_state_us2(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_l13_change_action_us2(0x2E, 1); + hero_l13_set_move_state_us2(0x2E, 1); break; } { @@ -347,28 +347,28 @@ void hero_l13_decide_state_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l13_change_action_us2(1, 1); + hero_l13_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad3C = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad3C & 8)) { - hero_l13_change_action_us2(0x3D, 1); + hero_l13_set_move_state_us2(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l13_change_action_us2(0x3D, 1); + hero_l13_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } break; case 0x3D: @@ -377,22 +377,22 @@ void hero_l13_decide_state_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l13_change_action_us2(4, 1); + hero_l13_set_move_state_us2(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); break; } - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -431,25 +431,25 @@ void hero_l13_decide_state_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_l13_change_action_us2(0x33, 1); + hero_l13_set_move_state_us2(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_l13_change_action_us2(0x34, 1); + hero_l13_set_move_state_us2(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l13_change_action_us2(0x32, 1); + hero_l13_set_move_state_us2(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_l13_change_action_us2(0x33, 1); + hero_l13_set_move_state_us2(0x33, 1); } } break; @@ -462,81 +462,81 @@ void hero_l13_decide_state_us2(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l13_change_action_us2(0x32, 1); + hero_l13_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l13_change_action_us2(0x34, 1); + hero_l13_set_move_state_us2(0x34, 1); } else { - hero_l13_change_action_us2(0x32, 1); + hero_l13_set_move_state_us2(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l13_change_action_us2(0x12, 1); + hero_l13_set_move_state_us2(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l13_change_action_us2(0x32, 1); + hero_l13_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l13_change_action_us2(0x34, 1); + hero_l13_set_move_state_us2(0x34, 1); } else { - hero_l13_change_action_us2(0x32, 1); + hero_l13_set_move_state_us2(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l13_change_action_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l13_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_l13_change_action_us2(0x35, 1); + hero_l13_set_move_state_us2(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_l13_change_action_us2(0x12, 1); + hero_l13_set_move_state_us2(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_l13_change_action_us2(0x32, 1); + hero_l13_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_l13_change_action_us2(0x34, 1); + hero_l13_set_move_state_us2(0x34, 1); } else { - hero_l13_change_action_us2(0x32, 1); + hero_l13_set_move_state_us2(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_l13_change_action_us2(0x70, 0); + hero_l13_set_move_state_us2(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_l13_change_action_us2(0x36, 1); + hero_l13_set_move_state_us2(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l13_change_action_us2(0x67, 1); + hero_l13_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0x33, 1); + hero_l13_set_move_state_us2(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l13_change_action_us2(0x33, 0); + hero_l13_set_move_state_us2(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l13_change_action_us2(0x67, 1); + hero_l13_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_l13_change_action_us2(0x36, 0); + hero_l13_set_move_state_us2(0x36, 0); } break; case 0x1: @@ -570,9 +570,9 @@ void hero_l13_decide_state_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { hero_start_loader_state(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l13_change_action_us2(4, 1); + hero_l13_set_move_state_us2(4, 1); } else { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -584,9 +584,9 @@ void hero_l13_decide_state_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); } else { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } } break; @@ -619,7 +619,7 @@ void hero_l13_decide_state_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -628,7 +628,7 @@ void hero_l13_decide_state_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); } break; } @@ -650,7 +650,7 @@ void hero_l13_decide_state_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -663,7 +663,7 @@ void hero_l13_decide_state_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_l13_change_action_us2(2, 0); + hero_l13_set_move_state_us2(2, 0); set_hero_animation(3, g_hero_action_anim_table[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -674,22 +674,22 @@ void hero_l13_decide_state_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -706,7 +706,7 @@ void hero_l13_decide_state_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -715,7 +715,7 @@ void hero_l13_decide_state_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, 15.0f); break; } @@ -727,7 +727,7 @@ void hero_l13_decide_state_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } break; case 0x2: @@ -741,11 +741,11 @@ void hero_l13_decide_state_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l13_change_action_us2(0x76, 1); + hero_l13_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } n = 9; @@ -759,12 +759,12 @@ void hero_l13_decide_state_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_l13_change_action_us2(9, 1); + hero_l13_set_move_state_us2(9, 1); } else { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); } } else { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); } break; } @@ -772,11 +772,11 @@ void hero_l13_decide_state_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l13_change_action_us2(1, 1); + hero_l13_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l13_change_action_us2(4, 1); + hero_l13_set_move_state_us2(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -793,25 +793,25 @@ void hero_l13_decide_state_us2(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_l13_change_action_us2(0x2E, 1); + hero_l13_set_move_state_us2(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_l13_change_action_us2(0x70, 1); + hero_l13_set_move_state_us2(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -822,7 +822,7 @@ void hero_l13_decide_state_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_l13_change_action_us2(0, 0) == 0) { + if (hero_l13_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -839,7 +839,7 @@ void hero_l13_decide_state_us2(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l13_change_action_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l13_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } if (FLD(sp74, u8, 0x43) == 0x37) { @@ -860,7 +860,7 @@ void hero_l13_decide_state_us2(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l13_change_action_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l13_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -894,17 +894,17 @@ void hero_l13_decide_state_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_l13_change_action_us2(3, 0); + hero_l13_set_move_state_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_l13_change_action_us2(0x77, 1); + hero_l13_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_l13_change_action_us2(0x77, 1); + hero_l13_set_move_state_us2(0x77, 1); break; } } @@ -922,11 +922,11 @@ void hero_l13_decide_state_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_l13_change_action_us2(0x64, 1); + hero_l13_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_l13_change_action_us2(0x63, 1); + hero_l13_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -934,21 +934,21 @@ void hero_l13_decide_state_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0x62, 1); + hero_l13_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_l13_change_action_us2(0x62, 1); + hero_l13_set_move_state_us2(0x62, 1); } break; case 0x65: /* switch 2 */ temp_a0_11 = FLD(g_hero_state, s32, 0x18C0); if ((temp_a0_11 < 3) && (((temp_a0_11 * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 7, &sp44) != 0)) { - hero_l13_change_action_us2(0x66, 1); + hero_l13_set_move_state_us2(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -991,7 +991,7 @@ void hero_l13_decide_state_us2(void) { return; case 0x6D: if ((f32)g_hero_l13_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } break; case 0x30: @@ -1004,7 +1004,7 @@ void hero_l13_decide_state_us2(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_l13_change_action_us2(0, 0) != 0) { + if (hero_l13_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1012,29 +1012,29 @@ void hero_l13_decide_state_us2(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l13_change_action_us2(1, 1); + hero_l13_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l13_change_action_us2(4, 1); + hero_l13_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1042,45 +1042,45 @@ void hero_l13_decide_state_us2(void) { } if (hero_get_weapon_or_form_id(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l13_change_action_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l13_set_move_state_us2(0, 0) != 0)) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l13_change_action_us2(1, 1); + hero_l13_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_l13_change_action_us2(0x76, 1); + hero_l13_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_l13_change_action_us2(0x15, 1); + hero_l13_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1088,17 +1088,17 @@ void hero_l13_decide_state_us2(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_l13_change_action_us2(0x8B, 1); + hero_l13_set_move_state_us2(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } break; case 0x24: @@ -1124,14 +1124,14 @@ void hero_l13_decide_state_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); set_hero_animation(hero_get_weapon_or_form_id(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_l13_change_action_us2(6, 0); + hero_l13_set_move_state_us2(6, 0); } else { - hero_l13_change_action_us2(6, 0); + hero_l13_set_move_state_us2(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1147,9 +1147,9 @@ void hero_l13_decide_state_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } else { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1161,7 +1161,7 @@ void hero_l13_decide_state_us2(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_l13_change_action_us2(0x2C, 1); + hero_l13_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1225,11 +1225,11 @@ void hero_l13_decide_state_us2(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.21666668f); FLD(g_hero_state, f32, 0x128) = 0.16666667f; - hero_l13_change_action_us2(0x16, 1); + hero_l13_set_move_state_us2(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x46; FLD(g_hero_state, s16, 0x1D0) = 0x46; } else { - hero_l13_change_action_us2(0x3E, 1); + hero_l13_set_move_state_us2(0x3E, 1); } break; } @@ -1242,7 +1242,7 @@ void hero_l13_decide_state_us2(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_l13_change_action_us2(0x28, 1); + hero_l13_set_move_state_us2(0x28, 1); } break; } @@ -1253,16 +1253,16 @@ void hero_l13_decide_state_us2(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x46; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l13_change_action_us2(0x74, 1); + hero_l13_set_move_state_us2(0x74, 1); } else { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { - hero_l13_change_action_us2(0x2A, 1); + hero_l13_set_move_state_us2(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1279,7 +1279,7 @@ void hero_l13_decide_state_us2(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_l13_change_action_us2(0x28, 1); + hero_l13_set_move_state_us2(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)v20 = 0; @@ -1296,7 +1296,7 @@ void hero_l13_decide_state_us2(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 5, NULL) != 0) && ((f32)g_hero_l13_action_table[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_l13_change_action_us2(0x28, 1); + hero_l13_set_move_state_us2(0x28, 1); break; } top = 0xE; @@ -1305,19 +1305,19 @@ void hero_l13_decide_state_us2(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_l13_change_action_us2(0x2A, 1); + hero_l13_set_move_state_us2(0x2A, 1); } break; } if ((f32)g_hero_l13_action_table[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x6C8) >= 6)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_l13_change_action_us2(0x74, 1); + hero_l13_set_move_state_us2(0x74, 1); } else { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1326,11 +1326,11 @@ void hero_l13_decide_state_us2(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) && (g_current_map_index == 0x14)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0xA) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1366,7 +1366,7 @@ void hero_l13_decide_state_us2(void) { find_nearest_path_point(sp50, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), sp5C, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_l13_change_action_us2(0x29, 1); + hero_l13_set_move_state_us2(0x29, 1); break; } } @@ -1414,7 +1414,7 @@ void hero_l13_decide_state_us2(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x46; FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1422,7 +1422,7 @@ void hero_l13_decide_state_us2(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_l13_change_action_us2(0x71, 1); + hero_l13_set_move_state_us2(0x71, 1); break; } { @@ -1434,7 +1434,7 @@ void hero_l13_decide_state_us2(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l13_change_action_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l13_set_move_state_us2(0, 0) != 0)) { set_hero_animation(0xC, 4, 6.0f); } } else if (st == 0x3E) { @@ -1443,24 +1443,24 @@ void hero_l13_decide_state_us2(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)sp64, 0.5f, -1.0f); } if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s32, 0x340) != 0)) { - if (hero_l13_change_action_us2(0, 0) != 0) { + if (hero_l13_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x10) && (FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); } } break; } case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_l13_change_action_us2(0x18, 0); + hero_l13_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -1469,18 +1469,18 @@ void hero_l13_decide_state_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_l13_change_action_us2(0x1B, 1); + hero_l13_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1489,7 +1489,7 @@ void hero_l13_decide_state_us2(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l13_change_action_us2(0x19, 1); + hero_l13_set_move_state_us2(0x19, 1); } break; } @@ -1500,7 +1500,7 @@ void hero_l13_decide_state_us2(void) { v10[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v10[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l13_change_action_us2(0x1A, 1); + hero_l13_set_move_state_us2(0x1A, 1); } } } @@ -1519,18 +1519,18 @@ void hero_l13_decide_state_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0x18, 1); + hero_l13_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l13_change_action_us2(0x1B, 1); + hero_l13_set_move_state_us2(0x1B, 1); } break; } @@ -1540,9 +1540,9 @@ void hero_l13_decide_state_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } else { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); } } break; @@ -1566,12 +1566,12 @@ void hero_l13_decide_state_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l13_change_action_us2(0x39, 1); + hero_l13_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_l13_change_action_us2(0, 0) != 0) { + if (hero_l13_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1579,7 +1579,7 @@ void hero_l13_decide_state_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_l13_change_action_us2(0, 0) != 0) { + if (hero_l13_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1593,32 +1593,32 @@ void hero_l13_decide_state_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.050000004f) { - if (hero_l13_change_action_us2(3, 0) != 0) { + if (hero_l13_set_move_state_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_l13_change_action_us2(0, 1); + hero_l13_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l13_change_action_us2(8, 1); + hero_l13_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l13_change_action_us2(0x17, 1); + hero_l13_set_move_state_us2(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } } @@ -1650,7 +1650,7 @@ void hero_l13_decide_state_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_l13_change_action_us2(0, 0) != 0) { + if (hero_l13_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1660,9 +1660,9 @@ void hero_l13_decide_state_us2(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_l13_change_action_us2(0x74, 1); + hero_l13_set_move_state_us2(0x74, 1); } else { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } } break; @@ -1675,16 +1675,16 @@ void hero_l13_decide_state_us2(void) { ok = 1; } if (ok != 0) { - hero_l13_change_action_us2(0x11, 1); + hero_l13_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l13_change_action_us2(0x17, 1); + hero_l13_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1695,23 +1695,23 @@ void hero_l13_decide_state_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_l13_change_action_us2(3, 0) != 0) { + if (hero_l13_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_l13_change_action_us2(4, 1); + hero_l13_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_state_threshold_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); break; } - hero_l13_change_action_us2(2, 0); + hero_l13_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1720,21 +1720,21 @@ void hero_l13_decide_state_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_state_threshold_table[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_l13_change_action_us2(2, 1); + hero_l13_set_move_state_us2(2, 1); break; } - hero_l13_change_action_us2(2, 0); + hero_l13_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_action_anim_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_l13_change_action_us2(0, 0) != 0) { + if (hero_l13_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_l13_change_action_us2(0, 0) != 0) { + } else if (hero_l13_set_move_state_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1781,14 +1781,14 @@ void hero_l13_decide_state_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l13_change_action_us2(0xB, 1); + hero_l13_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_l13_change_action_us2(0x82, 1); + hero_l13_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1797,25 +1797,25 @@ void hero_l13_decide_state_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_l13_change_action_us2(0xA, 1); + hero_l13_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_l13_change_action_us2(0x10, 1); + hero_l13_set_move_state_us2(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_l13_change_action_us2(0x27, 1); + hero_l13_set_move_state_us2(0x27, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_l13_change_action_us2(0x77, 1); + hero_l13_set_move_state_us2(0x77, 1); break; } } @@ -1919,7 +1919,7 @@ void hero_l13_decide_state_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_l13_change_action_us2(3, 0) != 0) { + if (hero_l13_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1927,13 +1927,13 @@ void hero_l13_decide_state_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_state_threshold_table[0][2])) { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); } else if (g_hero_state_threshold_table[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_l13_change_action_us2(9, 1); + hero_l13_set_move_state_us2(9, 1); } else { - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); } break; } @@ -1941,10 +1941,10 @@ void hero_l13_decide_state_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } { @@ -1954,7 +1954,7 @@ void hero_l13_decide_state_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_l13_change_action_us2(0x11, 1); + hero_l13_set_move_state_us2(0x11, 1); break; } } @@ -1983,7 +1983,7 @@ void hero_l13_decide_state_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_l13_change_action_us2(0xE, 1); + hero_l13_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -1993,32 +1993,32 @@ void hero_l13_decide_state_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_l13_change_action_us2(8, 1); + hero_l13_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_l13_change_action_us2(0x17, 1); + hero_l13_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_l13_change_action_us2(0x79, 1); + hero_l13_set_move_state_us2(0x79, 1); } else { - hero_l13_change_action_us2(0x39, 1); + hero_l13_set_move_state_us2(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_l13_change_action_us2(0x82, 1); + hero_l13_set_move_state_us2(0x82, 1); } else { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); } } break; @@ -2028,8 +2028,8 @@ void hero_l13_decide_state_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l13_change_action_us2(0x39, 1); - } else if (hero_l13_change_action_us2(0, 0) != 0) { + hero_l13_set_move_state_us2(0x39, 1); + } else if (hero_l13_set_move_state_us2(0, 0) != 0) { set_hero_animation(hero_get_weapon_or_form_id(0), 0, 13.0f); } } @@ -2054,28 +2054,28 @@ void hero_l13_decide_state_us2(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l13_change_action_us2(0x4E, 1); + hero_l13_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_l13_change_action_us2(1, 1); + hero_l13_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l13_change_action_us2(0x45, 1); + hero_l13_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l13_change_action_us2(0x4D, 1); + hero_l13_set_move_state_us2(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_l13_change_action_us2(0x40, 1); + hero_l13_set_move_state_us2(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -2088,14 +2088,14 @@ void hero_l13_decide_state_us2(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l13_change_action_us2(0x4E, 1); + hero_l13_set_move_state_us2(0x4E, 1); break; } rec = (u8 *)&g_hero_l13_action_table[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_l13_change_action_us2(0x3F, 0); + hero_l13_set_move_state_us2(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -2104,13 +2104,13 @@ void hero_l13_decide_state_us2(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0x10) ? n : 0xF, NULL) != 0) { - hero_l13_change_action_us2(0x4D, 1); + hero_l13_set_move_state_us2(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_l13_change_action_us2(0x45, 1); + hero_l13_set_move_state_us2(0x45, 1); } break; } @@ -2173,42 +2173,42 @@ void hero_l13_decide_state_us2(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_l13_change_action_us2(0x45, 1); + hero_l13_set_move_state_us2(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_state_threshold_table[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_l13_change_action_us2(0x40, 1); + hero_l13_set_move_state_us2(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_l13_change_action_us2(0x3F, 1); + hero_l13_set_move_state_us2(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 5, NULL) != 0)) { - hero_l13_change_action_us2(0x4D, 1); + hero_l13_set_move_state_us2(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l13_change_action_us2(0x46, 1); + hero_l13_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_l13_change_action_us2(0x4B, 1); + hero_l13_set_move_state_us2(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l13_change_action_us2(0x46, 1); + hero_l13_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -2218,11 +2218,11 @@ void hero_l13_decide_state_us2(void) { FLD(g_hero_state, s16, 0x1EE) = 0xC - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_l13_change_action_us2(0x40, 1); + hero_l13_set_move_state_us2(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_l13_change_action_us2(0x3F, 1); + hero_l13_set_move_state_us2(0x3F, 1); } break; case 0x41: @@ -2234,29 +2234,29 @@ void hero_l13_decide_state_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l13_change_action_us2(0x43, 1); + hero_l13_set_move_state_us2(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_l13_change_action_us2(0x40, 1); + hero_l13_set_move_state_us2(0x40, 1); } else { - hero_l13_change_action_us2(0x3F, 1); + hero_l13_set_move_state_us2(0x3F, 1); } } else { - hero_l13_change_action_us2(0x3F, 1); + hero_l13_set_move_state_us2(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_l13_change_action_us2(0x46, 1); + hero_l13_set_move_state_us2(0x46, 1); break; } if ((PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_l13_change_action_us2(0x4B, 1); + hero_l13_set_move_state_us2(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_l13_change_action_us2(0x3F, 1); + hero_l13_set_move_state_us2(0x3F, 1); } break; case 0x4E: @@ -2265,9 +2265,9 @@ void hero_l13_decide_state_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); } else { - hero_l13_change_action_us2(0x3F, 1); + hero_l13_set_move_state_us2(0x3F, 1); } } break; @@ -2277,7 +2277,7 @@ void hero_l13_decide_state_us2(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_l13_change_action_us2(0x4E, 1); + hero_l13_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.025000002f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2303,55 +2303,55 @@ void hero_l13_decide_state_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_l13_change_action_us2(0x45, 1); + hero_l13_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_l13_change_action_us2(0x4D, 1); + hero_l13_set_move_state_us2(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_l13_change_action_us2(0x3F, 1); + hero_l13_set_move_state_us2(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x24) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_l13_change_action_us2(0x43, 1); + hero_l13_set_move_state_us2(0x43, 1); } else { - hero_l13_change_action_us2(0x3F, 0); + hero_l13_set_move_state_us2(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0x47, 1); + hero_l13_set_move_state_us2(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)v10 = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l13_change_action_us2(0x48, 1); + hero_l13_set_move_state_us2(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2360,7 +2360,7 @@ void hero_l13_decide_state_us2(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l13_change_action_us2(0x49, 1); + hero_l13_set_move_state_us2(0x49, 1); } break; } @@ -2371,7 +2371,7 @@ void hero_l13_decide_state_us2(void) { v20[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; v20[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)v20, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_l13_change_action_us2(0x4A, 1); + hero_l13_set_move_state_us2(0x4A, 1); } } } @@ -2390,17 +2390,17 @@ void hero_l13_decide_state_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)v10, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_l13_change_action_us2(0x47, 1); + hero_l13_set_move_state_us2(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_l13_change_action_us2(0x41, 1); + hero_l13_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_l13_change_action_us2(0x48, 1); + hero_l13_set_move_state_us2(0x48, 1); } break; } @@ -2415,7 +2415,7 @@ void hero_l13_decide_state_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); anim = hero_get_weapon_or_form_id(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -2426,7 +2426,7 @@ void hero_l13_decide_state_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); } break; case 0x22: @@ -2436,12 +2436,12 @@ void hero_l13_decide_state_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_l13_change_action_us2(7, 1); + hero_l13_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_l13_change_action_us2(0, 0); + hero_l13_set_move_state_us2(0, 0); } break; default: diff --git a/src/us2/levels/shared/L13_003C6DC0.c b/src/us2/levels/shared/L13_003C6DC0.c index fa567dcd9..228a35ed6 100644 --- a/src/us2/levels/shared/L13_003C6DC0.c +++ b/src/us2/levels/shared/L13_003C6DC0.c @@ -10,7 +10,7 @@ extern int IsPointInCuboid(void *, int); extern int flag_set_first_pending(char *); extern void cam_lock_entry(int); extern int ForceClaimNotice(int, int, int); -extern int hero_l13_change_action_us2(int, int); +extern int hero_l13_set_move_state_us2(int, int); extern float FastAddRotations(float, float); /* State 0 opens the trigger; state 1 reacts to the hero being on the object, or being in state @@ -49,7 +49,7 @@ void l13_pulse_trigger_update_us2(char *obj) if (*(int *)(other + 0x2294) == 0x82) { level = *(int *)(rig + 8); if (level >= 0 && IsPointInCuboid(other + 0x80, level) != 0) - hero_l13_change_action_us2(6, 1); + hero_l13_set_move_state_us2(6, 1); } } break; diff --git a/src/us2/levels/shared/L18_002D0050-qcopy.c b/src/us2/levels/shared/L18_002D0050-qcopy.c index 003673c56..ed6527e88 100644 --- a/src/us2/levels/shared/L18_002D0050-qcopy.c +++ b/src/us2/levels/shared/L18_002D0050-qcopy.c @@ -4,7 +4,7 @@ extern void hero_clear_tracked_slots(void); extern void attachment_reset_all(void); extern void hero_clear_queued_anim(void); -extern s32 hero_l18_set_action_us2(s32, s32); +extern s32 hero_l18_set_move_state_us2(s32, s32); extern u8 g_hero_state[]; extern u8 g_hero_state[]; extern u8 g_anim_entry_table_a[], g_anim_entry_table_b[]; @@ -78,7 +78,7 @@ void hero_detach_from_object_us2(s32 keep) goto done; } reset: - hero_l18_set_action_us2(0, 1); + hero_l18_set_move_state_us2(0, 1); done: if (g_hero_state[0x22B4] == 4) cam_reset_default(); } diff --git a/src/us2/levels/shared/L18_004290D0-update-g8.c b/src/us2/levels/shared/L18_004290D0-update-g8.c index 412977c7d..8135fb57a 100644 --- a/src/us2/levels/shared/L18_004290D0-update-g8.c +++ b/src/us2/levels/shared/L18_004290D0-update-g8.c @@ -49,7 +49,7 @@ extern void level_store_value_pair_us2(int,int); extern void SetCamera5Pose(void *,void *,int,int,int); extern void object_copy_vector_to_selected(void *); extern void cam_set_state_rotation(void *); -extern s32 hero_l18_set_action_us2(int,int); +extern s32 hero_l18_set_move_state_us2(int,int); extern float vec_distance_xy(void *,void *); extern void moby_set_flag_bit(void *,int); extern void moby_start_or_forward_anim(void *,int,int,float); @@ -102,7 +102,7 @@ void receiver_bot_update_targeting_us2(u8 *o) { object_copy_vector_to_selected(&g_camera_l18_position); cam_set_state_rotation(g_camera_l18_position.b+0x10); if (g_hero_state.i[0x2294/4] == 1 || g_hero_state.i[0x2294/4] == 29) - hero_l18_set_action_us2(0, 1); + hero_l18_set_move_state_us2(0, 1); g_hero_state.h[0x1E0/2] = 20; s->f[0x3B8/4] = (vec_distance_xy(o+0x10,&g_camera_l18_position)-g_receiver_targeting_distance) / g_receiver_targeting_frames; if (g_statistics_table.uh[0x294/2] < 65535) diff --git a/src/us2/levels/shared/L22_002C9B20-sw.c b/src/us2/levels/shared/L22_002C9B20-sw.c index ebabdd35c..79dd56ddd 100644 --- a/src/us2/levels/shared/L22_002C9B20-sw.c +++ b/src/us2/levels/shared/L22_002C9B20-sw.c @@ -71,8 +71,8 @@ extern int hero_classify_input_direction(void); extern void hero_select_anim_frame(s32, s32); extern f32 cam_get_view_space_vector_length(char *); extern void cam_set_view_space_height(V4_F6a70b950 *, V4_F6a70b950 *, float); -extern int queue_copy_record_by_index(unsigned int); -extern void slot_clear_active_bytes(void); +extern int actuator_play_pattern(unsigned int); +extern void actuator_stop_all(void); extern void level_init_pending_slot(void *, char *); extern void level_append_record_to_table(List_F66766f2b *, int, int, float); extern void level_release_slot_list(Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *); @@ -140,7 +140,7 @@ typedef union { u8 b[0x2600]; s16 h[0x1300]; u16 uh[0x1300]; s32 i[0x980]; u32 u #define COPY_VECTOR(dst,src) (*(TI128 *)VEC(dst) = *(TI128 *)VEC(src)) /* Changes the player's action, initializes its movement parameters and selects animation. */ -s32 hero_set_action_us2(s32 action, s32 animate) { +s32 hero_l22_set_move_state_us2(s32 action, s32 animate) { f32 dir[4]; f32 pos[4]; u8 *object_snapshot; @@ -189,7 +189,9 @@ s32 hero_set_action_us2(s32 action, s32 animate) { HALF(0x2504) = 0; level_release_slot_list((Rac2Native_5b4b17178a13f443_SmallSlotReset128Owner *)VEC(0x18E0)); } - if (SHORT(0x1FA) == 0) slot_clear_active_bytes(); + /* A change of action stops the vibration, but not while 0x1FA counts down: the 50 ticks + * after the wrench slam's rumble starts as it strikes the ground. */ + if (SHORT(0x1FA) == 0) actuator_stop_all(); hero_create_item_slot_objects(WORD(0x22A0), WORD(0x2294)); WORD(0x1188) = 0; switch (action) { @@ -202,8 +204,8 @@ s32 hero_set_action_us2(s32 action, s32 animate) { hero_clear_slot_records(); if (BYTE(0x22B4)) { text_play_mode_message(0); return 1; } COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_set_action_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_set_action_us2(0x76, 1); return 0; } + if (BYTE(0x1492) && vec_length_xy(VEC(0x160)) > 0.00833333377f) { hero_l22_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; if (!animate) goto finish; if (shop_get_entry_for_state(0) == 0x51) set_hero_animation(shop_get_entry_for_state(0), 0, 18.0f); else set_hero_animation(shop_get_entry_for_state(0), 0, -1.0f); @@ -350,7 +352,7 @@ s32 hero_set_action_us2(s32 action, s32 animate) { (WORD(0x22A4) == 4 || WORD(0x22A0) == 3 || WORD(0x22AC) == 3)) REAL(0x1B4) = 0; WORD(0x1188) = 0x68; if (BYTE(0x149A)) { - if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_set_action_us2(0x76, 1); return 0; } + if (SHORT(0x34C) == 0 || REAL(0x31C) < 0.3f) { hero_l22_set_move_state_us2(0x76, 1); return 0; } } if (BYTE(0x1492) || WORD(0x2294) == 0x2E) { if (REAL(0x1B4) > 0.128333330f) REAL(0x1B4) = 0.128333330f; @@ -396,12 +398,12 @@ s32 hero_set_action_us2(s32 action, s32 animate) { case 3: WORD(0x229C) = 1; BITS(0x24A0) = 0; COPY_VECTOR(0x160, 0x120); - if (BYTE(0x1492)) { hero_set_action_us2(0x2E, 1); return 0; } - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_set_action_us2(0x76, 1); return 0; } + if (BYTE(0x1492)) { hero_l22_set_move_state_us2(0x2E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state_us2(0x76, 1); return 0; } if (hero_try_start_grab()) return 0; if (shop_get_entry_for_state(0) == 0x51) { if (!animate) goto finish; - if (hero_set_action_us2(0, 0)) set_hero_animation(shop_get_entry_for_state(0), 0, 18.0f); + if (hero_l22_set_move_state_us2(0, 0)) set_hero_animation(shop_get_entry_for_state(0), 0, 18.0f); return 0; } if (!animate) goto finish; @@ -426,7 +428,7 @@ s32 hero_set_action_us2(s32 action, s32 animate) { WORD(0x229C) = 12; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (REAL(0x1B4) > 0.11666667461395264f) REAL(0x1B4) = 0.11666667461395264f; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_set_action_us2(0x76, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state_us2(0x76, 1); return 0; } WORD(0x1188) = 0x68; COPY_VECTOR(0x160, 0x120); vec_clamp_length((float *)VEC(0x160), 0.11666667461395264f); @@ -605,13 +607,13 @@ s32 hero_set_action_us2(s32 action, s32 animate) { case 0x6E: case 0x81: case 0x89: case 0x92: if (WORD(0x2294) != 0x81 && PTR(0x33C) && (*(s16 *)(PTR(0x33C) + 0xAA) == 0x9B9 || *(s16 *)(PTR(0x33C) + 0xAA) == 0xF05)) { - hero_set_action_us2(0x81, 1); return 0; + hero_l22_set_move_state_us2(0x81, 1); return 0; } if (WORD(0x2294) != 0x6E && SHORT(0x348) == 1 && action != 0xE && - action != 0x38 && !g_hero_flag_b) { hero_set_action_us2(0x6E, 1); return 0; } + action != 0x38 && !g_hero_flag_b) { hero_l22_set_move_state_us2(0x6E, 1); return 0; } if (WORD(0x22A0) == 0x11 && !BYTE(0x24DA)) BYTE(0x24DB)++; else BYTE(0x24DB) = 0; - if (SHORT(0x1F2)) { hero_set_action_us2(0x82, 1); return 0; } + if (SHORT(0x1F2)) { hero_l22_set_move_state_us2(0x82, 1); return 0; } if (SHORT(0x212)) { WORD(0x2294) = WORD(0x22A0); WORD(0x2298) = old_step; WORD(0x1B8) = WORD(0x22A8); return 0; @@ -686,9 +688,9 @@ s32 hero_set_action_us2(s32 action, s32 animate) { if (WORD(0x22A0) == 0x38 || WORD(0x22AC) == 0x38 || WORD(0x24CC) == 0) { WORD(0x18C0)++; if (WORD(0x18C0) > 2 || WORD(0x24CC) == 0) { - if (g_current_map_index == 2 && g_hero_map_event_flag) hero_set_action_us2(0x7D, 1); - else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_set_action_us2(0x79, 1); - else hero_set_action_us2(0x39, 1); + if (g_current_map_index == 2 && g_hero_map_event_flag) hero_l22_set_move_state_us2(0x7D, 1); + else if (*(s32 *)(*(u8 **)(PTR(0x2290) + 0x24) + 0x1F0) != 0) hero_l22_set_move_state_us2(0x79, 1); + else hero_l22_set_move_state_us2(0x39, 1); return 0; } } else WORD(0x18C0) = 0; @@ -743,7 +745,7 @@ s32 hero_set_action_us2(s32 action, s32 animate) { REAL(0x4C8) = 18.0f; SHORT(0x4AC) = 5; REAL(0x4B8) = 0.8f; REAL(0x4CC) = 30.0f; REAL(0x4D0) = 11.0f; REAL(0x4A8) = 1.5f; REAL(0x50C) = 1.55f; REAL(0x508) = 1.5f; HALF(0x518) = 1; - queue_copy_record_by_index(20); + actuator_play_pattern(20); REAL(0x50C) = 0.9f; REAL(0x4A8) = 0.4f; REAL(0x508) = 0.4f; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -772,7 +774,7 @@ s32 hero_set_action_us2(s32 action, s32 animate) { REAL(0x4C8) = 12.0f; REAL(0x4CC) = 20.0f; REAL(0x4D0) = 10.0f; HALF(0x518) = 12; if (BYTE(0x24DA)) { REAL(0x498) = 0.081666670739650726f; REAL(0x50C) = 3.35f; REAL(0x508) = 3.3f; } else { REAL(0x498) = 0.028333336114883423f; REAL(0x50C) = 1.85f; REAL(0x508) = 1.8f; } - BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); queue_copy_record_by_index(27); + BYTE(0x49F) = 1; REAL(0x4A8) = REAL(0x508); actuator_play_pattern(27); HALF(0x52A) = 80; REAL(0x520) = 0.008055555634f; COPY_VECTOR(0x4F0, 0x4E0); HALF(0x24D8) = 1; BYTE(0x22B7) = 1; BYTE(0x52C) = 1; @@ -781,7 +783,7 @@ s32 hero_set_action_us2(s32 action, s32 animate) { REAL(0x4A8) = 4.0f; REAL(0x4C8) = 26.0f; SHORT(0x4AC) = 9; REAL(0x4CC) = 38.0f; REAL(0x4D0) = 18.0f; REAL(0x50C) = 4.07f; REAL(0x4B8) = 0.6f; REAL(0x508) = 4.0f; HALF(0x518) = 14; - queue_copy_record_by_index(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; + actuator_play_pattern(20); REAL(0x510) = 4.5f; HALF(0x51A) = 120; REAL(0x4A4) = 0.031666666269302368f; HALF(0x526) = 37; if (REAL(0x184) < 0.3333333433f) { level_init_pending_slot(PTR(0x2290), (char *)VEC(0x18E0)); @@ -924,7 +926,7 @@ s32 hero_set_action_us2(s32 action, s32 animate) { goto finish; case 0x1F: if (WORD(0x1220)) { - queue_copy_record_by_index(19); + actuator_play_pattern(19); if (animate) { set_hero_animation(0x60, 4, -1.0f); anim_start_blended(PTR(0x1220), 3, 4, -1); @@ -1015,7 +1017,7 @@ s32 hero_set_action_us2(s32 action, s32 animate) { frames = 8.0f; animation_43 = 0x29; { set_hero_animation(animation_43, 5, frames); goto finish; } case 0x16: WORD(0x229C) = 7; BITS(0x24A0) = 0; - hero_scale_saved_vectors(0.5f); queue_copy_record_by_index(18); HALF(0x20E) = 45; + hero_scale_saved_vectors(0.5f); actuator_play_pattern(18); HALF(0x20E) = 45; COPY_VECTOR(0xF0, 0x120); vec_clamp_length((f32 *)VEC(0xF0), 0.1166666746f); hit_44 = part_find_owned_effect_slot(PTR(0x2290), 1, 0); if (hit_44) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_44 + 0x2C))); @@ -1027,7 +1029,7 @@ s32 hero_set_action_us2(s32 action, s32 animate) { goto finish; case 0x8C: WORD(0x229C) = 7; BITS(0x24A0) = 0; hero_scale_saved_vectors(0.5f); - BYTE(0x22BC) = 1; queue_copy_record_by_index(18); + BYTE(0x22BC) = 1; actuator_play_pattern(18); hit_45 = part_find_owned_effect_slot(PTR(0x2290), 8, 0); if (hit_45) AdjustPlayerHealth_us2(FloatToInt(*(f32 *)(hit_45 + 0x2C))); else AdjustPlayerHealth_us2(1); @@ -1062,7 +1064,7 @@ s32 hero_set_action_us2(s32 action, s32 animate) { set_hero_animation(0x11, 0, 8.0f); goto finish; case 0x3F: WORD(0x229C) = 0; BITS(0x24A0) = 0; - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_set_action_us2(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state_us2(0x4E, 1); return 0; } if (!animate) goto finish; set_hero_animation(0, 0, 9.0f); goto finish; case 0x4B: @@ -1096,7 +1098,7 @@ s32 hero_set_action_us2(s32 action, s32 animate) { *(f32 *)(PTR(0x2290) + 0x44) = g_hero_l22_action_float_table[WORD(0xC30)][WORD(0xC34)++]; goto finish; case 0x40: - if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_set_action_us2(0x4E, 1); return 0; } + if (BYTE(0x149A) && SHORT(0x34C) == 0) { hero_l22_set_move_state_us2(0x4E, 1); return 0; } WORD(0x229C) = 1; BITS(0x24A0) = 0; REAL(0x1B4) = vec_length_xy(VEC(0x120)); if (WORD(0x22A0) == 3) BITS(0x1B4) = 0; @@ -1181,7 +1183,7 @@ s32 hero_set_action_us2(s32 action, s32 animate) { REAL(0x120) = math_fast_sin_or_cos_a(angle_53) * REAL(0x644) * 0.7f; REAL(0x124) = math_fast_sin_or_cos_b(angle_53) * REAL(0x644) * 0.7f; REAL(0x128) = 0.075f; if (WORD(0x640) > 15 && WORD(0x24CC) < 2) WORD(0x24CC) = 2; - PTR(0x2290)[0xA8] = 255; hero_set_action_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; + PTR(0x2290)[0xA8] = 255; hero_l22_set_move_state_us2(0x16, 1); HALF(0x1F4) = 150; HALF(0x1D0) = 70; return 0; } HALF(0x1DC) = 77; REAL(0x69C) = 0.041666667908430099f; diff --git a/src/us2/levels/shared/L22_002D0F48-sw.c b/src/us2/levels/shared/L22_002D0F48-sw.c index 31fd30001..45e059ced 100644 --- a/src/us2/levels/shared/L22_002D0F48-sw.c +++ b/src/us2/levels/shared/L22_002D0F48-sw.c @@ -78,7 +78,7 @@ void hero_resolve_stick_direction(s32, f32); void hero_update_target_speed(void); s32 hero_play_sound(s32 index, s32 flags); s32 hero_get_step_offset_from_direction(void); -s32 hero_set_action_us2(s32, s32); +s32 hero_l22_set_move_state_us2(s32, s32); void text_play_mode_message(s32 a0); s32 hero_try_start_transition(void); s32 hero_try_start_ledge_move(void); @@ -162,7 +162,7 @@ void hero_action_state_update_us2(void) { UpdateHeroHeldTarget(); if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if ((FLD(g_hero_state, u32, 0x2294) == 0) || (FLD(g_hero_state, u32, 0x2294) == 2)) { - hero_set_action_us2(0x39, 1); + hero_l22_set_move_state_us2(0x39, 1); goto end; } } @@ -197,7 +197,7 @@ void hero_action_state_update_us2(void) { hero_apply_pending_change(); if (FLD(g_hero_state, f32, 0x88) < g_hero_l22_speed_threshold) { if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x22B4) != 2) && (FLD(g_hero_state, u32, 0x2294) != 0x74)) { - hero_set_action_us2(0x74, 1); + hero_l22_set_move_state_us2(0x74, 1); goto end; } } @@ -208,12 +208,12 @@ void hero_action_state_update_us2(void) { s32 anim; u8 *obj; if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_set_action_us2(1, 1); + hero_l22_set_move_state_us2(1, 1); break; } hero_clear_queued_anim(); if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_set_action_us2(0x82, 1); + hero_l22_set_move_state_us2(0x82, 1); break; } notcrouch = FLD(g_hero_state, u8, 0x1492) == 0; @@ -250,7 +250,7 @@ void hero_action_state_update_us2(void) { rec = g_hero_action_records + idle_anim_index * 0x70; FLD(rec, s32, 0x60) = FLD(rec, f32, 0x5C) * 60.0f; if (FLD(rec, s32, 0x44) != 0) { - hero_set_action_us2(0x3C, 1); + hero_l22_set_move_state_us2(0x3C, 1); } else { set_hero_animation(FLD(rec, s32, 0x48), 0, 12.0f); } @@ -293,12 +293,12 @@ void hero_action_state_update_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_set_action_us2(0x76, 1); + hero_l22_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 0.4f)) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); } break; } @@ -319,21 +319,21 @@ void hero_action_state_update_us2(void) { } } if ((FLD(g_hero_state, s16, 0x348) == 1) && (g_hero_flag_b == 0) && (PadPressedWithin(0x40, 7, NULL) != 0)) { - hero_set_action_us2(0x6E, 1); + hero_l22_set_move_state_us2(0x6E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 8) && (FLD(g_hero_state, s32, 0x340) != 0)) { if ((FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 0x1A) || (FLD(g_hero_state, f32, 0xC38) >= 108.0f)) { - hero_set_action_us2(4, 1); + hero_l22_set_move_state_us2(4, 1); break; } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_set_action_us2(0x27, 1); + hero_l22_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, f32, 0x320) > 0.087266475f)) { - hero_set_action_us2(0x2E, 1); + hero_l22_set_move_state_us2(0x2E, 1); break; } { @@ -353,28 +353,28 @@ void hero_action_state_update_us2(void) { s32 side = FLD(g_hero_state, u8, 0x149D); hero_play_footstep_sound_dust(side, 0, 0, 0x1E); hero_play_footstep_sound_dust(side, 1, 0, 0x1E); - hero_set_action_us2(2, 1); + hero_l22_set_move_state_us2(2, 1); } } break; } case 0x3C: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_set_action_us2(1, 1); + hero_l22_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) || ((pad_held = FLD(g_pad_state, s32, 0x1A0)) & 0x40) || (pad_held & 8)) { - hero_set_action_us2(0x3D, 1); + hero_l22_set_move_state_us2(0x3D, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_set_action_us2(0x3D, 1); + hero_l22_set_move_state_us2(0x3D, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { hero_clear_target_flags(); - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); } break; case 0x3D: @@ -383,22 +383,22 @@ void hero_action_state_update_us2(void) { } hero_clear_target_flags(); if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); break; } if (hero_try_start_move_from_buffer(7, 0) != 0) { break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_set_action_us2(4, 1); + hero_l22_set_move_state_us2(4, 1); break; } hero_update_target_speed(); if (FLD(g_hero_state, f32, 0x1B0) > 0.0f) { - hero_set_action_us2(2, 1); + hero_l22_set_move_state_us2(2, 1); break; } - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); break; case 0x39: case 0x43: @@ -437,25 +437,25 @@ void hero_action_state_update_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if ((FLD(g_hero_state, u32, 0x2294) == st) && !(FLD(g_pad_state, s32, 0x1A0) & 0xC0) && ((h = FLD(g_hero_state, f32, 0xC38)) > 9.0f) && (h < 19.0f) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) < 0.033333335f)) { - hero_set_action_us2(0x33, 1); + hero_l22_set_move_state_us2(0x33, 1); break; } } if ((FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0xA)) { if ((FLD(g_hero_state, u32, 0x2294) == 0x32) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_set_action_us2(0x34, 1); + hero_l22_set_move_state_us2(0x34, 1); break; } } else if (FLD(g_hero_state, u32, 0x2294) == 0x34) { if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_set_action_us2(0x32, 1); + hero_l22_set_move_state_us2(0x32, 1); break; } } if (FLD(g_hero_state, u32, 0x2294) == 0x34) { s32 pad = FLD(g_pad_state, s32, 0x1A0); if (!(pad & 0xC0) && (FLD(g_hero_state, s32, 0x2298) != 1) && (FLD(g_hero_state, f32, 0x24B8) < 0.7f) && !(pad & 0xA)) { - hero_set_action_us2(0x33, 1); + hero_l22_set_move_state_us2(0x33, 1); } } break; @@ -468,81 +468,81 @@ void hero_action_state_update_us2(void) { } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) || ((pad = FLD(g_pad_state, s32, 0x1A0)) & 0xC0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (pad & 0xA))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_set_action_us2(0x32, 1); + hero_l22_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_set_action_us2(0x34, 1); + hero_l22_set_move_state_us2(0x34, 1); } else { - hero_set_action_us2(0x32, 1); + hero_l22_set_move_state_us2(0x32, 1); } } break; } case 0x36: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_set_action_us2(0x12, 1); + hero_l22_set_move_state_us2(0x12, 1); break; } FLD(g_hero_state, u8, 0x22B7) = 1; if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0)) { if ((PadPressedWithin(0x80, 7, NULL) != 0) || ((FLD(g_hero_state, s16, 0x24FC) == 0) && (PadPressedWithin(0xA, 7, NULL) != 0))) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_set_action_us2(0x32, 1); + hero_l22_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_set_action_us2(0x34, 1); + hero_l22_set_move_state_us2(0x34, 1); } else { - hero_set_action_us2(0x32, 1); + hero_l22_set_move_state_us2(0x32, 1); } break; } } - if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_set_action_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.4f) && (hero_l22_set_move_state_us2(0, 0) != 0)) { set_hero_animation(shop_get_entry_for_state(0), 0, 18.0f); } if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, s32, 0x1B8) >= 0xB)) { - hero_set_action_us2(0x35, 1); + hero_l22_set_move_state_us2(0x35, 1); } break; case 0x35: if ((FLD(g_hero_state, s16, 0x1F8) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0)) { - hero_set_action_us2(0x12, 1); + hero_l22_set_move_state_us2(0x12, 1); break; } if ((FLD(g_hero_state, s16, 0x1FE) == 0) && (FLD(FLD(FLD(g_hero_state, u8 *, 0x2290), u8 *, 0x24), s32, 0x134) != 0) && (PadPressedWithin(0x80, 7, NULL) != 0)) { if (FLD(g_hero_state, s16, 0x24FC) != 0) { - hero_set_action_us2(0x32, 1); + hero_l22_set_move_state_us2(0x32, 1); } else if (FLD(g_pad_state, s32, 0x1A0) & 0xA) { - hero_set_action_us2(0x34, 1); + hero_l22_set_move_state_us2(0x34, 1); } else { - hero_set_action_us2(0x32, 1); + hero_l22_set_move_state_us2(0x32, 1); } break; } if ((FLD(g_hero_state, u8, 0x22B9) != 0) && (FLD(g_hero_state, f32, 0x24C4) < 0.7f)) { - hero_set_action_us2(0x70, 0); + hero_l22_set_move_state_us2(0x70, 0); set_hero_animation(0x59, 0, 17.0f); FLD(g_hero_state, s32, 0xF8) = 0; FLD(g_hero_state, s32, 0x118) = 0; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.1f) && (FLD(g_hero_state, f32, 0x1B4) == 0.0f) && (FLD(g_hero_state, s32, 0x798) == 0)) { - hero_set_action_us2(0x36, 1); + hero_l22_set_move_state_us2(0x36, 1); } break; case 0x73: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_set_action_us2(0x67, 1); + hero_l22_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x28, 18.0f); } else if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_action_us2(0x33, 1); + hero_l22_set_move_state_us2(0x33, 1); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_set_action_us2(0x33, 0); + hero_l22_set_move_state_us2(0x33, 0); } break; case 0x72: if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_set_action_us2(0x67, 1); + hero_l22_set_move_state_us2(0x67, 1); set_hero_animation(0x58, 0x25, 18.0f); } else if (FLD(g_hero_state, s32, 0x1B8) >= 0x33) { - hero_set_action_us2(0x36, 0); + hero_l22_set_move_state_us2(0x36, 0); } break; case 0x1: @@ -576,9 +576,9 @@ void hero_action_state_update_us2(void) { if (FLD(g_hero_state, u8, 0x22B4) != 0) { text_play_mode_message(0); } else if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_set_action_us2(4, 1); + hero_l22_set_move_state_us2(4, 1); } else { - hero_set_action_us2(0, 0); + hero_l22_set_move_state_us2(0, 0); anim = shop_get_entry_for_state(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -590,9 +590,9 @@ void hero_action_state_update_us2(void) { case 0x2F: if (!(FLD(g_pad_state, s32, 0x1A0) & FLD(g_hero_state, s32, 0x1230)) && (FLD(g_hero_state, s16, 0x1EC) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x36) { - hero_set_action_us2(0, 0); + hero_l22_set_move_state_us2(0, 0); } else { - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); } } break; @@ -625,7 +625,7 @@ void hero_action_state_update_us2(void) { } if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_set_action_us2(7, 1); + hero_l22_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -634,7 +634,7 @@ void hero_action_state_update_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38))) { - hero_set_action_us2(0, 0); + hero_l22_set_move_state_us2(0, 0); } break; } @@ -656,7 +656,7 @@ void hero_action_state_update_us2(void) { if ((st != 0x15) || (FLD(g_hero_state, s16, 0x348) != 1)) { if (PadPressedWithin(0x40, frames, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_set_action_us2(7, 1); + hero_l22_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -669,7 +669,7 @@ void hero_action_state_update_us2(void) { goto tail13; } if ((FLD(g_hero_state, f32, 0xC38) > 34.0f) && (FLD(g_hero_state, f32, 0x24B8) > 0.9f)) { - hero_set_action_us2(2, 0); + hero_l22_set_move_state_us2(2, 0); set_hero_animation(3, g_hero_l22_animation_ids[FLD(g_hero_state, s32, 0x2298)], 13.0f); break; } @@ -680,22 +680,22 @@ void hero_action_state_update_us2(void) { h = FLD(g_hero_state, f32, 0xC38); if ((f32)lim < h) { if (FLD(g_hero_state, f32, 0x24B8) > 0.8f) { - hero_set_action_us2(2, 1); + hero_l22_set_move_state_us2(2, 1); break; } if ((f32)(lim + 5) < h) { - hero_set_action_us2(0, 0); + hero_l22_set_move_state_us2(0, 0); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_action_us2(0, 0); + hero_l22_set_move_state_us2(0, 0); } break; } tail13: if (FLD(g_hero_state, u32, 0x2294) == 0x15) { if (FLD(g_hero_state, s32, 0x1248) != 0xA) { - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x65) && (FLD(g_hero_state, s32, 0xC44) < 0x1A)) { @@ -712,7 +712,7 @@ void hero_action_state_update_us2(void) { } if (PadPressedWithin(0x40, 7, NULL) != 0) { if (!(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_set_action_us2(7, 1); + hero_l22_set_move_state_us2(7, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { @@ -721,7 +721,7 @@ void hero_action_state_update_us2(void) { } } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 37.0f)) { - hero_set_action_us2(0, 0); + hero_l22_set_move_state_us2(0, 0); set_hero_animation(shop_get_entry_for_state(0), 0, 15.0f); break; } @@ -733,7 +733,7 @@ void hero_action_state_update_us2(void) { break; case 0x77: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); } break; case 0x2: @@ -747,11 +747,11 @@ void hero_action_state_update_us2(void) { FLD(g_hero_state, u8, 0x40E) = 0; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_set_action_us2(0x76, 1); + hero_l22_set_move_state_us2(0x76, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, s32, 0x22A4) != 0x12) || (FLD(g_hero_state, u8, 0x22B9) == 0)) && (FLD(g_hero_state, f32, 0x31C) > 1.35f) && (hero_check_step_ahead() == 0)) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); break; } n = 9; @@ -765,12 +765,12 @@ void hero_action_state_update_us2(void) { } if (FLD(g_hero_state, f32, 0x24B8) > 0.85f) { if (FLD(g_hero_state, s16, 0x1454) == 0) { - hero_set_action_us2(9, 1); + hero_l22_set_move_state_us2(9, 1); } else { - hero_set_action_us2(7, 1); + hero_l22_set_move_state_us2(7, 1); } } else { - hero_set_action_us2(7, 1); + hero_l22_set_move_state_us2(7, 1); } break; } @@ -778,11 +778,11 @@ void hero_action_state_update_us2(void) { break; } if (((FLD(g_hero_state, u8, 0x1492) == 0) || ((FLD(g_hero_state, f32, 0x174) < 0.033333335f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f))) && (FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_set_action_us2(1, 1); + hero_l22_set_move_state_us2(1, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_set_action_us2(4, 1); + hero_l22_set_move_state_us2(4, 1); break; } if ((FLD(g_hero_state, u8, 0x1492) != 0) && (FLD(g_hero_state, u32, 0x2294) == 0x2E)) { @@ -799,25 +799,25 @@ void hero_action_state_update_us2(void) { st = FLD(g_hero_state, u32, 0x2294); if ((st == 2) || (st == 0x7B)) { if (FLD(g_hero_state, u8, 0x1492) != 0) { - hero_set_action_us2(0x2E, 1); + hero_l22_set_move_state_us2(0x2E, 1); } } else if (st == 0x2E) { if (FLD(g_hero_state, u8, 0x1492) == 0) { - hero_set_action_us2(2, 1); + hero_l22_set_move_state_us2(2, 1); } } st = FLD(g_hero_state, u32, 0x2294); if (st == 2) { if (FLD(g_hero_state, u8, 0x22B9) != 0) { - hero_set_action_us2(0x70, 1); + hero_l22_set_move_state_us2(0x70, 1); } } else if (st == 0x70) { if (FLD(g_hero_state, u8, 0x22B9) == 0) { - hero_set_action_us2(2, 1); + hero_l22_set_move_state_us2(2, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_set_action_us2(0x27, 1); + hero_l22_set_move_state_us2(0x27, 1); break; } turned = hero_is_turned_past_angle(0.03490659f); @@ -828,7 +828,7 @@ void hero_action_state_update_us2(void) { if (hero_try_start_grab() != 0) { break; } - if (hero_set_action_us2(0, 0) == 0) { + if (hero_l22_set_move_state_us2(0, 0) == 0) { break; } vec_clamp_length(g_hero_state + 0x160, 0.025000002f); @@ -845,7 +845,7 @@ void hero_action_state_update_us2(void) { hero_update_anim_scale(); } } else if (st == 0x2E) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_set_action_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.0008333334f) && (FLD(g_hero_state, f32, 0x320) < 0.087266475f) && (hero_l22_set_move_state_us2(0, 0) != 0)) { set_hero_animation(shop_get_entry_for_state(0), 0, 17.0f); } if (FLD(hero_moby, u8, 0x43) == 0x37) { @@ -866,7 +866,7 @@ void hero_action_state_update_us2(void) { } } } else if (st == 0x70) { - if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_set_action_us2(0, 0) != 0)) { + if ((FLD(g_pad_state, s32, 0x1D4) != 0) && (vec_length_xy(g_hero_state + 0xF0) < 0.05333334f) && (hero_l22_set_move_state_us2(0, 0) != 0)) { set_hero_animation(shop_get_entry_for_state(0), 0, 17.0f); } FLD(g_hero_state, f32, 0xC20) = FLD(g_hero_state, f32, 0x170) * 35.0f; @@ -900,17 +900,17 @@ void hero_action_state_update_us2(void) { } hero_play_sound(9, 0); FLD(g_hero_state, s16, 0x1E0) = 0x1E; - hero_set_action_us2(3, 0); + hero_l22_set_move_state_us2(3, 0); set_hero_animation(6, 4, 11.0f); } else { if (FLD(g_hero_state, u8, 0x287) != 0) { f32 a = FastVecLength(g_hero_state + 0x110); if (a < FastVecLength(g_hero_state + 0xF0) * 0.75f) { - hero_set_action_us2(0x77, 1); + hero_l22_set_move_state_us2(0x77, 1); break; } if (hero_test_reach_blend(NULL, 1.0f, 1.25f) != 0) { - hero_set_action_us2(0x77, 1); + hero_l22_set_move_state_us2(0x77, 1); break; } } @@ -928,11 +928,11 @@ void hero_action_state_update_us2(void) { case 0x62: if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) < 0.2f) { if ((FLD(g_hero_state, f32, 0x170) < 0.045f) && (FastDiffRots(FLD(g_hero_state, f32, 0x98), FLD(g_hero_state, f32, 0x18AC)) < 0.03490659f)) { - hero_set_action_us2(0x64, 1); + hero_l22_set_move_state_us2(0x64, 1); break; } if ((FLD(g_hero_state, u8, 0x22B4) != 0) && (FLD(g_hero_state, f32, 0x170) >= 0.045f)) { - hero_set_action_us2(0x63, 1); + hero_l22_set_move_state_us2(0x63, 1); } } else { hero_update_anim_scale(); @@ -940,21 +940,21 @@ void hero_action_state_update_us2(void) { break; case 0x63: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_action_us2(0x62, 1); + hero_l22_set_move_state_us2(0x62, 1); } break; case 0x64: if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, s32, 0x18B0) != 0)) { - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); } if (vec_distance_xy(g_hero_state + 0x80, g_hero_state + 0x18A0) > 0.2f) { - hero_set_action_us2(0x62, 1); + hero_l22_set_move_state_us2(0x62, 1); } break; case 0x65: /* switch 2 */ jump_count = FLD(g_hero_state, s32, 0x18C0); if ((jump_count < 3) && (((jump_count * 7) + 0xA) < FLD(g_hero_state, s32, 0x1B8)) && (PadPressedWithin(0x40U, 7, &press_time) != 0)) { - hero_set_action_us2(0x66, 1); + hero_l22_set_move_state_us2(0x66, 1); } if (FLD(g_hero_state, f32, 0x88) < (FLD(g_hero_state, f32, 0x334) - 1.2f)) { hero_record_play_counters(); @@ -997,7 +997,7 @@ void hero_action_state_update_us2(void) { return; case 0x6D: if ((f32)g_hero_anim_records[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); } break; case 0x30: @@ -1010,7 +1010,7 @@ void hero_action_state_update_us2(void) { } } FLD(g_hero_state, s32, 0x2434) = -1; - if (hero_set_action_us2(0, 0) != 0) { + if (hero_l22_set_move_state_us2(0, 0) != 0) { set_hero_animation(shop_get_entry_for_state(0), 0, 17.0f); FLD(g_hero_state, s128, 0x160) = FLD(g_hero_state, s128, 0x150); } @@ -1018,29 +1018,29 @@ void hero_action_state_update_us2(void) { break; case 0x3: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_set_action_us2(1, 1); + hero_l22_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x1E0) == 0) { if (FLD(g_pad_state, s32, 0x1A4) & 0x40) { - hero_set_action_us2(7, 1); + hero_l22_set_move_state_us2(7, 1); break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_set_action_us2(4, 1); + hero_l22_set_move_state_us2(4, 1); break; } } if ((FLD(g_hero_state, s16, 0x34E) >= 9) && (FLD(g_hero_state, f32, 0x31C) > 0.3f)) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_set_action_us2(0x27, 1); + hero_l22_set_move_state_us2(0x27, 1); break; } if (!(FLD(g_hero_state, f32, 0x24B8) > 0.2f) || (FLD(g_hero_state, s16, 0x1E0) != 0)) { @@ -1048,45 +1048,45 @@ void hero_action_state_update_us2(void) { } if (shop_get_entry_for_state(0) != 0x51) { if (FLD(g_hero_state, f32, 0x1B4) == 0.0f) { - hero_set_action_us2(0, 0); + hero_l22_set_move_state_us2(0, 0); break; } - } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_set_action_us2(0, 0) != 0)) { + } else if ((FLD(g_hero_state, f32, 0xC38) > 10.0f) && (hero_l22_set_move_state_us2(0, 0) != 0)) { set_hero_animation(shop_get_entry_for_state(0), 0, 17.0f); } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { - hero_set_action_us2(2, 1); + hero_l22_set_move_state_us2(2, 1); } break; case 0x4: if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_set_action_us2(1, 1); + hero_l22_set_move_state_us2(1, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0xC) && !(FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_set_action_us2(0, 0); + hero_l22_set_move_state_us2(0, 0); set_hero_animation(shop_get_entry_for_state(0), 0, -2.0f); break; } if ((FLD(g_hero_state, u8, 0x149A) != 0) && (FLD(g_hero_state, s16, 0x34C) == 0)) { - hero_set_action_us2(0x76, 1); + hero_l22_set_move_state_us2(0x76, 1); break; } if (hero_choose_jump_or_roll_move() != 0) { break; } if ((PadPressedWithin(0x80, 0xF, NULL) != 0) && (FLD(g_hero_state, u8, 0x123A) == 0) && (FLD(g_hero_state, s32, 0x1248) == 0xA)) { - hero_set_action_us2(0x15, 1); + hero_l22_set_move_state_us2(0x15, 1); } if (FLD(g_hero_state, s16, 0x34E) >= 9) { if ((FLD(g_hero_state, s32, 0x22A0) != 8) || (FLD(g_hero_state, s32, 0x1B8) >= 0xF)) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); } } break; case 0x8A: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); break; } if (FLD(g_hero_state, s32, 0xB1C) != 0) { @@ -1094,17 +1094,17 @@ void hero_action_state_update_us2(void) { if (obj != NULL) { moby_set_flag_bit(obj, 1); } - hero_set_action_us2(0x8B, 1); + hero_l22_set_move_state_us2(0x8B, 1); } break; case 0x8B: if (FLD(g_hero_state, s32, 0x1B8) >= 0x5B) { - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); } break; case 0x23: if (FLD(g_hero_state, s32, 0x1248) != 0xD) { - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); } break; case 0x24: @@ -1130,14 +1130,14 @@ void hero_action_state_update_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.3f) { - hero_set_action_us2(0, 0); + hero_l22_set_move_state_us2(0, 0); set_hero_animation(shop_get_entry_for_state(0), 0, 30.0f); break; } if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0xA) { - hero_set_action_us2(6, 0); + hero_l22_set_move_state_us2(6, 0); } else { - hero_set_action_us2(6, 0); + hero_l22_set_move_state_us2(6, 0); set_hero_animation(0xA, 0, 17.0f); } FLD(g_hero_state, f32, 0xA84) = 0.011666667f; @@ -1153,9 +1153,9 @@ void hero_action_state_update_us2(void) { FLD(g_hero_state, f32, 0x1B4) = 0.116666675f; } if (FLD(g_hero_state, f32, 0x31C) < 0.4f) { - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); } else { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); FLD(g_hero_state, s32, 0x24A0) = 0; } } @@ -1167,7 +1167,7 @@ void hero_action_state_update_us2(void) { if (t < 0x28) { FLD(g_hero_state, s32, 0xAC8) = 1; } - hero_set_action_us2(0x2C, 1); + hero_l22_set_move_state_us2(0x2C, 1); FLD(g_hero_state, f32, 0xA84) = 0.0019444445f; FLD(g_hero_state, f32, 0xA80) = 0.0075000003f; } @@ -1231,11 +1231,11 @@ void hero_action_state_update_us2(void) { if (((level == 0xD) || (level == 0x12)) && (clear == 0)) { vec_scale_to_length(g_hero_state + 0x120, g_hero_state + 0x10, 0.21666668f); FLD(g_hero_state, f32, 0x128) = 0.16666667f; - hero_set_action_us2(0x16, 1); + hero_l22_set_move_state_us2(0x16, 1); FLD(g_hero_state, s16, 0x1F4) = 0x46; FLD(g_hero_state, s16, 0x1D0) = 0x46; } else { - hero_set_action_us2(0x3E, 1); + hero_l22_set_move_state_us2(0x3E, 1); } break; } @@ -1248,7 +1248,7 @@ void hero_action_state_update_us2(void) { if (FLD(g_hero_state, s32, 0x688) != 0) { FLD(g_hero_state, s32, 0x690) = 1; } else { - hero_set_action_us2(0x28, 1); + hero_l22_set_move_state_us2(0x28, 1); } break; } @@ -1259,16 +1259,16 @@ void hero_action_state_update_us2(void) { } FLD(g_hero_state, s16, 0x1D0) = 0x46; if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_set_action_us2(0x74, 1); + hero_l22_set_move_state_us2(0x74, 1); } else { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; break; } if ((a == 0) && (b == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { - hero_set_action_us2(0x2A, 1); + hero_l22_set_move_state_us2(0x2A, 1); break; } if (FLD(g_hero_state, s32, 0x67C) == -1) { @@ -1285,7 +1285,7 @@ void hero_action_state_update_us2(void) { if ((FLD(g_hero_state, s16, 0x68C) != 0) && (FLD(g_hero_state, s32, 0x690) != 0)) { f32 h; f32 t; - hero_set_action_us2(0x28, 1); + hero_l22_set_move_state_us2(0x28, 1); FLD(g_hero_state, s32, 0x694) = 1; h = weapon_compute_shot_launch_speed((f32 *)(g_hero_state + 0x80), (f32 *)(g_hero_state + 0x620), NULL, FLD(g_hero_state, f32, 0x174), -FLD(g_hero_state, f32, 0x520)); *(s128 *)vec_b = 0; @@ -1302,7 +1302,7 @@ void hero_action_state_update_us2(void) { } else if (st == 0x2A) { s32 top; if ((PadPressedWithin(0x40, 5, NULL) != 0) && ((f32)g_hero_anim_records[FLD(g_hero_state, s16, 0xBFC)].w[5] <= FLD(g_hero_state, f32, 0xC38))) { - hero_set_action_us2(0x28, 1); + hero_l22_set_move_state_us2(0x28, 1); break; } top = 0xE; @@ -1311,19 +1311,19 @@ void hero_action_state_update_us2(void) { } if ((FLD(g_hero_state, s32, 0x640) == 0) && (FLD(g_hero_state, s32, 0x6C8) == 0) && (PadPressedWithin(0x80, 0xA, NULL) != 0)) { if ((f32)top < FLD(g_hero_state, f32, 0xC38)) { - hero_set_action_us2(0x2A, 1); + hero_l22_set_move_state_us2(0x2A, 1); } break; } if ((f32)g_hero_anim_records[FLD(g_hero_state, s16, 0xBFC)].w[6] < FLD(g_hero_state, f32, 0xC38)) { - hero_set_action_us2(0x27, 1); + hero_l22_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x6C8) >= 6)) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x31C) > 4.0f)) { - hero_set_action_us2(0x74, 1); + hero_l22_set_move_state_us2(0x74, 1); } else { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); } FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1332,11 +1332,11 @@ void hero_action_state_update_us2(void) { s32 lo; s32 now; if (((FLD(g_hero_state, s32, 0x640) >= 6) || (FLD(g_hero_state, s32, 0x694) != 0)) && (FLD(g_hero_state, s32, 0x63C) != 0) && ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.35f)) { - hero_set_action_us2(0x27, 1); + hero_l22_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x640) >= 6) && (g_current_map_index == 0x14)) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x28) && (FLD(g_hero_state, s32, 0x1B8) < 0xA) && (FLD(g_hero_state, u8, 0x49E) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s32, 0x660) == 0)) { @@ -1372,7 +1372,7 @@ void hero_action_state_update_us2(void) { find_nearest_path_point(rail_path, pos, g_hero_state + 0x5D0, (s32 *)(g_hero_state + 0x634), (f32 *)(g_hero_state + 0x638), rail_index, 999.0f, 2.0f, 0.0f); FLD(g_hero_state, s32, 0x660) = 1; FLD(g_hero_state, s32, 0x678) = 0; - hero_set_action_us2(0x29, 1); + hero_l22_set_move_state_us2(0x29, 1); break; } } @@ -1420,7 +1420,7 @@ void hero_action_state_update_us2(void) { } } if ((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < -2.5f) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1E0) = 0x46; FLD(g_hero_state, s16, 0x1F4) = 8; FLD(g_hero_state, s16, 0x1D0) = 0x46; @@ -1428,7 +1428,7 @@ void hero_action_state_update_us2(void) { } } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_set_action_us2(0x71, 1); + hero_l22_set_move_state_us2(0x71, 1); break; } { @@ -1440,7 +1440,7 @@ void hero_action_state_update_us2(void) { } } } - if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_set_action_us2(0, 0) != 0)) { + if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s16, 0x34E) == 0) && (hero_l22_set_move_state_us2(0, 0) != 0)) { set_hero_animation(0xC, 4, 6.0f); } } else if (st == 0x3E) { @@ -1449,17 +1449,17 @@ void hero_action_state_update_us2(void) { AdjustHeroAnimationSpeedForTargetFrame(9.0f, (f32)target_frame_b, 0.5f, -1.0f); } if ((FLD(g_hero_state, s32, 0x640) != 0) && (FLD(g_hero_state, s32, 0x340) != 0)) { - if (hero_set_action_us2(0, 0) != 0) { + if (hero_l22_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } break; } if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_action_us2(0x27, 1); + hero_l22_set_move_state_us2(0x27, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x10) && (FLD(g_hero_state, f32, 0xF8) < 0.0f) && (math_fabs(FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x5D8)) < 0.3f)) { - hero_set_action_us2(0x27, 1); + hero_l22_set_move_state_us2(0x27, 1); } } break; @@ -1475,13 +1475,13 @@ void hero_action_state_update_us2(void) { } } if (FLD(g_hero_state, s32, 0x6F0) >= 6) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x204) = 0x1E; } break; case 0x17: if (FLD(g_hero_state, f32, 0xC38) > 13.5f) { - hero_set_action_us2(0x18, 0); + hero_l22_set_move_state_us2(0x18, 0); } break; case 0x18: @@ -1490,18 +1490,18 @@ void hero_action_state_update_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if (hero_find_ledge_grab((s8 *)(g_hero_state + 0x80), (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A4) & 8)) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 0x11, NULL) != 0) { - hero_set_action_us2(0x1B, 1); + hero_l22_set_move_state_us2(0x1B, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -1510,7 +1510,7 @@ void hero_action_state_update_us2(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_set_action_us2(0x19, 1); + hero_l22_set_move_state_us2(0x19, 1); } break; } @@ -1521,7 +1521,7 @@ void hero_action_state_update_us2(void) { vec_a[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_a[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_set_action_us2(0x1A, 1); + hero_l22_set_move_state_us2(0x1A, 1); } } } @@ -1540,18 +1540,18 @@ void hero_action_state_update_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_action_us2(0x18, 1); + hero_l22_set_move_state_us2(0x18, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); FLD(g_hero_state, s8, 0x22BF) = 1; FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_set_action_us2(0x1B, 1); + hero_l22_set_move_state_us2(0x1B, 1); } break; } @@ -1561,9 +1561,9 @@ void hero_action_state_update_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); } else { - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); } } break; @@ -1587,12 +1587,12 @@ void hero_action_state_update_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_set_action_us2(0x39, 1); + hero_l22_set_move_state_us2(0x39, 1); } else { s32 one = 1; s32 low = FLD(g_hero_state, s32, 0x33C) == 0; if (FLD(g_hero_state, s32, 0x1B8) >= 0x5A) { - if (hero_set_action_us2(0, 0) != 0) { + if (hero_l22_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 4, 6.0f); } if (low != 0) { @@ -1600,7 +1600,7 @@ void hero_action_state_update_us2(void) { } hero_set_level_clock_and_bytes(0xA, 4, 0, 1, 0.022f, 0.004f); } else if (FLD(g_hero_state, s32, 0x2298) == one) { - if (hero_set_action_us2(0, 0) != 0) { + if (hero_l22_set_move_state_us2(0, 0) != 0) { set_hero_animation(0xC, 9, -1.0f); } cam_set_view_space_height(g_hero_state + 0x160, g_hero_state + 0x160, 0.0f); @@ -1614,36 +1614,36 @@ void hero_action_state_update_us2(void) { } hero_set_level_clock_and_bytes(0xA, 2, 0, 1, 0.019f, 0.002f); } else if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_set_action_us2(2, 1); + hero_l22_set_move_state_us2(2, 1); hero_set_level_clock_and_bytes(7, 2, 0, 1, 0.016f, 0.002f); } else if (FLD(g_hero_state, f32, 0x174) > 0.0500000045f) { - if (hero_set_action_us2(3, 0) != 0) { + if (hero_l22_set_move_state_us2(3, 0) != 0) { set_hero_animation(6, 0, 12.0f); vec_clamp_length((f32 *)(g_hero_state + 0x160), 0.12833333f); } } else { - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if ((FLD(g_pad_state, s32, 0x1A0) & 0x40) && (g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_set_action_us2(8, 1); + hero_l22_set_move_state_us2(8, 1); break; } if ((FLD(g_hero_state, s16, 0x202) >= 0x15) && (hero_try_start_move_from_buffer((FLD(g_hero_state, s16, 0x1EE) != 0) ? 1 : 6, 0) != 0)) { break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_set_action_us2(0x17, 1); + hero_l22_set_move_state_us2(0x17, 1); break; } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_set_action_us2(0x27, 1); + hero_l22_set_move_state_us2(0x27, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_set_action_us2(0x71, 1); + hero_l22_set_move_state_us2(0x71, 1); } } break; @@ -1674,7 +1674,7 @@ void hero_action_state_update_us2(void) { if (FLD(p, s32, 0x340) != 0) { u8 *q = FLD(p, u8 *, 0x33C); if ((q == NULL) || (FLD(q, s16, 0xAA) == 0x8E2)) { - if (hero_set_action_us2(0, 0) != 0) { + if (hero_l22_set_move_state_us2(0, 0) != 0) { FLD(p, s8, 0x24EF) = 0; set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); @@ -1684,9 +1684,9 @@ void hero_action_state_update_us2(void) { } if (FLD(g_hero_state, f32, 0x5B0) == 0.0f) { if ((g_current_map_index == 0xD) && (FLD(g_hero_state, f32, 0x318) < 69.0f)) { - hero_set_action_us2(0x74, 1); + hero_l22_set_move_state_us2(0x74, 1); } else { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); } } break; @@ -1699,16 +1699,16 @@ void hero_action_state_update_us2(void) { ok = 1; } if (ok != 0) { - hero_set_action_us2(0x11, 1); + hero_l22_set_move_state_us2(0x11, 1); } break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40) && !(FLD(g_pad_state, s32, 0x1C0) & 0x40)) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_set_action_us2(0x17, 1); + hero_l22_set_move_state_us2(0x17, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !(FLD(g_hero_state, f32, 0x31C) < 0.4f)) { @@ -1719,23 +1719,23 @@ void hero_action_state_update_us2(void) { } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0x22A0) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) < 4)) { - if (hero_set_action_us2(3, 0) != 0) { + if (hero_l22_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -1.0f); FLD(g_hero_state, s16, 0x1E0) = 0x22; } break; } if (FLD(g_pad_state, s32, 0x1A0) & 8) { - hero_set_action_us2(4, 1); + hero_l22_set_move_state_us2(4, 1); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); break; } if ((g_hero_distance_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_set_action_us2(2, 1); + hero_l22_set_move_state_us2(2, 1); break; } - hero_set_action_us2(2, 0); + hero_l22_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, 2, 8.0f); @@ -1744,21 +1744,21 @@ void hero_action_state_update_us2(void) { hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (g_hero_distance_params[0][2] < FLD(g_hero_state, f32, 0x1B0)) { if ((FLD(g_hero_state, u8, 0x1492) != 0) || (FLD(g_hero_state, u8, 0x22B9) != 0)) { - hero_set_action_us2(2, 1); + hero_l22_set_move_state_us2(2, 1); break; } - hero_set_action_us2(2, 0); + hero_l22_set_move_state_us2(2, 0); if (FLD(g_hero_state, u32, 0x2294) == 2) { FLD(g_hero_state, s32, 0x2298) = 1; set_hero_animation(4, g_hero_l22_extra_animation_id, 12.0f); } hero_set_level_clock_and_bytes(5, 2, 1, 0, 0.016f, 0.002f); } else if (FLD(g_hero_state, s16, 0x34E) == 0) { - if (hero_set_action_us2(0, 0) != 0) { + if (hero_l22_set_move_state_us2(0, 0) != 0) { set_hero_animation(shop_get_entry_for_state(0), 0, -2.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } - } else if (hero_set_action_us2(0, 0) != 0) { + } else if (hero_l22_set_move_state_us2(0, 0) != 0) { set_hero_animation(7, 0x17, 9.0f); hero_set_level_clock_and_bytes(5, 2, 0, 1, 0.016f, 0.002f); } @@ -1806,14 +1806,14 @@ void hero_action_state_update_us2(void) { } } if ((go != 0) && (PadPressedWithin(0x1F000, 5, NULL) != 0) && (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_set_action_us2(0xB, 1); + hero_l22_set_move_state_us2(0xB, 1); break; } } } } if ((FLD(g_hero_state, s16, 0x1F2) != 0) && ((FLD(g_hero_state, u32, 0x2294) == 7) || (FLD(g_hero_state, u32, 0x2294) == 9)) && (FLD(g_hero_state, s32, 0x1B8) < 0x14)) { - hero_set_action_us2(0x82, 1); + hero_l22_set_move_state_us2(0x82, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) == 0x1B) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (FLD(g_hero_state, f32, 0x278) > 0.7f)) { @@ -1822,29 +1822,29 @@ void hero_action_state_update_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) < 7) && (PadPressedWithin(8, 2, NULL) != 0) && ((sa = FLD(g_hero_state, u32, 0x2294)) != 0x10) && (sa != 0xA) && (sa != 0x12) && (sa != 0x38) && (sa != 0x11) && (sa != 0xE) && (sa != 0x66)) { if ((hero_slot_item_id(3) == 2) && (g_item_owned_flags[2] != 0) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f)) { - hero_set_action_us2(0xA, 1); + hero_l22_set_move_state_us2(0xA, 1); } else if ((hero_slot_item_id(3) == 3) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_hero_state, f32, 0x178) > 0.015000001f) && (FLD(g_hero_state, s16, 0x1E4) == 0)) { - hero_set_action_us2(0x10, 1); + hero_l22_set_move_state_us2(0x10, 1); } } if (FLD(g_hero_state, s32, 0x63C) != 0) { - hero_set_action_us2(0x27, 1); + hero_l22_set_move_state_us2(0x27, 1); break; } if (FLD(g_hero_state, s32, 0x6EC) != 0) { - hero_set_action_us2(0x71, 1); + hero_l22_set_move_state_us2(0x71, 1); break; } { if (FLD(g_hero_state, s16, 0x51A) < FLD(g_hero_state, s32, 0x1B8)) { if (FLD(g_hero_state, u8, 0x49C) == 0) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); break; } } else if ((FLD(g_hero_state, u8, 0x49C) == 0) && ((FLD(g_hero_state, u32, 0x2294) == 0xA) || (FLD(g_hero_state, u32, 0x2294) == 0x10)) && (FLD(g_hero_state, f32, 0x278) < 0.9f) && (FLD(g_hero_state, u8, 0x287) != 0) && (FastVecLength(g_hero_state + 0xF0) > 0.116666675f)) { f32 a = FastVecLength(g_hero_state + 0x110); if ((a < FastVecLength(g_hero_state + 0xF0) * 0.5f) && (FLD(g_hero_state, s32, 0x578) == 0) && (FLD(g_hero_state, f32, 0x31C) < 2.0f)) { - hero_set_action_us2(0x77, 1); + hero_l22_set_move_state_us2(0x77, 1); break; } } @@ -1948,7 +1948,7 @@ void hero_action_state_update_us2(void) { } if (FLD(g_hero_state, u8, 0x49C) != 0) { if (FLD(g_hero_state, u32, 0x2294) == 0xA) { - if (hero_set_action_us2(3, 0) != 0) { + if (hero_l22_set_move_state_us2(3, 0) != 0) { set_hero_animation(5, 0, -2.0f); FastVecScale(g_hero_state + 0x160, g_hero_state + 0x160, 0.8f); } @@ -1956,13 +1956,13 @@ void hero_action_state_update_us2(void) { } if ((FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 8, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { if (!(FLD(g_hero_state, f32, 0x1B0) > g_hero_distance_params[0][2])) { - hero_set_action_us2(7, 1); + hero_l22_set_move_state_us2(7, 1); } else if (!(FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.0471976f)) { - hero_set_action_us2(7, 1); + hero_l22_set_move_state_us2(7, 1); } else if (g_hero_distance_params[1][1] * 0.014166668f < FLD(g_hero_state, f32, 0x174)) { - hero_set_action_us2(9, 1); + hero_l22_set_move_state_us2(9, 1); } else { - hero_set_action_us2(7, 1); + hero_l22_set_move_state_us2(7, 1); } break; } @@ -1970,10 +1970,10 @@ void hero_action_state_update_us2(void) { if ((FLD(g_hero_state, u8, 0x49C) >= 2) && (FLD(g_hero_state, u32, 0x2294) != 0xA)) { hero_choose_next_move_after_landing(); } else if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= FLD(g_hero_state, s16, 0x52A)) && (FLD(g_hero_state, f32, 0x31C) > FLD(g_hero_state, f32, 0x510))) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); } if ((FLD(g_hero_state, u32, 0x2294) == 0x10) && (FLD(g_hero_state, s32, 0x1B8) >= 0x3D) && (FLD(g_hero_state, f32, 0x31C) > 1.5f)) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); break; } { @@ -1983,7 +1983,7 @@ void hero_action_state_update_us2(void) { ok = 1; } if ((FLD(g_hero_state, s32, 0x1D4) != 0) && (FLD(g_hero_state, u8, 0x49C) == 0) && (ok != 0) && ((FLD(g_hero_state, u32, 0x2294) != 0x11) || (FLD(g_hero_state, s32, 0x1B8) >= 0x1A)) && (PadPressedWithin(0x40, 7, &sp6C) != 0) && (sp6C < FLD(g_hero_state, s32, 0x1B8))) { - hero_set_action_us2(0x11, 1); + hero_l22_set_move_state_us2(0x11, 1); break; } } @@ -2012,7 +2012,7 @@ void hero_action_state_update_us2(void) { if (!(FLD(g_hero_state, s64, 0x498) & 0xFF0000FF00000000LL)) { if ((PadPressedWithin(0x40, frames, NULL) != 0) || (FLD(g_hero_state, u32, 0x2294) == 0xE) || (FLD(g_hero_state, u32, 0x2294) == 0xF) || (FLD(g_hero_state, u32, 0x2294) == 0xD)) { if ((FLD(g_hero_state, u32, 0x2294) != 0xE) && (FLD(g_hero_state, u8, 0x22B8) == 0) && ((FLD(g_hero_state, u8, 0x149A) == 0) || (FLD(g_hero_state, f32, 0x31C) >= 0.4f)) && (FLD(g_hero_state, u8, 0x52F) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0xF) && ((FLD(g_hero_state, u8, 0x49E) == 0) || ((FLD(g_hero_state, f32, 0x31C) > 0.7f) && (math_fabs(cam_get_view_space_height((s8 *)(g_hero_state + 0xF0))) < 0.09666667f)))) { - hero_set_action_us2(0xE, 1); + hero_l22_set_move_state_us2(0xE, 1); } else if ((g_item_owned_flags[2] != 0) && (hero_slot_item_id(3) != 4) && (FLD(g_hero_state, s16, 0x24FC) == 0) && (FLD(g_pad_state, s32, 0x1A0) & 0x40) && (lim < FLD(g_hero_state, s32, 0x1B8)) && (FLD(g_hero_state, s16, 0x526) < FLD(g_hero_state, s32, 0x1B8))) { f32 need = 0.6f; if ((FLD(g_hero_state, u32, 0x2294) == 9) || (FLD(g_hero_state, u32, 0x2294) == 7)) { @@ -2022,32 +2022,32 @@ void hero_action_state_update_us2(void) { need = 1.5f; } if (need < FLD(g_hero_state, f32, 0x31C)) { - hero_set_action_us2(8, 1); + hero_l22_set_move_state_us2(8, 1); } } } } if ((FLD(g_hero_state, s32, 0x578) != 0) && (FLD(g_hero_state, u32, 0x2294) != 0xB)) { - hero_set_action_us2(0x17, 1); + hero_l22_set_move_state_us2(0x17, 1); } break; } case 0x16: if ((FLD(g_hero_state, f32, 0xC38) > 12.5f) && (FLD(g_hero_state, u8, 0x24EF) == 0) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_set_action_us2(6, 1); + hero_l22_set_move_state_us2(6, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x1C) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { if (FLD(g_hero_state, u8, 0x1495) != 0) { - hero_set_action_us2(0x79, 1); + hero_l22_set_move_state_us2(0x79, 1); } else { - hero_set_action_us2(0x39, 1); + hero_l22_set_move_state_us2(0x39, 1); } } else if (FLD(g_hero_state, u8, 0x24EF) != 0) { - hero_set_action_us2(0x82, 1); + hero_l22_set_move_state_us2(0x82, 1); } else { - hero_set_action_us2(0, 0); + hero_l22_set_move_state_us2(0, 0); } } break; @@ -2057,8 +2057,8 @@ void hero_action_state_update_us2(void) { } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x33) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_set_action_us2(0x39, 1); - } else if (hero_set_action_us2(0, 0) != 0) { + hero_l22_set_move_state_us2(0x39, 1); + } else if (hero_l22_set_move_state_us2(0, 0) != 0) { set_hero_animation(shop_get_entry_for_state(0), 0, 13.0f); } } @@ -2083,28 +2083,28 @@ void hero_action_state_update_us2(void) { } } if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_set_action_us2(0x4E, 1); + hero_l22_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_set_action_us2(1, 1); + hero_l22_set_move_state_us2(1, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_set_action_us2(0x41, 1); + hero_l22_set_move_state_us2(0x41, 1); break; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_set_action_us2(0x45, 1); + hero_l22_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_set_action_us2(0x4D, 1); + hero_l22_set_move_state_us2(0x4D, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.2f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_set_action_us2(0x40, 1); + hero_l22_set_move_state_us2(0x40, 1); break; } if ((FLD(g_hero_state, s16, 0x2520) == 0) && (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) == 0x12)) { @@ -2117,14 +2117,14 @@ void hero_action_state_update_us2(void) { u8 *rec; s32 frames; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_set_action_us2(0x4E, 1); + hero_l22_set_move_state_us2(0x4E, 1); break; } rec = (u8 *)&g_hero_anim_records[FLD(g_hero_state, s16, 0xBFC)]; if (FLD(g_hero_state, s32, 0xC2C) == 0) { s32 busy; if ((f32)FLD(rec, s32, 0x18) < FLD(g_hero_state, f32, 0xC38)) { - hero_set_action_us2(0x3F, 0); + hero_l22_set_move_state_us2(0x3F, 0); } busy = FLD(g_hero_state, s32, 0xC2C); if ((busy == 0) && ((f32)FLD(rec, s32, 0x10) <= FLD(g_hero_state, f32, 0xC38))) { @@ -2133,13 +2133,13 @@ void hero_action_state_update_us2(void) { n = 1; } if (PadPressedWithin(0x80, (n < 0x10) ? n : 0xF, NULL) != 0) { - hero_set_action_us2(0x4D, 1); + hero_l22_set_move_state_us2(0x4D, 1); } } } frames = (FloatToInt(FLD(g_hero_state, f32, 0xC38)) - FLD(rec, s32, 0xC)) * 2; if (((f32)FLD(rec, s32, 0x14) < FLD(g_hero_state, f32, 0xC38)) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (PadPressedWithin(0x40, frames, NULL) != 0)) { - hero_set_action_us2(0x45, 1); + hero_l22_set_move_state_us2(0x45, 1); } break; } @@ -2202,42 +2202,42 @@ void hero_action_state_update_us2(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FLD(g_hero_state, u8, 0x149A) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 4)) { hero_resolve_stick_direction(0, 1.0f); - hero_set_action_us2(0x45, 1); + hero_l22_set_move_state_us2(0x45, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 2) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_distance_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, u8, 0x149A) == 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_set_action_us2(0x40, 1); + hero_l22_set_move_state_us2(0x40, 1); } else if (FLD(g_hero_state, u8, 0x49C) >= 0xD) { - hero_set_action_us2(0x3F, 1); + hero_l22_set_move_state_us2(0x3F, 1); } } if ((FLD(g_hero_state, f32, 0x31C) > 2.0f) && (FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x29)) { - hero_set_action_us2(0x41, 1); + hero_l22_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, u8, 0x49E) != 0) && (FLD(g_hero_state, f32, 0x31C) < 0.2f) && (PadPressedWithin(0x80, 5, NULL) != 0)) { - hero_set_action_us2(0x4D, 1); + hero_l22_set_move_state_us2(0x4D, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_set_action_us2(0x46, 1); + hero_l22_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, u32, 0x2294) != 0x48) && (PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.55f)) { - hero_set_action_us2(0x4B, 1); + hero_l22_set_move_state_us2(0x4B, 1); } break; } case 0x4B: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x1F) && !(FLD(g_pad_state, s32, 0x1A0) & 0x40)) { - hero_set_action_us2(0x41, 1); + hero_l22_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_set_action_us2(0x46, 1); + hero_l22_set_move_state_us2(0x46, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && !((FLD(g_hero_state, f32, 0x88) - FLD(g_hero_state, f32, 0x318)) < 0.0f)) { @@ -2247,11 +2247,11 @@ void hero_action_state_update_us2(void) { FLD(g_hero_state, s16, 0x1EE) = 0xC - FLD(g_hero_state, u16, 0x1B8); } if (FLD(g_hero_state, f32, 0x24B8) > 0.3f) { - hero_set_action_us2(0x40, 1); + hero_l22_set_move_state_us2(0x40, 1); break; } if (FLD(g_hero_state, s16, 0x34E) == 0) { - hero_set_action_us2(0x3F, 1); + hero_l22_set_move_state_us2(0x3F, 1); } break; case 0x41: @@ -2263,29 +2263,29 @@ void hero_action_state_update_us2(void) { FLD(g_hero_state, f32, 0xF8) = -0.15f; } if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_set_action_us2(0x43, 1); + hero_l22_set_move_state_us2(0x43, 1); } else if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { if (FLD(g_hero_state, s16, 0x1E0) == 0) { - hero_set_action_us2(0x40, 1); + hero_l22_set_move_state_us2(0x40, 1); } else { - hero_set_action_us2(0x3F, 1); + hero_l22_set_move_state_us2(0x3F, 1); } } else { - hero_set_action_us2(0x3F, 1); + hero_l22_set_move_state_us2(0x3F, 1); } } else if (FLD(g_hero_state, s32, 0x24CC) > 0) { if (FLD(g_hero_state, s32, 0x578) != 0) { - hero_set_action_us2(0x46, 1); + hero_l22_set_move_state_us2(0x46, 1); break; } if ((PadPressedWithin(0x40, 5, NULL) != 0) && (FLD(g_hero_state, f32, 0x31C) > 0.6f)) { - hero_set_action_us2(0x4B, 1); + hero_l22_set_move_state_us2(0x4B, 1); } } break; case 0x44: if ((FLD(g_hero_state, f32, 0xF8) < 0.0f) && (FLD(g_hero_state, s32, 0x340) != 0)) { - hero_set_action_us2(0x3F, 1); + hero_l22_set_move_state_us2(0x3F, 1); } break; case 0x4E: @@ -2294,9 +2294,9 @@ void hero_action_state_update_us2(void) { } if (FLD(g_hero_state, u8, 0x149A) == 0) { if (FLD(g_hero_state, s16, 0x34E) != 0) { - hero_set_action_us2(0x41, 1); + hero_l22_set_move_state_us2(0x41, 1); } else { - hero_set_action_us2(0x3F, 1); + hero_l22_set_move_state_us2(0x3F, 1); } } break; @@ -2306,7 +2306,7 @@ void hero_action_state_update_us2(void) { u8 *o; s32 anim; if (FLD(g_hero_state, u8, 0x149A) != 0) { - hero_set_action_us2(0x4E, 1); + hero_l22_set_move_state_us2(0x4E, 1); break; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x170) < 0.025000002f) && (FLD(o = FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != 2)) { @@ -2332,55 +2332,55 @@ void hero_action_state_update_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.57f; } if (PadPressedWithin(0x40, 8, NULL) != 0) { - hero_set_action_us2(0x45, 1); + hero_l22_set_move_state_us2(0x45, 1); break; } if (PadPressedWithin(0x80, 9, NULL) != 0) { - hero_set_action_us2(0x4D, 1); + hero_l22_set_move_state_us2(0x4D, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && ((FLD(g_hero_state, f32, 0x31C) > 0.8f) || (FLD(g_hero_state, f32, 0x320) > 0.8726647f))) { - hero_set_action_us2(0x41, 1); + hero_l22_set_move_state_us2(0x41, 1); break; } if ((FLD(g_hero_state, s16, 0x34E) == 0) && (FLD(g_hero_state, f32, 0x24B8) < 0.17f)) { - hero_set_action_us2(0x3F, 1); + hero_l22_set_move_state_us2(0x3F, 1); } break; } case 0x42: if ((FLD(g_hero_state, s32, 0x1B8) >= 0x20) && (FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 1.0f)) { - hero_set_action_us2(0x41, 1); + hero_l22_set_move_state_us2(0x41, 1); break; } if (FLD(g_hero_state, s32, 0x1B8) >= 0x24) { if (FLD(g_hero_state, s32, 0x24CC) <= 0) { - hero_set_action_us2(0x43, 1); + hero_l22_set_move_state_us2(0x43, 1); } else { - hero_set_action_us2(0x3F, 0); + hero_l22_set_move_state_us2(0x3F, 0); } } break; case 0x46: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_action_us2(0x47, 1); + hero_l22_set_move_state_us2(0x47, 1); } break; case 0x47: hero_resolve_stick_direction(0, 1.0f); *(s128 *)vec_a = FLD(g_hero_state + 0x80, s128, 0); if (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0) { - hero_set_action_us2(0x41, 1); + hero_l22_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) || (FLD(g_pad_state, s32, 0x1A0) & 8)) { - hero_set_action_us2(0x41, 1); + hero_l22_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0xA; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_set_action_us2(0x48, 1); + hero_l22_set_move_state_us2(0x48, 1); break; } if (FLD(g_hero_state, f32, 0x24B8) > 0.5f) { @@ -2389,7 +2389,7 @@ void hero_action_state_update_us2(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), 1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_set_action_us2(0x49, 1); + hero_l22_set_move_state_us2(0x49, 1); } break; } @@ -2400,7 +2400,7 @@ void hero_action_state_update_us2(void) { vec_b[0] += math_fast_sin_or_cos_a(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; vec_b[1] += math_fast_sin_or_cos_b(FastAddRotations(FLD(g_hero_state, f32, 0x98), -1.5707965f)) * 0.3f; if (hero_find_ledge_grab((s8 *)vec_b, (s8 *)(g_hero_state + 0x90), NULL) != 0) { - hero_set_action_us2(0x4A, 1); + hero_l22_set_move_state_us2(0x4A, 1); } } } @@ -2419,17 +2419,17 @@ void hero_action_state_update_us2(void) { hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) < 0.5f) || (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FastAddRotations(FLD(g_hero_state, f32, 0x98), side)) > 0.78539824f) || (hero_find_ledge_grab((s8 *)vec_a, (s8 *)(g_hero_state + 0x90), NULL) == 0)) { if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_action_us2(0x47, 1); + hero_l22_set_move_state_us2(0x47, 1); break; } } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (PadPressedWithin(0x40, 9, NULL) != 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) > 2.3561947f)) { - hero_set_action_us2(0x41, 1); + hero_l22_set_move_state_us2(0x41, 1); FLD(g_hero_state, s16, 0x1D0) = 0x28; break; } if (PadPressedWithin(0x40, 9, NULL) != 0) { - hero_set_action_us2(0x48, 1); + hero_l22_set_move_state_us2(0x48, 1); } break; } @@ -2450,31 +2450,31 @@ void hero_action_state_update_us2(void) { } } if ((FLD(g_pad_state, s32, 0x1A0) & 4) && (FLD(g_hero_state, s32, 0x1500) == 0) && (level_get_saved_value() == 0)) { - hero_set_action_us2(1, 1); + hero_l22_set_move_state_us2(1, 1); break; } if (PadPressedWithin(0x40, 0xF, NULL) != 0) { - hero_set_action_us2(0x5B, 1); + hero_l22_set_move_state_us2(0x5B, 1); break; } if (PadPressedWithin(0x80, 0xF, NULL) != 0) { - hero_set_action_us2(0x5D, 1); + hero_l22_set_move_state_us2(0x5D, 1); break; } if ((PadPressedWithin(0x10, 8, NULL) != 0) && (player_slot_has_object(FLD(g_hero_state, u32, 0x2290)) == 0)) { if (FLD(FLD(g_hero_state, u8 *, 0x1888), s32, 0xC) != 0) { - hero_set_action_us2(0x5E, 1); + hero_l22_set_move_state_us2(0x5E, 1); FLD(FLD(g_hero_state, u8 *, 0x1888), s32, 0xC)--; } break; } if ((FLD(g_hero_state, s16, 0x34E) != 0) && (FLD(g_hero_state, f32, 0x31C) > 2.0f)) { - hero_set_action_us2(0x58, 1); + hero_l22_set_move_state_us2(0x58, 1); break; } hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, f32, 0x24B8) > 0.22f) && (FLD(g_hero_state, f32, 0x1B0) > 0.0f)) { - hero_set_action_us2(0x57, 1); + hero_l22_set_move_state_us2(0x57, 1); break; } break; @@ -2546,18 +2546,18 @@ void hero_action_state_update_us2(void) { } if ((FLD(g_hero_state, u8, 0x49C) != 0) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (PadPressedWithin(0x40, 4, NULL) != 0) && (FLD(g_hero_state, s16, 0x34E) < 0xF)) { hero_resolve_stick_direction(0, 1.0f); - hero_set_action_us2(0x5B, 1); + hero_l22_set_move_state_us2(0x5B, 1); break; } if (FLD(g_hero_state, u8, 0x49C) >= 0xB) { FLD(g_hero_state, s32, 0x24A0) = 0; hero_resolve_stick_direction(0, 1.0f); if ((FLD(g_hero_state, s32, 0xC28) & 2) || (FLD(g_hero_state, u8, 0x49C) >= 0xF)) { - hero_set_action_us2(0x56, 1); + hero_l22_set_move_state_us2(0x56, 1); break; } if ((FLD(g_hero_state, f32, 0x1B0) > g_hero_distance_params[0][2]) && (FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0) && (FastDiffRots(FLD(g_hero_state, f32, 0x1A0), FLD(g_hero_state, f32, 0x98)) < 1.5707964f)) { - hero_set_action_us2(0x57, 1); + hero_l22_set_move_state_us2(0x57, 1); break; } } @@ -2570,7 +2570,7 @@ void hero_action_state_update_us2(void) { coll_sweep_from_object(FLD(g_hero_state, char *, 0x2290), (char *)vec_a, 0x30000, 0, 3.5f, 2.0f, 1.0f, 1, 0); } if ((FLD(g_hero_state, s16, 0x202) != 0) && (PadPressedWithin(0x40, 0xA, NULL) != 0)) { - hero_set_action_us2(0x5B, 1); + hero_l22_set_move_state_us2(0x5B, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { @@ -2586,13 +2586,13 @@ void hero_action_state_update_us2(void) { FLD(g_hero_l22_state_block, s32, 0x168) = 0x1E; FLD(g_hero_l22_state_block, s32, 0x16C) = 0; if (FLD(g_hero_state, s32, 0x1874) <= 0) { - hero_set_action_us2(0x5F, 1); + hero_l22_set_move_state_us2(0x5F, 1); break; } if ((FLD(g_hero_state, f32, 0x24B8) > 0.5f) && (FLD(g_hero_state, s16, 0x1E0) == 0)) { - hero_set_action_us2(0x57, 1); + hero_l22_set_move_state_us2(0x57, 1); } else { - hero_set_action_us2(0x56, 1); + hero_l22_set_move_state_us2(0x56, 1); } break; case 0x5D: @@ -2602,28 +2602,28 @@ void hero_action_state_update_us2(void) { lim = 25.5f; } if ((FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > lim) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15) && (PadPressedWithin(0x80, 0x11, NULL) != 0)) { - hero_set_action_us2(0x5D, 1); + hero_l22_set_move_state_us2(0x5D, 1); } if (((FLD(g_hero_state, f32, 0xC38) > 28.5f) && (FLD(g_hero_state, s32, 0xC2C) == 0)) || (FLD(g_hero_state, s32, 0xC28) & 2)) { - hero_set_action_us2(0x56, 0); + hero_l22_set_move_state_us2(0x56, 0); break; } if ((FLD(g_hero_state, f32, 0xC38) > 19.0f) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0x24B8) > 0.75f)) { - hero_set_action_us2(0x57, 0); + hero_l22_set_move_state_us2(0x57, 0); set_hero_animation(3, 0x12, 11.0f); } break; } case 0x5E: if (FLD(g_hero_state, s32, 0xC28) & 2) { - hero_set_action_us2(0x56, 1); + hero_l22_set_move_state_us2(0x56, 1); break; } if (FLD(g_hero_state, s32, 0xC2C) != 0) { break; } if (FLD(g_hero_state, f32, 0xC38) > 32.0f) { - hero_set_action_us2(0x56, 1); + hero_l22_set_move_state_us2(0x56, 1); } break; case 0x57: @@ -2632,40 +2632,40 @@ void hero_action_state_update_us2(void) { FLD(g_hero_state, f32, 0xC20) = 0.75f; } if (PadPressedWithin(0x40, 0xF, NULL) != 0) { - hero_set_action_us2(0x5B, 1); + hero_l22_set_move_state_us2(0x5B, 1); break; } if (PadPressedWithin(0x80, 8, NULL) != 0) { - hero_set_action_us2(0x5D, 1); + hero_l22_set_move_state_us2(0x5D, 1); break; } if (PadPressedWithin(0x10, 8, NULL) != 0) { if (FLD(FLD(g_hero_state, u8 *, 0x1888), s32, 0xC) != 0) { - hero_set_action_us2(0x5E, 1); + hero_l22_set_move_state_us2(0x5E, 1); FLD(FLD(g_hero_state, u8 *, 0x1888), s32, 0xC)--; } break; } if ((FLD(g_hero_state, s16, 0x34E) >= 5) && (FLD(g_hero_state, f32, 0x31C) > 1.5f) && ((FLD(g_hero_state, f32, 0x31C) > 1.5f) || (FLD(g_hero_state, f32, 0x320) > 0.87266469f))) { - hero_set_action_us2(0x58, 1); + hero_l22_set_move_state_us2(0x58, 1); break; } if (FLD(g_hero_state, s16, 0x34E) != 0) { break; } if ((FLD(g_hero_state, f32, 0x24B8) < 0.17f) && (FLD(g_hero_state, s32, 0x1B8) >= 0x15)) { - hero_set_action_us2(0x56, 1); + hero_l22_set_move_state_us2(0x56, 1); } break; case 0x59: case 0x5A: if ((FLD(g_hero_state, s32, 0x340) != 0) && (FLD(g_hero_state, s32, 0x1B8) >= 0x33)) { - hero_set_action_us2(0x56, 1); + hero_l22_set_move_state_us2(0x56, 1); break; } if ((FLD(g_hero_state, s32, 0x1B8) >= 0x29) || (FLD(g_hero_state, s32, 0xC28) & 2)) { if (FLD(g_hero_state, s32, 0x1874) <= 0) { - hero_set_action_us2(0x5F, 1); + hero_l22_set_move_state_us2(0x5F, 1); break; } set_hero_animation(0xE, 0, 11.0f); @@ -2682,7 +2682,7 @@ void hero_action_state_update_us2(void) { if (!(FLD(g_pad_state, s32, 0x1A0) & 4)) { if (FLD(g_hero_state, u32, 0x2294) == 0x1D) { s32 anim; - hero_set_action_us2(0, 0); + hero_l22_set_move_state_us2(0, 0); anim = shop_get_entry_for_state(1); if (FLD(FLD(g_hero_state, u8 *, 0x2290), u8, 0x43) != anim) { set_hero_animation(anim, 0, 8.0f); @@ -2693,7 +2693,7 @@ void hero_action_state_update_us2(void) { break; case 0x1F: if ((FLD(g_hero_state, s32, 0x1220) != 0) && (FLD(g_hero_state, s32, 0xC2C) == 0) && (FLD(g_hero_state, f32, 0xC38) > 20.0f)) { - hero_set_action_us2(0, 0); + hero_l22_set_move_state_us2(0, 0); } break; case 0x22: @@ -2703,12 +2703,12 @@ void hero_action_state_update_us2(void) { hero_choose_jump_or_roll_move(); break; } - hero_set_action_us2(7, 1); + hero_l22_set_move_state_us2(7, 1); break; } } if (FLD(g_hero_state, f32, 0xC38) >= 21.0f) { - hero_set_action_us2(0, 0); + hero_l22_set_move_state_us2(0, 0); } break; default: diff --git a/src/us2/levels/shared/L22_0039EB38-cc-g8.c b/src/us2/levels/shared/L22_0039EB38-cc-g8.c index e15d2d754..3207724f9 100644 --- a/src/us2/levels/shared/L22_0039EB38-cc-g8.c +++ b/src/us2/levels/shared/L22_0039EB38-cc-g8.c @@ -81,7 +81,7 @@ extern void object_copy_vector_to_selected(void *); extern void cam_set_state_rotation(void *); extern void SetCamera5Pose(void *, void *, int, int, int); extern void cancel_hero_item_animation(void); -extern int queue_copy_record_by_index(int); +extern int actuator_play_pattern(int); extern void release_moby_animation_slot(void *, void *); extern void moby_set_flag_bit(void *, int); extern int snd_start_in_slot(int, int, int); @@ -90,7 +90,7 @@ extern int moby_check_target_point_from_offset(void *, void *); extern int moby_aim_at_target_offset(void *, void *); extern void moby_store_position_private(void *, void *); extern int moby_call_helper_with_blocks(void *); -extern int hero_set_action_us2(int, int); +extern int hero_l22_set_move_state_us2(int, int); extern void math_steer_along_direction(void *, void *, void *, void *, float, float, float); extern void moby_update_timed(void *); extern void arena_push_point_out(void *, float); @@ -435,7 +435,7 @@ void space_ship_update_us2(s8 *moby) { cancel_hero_item_animation(); release_moby_animation_slot(M2C_FIELD(game, void **, 0x2290), game + 0x1870); M2C_FIELD(game, s32 *, 0x187C) = 0; - hero_set_action_us2(0, 1); + hero_l22_set_move_state_us2(0, 1); M2C_FIELD(vars, s32 *, 0x344) = 0; } value_43 = M2C_FIELD(vars, u16 *, 0x41E); @@ -986,7 +986,7 @@ void space_ship_update_us2(s8 *moby) { } if (fast_vec_dist(&scratch[2].q, &scratch[3].q) < g_space_ship_trigger_distance) { - queue_copy_record_by_index(0x2B); + actuator_play_pattern(0x2B); g_space_ship_boost_timer = g_space_ship_state_default; } } diff --git a/src/us2/levels/shared/L22_003A2A00-cc-g8.c b/src/us2/levels/shared/L22_003A2A00-cc-g8.c index 1329e7721..420b55d4d 100644 --- a/src/us2/levels/shared/L22_003A2A00-cc-g8.c +++ b/src/us2/levels/shared/L22_003A2A00-cc-g8.c @@ -189,7 +189,7 @@ extern void moby_update_ground_check(void *),func_002A0F48(void *); extern void cam_compute_view_direction(void *,void *,int), vec_negate_and_forward(void *,void *,int); extern int moby_apply_damage_to_object(void *,void *,int); extern void moby_set_state(void *,int,int), cancel_hero_item_animation(void), release_moby_animation_slot(void *,void *); -extern s32 hero_set_action_us2(int,int); +extern s32 hero_l22_set_move_state_us2(int,int); /* Sets the record up on the first update (health scaled by difficulty, the object table scan, then the tuning block) and keeps the three child objects in step. The tuning @@ -329,7 +329,7 @@ void space_ship_init_and_update_us2(Obj_15D0 *obj) { } else if(g_space_ship_timer<30) { g_hero_state.field2294=0; cancel_hero_item_animation(); release_moby_animation_slot(g_hero_state.field2290,&g_hero_state.field1870); - g_hero_state.field187C=0; hero_set_action_us2(0,1); + g_hero_state.field187C=0; hero_l22_set_move_state_us2(0,1); } } else if(g_hero_state.health<=0 && obj->f95!=1) { p->f350=0; p->f3E4=p->f3E8=0.0f;