From b9cc73472bed1df0e26616b628a642bcd2f86f84 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Sun, 30 Jul 2023 14:08:07 +0900 Subject: [PATCH] Standard names for struct fields (#1103) * position -> pos * rotation -> rot * velocity -> vel * distance -> dist * current -> cur * current -> cur --- include/common_structs.h | 199 ++-- include/effects.h | 28 +- include/entity.h | 34 +- include/npc.h | 14 +- src/16F740.c | 212 ++-- src/16c8e0.c | 64 +- src/17D6A0.c | 14 +- src/17FEB0.c | 158 +-- src/181810.c | 34 +- src/182B30.c | 592 +++++------ src/18C790.c | 48 +- src/18F340.c | 52 +- src/190B20.c | 336 +++---- src/19FAF0.c | 928 +++++++++--------- src/1A5830.c | 912 ++++++++--------- src/1AC760.c | 252 ++--- src/23680.c | 48 +- src/38F00.c | 14 +- src/39210_len_aa0.c | 48 +- src/415D90.c | 348 +++---- src/77480.c | 124 +-- src/7B440.c | 40 +- src/7E9D0.c | 70 +- src/7bb60_len_41b0.c | 392 ++++---- src/7fd10_len_b40.c | 12 +- src/80850_len_3060.c | 2 +- src/8800.c | 14 +- src/891b0_len_fb0.c | 106 +- src/8a860_len_3f30.c | 2 +- src/9d10_len_1080.c | 104 +- src/B0E0.c | 80 +- src/B4580.c | 48 +- src/C50A0.c | 350 +++---- src/actor_api.c | 292 +++--- src/ad90_len_2880.c | 20 +- src/audio.h | 14 +- src/audio/28910_len_5090.c | 12 +- src/audio/2e230_len_2190.c | 12 +- src/audio/31650.c | 10 +- src/audio/sfx.c | 22 +- src/audio/sfx_player.c | 38 +- src/background.c | 2 +- src/battle/action_cmd/07.c | 2 +- src/battle/action_cmd/0A.c | 2 +- src/battle/action_cmd/air_lift.c | 2 +- src/battle/action_cmd/air_raid.c | 6 +- src/battle/action_cmd/body_slam.c | 2 +- src/battle/action_cmd/bomb.c | 2 +- src/battle/action_cmd/dizzy_shell.c | 2 +- src/battle/action_cmd/fire_shell.c | 6 +- src/battle/action_cmd/flee.c | 2 +- src/battle/action_cmd/hammer.c | 4 +- src/battle/action_cmd/jump.c | 4 +- src/battle/action_cmd/power_shock.c | 2 +- src/battle/action_cmd/smack.c | 6 +- src/battle/action_cmd/spiny_surge.c | 8 +- src/battle/action_cmd/spook.c | 12 +- src/battle/action_cmd/squirt.c | 2 +- src/battle/action_cmd/stop_leech.c | 2 +- src/battle/action_cmd/whirlwind.c | 2 +- src/battle/area/dig/script/dig_01.c | 2 +- src/battle/area/dig/script/dig_02.c | 2 +- src/battle/area/dig/script/dig_03.c | 2 +- src/battle/area/dig/script/dig_04.c | 4 +- src/battle/area/hos/actor/goombario_tutor.c | 2 +- src/battle/area/kkj/actor/kammy_koopa.c | 2 +- src/battle/area/kzn2/actor/lava_piranha.c | 2 +- src/battle/area/mac/actor/lee.c | 14 +- .../area/omo3/actor/big_lantern_ghost.c | 14 +- src/battle/area/pra2/actor/crystal_bit.c | 10 +- .../trd_part_2/actor/common_koopa_bros.inc.c | 6 +- src/battle/battle.c | 10 +- src/battle/common/actor/duplighost.inc.c | 4 +- .../actor/duplighost/ghost_kooper.inc.c | 18 +- .../common/actor/duplighost/ghost_watt.inc.c | 10 +- src/battle/common/actor/groove_guy.inc.c | 6 +- src/battle/common/move/ItemRefund.inc.c | 12 +- src/battle/common/move/StarBeamSupport.inc.c | 110 +-- src/battle/common/stage/lib/DripVolumes.inc.c | 24 +- src/battle/move/hammer/spin_smash.c | 12 +- src/battle/move/item/food.c | 6 +- src/battle/move/item/life_shroom.c | 6 +- src/battle/move/item/mushroom.c | 6 +- src/battle/move/item/pow_block.c | 6 +- src/battle/move/item/stone_cap.c | 6 +- src/battle/move/item/super_soda.c | 6 +- src/battle/move/item/thunder_bolt.c | 6 +- src/battle/move/item/thunder_rage.c | 6 +- src/battle/move/star_power/chill_out.c | 10 +- src/battle/move/star_power/refresh.c | 8 +- src/battle/partner/bombette.c | 22 +- src/battle/partner/goombario.c | 134 +-- src/battle/partner/kooper.c | 24 +- src/battle/partner/lakilester.c | 110 +-- src/battle/partner/parakarry.c | 142 +-- src/battle/partner/sushie.c | 72 +- src/battle/partner/watt.c | 62 +- src/battle/use_items.c | 8 +- src/battle_cam.c | 162 +-- src/camera.c | 8 +- src/collision.c | 20 +- src/common/ActorJumpToPos.inc.c | 28 +- src/common/GetItemEntityPosition.inc.c | 6 +- src/common/ItemEntityJumpToPos.inc.c | 26 +- src/common/SetPlayerStatusPosYaw.inc.c | 6 +- src/common/UnkActorPosFunc.inc.c | 18 +- src/common/UnkSfxFunc.inc.c | 10 +- src/common/UnkStarFunc.inc.c | 2 +- src/common/battle/ChompChainSupport.inc.c | 58 +- src/effects/attack_result_text.c | 2 +- src/effects/aura.c | 6 +- src/effects/balloon.c | 4 +- src/effects/big_smoke_puff.c | 4 +- src/effects/big_snowflakes.c | 4 +- src/effects/blast.c | 4 +- src/effects/bombette_breaking.c | 4 +- src/effects/breaking_junk.c | 4 +- src/effects/bulb_glow.c | 4 +- src/effects/butterflies.c | 2 +- src/effects/chapter_change.c | 2 +- src/effects/chomp_drop.c | 2 +- src/effects/cloud_puff.c | 4 +- src/effects/cloud_trail.c | 4 +- src/effects/cold_breath.c | 2 +- src/effects/confetti.c | 4 +- src/effects/damage_indicator.c | 2 +- src/effects/damage_stars.c | 12 +- src/effects/debuff.c | 4 +- src/effects/disable_x.c | 2 +- src/effects/drop_leaves.c | 4 +- src/effects/dust.c | 4 +- src/effects/effect_3D.c | 4 +- src/effects/effect_46.c | 10 +- src/effects/effect_63.c | 2 +- src/effects/effect_65.c | 2 +- src/effects/effect_75.c | 2 +- src/effects/effect_86.c | 2 +- src/effects/embers.c | 2 +- src/effects/emote.c | 16 +- src/effects/ending_decals.c | 4 +- src/effects/energy_in_out.c | 4 +- src/effects/energy_orb_wave.c | 2 +- src/effects/energy_shockwave.c | 2 +- src/effects/explosion.c | 4 +- src/effects/falling_leaves.c | 4 +- src/effects/fire_breath.c | 8 +- src/effects/fire_flower.c | 4 +- src/effects/firework.c | 2 +- src/effects/firework_rocket.c | 50 +- src/effects/flame.c | 4 +- src/effects/flashing_box_shockwave.c | 4 +- src/effects/floating_cloud_puff.c | 2 +- src/effects/floating_flower.c | 2 +- src/effects/floating_rock.c | 2 +- src/effects/flower_splash.c | 16 +- src/effects/flower_trail.c | 18 +- src/effects/footprint.c | 2 +- src/effects/fright_jar.c | 2 +- src/effects/gather_energy_pink.c | 2 +- src/effects/gather_magic.c | 4 +- src/effects/got_item_outline.c | 4 +- src/effects/green_impact.c | 4 +- src/effects/hieroglyphs.c | 2 +- src/effects/huff_puff_breath.c | 2 +- src/effects/ice_pillar.c | 4 +- src/effects/ice_shard.c | 10 +- src/effects/landing_dust.c | 4 +- src/effects/lens_flare.c | 4 +- src/effects/light_rays.c | 30 +- src/effects/lightning.c | 4 +- src/effects/lightning_bolt.c | 4 +- src/effects/lil_oink.c | 2 +- src/effects/merlin_house_stars.c | 2 +- src/effects/misc_particles.c | 8 +- src/effects/motion_blur_flame.c | 2 +- src/effects/moving_cloud.c | 2 +- src/effects/music_note.c | 4 +- src/effects/peach_star_beam.c | 10 +- src/effects/pink_sparkles.c | 4 +- src/effects/purple_ring.c | 2 +- src/effects/quizmo_assistant.c | 12 +- src/effects/quizmo_audience.c | 4 +- src/effects/quizmo_stage.c | 4 +- src/effects/radial_shimmer.c | 2 +- src/effects/radiating_energy_orb.c | 2 +- src/effects/recover.c | 2 +- src/effects/red_impact.c | 4 +- src/effects/ring_blast.c | 4 +- src/effects/rising_bubble.c | 4 +- src/effects/shape_spell.c | 6 +- src/effects/shattering_stones.c | 6 +- src/effects/shimmer_burst.c | 2 +- src/effects/shimmer_wave.c | 2 +- src/effects/shiny_flare.c | 2 +- src/effects/shockwave.c | 4 +- src/effects/sleep_bubble.c | 4 +- src/effects/small_gold_sparkle.c | 4 +- src/effects/smoke_burst.c | 4 +- src/effects/smoke_impact.c | 4 +- src/effects/smoke_ring.c | 4 +- src/effects/snaking_static.c | 2 +- src/effects/snowfall.c | 6 +- src/effects/snowflake.c | 8 +- src/effects/snowman_doll.c | 2 +- src/effects/something_rotating.c | 4 +- src/effects/sparkles.c | 4 +- src/effects/spiky_white_aura.c | 8 +- src/effects/spirit_card.c | 4 +- src/effects/squirt.c | 2 +- src/effects/star.c | 10 +- src/effects/star_outline.c | 6 +- src/effects/star_spirits_energy.c | 4 +- src/effects/stars_burst.c | 4 +- src/effects/stars_orbiting.c | 2 +- src/effects/stars_shimmer.c | 4 +- src/effects/stars_spread.c | 4 +- src/effects/stat_change.c | 2 +- src/effects/static_status.c | 6 +- src/effects/steam_burst.c | 4 +- src/effects/stop_watch.c | 2 +- src/effects/sun.c | 2 +- src/effects/sweat.c | 6 +- src/effects/throw_spiny.c | 10 +- src/effects/thunderbolt_ring.c | 4 +- src/effects/tubba_heart_attack.c | 2 +- src/effects/underwater.c | 2 +- src/effects/walking_dust.c | 4 +- src/effects/water_block.c | 2 +- src/effects/water_fountain.c | 2 +- src/effects/water_splash.c | 2 +- src/effects/waterfall.c | 2 +- src/effects/whirlwind.c | 2 +- src/effects/windy_leaves.c | 4 +- src/encounter.c | 226 ++--- src/encounter_api.c | 26 +- src/entity.c | 94 +- src/entity/Block.c | 76 +- src/entity/BlueWarpPipe.c | 20 +- src/entity/Chest.c | 20 +- src/entity/HeartBlock.c | 64 +- src/entity/HiddenPanel.c | 102 +- src/entity/ItemBlock.c | 14 +- src/entity/SaveBlock.c | 10 +- src/entity/ShatteringBlock.c | 6 +- src/entity/ShatteringBlock_common.c | 10 +- src/entity/Signpost.c | 4 +- src/entity/SimpleSpring.c | 14 +- src/entity/SuperBlock.c | 16 +- src/entity/Switch.c | 26 +- src/entity/WoodenCrate.c | 36 +- src/entity/default/BoardedFloor.c | 34 +- src/entity/default/BombableRock.c | 36 +- src/entity/default/Padlock.c | 76 +- src/entity/jan_iwa/Plants1.c | 60 +- src/entity/jan_iwa/Plants2.c | 34 +- src/entity/sbk_omo/StarBoxLauncher.c | 88 +- src/entity/sbk_omo/Tweester.c | 42 +- src/entity_model.c | 8 +- src/evt/cam_api.c | 16 +- src/evt/evt.c | 16 +- src/evt/f8f60_len_1560.c | 10 +- src/evt/fa4c0_len_3bf0.c | 6 +- src/evt/fx_api.c | 12 +- src/evt/map_api.c | 6 +- src/evt/model_api.c | 24 +- src/evt/msg_api.c | 20 +- src/evt/npc_api.c | 78 +- src/evt/player_api.c | 92 +- src/evt/script_list.c | 24 +- src/evt/virtual_entity.c | 10 +- src/hud_element.c | 60 +- src/hud_element.h | 6 +- src/i_spy.c | 14 +- src/imgfx.c | 4 +- src/input.c | 24 +- src/inspect_icon.c | 20 +- src/main_loop.c | 2 +- src/model.c | 18 +- src/msg.c | 104 +- src/npc.c | 192 ++-- src/pause/pause_partners.c | 2 +- src/pulse_stone.c | 14 +- src/rumble.c | 4 +- src/speech_bubble.c | 4 +- src/sprite.c | 76 +- src/sprite.h | 8 +- src/state_battle.c | 2 +- src/state_demo.c | 4 +- src/state_intro.c | 2 +- src/status_icons.c | 16 +- src/trigger.c | 22 +- src/world/action/hammer.c | 30 +- src/world/action/hit_fire.c | 14 +- src/world/action/hit_lava.c | 86 +- src/world/action/idle.c | 24 +- src/world/action/jump.c | 22 +- src/world/action/knockback.c | 16 +- src/world/action/land.c | 32 +- src/world/action/misc.c | 60 +- src/world/action/slide.c | 106 +- src/world/action/sneaky_parasol.c | 116 +-- src/world/action/spin.c | 38 +- src/world/action/spin_jump.c | 48 +- src/world/action/step_up.c | 18 +- src/world/action/tornado_jump.c | 40 +- src/world/action/use_munchlesia.c | 28 +- src/world/action/use_spinning_flower.c | 122 +-- src/world/action/use_tweester.c | 30 +- src/world/action/walk.c | 12 +- src/world/area_arn/arn_08/arn_08_3_well.c | 4 +- src/world/area_arn/arn_08/arn_08_5_demo.c | 8 +- src/world/area_dgb/dgb_05/dgb_05_3_hole.c | 4 +- src/world/area_dgb/dgb_10/dgb_10_3_hole.c | 8 +- src/world/area_dgb/dgb_18/dgb_18_3_npc.c | 4 +- src/world/area_dro/dro_01/npc_hint_dryite.c | 4 +- .../dro_01/npc_hint_dryite_companion.c | 2 +- src/world/area_dro/dro_01/npc_shop_owner.c | 2 +- src/world/area_dro/dro_02/npc_merlee.c | 6 +- .../area_end/end_01/end_01_4_opera_float.c | 2 +- .../common/ItemChoice_FlowerGuard.inc.c | 6 +- .../area_flo/flo_00/flo_00_5_beanstalk.c | 6 +- src/world/area_flo/flo_03/flo_03_3_npc.c | 8 +- src/world/area_flo/flo_14/flo_14_3_bubbles.c | 2 +- .../area_flo/flo_19/flo_19_5_beanstalk.c | 6 +- src/world/area_hos/common/FallingStars.inc.c | 46 +- src/world/area_hos/hos_00/hos_00_4_npc.c | 2 +- src/world/area_hos/hos_00/hos_00_6_scenes.c | 2 +- .../area_hos/hos_00/hos_00_7_shade_gfx.c | 2 +- src/world/area_hos/hos_05/hos_05_5_intro.c | 2 +- .../area_hos/hos_05/hos_05_8_star_ship.c | 4 +- .../area_hos/hos_06/hos_06_5_merluvlee.c | 2 +- src/world/area_hos/hos_10/hos_10_7_ending.c | 14 +- src/world/area_isk/isk_02/isk_02_3_ambush.c | 2 +- src/world/area_isk/isk_04/isk_04_6_demo.c | 8 +- src/world/area_isk/isk_05/isk_05_3_npc.c | 2 +- src/world/area_isk/isk_07/isk_07_6_switch.c | 2 +- src/world/area_isk/isk_09/isk_09_5_switch.c | 2 +- src/world/area_isk/isk_10/isk_10_2_entity.c | 4 +- src/world/area_isk/isk_13/isk_13_3_npc.c | 2 +- src/world/area_isk/isk_14/isk_14_3_npc.c | 2 +- src/world/area_iwa/iwa_00/iwa_00_4_slide.c | 4 +- src/world/area_iwa/iwa_01/iwa_01_5_slide.c | 8 +- src/world/area_iwa/iwa_03/iwa_03_2_entity.c | 4 +- src/world/area_iwa/iwa_03/iwa_03_4_slide.c | 4 +- src/world/area_iwa/iwa_04/iwa_04_3_entity.c | 4 +- src/world/area_jan/jan_00/jan_00_2_npc.c | 8 +- src/world/area_jan/jan_02/jan_02_2_main.c | 2 +- src/world/area_jan/jan_03/jan_03_5_entity.c | 8 +- src/world/area_jan/jan_04/jan_04_10_demo.c | 8 +- src/world/area_jan/jan_04/jan_04_8_treasure.c | 6 +- src/world/area_jan/jan_22/jan_22_5_zipline.c | 16 +- src/world/area_kgr/kgr_01/kgr_01_2_wiggle.c | 4 +- .../common/ApproachPlayer100Units.inc.c | 8 +- .../common/ApproachPlayer50Units.inc.c | 8 +- .../common/RestoreFromPeachState.inc.c | 2 +- src/world/area_kkj/common/Searchlights.inc.c | 16 +- src/world/area_kkj/kkj_00/kkj_00_2_main.c | 8 +- .../area_kkj/kkj_13/kkj_13_5_intro_scenes.c | 2 +- .../area_kkj/kkj_15/kkj_15_3_rotating_wall.c | 4 +- .../area_kkj/kkj_27/kkj_27_3_rotating_wall.c | 4 +- src/world/area_kmr/kmr_02/kmr_02_5_entity.c | 2 +- src/world/area_kmr/kmr_03/kmr_03_4_entity.c | 8 +- .../area_kmr/kmr_06/kmr_06_5_sticker_sign.c | 2 +- src/world/area_kmr/kmr_10/kmr_10_4_entity.c | 6 +- src/world/area_kmr/kmr_11/kmr_11_5_entity.c | 6 +- src/world/area_kmr/kmr_20/kmr_20_13_records.c | 4 +- src/world/area_kmr/kmr_23/kmr_23_2_npc.c | 4 +- src/world/area_kpa/kpa_03/kpa_03_4_entity.c | 4 +- src/world/area_kpa/kpa_08/kpa_08_3_entity.c | 4 +- src/world/area_kpa/kpa_09/kpa_09_3_entity.c | 4 +- .../area_kpa/kpa_12/kpa_12_3_platforms.c | 8 +- .../area_kpa/kpa_13/kpa_13_4_platforms.c | 8 +- src/world/area_kpa/kpa_133/kpa_133_3_entity.c | 12 +- src/world/area_kpa/kpa_134/kpa_134_3_chains.c | 28 +- src/world/area_kpa/kpa_134/kpa_134_6_entity.c | 6 +- .../area_kpa/kpa_14/kpa_14_4_platforms.c | 8 +- src/world/area_kpa/kpa_53/kpa_53_3_npc.c | 8 +- src/world/area_kpa/kpa_63/kpa_63_4_scenes.c | 6 +- .../area_kzn/common/LavaGlowLighting.inc.c | 2 +- .../area_kzn/kzn_02/kzn_02_2_platforms.c | 12 +- src/world/area_kzn/kzn_02/kzn_02_4_demo.c | 4 +- src/world/area_kzn/kzn_03/kzn_03_3_entity.c | 4 +- src/world/area_kzn/kzn_03/kzn_03_4_ziplines.c | 12 +- src/world/area_kzn/kzn_04/kzn_04_3_npc.c | 6 +- src/world/area_kzn/kzn_08/kzn_08_4_extra.c | 6 +- src/world/area_kzn/kzn_09/kzn_09_3_zipline.c | 12 +- .../area_kzn/kzn_11/kzn_11_2_platforms.c | 12 +- src/world/area_kzn/kzn_11/kzn_11_3_npc.c | 6 +- src/world/area_kzn/kzn_20/kzn_20_3_npc.c | 2 +- src/world/area_kzn/kzn_22/kzn_22_2_main.c | 2 +- src/world/area_kzn/kzn_22/kzn_22_4_npc.c | 2 +- src/world/area_kzn/kzn_23/kzn_23_3_npc.c | 14 +- .../area_mac/mac_01/npc/post_office.inc.c | 2 +- .../area_mac/mac_01/npc/read_fortune.inc.c | 2 +- .../area_mac/mac_01/npc/rowf_and_rhuff.inc.c | 6 +- src/world/area_mac/mac_04/mac_04_8_entity.c | 6 +- src/world/area_mac/mac_05/mac_05_4_npc.c | 14 +- src/world/area_mac/mac_06/mac_06_3_npc.c | 10 +- .../area_mgm/mgm_00/mgm_00_3_scoreboard.c | 4 +- src/world/area_mgm/mgm_01/mgm_01_1_main.c | 8 +- src/world/area_mgm/mgm_01/mgm_01_2_npc.c | 52 +- src/world/area_mgm/mgm_02/mgm_02_2_npc.c | 82 +- src/world/area_mim/mim_10/mim_10_4_npc.c | 2 +- src/world/area_nok/nok_01/nok_01_4_npc.c | 2 +- src/world/area_nok/nok_02/nok_02_7_demo.c | 4 +- src/world/area_nok/nok_02/npcs_crisis.inc.c | 18 +- src/world/area_nok/nok_04/nok_04_4_npc.c | 52 +- src/world/area_nok/nok_12/nok_12_2_main.c | 4 +- src/world/area_nok/nok_12/nok_12_7_demo.c | 8 +- src/world/area_nok/nok_13/nok_13_5.c | 2 +- src/world/area_nok/nok_14/nok_14_2_main.c | 4 +- src/world/area_obk/common/RockingChair.inc.c | 50 +- .../area_obk/obk_01/obk_01_3_chandelier.c | 6 +- src/world/area_obk/obk_04/obk_04_5_hole.c | 2 +- src/world/area_obk/obk_04/obk_04_6_game.c | 10 +- src/world/area_obk/obk_05/obk_05_2_main.c | 2 +- src/world/area_obk/obk_05/obk_05_4_hole.c | 2 +- .../area_obk/obk_07/obk_07_6_phonograph.c | 10 +- src/world/area_obk/obk_08/obk_08_6_game.c | 10 +- src/world/area_obk/obk_09/obk_09_4_npc.c | 6 +- .../area_omo/omo_02/omo_02_5_barricade.c | 40 +- src/world/area_omo/omo_04/omo_04_4_entity.c | 8 +- .../area_omo/omo_09/omo_09_3_conveyors.c | 20 +- .../area_omo/omo_09/omo_09_4_slot_machine.c | 12 +- src/world/area_omo/omo_09/omo_09_5_gizmos.c | 2 +- src/world/area_omo/omo_11/omo_11_3_gizmos.c | 30 +- src/world/area_omo/omo_13/omo_13_4_npc.c | 16 +- src/world/area_omo/omo_14/omo_14_3_npc.c | 14 +- .../area_osr/osr_03/osr_03_5_interlude.c | 8 +- src/world/area_pra/common/Reflection.inc.c | 30 +- src/world/area_pra/pra_02/pra_02_4_entity.c | 6 +- src/world/area_pra/pra_03/pra_03_3_entity.c | 4 +- src/world/area_pra/pra_04/pra_04_3_entity.c | 4 +- src/world/area_pra/pra_09/pra_09_3_npc.c | 20 +- src/world/area_pra/pra_13/pra_13_3_npc.c | 6 +- src/world/area_pra/pra_19/pra_19_3_npc.c | 8 +- src/world/area_pra/pra_21/pra_21_3_entity.c | 4 +- src/world/area_pra/pra_22/pra_22_2_main.c | 16 +- src/world/area_pra/pra_22/pra_22_3_entity.c | 4 +- src/world/area_pra/pra_31/pra_31_2_npc.c | 2 +- src/world/area_pra/pra_31/pra_31_4_puzzle.c | 48 +- src/world/area_pra/pra_33/pra_33_3_entity.c | 10 +- src/world/area_sam/sam_03/sam_03_3_npc1.c | 2 +- .../area_sam/sam_07/sam_07_4_frozen_pit.c | 14 +- src/world/area_sam/sam_10/sam_10_4_stairs.c | 8 +- src/world/area_sam/sam_11/sam_11_4_entity.c | 16 +- src/world/area_sam/sam_11/sam_11_5_npc.c | 14 +- src/world/area_sam/sam_11/sam_11_6_pond.c | 16 +- src/world/area_sam/sam_12/sam_12_4_scenes.c | 12 +- src/world/area_tik/common/DripVolumes.inc.c | 6 +- .../area_tik/tik_03/tik_03_4_platforms.c | 2 +- src/world/area_tik/tik_03/tik_03_6_demo.c | 4 +- .../area_tik/tik_04/tik_04_4_platforms.c | 28 +- .../area_tik/tik_07/tik_07_5_platforms.c | 2 +- src/world/area_trd/trd_03/trd_03_4_puzzle.c | 8 +- src/world/area_trd/trd_05/trd_05_3_trap.c | 6 +- src/world/area_trd/trd_06/trd_06_2_falling.c | 6 +- .../area_trd/trd_07/trd_07_3_magic_doors.c | 8 +- src/world/area_trd/trd_08/trd_08_3_npc.c | 4 +- src/world/area_trd/trd_09/trd_09_4_demo.c | 8 +- src/world/area_trd/trd_10/trd_10_2_npc.c | 2 +- src/world/area_tst/tst_04/tst_04_1_main.c | 2 +- .../area_tst/tst_04/tst_04_3_reflection.c | 8 +- src/world/area_tst/tst_11/tst_11_2_extra.c | 18 +- src/world/area_tst/tst_13/tst_13_1_main.c | 2 +- src/world/common/atomic/BetaFloorPanels.inc.c | 4 +- src/world/common/atomic/CreateDarkness.inc.c | 6 +- .../atomic/MonitorMusicProximityTrigger.inc.c | 2 +- .../common/atomic/PushBlockGravity.inc.c | 6 +- src/world/common/atomic/ToadHouse.inc.c | 4 +- src/world/common/atomic/WhaleAnim.inc.c | 10 +- .../common/complete/KnockDownPlayer.inc.c | 6 +- .../common/complete/LetterDelivery.inc.c | 8 +- src/world/common/complete/Quizmo.inc.c | 4 +- src/world/common/enemy/ai/AvoidPlayerAI.inc.c | 18 +- src/world/common/enemy/ai/BulletBillAI.inc.c | 20 +- src/world/common/enemy/ai/CleftAI.inc.c | 38 +- .../common/enemy/ai/ClubbaNappingAI.inc.c | 32 +- .../common/enemy/ai/ClubbaPatrolAI.inc.c | 2 +- src/world/common/enemy/ai/FireBarAI.inc.c | 34 +- src/world/common/enemy/ai/FlyingAI.inc.c | 52 +- .../common/enemy/ai/FlyingMagikoopaAI.inc.c | 22 +- .../common/enemy/ai/FlyingNoAttackAI.inc.c | 8 +- src/world/common/enemy/ai/GrooveGuyAI.inc.c | 26 +- src/world/common/enemy/ai/GuardAI.inc.c | 24 +- src/world/common/enemy/ai/HoppingAI.inc.c | 36 +- src/world/common/enemy/ai/KoopaPatrolAI.inc.c | 2 +- src/world/common/enemy/ai/LakituAI.inc.c | 10 +- src/world/common/enemy/ai/MagikoopaAI.inc.c | 28 +- .../common/enemy/ai/MagikoopaSpellAI.inc.c | 28 +- src/world/common/enemy/ai/MeleeHitbox.inc.c | 18 +- src/world/common/enemy/ai/MontyMoleAI.inc.c | 26 +- src/world/common/enemy/ai/ParatroopaAI.inc.c | 22 +- .../common/enemy/ai/PatrolNoAttackAI.inc.c | 2 +- .../common/enemy/ai/PiranhaPlantAI.inc.c | 60 +- .../common/enemy/ai/ProjectileHitbox.inc.c | 54 +- .../common/enemy/ai/RangedAttackAI.inc.c | 4 +- src/world/common/enemy/ai/SentinelAI.inc.c | 36 +- .../common/enemy/ai/ShyGuyPatrolAI.inc.c | 8 +- .../common/enemy/ai/ShyGuyWanderAI.inc.c | 8 +- src/world/common/enemy/ai/SpearGuyAI.inc.c | 8 +- src/world/common/enemy/ai/SpinyAI.inc.c | 34 +- .../common/enemy/ai/States_PatrolAI.inc.c | 26 +- .../common/enemy/ai/States_TackleAI.inc.c | 12 +- src/world/common/enemy/ai/StoneChompAI.inc.c | 4 +- src/world/common/enemy/ai/SwooperAI.inc.c | 36 +- src/world/common/enemy/ai/TackleAI.inc.c | 16 +- src/world/common/enemy/ai/WanderMeleeAI.inc.c | 2 +- src/world/common/entity/Pipe.inc.c | 12 +- src/world/common/entity/SuperBlock.inc.c | 18 +- src/world/common/lava_piranha/part2.inc.c | 2 +- src/world/common/npc/Boo_Patrol.inc.c | 2 +- .../common/todo/AddPlayerHandsOffset.inc.c | 2 +- .../common/todo/AwaitPlayerNearNpc.inc.c | 2 +- .../todo/GetEncounterEnemyIsOwner.inc.c | 2 +- src/world/common/todo/GetEntityPosition.inc.c | 6 +- src/world/common/todo/GetFloorCollider.inc.c | 2 +- .../common/todo/GetLeftRightPoints.inc.c | 8 +- src/world/common/todo/SetEntityPosition.inc.c | 6 +- .../common/todo/SetEntityPositionF.inc.c | 6 +- .../common/todo/SomeItemEntityFunc.inc.c | 6 +- .../common/todo/SpinyTromp_CheckDist.inc.c | 6 +- .../common/todo/StarSpiritEffectFunc.inc.c | 4 +- src/world/common/todo/UnkFunc12.inc.c | 16 +- src/world/common/todo/UnkFunc62.inc.c | 100 +- src/world/common/todo/UnkMoveFunc1.inc.c | 6 +- src/world/common/todo/UpdateLogShadow.inc.c | 12 +- .../common/util/ChangeNpcToPartner.inc.c | 6 +- .../util/CheckPositionRelativeToPlane.inc.c | 2 +- .../common/util/GetKammyBroomEmitterPos.inc.c | 4 +- .../common/util/MonitorPlayerOrbiting.inc.c | 16 +- .../dead/area_flo/flo_00/flo_00_5_beanstalk.c | 6 +- src/world/dead/area_flo/flo_03/flo_03_3_npc.c | 8 +- .../dead/area_flo/flo_14/flo_14_3_bubbles.c | 2 +- .../dead/area_flo/flo_19/flo_19_5_beanstalk.c | 6 +- .../dead/area_kzn/kzn_11/kzn_11_2_platforms.c | 12 +- src/world/dead/area_kzn/kzn_11/kzn_11_3_npc.c | 6 +- src/world/dead/area_kzn/kzn_19/kzn_19_4_npc.c | 2 +- src/world/dead/area_kzn/kzn_20/kzn_20_3_npc.c | 2 +- .../dead/area_kzn/kzn_22/kzn_22_2_main.c | 2 +- src/world/dead/area_kzn/kzn_22/kzn_22_4_npc.c | 2 +- src/world/dead/area_kzn/kzn_23/kzn_23_3_npc.c | 14 +- src/world/partner/bombette.c | 144 +-- src/world/partner/bow.c | 82 +- src/world/partner/goombario.c | 32 +- src/world/partner/goompa.c | 28 +- src/world/partner/kooper.c | 86 +- src/world/partner/lakilester.c | 208 ++-- src/world/partner/parakarry.c | 150 +-- src/world/partner/sushie.c | 172 ++-- src/world/partner/watt.c | 70 +- src/world/partners.c | 508 +++++----- src/world/script_api/enter_exit.c | 40 +- src/world/script_api/push_blocks.c | 84 +- src/world/script_api/shops.c | 22 +- src/world/world.c | 2 +- 556 files changed, 7524 insertions(+), 7529 deletions(-) diff --git a/include/common_structs.h b/include/common_structs.h index e8dba3950e..09868bda65 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -219,7 +219,7 @@ typedef struct Npc { /* 0x010 */ f32 planarFlyDist; /* also used for speech, temp0? */ /* 0x014 */ f32 jumpScale; /* also used for speech, temp1? */ /* 0x018 */ f32 moveSpeed; - /* 0x01C */ f32 jumpVelocity; + /* 0x01C */ f32 jumpVel; /* 0x020 */ union { void* any; NpcMotionBlur* motion; ///< Null unless flag 0x100000 is set. @@ -230,21 +230,21 @@ typedef struct Npc { s32* keepAwayStarted; } blur; /* 0x024 */ s32 spriteInstanceID; - /* 0x028 */ AnimID currentAnim; + /* 0x028 */ AnimID curAnim; /* 0x02C */ s32 animNotifyValue; /* 0x030 */ f32 animationSpeed; /* 0x034 */ f32 renderYaw; /* 0x038 */ Vec3f pos; - /* 0x044 */ Vec3f rotation; - /* 0x050 */ f32 rotationPivotOffsetY; + /* 0x044 */ Vec3f rot; + /* 0x050 */ f32 rotPivotOffsetY; /* 0x054 */ Vec3f scale; /* 0x060 */ Vec3f moveToPos; /* 0x06C */ Vec3f colliderPos; /* used during collision with player */ /* 0x078 */ s32 shadowIndex; /* 0x07C */ f32 shadowScale; /* 0x080 */ s32 collisionChannel; /* flags used with collision tracing */ - /* 0x084 */ s16 currentFloor; /* colliderID */ - /* 0x086 */ s16 currentWall; /* colliderID */ + /* 0x084 */ s16 curFloor; /* colliderID */ + /* 0x086 */ s16 curWall; /* colliderID */ /* 0x088 */ s16 isFacingAway; /* 0x08A */ s16 yawCamOffset; /* 0x08C */ s16 turnAroundYawAdjustment; @@ -318,7 +318,7 @@ typedef struct PlayerData { /* 0x00F */ u8 starPieces; /* 0x010 */ s8 starPoints; /* 0x011 */ char unk_11; - /* 0x012 */ s8 currentPartner; + /* 0x012 */ s8 curPartner; /* 0x013 */ char unk_13; /* 0x014 */ struct PartnerData partners[12]; /* 0x074 */ s16 keyItems[32]; @@ -326,7 +326,7 @@ typedef struct PlayerData { /* 0x1B4 */ s16 invItems[10]; /* 0x1C8 */ s16 storedItems[32]; /* 0x208 */ s16 equippedBadges[64]; - /* 0x288 */ char unk_288; + /* 0x288 */ s8 unk_288; /* 0x289 */ s8 merleeSpellType; /* 0x28A */ s8 merleeCastsLeft; /* 0x28B */ char unk_28B; @@ -418,15 +418,10 @@ typedef struct TriggerBlueprint { /* 0x1C */ s32* itemList; } TriggerBlueprint; // size = 0x20 -typedef union X32 { - s32 s; - f32 f; -} X32; - typedef struct Evt { /* 0x000 */ u8 stateFlags; - /* 0x001 */ u8 currentArgc; - /* 0x002 */ u8 currentOpcode; + /* 0x001 */ u8 curArgc; + /* 0x002 */ u8 curOpcode; /* 0x003 */ u8 priority; /* 0x004 */ u8 groupFlags; /* 0x005 */ s8 blocked; /* 1 = blocking */ @@ -477,7 +472,7 @@ typedef struct Evt { /* 0x158 */ s32 unk_158; /* 0x15C */ Bytecode* ptrFirstLine; /* 0x160 */ Bytecode* ptrSavedPos; - /* 0x164 */ Bytecode* ptrCurrentLine; + /* 0x164 */ Bytecode* ptrCurLine; } Evt; // size = 0x168 typedef Evt* ScriptList[MAX_SCRIPTS]; @@ -581,9 +576,9 @@ typedef struct Entity { /* 0x3C */ void (*renderSetupFunc)(s32); /* 0x40 */ EntityData dataBuf; /* 0x44 */ void* gfxBaseAddr; - /* 0x48 */ Vec3f position; + /* 0x48 */ Vec3f pos; /* 0x54 */ Vec3f scale; - /* 0x60 */ Vec3f rotation; + /* 0x60 */ Vec3f rot; /* 0x6C */ f32 shadowPosY; /* 0x70 */ Matrix4f inverseTransformMatrix; /* world-to-local */ /* 0xB0 */ f32 effectiveSize; @@ -618,9 +613,9 @@ typedef struct Shadow { /* 0x08 */ s16 entityModelID; /* 0x0A */ s16 vertexSegment; /* 0x0C */ Vec3s* vertexArray; - /* 0x10 */ Vec3f position; + /* 0x10 */ Vec3f pos; /* 0x1C */ Vec3f scale; - /* 0x28 */ Vec3f rotation; + /* 0x28 */ Vec3f rot; /* 0x34 */ char unk_34[0x4]; /* 0x38 */ Mtx transformMatrix; } Shadow; // size = 0x78 @@ -790,15 +785,15 @@ typedef struct Camera { /* 0x048 */ Vec3f lookAt_obj; /* 0x054 */ Vec3f lookAt_obj_target; /* 0x060 */ Vec3f targetPos; - /* 0x06C */ f32 currentYaw; + /* 0x06C */ f32 curYaw; /* 0x070 */ f32 unk_70; - /* 0x074 */ f32 currentBoomYaw; - /* 0x078 */ f32 currentBoomLength; - /* 0x07C */ f32 currentYOffset; + /* 0x074 */ f32 curBoomYaw; + /* 0x078 */ f32 curBoomLength; + /* 0x07C */ f32 curYOffset; /* 0x080 */ char unk_80[4]; - /* 0x084 */ Vec3f trueRotation; - /* 0x090 */ f32 currentBlendedYawNegated; - /* 0x094 */ f32 currentPitch; + /* 0x084 */ Vec3f trueRot; + /* 0x090 */ f32 curBlendedYawNegated; + /* 0x094 */ f32 curPitch; /* 0x098 */ f32 unk_98; /* 0x09C */ f32 unk_9C; /* 0x0A0 */ Vp vp; @@ -820,7 +815,7 @@ typedef struct Camera { /* 0x212 */ s16 unk_212; /* 0x214 */ CameraUnk unk_214[4]; /* 0x444 */ CameraControlSettings* prevController; - /* 0x448 */ CameraControlSettings* currentController; + /* 0x448 */ CameraControlSettings* curController; /* 0x44C */ CamConfiguration prevConfiguration; /* 0x468 */ CamConfiguration goalConfiguration; /* 0x484 */ f32 interpAlpha; @@ -866,7 +861,7 @@ typedef struct BattleStatus { /* */ f32 varTableF[16]; /* */ void* varTablePtr[16]; /* */ }; - /* 0x048 */ s8 currentSubmenu; + /* 0x048 */ s8 curSubmenu; /* 0x049 */ s8 unk_49; /* 0x04A */ s8 unk_4A; /* 0x04B */ s8 unk_4B; @@ -938,31 +933,31 @@ typedef struct BattleStatus { /* 0x170 */ s8 nextEnemyIndex; /* (during enemy turn) who should go next */ /* 0x171 */ s8 numEnemyActors; /* 0x172 */ s16 activeEnemyActorID; /* (during enemy turn) enemy currently using their move */ - /* 0x174 */ struct Actor* currentTurnEnemy; + /* 0x174 */ struct Actor* curTurnEnemy; /* 0x178 */ s8 moveCategory; ///< 0 = jump, 1 = hammer, 5 = partner, ... /* 0x179 */ char unk_179; /* 0x17A */ s16 moveArgument; // argument provided for move; can be hammer/boots level, itemID, etc /* 0x17C */ s16 selectedMoveID; - /* 0x17E */ s16 currentAttackDamage; + /* 0x17E */ s16 curAttackDamage; /* 0x180 */ s16 lastAttackDamage; /* 0x182 */ char unk_182[2]; - /* 0x184 */ s32 currentTargetListFlags; /* set when creating a target list, also obtain from the flags field of moves */ - /* 0x188 */ s32 currentAttackElement; - /* 0x18C */ s32 currentAttackEventSuppression; - /* 0x190 */ s32 currentAttackStatus; + /* 0x184 */ s32 curTargetListFlags; /* set when creating a target list, also obtain from the flags field of moves */ + /* 0x188 */ s32 curAttackElement; + /* 0x18C */ s32 curAttackEventSuppression; + /* 0x190 */ s32 curAttackStatus; /* 0x194 */ u8 statusChance; /* 0x195 */ s8 statusDuration; /* 0x196 */ char unk_196; /* 0x197 */ s8 targetHomeIndex; /* some sort of home index used for target list construction */ /* 0x198 */ s8 powerBounceCounter; /* 0x199 */ s8 wasStatusInflicted; /* during last attack */ - /* 0x19A */ u8 currentDamageSource; + /* 0x19A */ u8 curDamageSource; /* 0x19B */ char unk_19B[5]; - /* 0x1A0 */ s16 currentTargetID; /* selected? */ - /* 0x1A2 */ s8 currentTargetPart; /* selected? */ + /* 0x1A0 */ s16 curTargetID; /* selected? */ + /* 0x1A2 */ s8 curTargetPart; /* selected? */ /* 0x1A3 */ char unk_1A3; - /* 0x1A4 */ s16 currentTargetID2; - /* 0x1A6 */ s8 currentTargetPart2; + /* 0x1A4 */ s16 curTargetID2; + /* 0x1A6 */ s8 curTargetPart2; /* 0x1A7 */ s8 battlePhase; /* 0x1A8 */ s16 attackerActorID; /* 0x1AA */ s16 unk_1AA; @@ -973,9 +968,9 @@ typedef struct BattleStatus { /* 0x1F6 */ s8 submenuStatus[24]; ///< @see enum BattleSubmenuStatus /* 0x20E */ u8 submenuMoveCount; /* 0x20F */ char unk_20F; - /* 0x210 */ s32 currentButtonsDown; - /* 0x214 */ s32 currentButtonsPressed; - /* 0x218 */ s32 currentButtonsHeld; + /* 0x210 */ s32 curButtonsDown; + /* 0x214 */ s32 curButtonsPressed; + /* 0x218 */ s32 curButtonsHeld; /* 0x21C */ s32 stickX; /* 0x220 */ s32 stickY; /* 0x224 */ s32 inputBitmask; @@ -988,7 +983,7 @@ typedef struct BattleStatus { /* 0x432 */ s8 darknessMode; /* 0x433 */ u8 unk_433; /* 0x434 */ s32* actionCmdDifficultyTable; - /* 0x438 */ struct Stage* currentStage; + /* 0x438 */ struct Stage* curStage; /* 0x43C */ struct EffectInstance* buffEffect; /* 0x440 */ u8 tattleFlags[28]; /* 0x45C */ char unk_45C[4]; @@ -1071,7 +1066,7 @@ typedef struct AnimatorNode { /* 0x04 */ struct AnimatorNode* children[32]; /* 0x84 */ Vec3f basePos; // ? /* 0x90 */ Vec3f pos; - /* 0x9C */ Vec3f rotation; + /* 0x9C */ Vec3f rot; /* 0xA8 */ Vec3f scale; /* 0xB4 */ Matrix4f mtx; /* 0xF4 */ s16 flags; @@ -1087,7 +1082,7 @@ typedef struct AnimatorNode { typedef struct AnimatorNodeBlueprint { /* 0x00 */ void* displayList; /* 0x04 */ Vec3f basePos; - /* 0x10 */ Vec3f rotation; + /* 0x10 */ Vec3f rot; /* 0x1C */ char unk_1C[0x4]; } AnimatorNodeBlueprint; // size = 0x20 @@ -1157,7 +1152,7 @@ typedef struct ItemEntity { /* 0x00 */ s32 flags; /* 0x04 */ s16 boundVar; /* 0x06 */ s16 pickupMsgFlags; - /* 0x08 */ Vec3f position; + /* 0x08 */ Vec3f pos; /* 0x14 */ struct ItemEntityPhysicsData* physicsData; /* 0x18 */ s16 itemID; /* 0x1A */ s8 state; @@ -1192,7 +1187,7 @@ typedef struct MessagePrintState { /* 0x006 */ char unk_06[2]; /* 0x008 */ s32 msgID; /* 0x00C */ u16 srcBufferPos; - /* 0x00E */ u16 currentPrintDelay; + /* 0x00E */ u16 curPrintDelay; /* 0x010 */ u8 printBuffer[1088]; // slightly larger than source buffer /* 0x450 */ s16 printBufferSize; /* 0x452 */ u16 effectFrameCounter; @@ -1209,14 +1204,14 @@ typedef struct MessagePrintState { /* 0x468 */ u8 lineCount; /* 0x469 */ char unk_469[0x3]; /* 0x46C */ s32 unk_46C; - /* 0x470 */ u8 currentAnimFrame[4]; + /* 0x470 */ u8 curAnimFrame[4]; /* 0x474 */ s16 animTimers[4]; /* 0x47C */ u8 rewindArrowAnimState; /* 0x47D */ char unk_47D[0x1]; /* 0x47E */ s16 rewindArrowCounter; /* 0x480 */ s16 rewindArrowSwingPhase; /* 0x482 */ Vec2su rewindArrowPos; - /* 0x486 */ u8 currentLine; + /* 0x486 */ u8 curLine; /* 0x487 */ u8 unkArraySize; /* 0x488 */ u16 lineEndPos[4]; /* 0x490 */ char unk_490[0x38]; @@ -1227,7 +1222,7 @@ typedef struct MessagePrintState { /* 0x4CF */ char unk_4CF[0x1]; /* 0x4D0 */ u16 cursorPosX[6]; /* 0x4DC */ u16 cursorPosY[6]; - /* 0x4E8 */ u8 currentOption; + /* 0x4E8 */ u8 curOption; /* 0x4E9 */ s8 madeChoice; /* 0x4EA */ u8 cancelOption; /* 0x4EB */ char unk_4EB[0x1]; @@ -1258,7 +1253,7 @@ typedef struct MessagePrintState { /* 0x524 */ s32 speedSoundIDB; /* 0x528 */ u16 varBufferReadPos; /* 0x52A */ s8 unk_52A; - /* 0x52B */ u8 currentImageIndex; + /* 0x52B */ u8 curImageIndex; /* 0x52C */ Vec2su varImageScreenPos; // in addition, posX=0 is taken as 'dont draw' /* 0x530 */ u8 varImgHasBorder; /* 0x531 */ u8 varImgFinalAlpha; @@ -1300,7 +1295,7 @@ typedef struct MessageDrawState { /* 0x38 */ u32 effectFlags; /* 0x3C */ u16 font; // 0 or 1 /* 0x3E */ u16 fontVariant; - /* 0x40 */ u8 currentPosX; + /* 0x40 */ u8 curPosX; /* 0x41 */ char unk_41; /* 0x42 */ u16 nextPos[2]; /* 0x46 */ s16 textStartPos[2]; // relative to textbox @@ -1387,7 +1382,7 @@ typedef struct ShopSellPriceData { } ShopSellPriceData; // size = 0xC typedef struct GameStatus { - /* 0x000 */ u32 currentButtons[4]; + /* 0x000 */ u32 curButtons[4]; /* 0x010 */ u32 pressedButtons[4]; /* bits = 1 for frame of button press */ /* 0x020 */ u32 heldButtons[4]; /* bits = 1 every 4th frame during hold */ /* 0x030 */ u32 prevButtons[4]; /* from previous frame */ @@ -1503,12 +1498,12 @@ typedef struct PushBlockGrid { } PushBlockGrid; // size = 0x1C typedef struct ItemEntityPhysicsData { - /* 0x00 */ f32 verticalVelocity; + /* 0x00 */ f32 verticalVel; /* 0x04 */ f32 gravity; /* 2 = normal, 1 = low gravity, higher values never 'settle' */ /* 0x08 */ f32 collisionRadius; - /* 0x0C */ f32 constVelocity; - /* 0x10 */ f32 velx; - /* 0x14 */ f32 velz; + /* 0x0C */ f32 constVel; + /* 0x10 */ f32 velX; + /* 0x14 */ f32 velZ; /* 0x18 */ f32 moveAngle; /* 0x1C */ s32 timeLeft; /* 0x20 */ b32 useSimplePhysics; @@ -1516,7 +1511,7 @@ typedef struct ItemEntityPhysicsData { typedef struct RenderTask { /* 0x00 */ s32 renderMode; - /* 0x04 */ s32 distance; /* value between 0 and -10k */ + /* 0x04 */ s32 dist; /* value between 0 and -10k */ /* 0x08 */ void* appendGfxArg; /* 0x0C */ void (*appendGfx)(void*); } RenderTask; // size = 0x10 @@ -1533,14 +1528,14 @@ typedef struct SelectableTarget { } SelectableTarget; // size = 0x14 typedef struct ActorPartMovement { - /* 0x00 */ Vec3f absolutePosition; + /* 0x00 */ Vec3f absolutePos; /* 0x0C */ Vec3f goalPos; /* 0x18 */ Vec3f unk_18; /* 0x24 */ f32 jumpScale; /* 0x28 */ f32 moveSpeed; /* 0x2C */ f32 unk_2C; /* 0x30 */ f32 angle; - /* 0x34 */ f32 distance; + /* 0x34 */ f32 dist; /* 0x38 */ s16 moveTime; /* 0x3A */ s16 unk_3A; /* 0x3C */ s32 unk_3C; @@ -1577,12 +1572,12 @@ typedef struct ActorPart { /* 0x14 */ Vec3s partOffset; /* 0x1A */ Vec3s visualOffset; /* 0x20 */ Vec3f partOffsetFloat; - /* 0x2C */ Vec3f absolutePosition; - /* 0x38 */ Vec3f rotation; - /* 0x44 */ Vec3s rotationPivotOffset; + /* 0x2C */ Vec3f absolutePos; + /* 0x38 */ Vec3f rot; + /* 0x44 */ Vec3s rotPivotOffset; /* 0x4A */ char unk_4A[2]; /* 0x4C */ Vec3f scale; - /* 0x58 */ Vec3f currentPos; + /* 0x58 */ Vec3f curPos; /* 0x64 */ f32 yaw; /* 0x68 */ s16 palAnimPosOffset[2]; // used by some palette animations to slightly adjust the screen position /* 0x6C */ Vec2s targetOffset; @@ -1595,7 +1590,7 @@ typedef struct ActorPart { /* 0x7C */ s32 eventFlags; /* 0x80 */ s32 elementalImmunities; // bits from Elements, i.e., ELEMENT_FIRE | ELEMENT_QUAKE /* 0x84 */ s32 spriteInstanceID; - /* 0x88 */ u32 currentAnimation; + /* 0x88 */ u32 curAnimation; /* 0x8C */ s32 animNotifyValue; /* 0x90 */ f32 animationRate; /* 0x94 */ u32* idleAnimations; @@ -1628,15 +1623,15 @@ typedef struct FontRasterSet { typedef struct CollisionStatus { /* 0x00 */ s16 pushingAgainstWall; /* FFFF = none for all below VVV */ - /* 0x02 */ s16 currentFloor; /* valid on touch */ + /* 0x02 */ s16 curFloor; /* valid on touch */ /* 0x04 */ s16 lastTouchedFloor; /* valid after jump */ /* 0x06 */ s16 floorBelow; - /* 0x08 */ s16 currentCeiling; /* valid on touching with head */ - /* 0x0A */ s16 currentInspect; /* associated with TRIGGER_WALL_PRESS_A */ + /* 0x08 */ s16 curCeiling; /* valid on touching with head */ + /* 0x0A */ s16 curInspect; /* associated with TRIGGER_WALL_PRESS_A */ /* 0x0C */ s16 unk_0C; /* associated with TRIGGER_FLAG_2000 */ /* 0x0E */ s16 unk_0E; /* associated with TRIGGER_FLAG_4000 */ /* 0x10 */ s16 unk_10; /* associated with TRIGGER_FLAG_8000 */ - /* 0x12 */ s16 currentWall; + /* 0x12 */ s16 curWall; /* 0x14 */ s16 lastWallHammered; /* valid when smashing */ /* 0x16 */ s16 touchingWallTrigger; /* 0/1 */ /* 0x18 */ s16 bombetteExploded; /* 0 = yes, FFFF = no */ @@ -1703,8 +1698,8 @@ typedef struct DecorationTable { /* 0x7FC */ s16 posX[16]; /* 0x81C */ s16 posY[16]; /* 0x83C */ s16 posZ[16]; - /* 0x85C */ s8 rotationPivotOffsetX[16]; - /* 0x86C */ s8 rotationPivotOffsetY[16]; + /* 0x85C */ s8 rotPivotOffsetX[16]; + /* 0x86C */ s8 rotPivotOffsetY[16]; /* 0x87C */ u8 rotX[16]; /* 0x88C */ u8 rotY[16]; /* 0x89C */ u8 rotZ[16]; @@ -1748,7 +1743,7 @@ typedef struct AnimatedModel { /* 0x10 */ Vec3f rot; /* 0x1C */ Vec3f scale; /* 0x28 */ Mtx mtx; - /* 0x68 */ s16* currentAnimData; + /* 0x68 */ s16* curAnimData; /* 0x6C */ char unk_6C[4]; } AnimatedModel; // size = 0x70 @@ -1768,15 +1763,15 @@ typedef struct CollisionHeader { } CollisionHeader; // size = 0x20 typedef struct ActorMovement { - /* 0x00 */ Vec3f currentPos; + /* 0x00 */ Vec3f curPos; /* 0x0C */ Vec3f goalPos; /* 0x18 */ Vec3f unk_18; /* 0x24 */ char unk_24[0x18]; /* 0x3C */ f32 acceleration; /* 0x40 */ f32 speed; - /* 0x44 */ f32 velocity; + /* 0x44 */ f32 vel; /* 0x48 */ f32 angle; - /* 0x4C */ f32 distance; + /* 0x4C */ f32 dist; /* 0x50 */ f32 flyElapsed; /* 0x54 */ char unk_11C[4]; /* 0x58 */ s16 flyTime; @@ -1785,7 +1780,7 @@ typedef struct ActorMovement { // a single link of a chain chomp's chain typedef struct ChompChain { - /* 0x00 */ Vec3f currentPos; + /* 0x00 */ Vec3f curPos; /* 0x0C */ f32 unk_0C; /* 0x10 */ f32 unk_10; /* 0x14 */ f32 gravAccel; @@ -1798,7 +1793,7 @@ typedef struct ChompChain { } ChompChain; // size = 0x30 typedef struct ActorState { // TODO: Make the first field of this an ActorMovement - /* 0x00 */ Vec3f currentPos; + /* 0x00 */ Vec3f curPos; /* 0x0C */ Vec3f goalPos; /* 0x18 */ Vec3f unk_18; /* 0x24 */ f32 unk_24; @@ -1807,9 +1802,9 @@ typedef struct ActorState { // TODO: Make the first field of this an ActorMoveme /* 0x30 */ Vec3f unk_30; /* 0x3C */ f32 acceleration; /* 0x40 */ f32 speed; - /* 0x44 */ f32 velocity; + /* 0x44 */ f32 vel; /* 0x48 */ f32 angle; - /* 0x4C */ f32 distance; + /* 0x4C */ f32 dist; /* 0x50 */ f32 bounceDivisor; /* 0x54 */ char unk_54[0x4]; /* 0x58 */ s32 animJumpRise; @@ -1843,11 +1838,11 @@ typedef struct Actor { /* 0x136 */ u8 actorType; /* 0x137 */ char unk_137; /* 0x138 */ Vec3f homePos; - /* 0x144 */ Vec3f currentPos; + /* 0x144 */ Vec3f curPos; /* 0x150 */ Vec3s headOffset; /* 0x156 */ Vec3s healthBarPos; - /* 0x15C */ Vec3f rotation; - /* 0x168 */ Vec3s rotationPivotOffset; + /* 0x15C */ Vec3f rot; + /* 0x168 */ Vec3s rotPivotOffset; /* 0x16E */ char unk_16E[2]; /* 0x170 */ Vec3f scale; /* 0x17C */ Vec3f scaleModifier; /* multiplies normal scale factors componentwise */ @@ -1862,7 +1857,7 @@ typedef struct Actor { /* 0x19B */ char unk_19B[1]; /* 0x19C */ s32 actorTypeData1[6]; /* 4 = jump sound, 5 = attack sound */ // TODO: struct /* 0x1B4 */ s16 actorTypeData1b[2]; - /* 0x1B8 */ s8 currentHP; + /* 0x1B8 */ s8 curHP; /* 0x1B9 */ s8 maxHP; /* 0x1BA */ char unk_1BA[2]; /* 0x1BC */ s8 healthFraction; /* used to render HP bar */ @@ -1950,17 +1945,17 @@ typedef struct FontData { } FontData; // size = 0x18 typedef struct SlideParams { - f32 heading; - f32 maxDescendAccel; - f32 launchVelocity; - f32 maxDescendVelocity; - f32 integrator[4]; -} SlideParams; + /* 0x00 */ f32 heading; + /* 0x04 */ f32 maxDescendAccel; + /* 0x08 */ f32 launchVel; + /* 0x0C */ f32 maxDescendVel; + /* 0x10 */ f32 integrator[4]; +} SlideParams; // size = 0x14 typedef struct PlayerStatus { /* 0x000 */ s32 flags; // PlayerStatusFlags /* 0x004 */ u32 animFlags; - /* 0x008 */ s16 currentStateTime; + /* 0x008 */ s16 curStateTime; /* 0x00A */ s8 shiverTime; /* 0x00B */ char unk_0B; /* 0x00C */ s8 peachDisguise; @@ -1971,15 +1966,15 @@ typedef struct PlayerStatus { /* 0x012 */ s16 moveFrames; /* 0x014 */ s8 enableCollisionOverlapsCheck; /* 0x015 */ s8 inputDisabledCount; /* whether the C-up menu can appear */ - /* 0x016 */ Vec3s lastGoodPosition; - /* 0x01C */ Vec3f pushVelocity; - /* 0x028 */ Vec3f position; + /* 0x016 */ Vec3s lastGoodPos; + /* 0x01C */ Vec3f pushVel; + /* 0x028 */ Vec3f pos; /* 0x034 */ Vec2f groundAnglesXZ; /* angles along X/Z axes of ground beneath player */ /* 0x03C */ VecXZf jumpFromPos; /* 0x044 */ VecXZf landPos; /* 0x04C */ f32 jumpFromHeight; /* 0x050 */ f32 jumpApexHeight; - /* 0x054 */ f32 currentSpeed; + /* 0x054 */ f32 curSpeed; /* 0x058 */ f32 walkSpeed; /* 0x05C */ f32 runSpeed; /* 0x060 */ s32 unk_60; @@ -1988,7 +1983,7 @@ typedef struct PlayerStatus { /* 0x06C */ f32 maxJumpSpeed; /* 0x070 */ f32 gravityIntegrator[4]; /* 0x080 */ f32 targetYaw; - /* 0x084 */ f32 currentYaw; + /* 0x084 */ f32 curYaw; /* 0x088 */ f32 overlapPushYaw; /* 0x08C */ f32 pitch; /* 0x090 */ f32 flipYaw[4]; @@ -2016,11 +2011,11 @@ typedef struct PlayerStatus { /* 0x0D0 */ SlideParams* slideParams; /* 0x0D4 */ f32 spinRate; /* 0x0D8 */ struct EffectInstance* specialDecorationEffect; - /* 0x0DC */ s32 currentButtons; + /* 0x0DC */ s32 curButtons; /* 0x0E0 */ s32 pressedButtons; /* 0x0E4 */ s32 heldButtons; /* 0x0E8 */ s32 stickAxis[2]; - /* 0x0F0 */ s32 currentButtonsBuffer[10]; + /* 0x0F0 */ s32 curButtonsBuffer[10]; /* 0x118 */ s32 pressedButtonsBuffer[10]; /* 0x140 */ s32 heldButtonsBuffer[10]; /* 0x168 */ s32 stickXBuffer[10]; @@ -2244,8 +2239,8 @@ typedef struct TweesterPhysics { /* 0x08 */ s32 prevFlags; ///< Partner npc flags before contact with Tweester /* 0x0C */ f32 radius; /* 0x10 */ f32 angle; - /* 0x14 */ f32 angularVelocity; - /* 0x18 */ f32 liftoffVelocityPhase; + /* 0x14 */ f32 angularVel; + /* 0x18 */ f32 liftoffVelPhase; } TweesterPhysics; // size = 0x1C typedef struct PartnerStatus { @@ -2255,7 +2250,7 @@ typedef struct PartnerStatus { /* 0x003 */ s8 actingPartner; /* 0x004 */ s16 stickX; /* 0x006 */ s16 stickY; - /* 0x008 */ s32 currentButtons; + /* 0x008 */ s32 curButtons; /* 0x00C */ s32 pressedButtons; /* 0x010 */ s32 heldButtons; /* 0x014 */ s8 inputDisabledCount; @@ -2294,7 +2289,7 @@ typedef struct VirtualEntity { /* 0x38 */ f32 moveAngle; /* 0x3C */ f32 moveSpeed; /* 0x40 */ f32 jumpGravity; - /* 0x44 */ f32 jumpVelocity; + /* 0x44 */ f32 jumpVel; /* 0x48 */ f32 moveTime; } VirtualEntity; // size = 0x4C diff --git a/include/effects.h b/include/effects.h index dd08a0a952..d018b3b54b 100644 --- a/include/effects.h +++ b/include/effects.h @@ -70,12 +70,12 @@ typedef struct FlowerFXData { /* 0x18 */ Vec3f scale; /* 0x24 */ Vec3f rot; /* 0x30 */ Mtx transformMtx; - /* 0x70 */ f32 velocityScaleA; - /* 0x74 */ f32 velocityScaleB; + /* 0x70 */ f32 velScaleA; + /* 0x74 */ f32 velScaleB; /* 0x78 */ f32 visibilityAmt; // when this is zero, the flower can vanish. may have once controlled alpha. /* 0x7C */ f32 unk_7C; /* 0x80 */ f32 integrator[4]; - /* 0x90 */ VecXZf velocity; + /* 0x90 */ VecXZf vel; } FlowerFXData; // size = 0x98 typedef struct CloudPuffFXData { @@ -833,7 +833,7 @@ typedef struct LightRaysFXData { /* 0x50 */ f32 unk_50; /* 0x54 */ f32 unk_54; /* 0x58 */ f32 unk_58; - /* 0x5C */ Vec3f rotation; + /* 0x5C */ Vec3f rot; /* 0x68 */ f32 unk_68; /* 0x6C */ f32 unk_6C; /* 0x70 */ Vec3f initialRot; @@ -1746,7 +1746,7 @@ typedef struct ThrowSpinyFXData { /* 0x48 */ f32 gravity; /* 0x4C */ f32 unk_4C; /* 0x50 */ f32 yaw; - /* 0x54 */ f32 rotationSpeed; + /* 0x54 */ f32 rotSpeed; /* 0x58 */ f32 xScale; /* 0x5C */ f32 yScale; /* 0x60 */ u32 state; @@ -2065,7 +2065,7 @@ typedef struct StaticStatusFXData { /* 0x18 */ f32 unk_18; /* 0x1C */ f32 unk_1C; /* 0x20 */ s32 frame; // not visible when negative - /* 0x24 */ f32 rotation; + /* 0x24 */ f32 rot; /* 0x28 */ s32 timeLeft; /* 0x2C */ s32 lifetime; /* 0x30 */ s32 alpha; @@ -2125,7 +2125,7 @@ typedef struct Effect75FXData { typedef struct FireworkRocketFXData { /* 0x00 */ s32 variation; /* 0x04 */ Vec3f pos; - /* 0x10 */ Vec3f velocity; + /* 0x10 */ Vec3f vel; /* 0x1C */ s32 timeLeft; /* 0x20 */ s32 lifeTime; /* 0x24 */ s32 r; @@ -2142,9 +2142,9 @@ typedef struct FireworkRocketFXData { /* 0x50 */ f32 rocketX[4]; /* 0x60 */ f32 rocketY[4]; /* 0x70 */ f32 rocketZ[4]; - /* 0x80 */ f32 rocketVelocityX[4]; - /* 0x90 */ f32 rocketVelocityY[4]; - /* 0xA0 */ f32 rocketVelocityZ[4]; + /* 0x80 */ f32 rocketVelX[4]; + /* 0x90 */ f32 rocketVelY[4]; + /* 0xA0 */ f32 rocketVelZ[4]; } FireworkRocketFXData; // size = 0xB0 typedef struct PeachStarBeamSpirit { @@ -2168,8 +2168,8 @@ typedef struct PeachStarBeamFXData { /* 0x34 */ s32 envA; /* 0x38 */ f32 beamScale; /* 0x3C */ s32 unk_3C; - /* 0x40 */ f32 rotationSpeed; - /* 0x44 */ f32 rotationAngle; + /* 0x40 */ f32 rotSpeed; + /* 0x44 */ f32 rotAngle; /* 0x48 */ f32 circleRadius; /* 0x4C */ Vec3f circleCenter; /* 0x58 */ f32 twinkYOffset; @@ -2207,7 +2207,7 @@ typedef struct IceShardFXData { /* 0x18 */ Color4i primCol; /* 0x28 */ Color4i envCol; /* 0x38 */ f32 scale; - /* 0x3C */ f32 rotation; + /* 0x3C */ f32 rot; /* 0x40 */ f32 angularVel; /* 0x44 */ f32 animFrame; /* 0x48 */ f32 animRate; @@ -2332,7 +2332,7 @@ typedef struct PartnerBuffFXData { typedef struct QuizmoAssistantFXData { /* 0x00 */ s32 unk_00; - /* 0x04 */ Vec3f position; + /* 0x04 */ Vec3f pos; /* 0x10 */ s32 vanishTimer; /* 0x14 */ s32 lifetime; /* 0x18 */ s32 fadeInAmt; // 0 = all-black, FF = fully-visible diff --git a/include/entity.h b/include/entity.h index c6643dab63..7d372a0fd5 100644 --- a/include/entity.h +++ b/include/entity.h @@ -74,7 +74,7 @@ typedef struct SaveBlockData { } SaveBlockData; // size = 0x20 typedef struct SwitchData { - /* 0x000 */ f32 fallVelocity; + /* 0x000 */ f32 fallVel; /* 0x004 */ f32 deltaScaleX; /* 0x008 */ f32 deltaScaleY; /* 0x00C */ char unk_0C[4]; @@ -155,7 +155,7 @@ typedef struct HeartBlockContentData { /* 0x00B */ char unk_0B; // padding? /* 0x00C */ s32 unk_0C; /* 0x010 */ s32 unk_10; - /* 0x014 */ f32 riseVelocity; + /* 0x014 */ f32 riseVel; /* 0x018 */ f32 sparkleTrailAngle; /* 0x01C */ f32 sparkleTrailRadius; /* 0x020 */ f32 bouncePhase; @@ -163,7 +163,7 @@ typedef struct HeartBlockContentData { /* 0x026 */ s16 unk_26; /* 0x028 */ f32 yawBuffer[10]; /* 0x050 */ f32 unk_50; - /* 0x054 */ f32 rotationRate; + /* 0x054 */ f32 rotRate; /* 0x058 */ Mtx unk_58; /* 0x098 */ Mtx unk_98; } HeartBlockContentData; // size = 0xD8 @@ -171,7 +171,7 @@ typedef struct HeartBlockContentData { typedef struct WoodenCrateData { /* 0x000 */ s32 itemID; /* 0x004 */ u16 globalFlagIndex; - /* 0x006 */ u8 unk_06[2]; + /* 0x006 */ u8 unk_06[2]; /* 0x008 */ Gfx** fragmentsGfx; /* 0x00C */ f32 basePosY; /* 0x010 */ s8 fragmentRebounds[36]; @@ -179,7 +179,7 @@ typedef struct WoodenCrateData { /* 0x058 */ u8 fragmentRotX[36]; // scaled to map [0,255] -> [0,360] /* 0x07C */ u8 fragmentRotY[36]; // scaled to map [0,255] -> [0,360] /* 0x0A0 */ u8 fragmentLateralSpeed[36]; // scaled to map [0,255] -> [0,25.5] - /* 0x0C4 */ f32 fragmentRotationSpeed[36]; + /* 0x0C4 */ f32 fragmentRotSpeed[36]; /* 0x154 */ f32 fragmentPosX[36]; /* 0x1E4 */ f32 fragmentPosY[36]; /* 0x274 */ f32 fragmentPosZ[36]; @@ -218,7 +218,7 @@ typedef struct BlueWarpPipeData { } BlueWarpPipeData; // size = 0x1C typedef struct SimpleSpringData { - /* 0x00 */ s32 launchVelocity; + /* 0x00 */ s32 launchVel; } SimpleSpringData; // size = 0x04 typedef struct HiddenPanelData { @@ -235,9 +235,9 @@ typedef struct HiddenPanelData { /* 0x14 */ s32 spawnedItemIndex; /* 0x18 */ Vec3i spawnedItemPos; /* 0x24 */ f32 initialY; - /* 0x28 */ f32 riseVelocity; + /* 0x28 */ f32 riseVel; /* 0x2C */ f32 riseInterpPhase; - /* 0x30 */ f32 rotationSpeed; + /* 0x30 */ f32 rotSpeed; /* 0x34 */ Matrix4f entityMatrix; /* 0x74 */ u16 modelID; /* 0x76 */ char unk_76[0x2]; @@ -252,7 +252,7 @@ typedef struct PadlockData { /* 0x00 */ f32 pushSpeed; /* 0x04 */ f32 shacklePos; /* 0x08 */ f32 fallSpeed; - /* 0x0C */ f32 rotationSpeed; + /* 0x0C */ f32 rotSpeed; /* 0x10 */ u8 blinkCounter; /* 0x11 */ s8 timer; /* 0x12 */ s8 state; @@ -269,7 +269,7 @@ typedef struct BoardedFloorData { /* 0x022 */ u8 fragmentRotX[13]; /* 0x02F */ u8 fragmentRotY[13]; /* 0x03C */ u8 fragmentLateralSpeed[13]; - /* 0x04C */ f32 fragmentRotationSpeed[13]; + /* 0x04C */ f32 fragmentRotSpeed[13]; /* 0x080 */ f32 fragmentPosX[13]; /* 0x0B4 */ f32 fragmentPosY[13]; /* 0x0E8 */ f32 fragmentPosZ[13]; @@ -284,7 +284,7 @@ typedef struct BombableRockData { /* 0x14 */ u8 fragmentRotX[6]; /* 0x1A */ u8 fragmentRotY[6]; /* 0x20 */ u8 fragmentLateralSpeed[6]; - /* 0x28 */ f32 fragmentRotationSpeed[6]; + /* 0x28 */ f32 fragmentRotSpeed[6]; /* 0x40 */ f32 fragmentPosX[6]; /* 0x58 */ f32 fragmentPosY[6]; /* 0x70 */ f32 fragmentPosZ[6]; @@ -298,7 +298,7 @@ typedef struct TweesterData { /* 0x01 */ s8 faceAnimState; /* 0x02 */ s8 faceAnimTimer; /* 0x03 */ s8 faceAnimTexOffset; - /* 0x04 */ f32 rotationSpeed; + /* 0x04 */ f32 rotSpeed; /* 0x08 */ f32 innerWhirlRotY; /* 0x0C */ f32 outerWhirlRotY; /* 0x10 */ Mtx mtxInnerWhirl; @@ -308,7 +308,7 @@ typedef struct TweesterData { /* 0x94 */ s16 outerWhirlTexOffsetX; /* 0x96 */ s16 outerWhirlTexOffsetY; /* 0x98 */ s16 frameCounter; - /* 0x9C */ s32* currentPath; + /* 0x9C */ s32* curPath; /* 0xA0 */ s32** paths; /* 0xA4 */ s16 targetX; /* 0xA6 */ s16 targetY; @@ -330,9 +330,9 @@ typedef struct StarBoxLauncherData { /* 0x0C */ f32 basePosZ; /* 0x10 */ f32 basePosY; /* 0x14 */ f32 riseSpeedPhase; - /* 0x18 */ f32 riseVelocity; - /* 0x1C */ f32 rotationZPhase; - /* 0x20 */ f32 maxRotationZ; + /* 0x18 */ f32 riseVel; + /* 0x1C */ f32 rotZPhase; + /* 0x20 */ f32 maxRotZ; } StarBoxLauncherData; // size = 0x24 typedef struct CymbalPlantData { @@ -353,7 +353,7 @@ typedef struct PinkFlowerData { typedef struct SpinningFlowerData { /* 0x00 */ s16 unk_00; /* 0x02 */ s8 state; - /* 0x04 */ Vec3f rotation; + /* 0x04 */ Vec3f rot; /* 0x10 */ s32 unk_10; /* 0x14 */ f32 spinSpeed; /* 0x18 */ s32 unk_18; diff --git a/include/npc.h b/include/npc.h index 635d50de9c..85bd68034c 100644 --- a/include/npc.h +++ b/include/npc.h @@ -117,7 +117,7 @@ typedef void (*FireBarCallback)(struct FireBarData*, s32); typedef struct FireBarAISettings { /* 0x00 */ Vec3i centerPos; - /* 0x0C */ s32 rotationRate; + /* 0x0C */ s32 rotRate; /* 0x10 */ s32 firstNpc; /* 0x14 */ s32 npcCount; /* 0x18 */ FireBarCallback callback; @@ -126,7 +126,7 @@ typedef struct FireBarAISettings { typedef struct FireBarData { /* 0x00 */ s32 flags; /* 0x04 */ Vec3f centerPos; - /* 0x10 */ f32 rotationRate; + /* 0x10 */ f32 rotRate; /* 0x14 */ s32 firstNpc; /* 0x18 */ s32 npcCount; /* 0x1C */ FireBarCallback callback; @@ -391,16 +391,16 @@ typedef struct EncounterStatus { /* 0x014 */ s32 songID; /* 0x018 */ s32 unk_18; /* 0x01C */ s8 numEncounters; /* number of encounters for current map (in list) */ - /* 0x01D */ s8 currentAreaIndex; - /* 0x01E */ u8 currentMapIndex; - /* 0x01F */ u8 currentEntryIndex; + /* 0x01D */ s8 curAreaIndex; + /* 0x01E */ u8 curMapIndex; + /* 0x01F */ u8 curEntryIndex; /* 0x020 */ s8 mapID; /* 0x021 */ s8 resetMapEncounterFlags; /* 0x021 */ char unk_22[2]; /* 0x024 */ s32* npcGroupList; /* 0x028 */ Encounter* encounterList[24]; - /* 0x088 */ Encounter* currentEncounter; - /* 0x08C */ Enemy* currentEnemy; + /* 0x088 */ Encounter* curEncounter; + /* 0x08C */ Enemy* curEnemy; /* 0x090 */ s32 fadeOutAmount; /* 0x094 */ s32 unk_94; /* 0x098 */ s32 fadeOutAccel; diff --git a/src/16F740.c b/src/16F740.c index d438ba26b0..563f0f2db5 100644 --- a/src/16F740.c +++ b/src/16F740.c @@ -45,8 +45,8 @@ void btl_merlee_on_start_turn(void) { if (playerData->merleeTurnCount <= 0) { s32 temp = rand_int(100); - if (currentEncounter->currentEnemy != NULL) { - if (currentEncounter->currentEnemy->flags & ACTOR_FLAG_NO_HEALTH_BAR) { + if (currentEncounter->curEnemy != NULL) { + if (currentEncounter->curEnemy->flags & ACTOR_FLAG_NO_HEALTH_BAR) { // 46/101 ≈ 45.5% if (temp <= 45) { playerData->merleeSpellType = MERLEE_SPELL_1; @@ -103,8 +103,8 @@ void btl_merlee_on_first_strike(void) { if (playerData->merleeTurnCount <= 0) { s32 temp = rand_int(100); - if (currentEncounter->currentEnemy != NULL) { - if (currentEncounter->currentEnemy->flags & ACTOR_FLAG_NO_HEALTH_BAR) { + if (currentEncounter->curEnemy != NULL) { + if (currentEncounter->curEnemy->flags & ACTOR_FLAG_NO_HEALTH_BAR) { // 46/101 ≈ 45.5% if (temp <= 45) { playerData->merleeSpellType = MERLEE_SPELL_1; @@ -215,7 +215,7 @@ void btl_state_update_normal_start(void) { stage = gCurrentStagePtr->stage; } - battleStatus->currentStage = stage; + battleStatus->curStage = stage; switch (gBattleSubState) { case BTL_SUBSTATE_NORMAL_START_INIT: BattleEnemiesCreated = battle->formationSize; @@ -247,7 +247,7 @@ void btl_state_update_normal_start(void) { battleStatus->unk_90 = 0; battleStatus->preUpdateCallback = NULL; battleStatus->initBattleCallback = NULL; - battleStatus->currentSubmenu = 0; + battleStatus->curSubmenu = 0; battleStatus->unk_49 = 0; battleStatus->unk_4A = 0; battleStatus->unk_4B = 0; @@ -458,8 +458,8 @@ void btl_state_update_normal_start(void) { script->owner1.actorID = ACTOR_PLAYER; } - if (currentEncounter->currentEnemy != NULL - && currentEncounter->currentEnemy->encountered == ENCOUNTER_TRIGGER_SPIN + if (currentEncounter->curEnemy != NULL + && currentEncounter->curEnemy->encountered == ENCOUNTER_TRIGGER_SPIN && is_ability_active(ABILITY_DIZZY_ATTACK) ) { actor = battleStatus->enemyActors[0]; @@ -766,10 +766,10 @@ void btl_state_update_begin_player_turn(void) { battleStatus->buffEffect->data.partnerBuff->unk_0C[FX_BUFF_DATA_WATER_BLOCK].turnsLeft = battleStatus->waterBlockTurnsLeft; if (battleStatus->waterBlockTurnsLeft <= 0) { battleStatus->waterBlockEffect->flags |= FX_INSTANCE_FLAG_DISMISS; - fx_water_block(1, player->currentPos.x, player->currentPos.y + 18.0f, player->currentPos.z + 5.0f, 1.5f, 10); - fx_water_splash(0, player->currentPos.x - 10.0f, player->currentPos.y + 5.0f, player->currentPos.z + 5.0f, 1.0f, 24); - fx_water_splash(0, player->currentPos.x - 15.0f, player->currentPos.y + 32.0f, player->currentPos.z + 5.0f, 1.0f, 24); - fx_water_splash(1, player->currentPos.x + 15.0f, player->currentPos.y + 22.0f, player->currentPos.z + 5.0f, 1.0f, 24); + fx_water_block(1, player->curPos.x, player->curPos.y + 18.0f, player->curPos.z + 5.0f, 1.5f, 10); + fx_water_splash(0, player->curPos.x - 10.0f, player->curPos.y + 5.0f, player->curPos.z + 5.0f, 1.0f, 24); + fx_water_splash(0, player->curPos.x - 15.0f, player->curPos.y + 32.0f, player->curPos.z + 5.0f, 1.0f, 24); + fx_water_splash(1, player->curPos.x + 15.0f, player->curPos.y + 22.0f, player->curPos.z + 5.0f, 1.0f, 24); battleStatus->waterBlockEffect = NULL; sfx_play_sound(SOUND_299); btl_show_battle_message(BTL_MSG_WATER_BLOCK_END, 60); @@ -1400,13 +1400,13 @@ void btl_state_update_9(void) { partner->flags |= ACTOR_FLAG_4000000; state = &partner->state; if (!battleStatus->outtaSightActive) { - partner->state.currentPos.x = partner->homePos.x; - partner->state.currentPos.z = partner->homePos.z; + partner->state.curPos.x = partner->homePos.x; + partner->state.curPos.z = partner->homePos.z; partner->state.goalPos.x = player->homePos.x; partner->state.goalPos.z = player->homePos.z; } else { - partner->state.currentPos.x = partner->homePos.x; - partner->state.currentPos.z = partner->homePos.z; + partner->state.curPos.x = partner->homePos.x; + partner->state.curPos.z = partner->homePos.z; partner->state.goalPos.x = partner->homePos.x; partner->state.goalPos.z = partner->homePos.z + 5.0f; partner->homePos.x = player->homePos.x; @@ -1423,32 +1423,32 @@ void btl_state_update_9(void) { if (gBattleSubState == BTL_SUBSTATE_9_3) { if (partner->state.moveTime != 0) { - partner->currentPos.x += (partner->state.goalPos.x - partner->currentPos.x) / partner->state.moveTime; - partner->currentPos.z += (partner->state.goalPos.z - partner->currentPos.z) / partner->state.moveTime; - player->currentPos.x += (partner->state.currentPos.x - player->currentPos.x) / partner->state.moveTime; - player->currentPos.z += (partner->state.currentPos.z - player->currentPos.z) / partner->state.moveTime; + partner->curPos.x += (partner->state.goalPos.x - partner->curPos.x) / partner->state.moveTime; + partner->curPos.z += (partner->state.goalPos.z - partner->curPos.z) / partner->state.moveTime; + player->curPos.x += (partner->state.curPos.x - player->curPos.x) / partner->state.moveTime; + player->curPos.z += (partner->state.curPos.z - player->curPos.z) / partner->state.moveTime; } - partner->currentPos.z -= sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f; + partner->curPos.z -= sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f; partner->yaw = clamp_angle(partner->state.angle); - player->currentPos.z += sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f; + player->curPos.z += sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f; player->yaw = clamp_angle(partner->state.angle); partner->state.angle += 90.0f; if (partner->state.moveTime != 0) { partner->state.moveTime--; } else { - partner->currentPos.x = partner->state.goalPos.x; - partner->currentPos.z = partner->state.goalPos.z; - player->currentPos.x = partner->state.currentPos.x; - player->currentPos.z = partner->state.currentPos.z; + partner->curPos.x = partner->state.goalPos.x; + partner->curPos.z = partner->state.goalPos.z; + player->curPos.x = partner->state.curPos.x; + player->curPos.z = partner->state.curPos.z; if (!battleStatus->outtaSightActive) { - partner->homePos.x = partner->currentPos.x; - partner->homePos.z = partner->currentPos.z; - player->homePos.x = player->currentPos.x; - player->homePos.z = player->currentPos.z; + partner->homePos.x = partner->curPos.x; + partner->homePos.z = partner->curPos.z; + player->homePos.x = player->curPos.x; + player->homePos.z = player->curPos.z; } else { - player->homePos.x = player->currentPos.x; - player->homePos.z = player->currentPos.z; + player->homePos.x = player->curPos.x; + player->homePos.z = player->curPos.z; } gBattleSubState = BTL_SUBSTATE_9_4; gBattleStatus.flags1 &= ~ACTOR_FLAG_100000; @@ -1605,8 +1605,8 @@ void btl_state_update_end_turn(void) { partner->flags &= ~ACTOR_FLAG_8000000; player->flags |= ACTOR_FLAG_4000000; partner->flags |= ACTOR_FLAG_4000000; - partner->state.currentPos.x = partner->homePos.x; - partner->state.currentPos.z = partner->homePos.z; + partner->state.curPos.x = partner->homePos.x; + partner->state.curPos.z = partner->homePos.z; partner->state.goalPos.x = player->homePos.x; partner->state.goalPos.z = player->homePos.z; partner->state.moveTime = 4; @@ -1617,27 +1617,27 @@ void btl_state_update_end_turn(void) { if (gBattleSubState == BTL_SUBSTATE_END_TURN_PERFORM_SWAP) { if (partner->state.moveTime != 0) { - partner->currentPos.x += (partner->state.goalPos.x - partner->currentPos.x) / partner->state.moveTime; - partner->currentPos.z += (partner->state.goalPos.z - partner->currentPos.z) / partner->state.moveTime; - player->currentPos.x += (partner->state.currentPos.x - player->currentPos.x) / partner->state.moveTime; - player->currentPos.z += (partner->state.currentPos.z - player->currentPos.z) / partner->state.moveTime; + partner->curPos.x += (partner->state.goalPos.x - partner->curPos.x) / partner->state.moveTime; + partner->curPos.z += (partner->state.goalPos.z - partner->curPos.z) / partner->state.moveTime; + player->curPos.x += (partner->state.curPos.x - player->curPos.x) / partner->state.moveTime; + player->curPos.z += (partner->state.curPos.z - player->curPos.z) / partner->state.moveTime; } - partner->currentPos.z -= sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f; + partner->curPos.z -= sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f; partner->yaw = clamp_angle(partner->state.angle); - player->currentPos.z += sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f; + player->curPos.z += sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f; player->yaw = clamp_angle(partner->state.angle); partner->state.angle += 90.0f; if (partner->state.moveTime != 0) { partner->state.moveTime--; } else { - partner->currentPos.x = partner->state.goalPos.x; - partner->currentPos.z = partner->state.goalPos.z; - player->currentPos.x = partner->state.currentPos.x; - player->currentPos.z = partner->state.currentPos.z; - partner->homePos.x = partner->currentPos.x; - partner->homePos.z = partner->currentPos.z; - player->homePos.x = player->currentPos.x; - player->homePos.z = player->currentPos.z; + partner->curPos.x = partner->state.goalPos.x; + partner->curPos.z = partner->state.goalPos.z; + player->curPos.x = partner->state.curPos.x; + player->curPos.z = partner->state.curPos.z; + partner->homePos.x = partner->curPos.x; + partner->homePos.z = partner->curPos.z; + player->homePos.x = player->curPos.x; + player->homePos.z = player->curPos.z; player->flags |= ACTOR_FLAG_8000000; partner->flags |= ACTOR_FLAG_8000000; if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { @@ -1825,10 +1825,10 @@ void btl_state_update_victory(void) { if (partner == NULL || !(gBattleStatus.flags1 & BS_FLAGS1_PLAYER_IN_BACK)) { gBattleSubState = BTL_SUBSTATE_VICTORY_CHECK_MERLEE; } else { - partner->state.currentPos.x = partner->currentPos.x; - partner->state.currentPos.z = partner->currentPos.z; - partner->state.goalPos.x = player->currentPos.x; - partner->state.goalPos.z = player->currentPos.z; + partner->state.curPos.x = partner->curPos.x; + partner->state.curPos.z = partner->curPos.z; + partner->state.goalPos.x = player->curPos.x; + partner->state.goalPos.z = player->curPos.z; partner->state.moveTime = 4; partner->state.angle = 0.0f; gBattleSubState = BTL_SUBSTATE_VICTORY_AWAIT_SWAP; @@ -1837,28 +1837,28 @@ void btl_state_update_victory(void) { if (gBattleSubState == BTL_SUBSTATE_VICTORY_AWAIT_SWAP) { if (partner->state.moveTime != 0) { - partner->currentPos.x += (partner->state.goalPos.x - partner->currentPos.x) / partner->state.moveTime; - partner->currentPos.z += (partner->state.goalPos.z - partner->currentPos.z) / partner->state.moveTime; - player->currentPos.x += (partner->state.currentPos.x - player->currentPos.x) / partner->state.moveTime; - player->currentPos.z += (partner->state.currentPos.z - player->currentPos.z) / partner->state.moveTime; + partner->curPos.x += (partner->state.goalPos.x - partner->curPos.x) / partner->state.moveTime; + partner->curPos.z += (partner->state.goalPos.z - partner->curPos.z) / partner->state.moveTime; + player->curPos.x += (partner->state.curPos.x - player->curPos.x) / partner->state.moveTime; + player->curPos.z += (partner->state.curPos.z - player->curPos.z) / partner->state.moveTime; } - partner->currentPos.z += sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f; + partner->curPos.z += sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f; partner->yaw = clamp_angle(-partner->state.angle); - player->currentPos.z -= sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f; + player->curPos.z -= sin_rad(DEG_TO_RAD(partner->state.angle)) * 16.0f; player->yaw = clamp_angle(-partner->state.angle); partner->state.angle += 90.0f; if (partner->state.moveTime != 0) { partner->state.moveTime--; } else { - partner->currentPos.x = partner->state.goalPos.x; - partner->currentPos.z = partner->state.goalPos.z; - player->currentPos.x = partner->state.currentPos.x; - player->currentPos.z = partner->state.currentPos.z; - partner->homePos.x = partner->currentPos.x; - partner->homePos.z = partner->currentPos.z; - player->homePos.x = player->currentPos.x; - player->homePos.z = player->currentPos.z; + partner->curPos.x = partner->state.goalPos.x; + partner->curPos.z = partner->state.goalPos.z; + player->curPos.x = partner->state.curPos.x; + player->curPos.z = partner->state.curPos.z; + partner->homePos.x = partner->curPos.x; + partner->homePos.z = partner->curPos.z; + player->homePos.x = player->curPos.x; + player->homePos.z = player->curPos.z; gBattleSubState = BTL_SUBSTATE_VICTORY_CHECK_MERLEE; gBattleStatus.flags1 &= ~BS_FLAGS1_PLAYER_IN_BACK; } @@ -2494,9 +2494,9 @@ void btl_state_update_change_partner(void) { battleStatus->controlScript = script; battleStatus->controlScriptID = script->id; script->owner1.actorID = ACTOR_PARTNER; - state->unk_18.x = partner->currentPos.x; + state->unk_18.x = partner->curPos.x; state->unk_18.y = 0.0f; - state->unk_18.z = partner->currentPos.z; + state->unk_18.z = partner->curPos.z; gBattleSubState = BTL_SUBSTATE_CHANGE_PARTNER_LOAD_NEW_PARTNER; break; case BTL_SUBSTATE_CHANGE_PARTNER_LOAD_NEW_PARTNER: @@ -2504,18 +2504,18 @@ void btl_state_update_change_partner(void) { break; } btl_delete_actor(partner); - playerData->currentPartner = battleStatus->unk_1AC; + playerData->curPartner = battleStatus->unk_1AC; load_partner_actor(); partner = battleStatus->partnerActor; partner->scale.x = 0.1f; partner->scale.y = 0.1f; partner->scale.z = 0.1f; partner->state.goalPos.x = state->unk_18.x; - partner->state.goalPos.y = partner->currentPos.y; + partner->state.goalPos.y = partner->curPos.y; partner->state.goalPos.z = state->unk_18.z; - partner->currentPos.x = player->currentPos.x; - partner->currentPos.y = player->currentPos.y + 25.0f; - partner->currentPos.z = player->currentPos.z; + partner->curPos.x = player->curPos.x; + partner->curPos.y = player->curPos.y + 25.0f; + partner->curPos.z = player->curPos.z; gBattleSubState = BTL_SUBSTATE_CHANGE_PARTNER_EXEC_BRING_OUT; break; case BTL_SUBSTATE_CHANGE_PARTNER_EXEC_BRING_OUT: @@ -2600,7 +2600,7 @@ void btl_state_update_player_move(void) { battleStatus->unk_86 = 127; battleStatus->blockResult = 127; battleStatus->lastAttackDamage = 0; - battleStatus->currentDamageSource = DMG_SRC_DEFAULT; + battleStatus->curDamageSource = DMG_SRC_DEFAULT; gBattleStatus.flags1 &= ~BS_FLAGS1_AUTO_SUCCEED_ACTION; gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; reset_actor_turn_info(); @@ -3029,8 +3029,8 @@ void btl_state_update_end_player_turn(void) { if (!(gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) || (gBattleStatus.flags1 & BS_FLAGS1_PLAYER_IN_BACK)) { gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_DONE; } else { - player->state.currentPos.x = player->homePos.x; - player->state.currentPos.z = player->homePos.z; + player->state.curPos.x = player->homePos.x; + player->state.curPos.z = player->homePos.z; player->state.goalPos.x = partner->homePos.x; player->state.goalPos.z = partner->homePos.z; player->state.moveTime = 4; @@ -3042,28 +3042,28 @@ void btl_state_update_end_player_turn(void) { if (gBattleSubState == BTL_SUBSTATE_END_PLAYER_TURN_AWAIT_SWAP) { if (player->state.moveTime != 0) { - player->currentPos.x += (player->state.goalPos.x - player->currentPos.x) / player->state.moveTime; - player->currentPos.z += (player->state.goalPos.z - player->currentPos.z) / player->state.moveTime; - partner->currentPos.x += (player->state.currentPos.x - partner->currentPos.x) / player->state.moveTime; - partner->currentPos.z += (player->state.currentPos.z - partner->currentPos.z) / player->state.moveTime; + player->curPos.x += (player->state.goalPos.x - player->curPos.x) / player->state.moveTime; + player->curPos.z += (player->state.goalPos.z - player->curPos.z) / player->state.moveTime; + partner->curPos.x += (player->state.curPos.x - partner->curPos.x) / player->state.moveTime; + partner->curPos.z += (player->state.curPos.z - partner->curPos.z) / player->state.moveTime; } - player->currentPos.z += sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; + player->curPos.z += sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; player->yaw = clamp_angle(-player->state.angle); - partner->currentPos.z -= sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; + partner->curPos.z -= sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; partner->yaw = clamp_angle(-player->state.angle); player->state.angle += 90.0f; if (player->state.moveTime != 0) { player->state.moveTime--; } else { - player->currentPos.x = player->state.goalPos.x; - player->currentPos.z = player->state.goalPos.z; - partner->currentPos.x = player->state.currentPos.x; - partner->currentPos.z = player->state.currentPos.z; - player->homePos.x = player->currentPos.x; - player->homePos.z = player->currentPos.z; - partner->homePos.x = partner->currentPos.x; - partner->homePos.z = partner->currentPos.z; + player->curPos.x = player->state.goalPos.x; + player->curPos.z = player->state.goalPos.z; + partner->curPos.x = player->state.curPos.x; + partner->curPos.z = player->state.curPos.z; + player->homePos.x = player->curPos.x; + player->homePos.z = player->curPos.z; + partner->homePos.x = partner->curPos.x; + partner->homePos.z = partner->curPos.z; gBattleStatus.flags1 |= BS_FLAGS1_PLAYER_IN_BACK; gBattleSubState = BTL_SUBSTATE_END_PLAYER_TURN_DONE; } @@ -3157,7 +3157,7 @@ void btl_state_update_partner_move(void) { battleStatus->stateFreezeCount = 0; battleStatus->unk_86 = 127; battleStatus->blockResult = 127; - battleStatus->currentDamageSource = DMG_SRC_DEFAULT; + battleStatus->curDamageSource = DMG_SRC_DEFAULT; gBattleStatus.flags1 &= ~BS_FLAGS1_AUTO_SUCCEED_ACTION; gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; reset_actor_turn_info(); @@ -3263,7 +3263,7 @@ void btl_state_update_partner_move(void) { break; } decrement_status_bar_disabled(); - if (playerData->currentPartner == PARTNER_GOOMBARIO + if (playerData->curPartner == PARTNER_GOOMBARIO && battleStatus->moveCategory == BTL_MENU_TYPE_CHANGE_PARTNER && battleStatus->selectedMoveID != MOVE_CHARGE) { partner->isGlowing = 0; @@ -3469,7 +3469,7 @@ void btl_state_update_next_enemy(void) { } battleStatus->activeEnemyActorID = battleStatus->enemyIDs[i++]; - battleStatus->currentTurnEnemy = enemy; + battleStatus->curTurnEnemy = enemy; battleStatus->nextEnemyIndex = i; skipEnemy = FALSE; @@ -3584,7 +3584,7 @@ void btl_state_update_enemy_move(void) { battleStatus->actionSuccess = 0; battleStatus->unk_86 = 127; battleStatus->blockResult = 127; - battleStatus->currentDamageSource = DMG_SRC_DEFAULT; + battleStatus->curDamageSource = DMG_SRC_DEFAULT; reset_actor_turn_info(); gBattleStatus.flags1 |= BS_FLAGS1_100; player->statusAfflicted = 0; @@ -3609,7 +3609,7 @@ void btl_state_update_enemy_move(void) { } } - enemy = battleStatus->currentTurnEnemy; + enemy = battleStatus->curTurnEnemy; if (!(enemy->flags & ACTOR_FLAG_NO_ATTACK)) { reset_all_actor_sounds(enemy); battleStatus->battlePhase = PHASE_EXECUTE_ACTION; @@ -3827,13 +3827,13 @@ void btl_state_update_first_strike(void) { battleStatus->moveCategory = BTL_MENU_TYPE_JUMP; battleStatus->selectedMoveID = MOVE_UNUSED_JUMP4; battleStatus->moveArgument = encounterStatus->hitTier; - battleStatus->currentTargetListFlags = gMoveTable[MOVE_UNUSED_JUMP4].flags; + battleStatus->curTargetListFlags = gMoveTable[MOVE_UNUSED_JUMP4].flags; break; case ENCOUNTER_TRIGGER_HAMMER: battleStatus->moveCategory = BTL_MENU_TYPE_SMASH; battleStatus->selectedMoveID = MOVE_UNUSED_HAMMER4; battleStatus->moveArgument = encounterStatus->hitTier; - battleStatus->currentTargetListFlags = gMoveTable[MOVE_UNUSED_HAMMER4].flags; + battleStatus->curTargetListFlags = gMoveTable[MOVE_UNUSED_HAMMER4].flags; break; case ENCOUNTER_TRIGGER_PARTNER: btl_set_state(BATTLE_STATE_PARTNER_FIRST_STRIKE); @@ -3863,7 +3863,7 @@ void btl_state_update_first_strike(void) { func_80263230(player, enemy); battleStatus->stateFreezeCount = 0; battleStatus->lastAttackDamage = 0; - battleStatus->currentDamageSource = DMG_SRC_DEFAULT; + battleStatus->curDamageSource = DMG_SRC_DEFAULT; gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; gBattleStatus.flags2 |= BS_FLAGS2_1000000; gBattleStatus.flags1 &= ~BS_FLAGS1_PARTNER_ACTING; @@ -4034,18 +4034,18 @@ void btl_state_update_partner_striking_first(void) { D_8029F254 = 0; // setup dummy 'menu selection' for partner move level = partner->actorBlueprint->level; - switch (playerData->currentPartner) { + switch (playerData->curPartner) { case PARTNER_KOOPER: battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER; battleStatus->moveArgument = 0; battleStatus->selectedMoveID = level + MOVE_SHELL_TOSS1; - battleStatus->currentTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; + battleStatus->curTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; break; case PARTNER_BOMBETTE: battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER; battleStatus->moveArgument = 0; battleStatus->selectedMoveID = level + MOVE_BODY_SLAM1; - battleStatus->currentTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; + battleStatus->curTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; break; } // let the enemy know a first strike is coming @@ -4066,7 +4066,7 @@ void btl_state_update_partner_striking_first(void) { partner->targetPartIndex = target->partID; battleStatus->stateFreezeCount = 0; battleStatus->lastAttackDamage = 0; - battleStatus->currentDamageSource = DMG_SRC_DEFAULT; + battleStatus->curDamageSource = DMG_SRC_DEFAULT; gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; gBattleStatus.flags2 |= BS_FLAGS2_1000000; gBattleStatus.flags1 |= BS_FLAGS1_PARTNER_ACTING; @@ -4217,7 +4217,7 @@ void btl_state_update_enemy_striking_first(void) { case BTL_SUBSTATE_ENEMY_FIRST_STRIKE_INIT: battleStatus->stateFreezeCount = 0; battleStatus->lastAttackDamage = 0; - battleStatus->currentDamageSource = DMG_SRC_DEFAULT; + battleStatus->curDamageSource = DMG_SRC_DEFAULT; playerData->enemyFirstStrikes++; battleStatus->flags1 &= ~BS_FLAGS1_MENU_OPEN; D_8029F254 = 0; @@ -4272,14 +4272,14 @@ void btl_state_update_enemy_striking_first(void) { activeEnemyActorID = battleStatus->enemyIDs[nextEnemyIdx]; nextEnemyIdx++; - battleStatus->currentTurnEnemy = actor; + battleStatus->curTurnEnemy = actor; battleStatus->activeEnemyActorID = activeEnemyActorID; if (nextEnemyIdx >= battleStatus->numEnemyActors) { nextEnemyIdx = 0; } battleStatus->nextEnemyIndex = nextEnemyIdx; btl_cam_target_actor(battleStatus->activeEnemyActorID); - actor = battleStatus->currentTurnEnemy; + actor = battleStatus->curTurnEnemy; reset_actor_turn_info(); battleStatus->battlePhase = PHASE_FIRST_STRIKE; script = start_script(actor->takeTurnSource, EVT_PRIORITY_A, 0); @@ -4296,7 +4296,7 @@ void btl_state_update_enemy_striking_first(void) { D_8029F254 = 1; } - actor = battleStatus->currentTurnEnemy; + actor = battleStatus->curTurnEnemy; if (actor->takeTurnScript == NULL || !does_script_exist(actor->takeTurnScriptID)) { actor->takeTurnScript = NULL; diff --git a/src/16c8e0.c b/src/16c8e0.c index 7e701d8400..bcfabab239 100644 --- a/src/16c8e0.c +++ b/src/16c8e0.c @@ -112,7 +112,7 @@ void get_dpad_input_radial(f32* angle, f32* magnitude) { f32 maxMagnitude = 60.0f; f32 stickX = battleStatus->stickX; f32 stickY = battleStatus->stickY; - u16 currentButtonsDown = battleStatus->currentButtonsDown; + u16 currentButtonsDown = battleStatus->curButtonsDown; f32 mag; if (currentButtonsDown & (BUTTON_D_UP | BUTTON_D_DOWN | BUTTON_D_LEFT | BUTTON_D_RIGHT)) { @@ -229,9 +229,9 @@ void initialize_battle(void) { playerData->battlesCount++; } - bSavedPartner = playerData->currentPartner; + bSavedPartner = playerData->curPartner; if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { - playerData->currentPartner = PARTNER_TWINK; + playerData->curPartner = PARTNER_TWINK; } } @@ -257,17 +257,17 @@ void btl_update(void) { if ((battleStatus->flags1 & BS_FLAGS1_PARTNER_ACTING) && gGameStatusPtr->multiplayerEnabled != 0) { s32 inputBitmask = battleStatus->inputBitmask; - battleStatus->currentButtonsDown = gGameStatusPtr->currentButtons[1] & inputBitmask; - battleStatus->currentButtonsPressed = gGameStatusPtr->pressedButtons[1] & inputBitmask; - battleStatus->currentButtonsHeld = gGameStatusPtr->heldButtons[1] & inputBitmask; + battleStatus->curButtonsDown = gGameStatusPtr->curButtons[1] & inputBitmask; + battleStatus->curButtonsPressed = gGameStatusPtr->pressedButtons[1] & inputBitmask; + battleStatus->curButtonsHeld = gGameStatusPtr->heldButtons[1] & inputBitmask; battleStatus->stickX = gGameStatusPtr->stickX[1]; battleStatus->stickY = gGameStatusPtr->stickY[1]; } else { s32 inputBitmask2 = battleStatus->inputBitmask; - battleStatus->currentButtonsDown = gGameStatusPtr->currentButtons[0] & inputBitmask2; - battleStatus->currentButtonsPressed = gGameStatusPtr->pressedButtons[0] & inputBitmask2; - battleStatus->currentButtonsHeld = gGameStatusPtr->heldButtons[0] & inputBitmask2; + battleStatus->curButtonsDown = gGameStatusPtr->curButtons[0] & inputBitmask2; + battleStatus->curButtonsPressed = gGameStatusPtr->pressedButtons[0] & inputBitmask2; + battleStatus->curButtonsHeld = gGameStatusPtr->heldButtons[0] & inputBitmask2; battleStatus->stickX = gGameStatusPtr->stickX[0]; battleStatus->stickY = gGameStatusPtr->stickY[0]; } @@ -276,8 +276,8 @@ void btl_update(void) { get_dpad_input_radial(&dpadAngle, &dpadMagnitude); battleStatus->dpadX = dpadAngle; battleStatus->dpadY = dpadMagnitude; - battleStatus->pushInputBuffer[battleStatus->inputBufferPos] = battleStatus->currentButtonsPressed; - battleStatus->holdInputBuffer[battleStatus->inputBufferPos] = battleStatus->currentButtonsDown; + battleStatus->pushInputBuffer[battleStatus->inputBufferPos] = battleStatus->curButtonsPressed; + battleStatus->holdInputBuffer[battleStatus->inputBufferPos] = battleStatus->curButtonsDown; battleStatus->inputBufferPos++; if (battleStatus->inputBufferPos >= ARRAY_COUNT(battleStatus->pushInputBuffer)) { @@ -422,7 +422,7 @@ void btl_update(void) { set_screen_overlay_color(SCREEN_LAYER_BACK, 0, 0, 0); if (partner == NULL) { set_screen_overlay_params_back(OVERLAY_SCREEN_COLOR, 215.0f); - } else if (playerData->currentPartner == PARTNER_WATT) { + } else if (playerData->curPartner == PARTNER_WATT) { paramAmount -= 10.0f; if (paramAmount < 0.0f) { paramAmount = 0.0f; @@ -636,14 +636,14 @@ void btl_render_actors(void) { if (actor != NULL && !(actor->flags & ACTOR_FLAG_DISABLED)) { renderTaskPtr->appendGfxArg = (void*)i; renderTaskPtr->appendGfx = appendGfx_enemy_actor; - renderTaskPtr->distance = actor->currentPos.z; + renderTaskPtr->dist = actor->curPos.z; renderTaskPtr->renderMode = actor->renderMode; queue_render_task(renderTaskPtr); if (actor->flags & ACTOR_FLAG_BLUR_ENABLED) { renderTaskPtr->appendGfxArg = actor; renderTaskPtr->appendGfx = appendGfx_enemy_actor_blur; - renderTaskPtr->distance = actor->currentPos.z; + renderTaskPtr->dist = actor->curPos.z; renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER3; queue_render_task(renderTaskPtr); } @@ -651,7 +651,7 @@ void btl_render_actors(void) { if (battleStatus->reflectFlags & BS_REFLECT_FLOOR) { renderTaskPtr->appendGfxArg = actor; renderTaskPtr->appendGfx = appendGfx_enemy_actor_reflection; - renderTaskPtr->distance = actor->currentPos.z; + renderTaskPtr->dist = actor->curPos.z; renderTaskPtr->renderMode = actor->renderMode; queue_render_task(renderTaskPtr); } @@ -662,14 +662,14 @@ void btl_render_actors(void) { if (actor != NULL && !(actor->flags & ACTOR_FLAG_DISABLED)) { renderTaskPtr->appendGfxArg = NULL; renderTaskPtr->appendGfx = appendGfx_partner_actor; - renderTaskPtr->distance = actor->currentPos.z; + renderTaskPtr->dist = actor->curPos.z; renderTaskPtr->renderMode = actor->renderMode; queue_render_task(renderTaskPtr); if (actor->flags & ACTOR_FLAG_BLUR_ENABLED) { renderTaskPtr->appendGfxArg = actor; renderTaskPtr->appendGfx = appendGfx_partner_actor_blur; - renderTaskPtr->distance = actor->currentPos.z; + renderTaskPtr->dist = actor->curPos.z; renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER3; queue_render_task(renderTaskPtr); } @@ -677,7 +677,7 @@ void btl_render_actors(void) { if (battleStatus->reflectFlags & BS_REFLECT_FLOOR) { renderTaskPtr->appendGfxArg = NULL; renderTaskPtr->appendGfx = appendGfx_partner_actor_reflection; - renderTaskPtr->distance = actor->currentPos.z; + renderTaskPtr->dist = actor->curPos.z; renderTaskPtr->renderMode = actor->renderMode; queue_render_task(renderTaskPtr); } @@ -687,14 +687,14 @@ void btl_render_actors(void) { if (actor != NULL && !(actor->flags & ACTOR_FLAG_DISABLED)) { renderTaskPtr->appendGfxArg = NULL; renderTaskPtr->appendGfx = appendGfx_player_actor; - renderTaskPtr->distance = actor->currentPos.z; + renderTaskPtr->dist = actor->curPos.z; renderTaskPtr->renderMode = actor->renderMode; queue_render_task(renderTaskPtr); if (actor->flags & ACTOR_FLAG_BLUR_ENABLED) { renderTaskPtr->appendGfxArg = actor; renderTaskPtr->appendGfx = (void (*) (void*)) appendGfx_player_actor_blur; - renderTaskPtr->distance = actor->currentPos.z; + renderTaskPtr->dist = actor->curPos.z; renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER3; queue_render_task(renderTaskPtr); } @@ -702,7 +702,7 @@ void btl_render_actors(void) { if (battleStatus->reflectFlags & BS_REFLECT_FLOOR) { renderTaskPtr->appendGfxArg = NULL; renderTaskPtr->appendGfx = appendGfx_player_actor_reflection; - renderTaskPtr->distance = actor->currentPos.z; + renderTaskPtr->dist = actor->curPos.z; renderTaskPtr->renderMode = actor->renderMode; queue_render_task(renderTaskPtr); } @@ -868,7 +868,7 @@ void btl_draw_enemy_health_bars(void) { s32 temp; s32 ones; - currentHP = enemy->currentHP; + currentHP = enemy->curHP; temp = (currentHP * 25) / enemy->maxHP; if (temp < enemy->healthFraction) { @@ -1070,12 +1070,12 @@ void btl_save_world_cameras(void) { D_8029DA50[i] = gCameras[i]; } - D_8029EFB0 = playerStatus->position.x; - D_8029EFB4 = playerStatus->position.y; - D_8029EFB8 = playerStatus->position.z; - playerStatus->position.x = NPC_DISPOSE_POS_X; - playerStatus->position.y = NPC_DISPOSE_POS_Y; - playerStatus->position.z = NPC_DISPOSE_POS_Z; + D_8029EFB0 = playerStatus->pos.x; + D_8029EFB4 = playerStatus->pos.y; + D_8029EFB8 = playerStatus->pos.z; + playerStatus->pos.x = NPC_DISPOSE_POS_X; + playerStatus->pos.y = NPC_DISPOSE_POS_Y; + playerStatus->pos.z = NPC_DISPOSE_POS_Z; } void btl_restore_world_cameras(void) { @@ -1088,9 +1088,9 @@ void btl_restore_world_cameras(void) { } gCurrentCameraID = CAM_DEFAULT; - playerStatus->position.x = D_8029EFB0; - playerStatus->position.y = D_8029EFB4; - playerStatus->position.z = D_8029EFB8; + playerStatus->pos.x = D_8029EFB0; + playerStatus->pos.y = D_8029EFB4; + playerStatus->pos.z = D_8029EFB8; if (bSavedOverrideFlags & GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION) { gOverrideFlags |= GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION; @@ -1099,7 +1099,7 @@ void btl_restore_world_cameras(void) { } if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { - playerData->currentPartner = bSavedPartner; + playerData->curPartner = bSavedPartner; } } diff --git a/src/17D6A0.c b/src/17D6A0.c index 99648dce06..d4063b1d5e 100644 --- a/src/17D6A0.c +++ b/src/17D6A0.c @@ -2872,7 +2872,7 @@ void show_immune_bonk(f32 x, f32 y, f32 z, s32 numStars, s32 arg4, s32 arg5) { message->scale = D_80283690[iMod8].x * baseScale; message->rotZ = 0; message->rotVelZ = sign * 107; - message->rotY = clamp_angle(180.0f - gCameras[CAM_BATTLE].currentYaw); + message->rotY = clamp_angle(180.0f - gCameras[CAM_BATTLE].curYaw); message->appearTime = 14; message->unk_24 = arg4; message->deleteTime = 240; @@ -2910,7 +2910,7 @@ void btl_bonk_update(void* data) { message->pos.y += message->vel.y; message->pos.z += message->vel.z; } - message->rotY = clamp_angle(180.0f - gCameras[CAM_BATTLE].currentYaw); + message->rotY = clamp_angle(180.0f - gCameras[CAM_BATTLE].curYaw); message->rotZ += message->rotVelZ; message->rotZ = clamp_angle(message->rotZ); message->rotVelZ *= 0.8; @@ -3170,7 +3170,7 @@ void btl_update_message_popup(void* data) { popup->showMsgState = 2; break; case 2: - if (battleStatus->currentButtonsPressed & (BUTTON_A | BUTTON_B)) { + if (battleStatus->curButtonsPressed & (BUTTON_A | BUTTON_B)) { popup->duration = 0; } @@ -3523,7 +3523,7 @@ void btl_update_message_popup(void* data) { popup->showMsgState = 2; break; case 2: - if (battleStatus->currentButtonsPressed & (BUTTON_A | BUTTON_B)) { + if (battleStatus->curButtonsPressed & (BUTTON_A | BUTTON_B)) { popup->duration = 0; } @@ -4105,9 +4105,9 @@ void apply_shock_effect(Actor* actor) { && part->idleAnimations != NULL && !(part->flags & ACTOR_PART_FLAG_40000000) ) { - f32 x = part->currentPos.x; - f32 y = part->currentPos.y + (actor->size.y / 10); - f32 z = part->currentPos.z; + f32 x = part->curPos.x; + f32 y = part->curPos.y + (actor->size.y / 10); + f32 z = part->curPos.z; s32 f1 = (part->size.x + (part->size.x / 4)) * actor->scalingFactor; s32 f2 = (part->size.y - 2) * actor->scalingFactor; diff --git a/src/17FEB0.c b/src/17FEB0.c index 426a47cdd6..308083976b 100644 --- a/src/17FEB0.c +++ b/src/17FEB0.c @@ -5,15 +5,15 @@ HitResult calc_item_check_hit(void) { BattleStatus* battleStatus = &gBattleStatus; ActorState* state = &battleStatus->playerActor->state; - s32 actorID = battleStatus->currentTargetID; + s32 actorID = battleStatus->curTargetID; s8 currentTargetPartS8; u32 currentTargetPart; Actor* actor; ActorPart* actorPart; - battleStatus->currentTargetID2 = battleStatus->currentTargetID; - currentTargetPart = currentTargetPartS8 = battleStatus->currentTargetPart; - battleStatus->currentTargetPart2 = currentTargetPartS8; + battleStatus->curTargetID2 = battleStatus->curTargetID; + currentTargetPart = currentTargetPartS8 = battleStatus->curTargetPart; + battleStatus->curTargetPart2 = currentTargetPartS8; actor = get_actor(actorID); if (actor == NULL) { @@ -36,7 +36,7 @@ HitResult calc_item_check_hit(void) { return HIT_RESULT_IMMUNE; } - if ((battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP) + if ((battleStatus->curAttackElement & DAMAGE_TYPE_JUMP) && (actorPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP)) { sfx_play_sound_at_position(SOUND_HIT_NORMAL, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); @@ -49,9 +49,9 @@ HitResult calc_item_check_hit(void) { HitResult calc_item_damage_enemy(void) { BattleStatus* battleStatus = &gBattleStatus; Actor* player = battleStatus->playerActor; - s32 currentTargetID = battleStatus->currentTargetID; + s32 currentTargetID = battleStatus->curTargetID; Actor* partner = battleStatus->partnerActor; - s32 currentTargetPartID = battleStatus->currentTargetPart; + s32 currentTargetPartID = battleStatus->curTargetPart; s32 partImmuneToElement; s32 sp1C = FALSE; s32 actorClass; @@ -73,8 +73,8 @@ HitResult calc_item_damage_enemy(void) { battleStatus->wasStatusInflicted = FALSE; battleStatus->lastAttackDamage = 0; battleStatus->attackerActorID = player->actorID; - battleStatus->currentTargetID2 = battleStatus->currentTargetID; - battleStatus->currentTargetPart2 = battleStatus->currentTargetPart; + battleStatus->curTargetID2 = battleStatus->curTargetID; + battleStatus->curTargetPart2 = battleStatus->curTargetPart; target = get_actor(currentTargetID); wasStatusInflicted = FALSE; @@ -95,28 +95,28 @@ HitResult calc_item_damage_enemy(void) { state = &partner->state; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_FIRE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_FIRE) { fx_ring_blast(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f, 1.0f, 24); isFireDamage = TRUE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_SHOCK) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_SHOCK) { apply_shock_effect(target); isShockDamage = TRUE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_WATER) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_WATER) { fx_water_splash(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f, 1.0f, 24); isWaterDamage = TRUE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_ICE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_ICE) { fx_big_snowflakes(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f); isIceDamage = TRUE; } - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_REMOVE_BUFFS)) { + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_REMOVE_BUFFS)) { if ((targetPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY) || (target->transparentStatus == STATUS_KEY_TRANSPARENT) || (targetPart->eventFlags & ACTOR_EVENT_FLAG_800) - && !(battleStatus->currentAttackElement & DAMAGE_TYPE_QUAKE) + && !(battleStatus->curAttackElement & DAMAGE_TYPE_QUAKE) ) { return HIT_RESULT_MISS; } @@ -132,22 +132,22 @@ HitResult calc_item_damage_enemy(void) { return HIT_RESULT_HIT; } - if (targetPart->elementalImmunities & battleStatus->currentAttackElement) { + if (targetPart->elementalImmunities & battleStatus->curAttackElement) { partImmuneToElement = TRUE; } else { partImmuneToElement = FALSE; } if (targetPart->eventFlags & (ACTOR_EVENT_FLAG_ENCHANTED | ACTOR_EVENT_FLAG_STAR_ROD_ENCHANTED)) { - battleStatus->currentAttackElement &= ~DAMAGE_TYPE_IGNORE_DEFENSE; + battleStatus->curAttackElement &= ~DAMAGE_TYPE_IGNORE_DEFENSE; } - temp = get_defense(target, targetPart->defenseTable, battleStatus->currentAttackElement); - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_IGNORE_DEFENSE)) { + temp = get_defense(target, targetPart->defenseTable, battleStatus->curAttackElement); + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_IGNORE_DEFENSE)) { temp += target->defenseBoost; } - attackDamage = battleStatus->currentAttackDamage; + attackDamage = battleStatus->curAttackDamage; if (attackDamage > 99) { attackDamage = 99; } @@ -162,7 +162,7 @@ HitResult calc_item_damage_enemy(void) { target->hpChangeCounter = 0; hitResult = HIT_RESULT_NO_DAMAGE; - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS)) { + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS)) { dispatchEvent = EVENT_ZERO_DAMAGE; sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); battleStatus->lastAttackDamage = 0; @@ -181,9 +181,9 @@ HitResult calc_item_damage_enemy(void) { && !partImmuneToElement && !(targetPart->targetFlags & ACTOR_PART_TARGET_FLAG_4) ) { - target->currentHP -= attackDamage; - if (target->currentHP <= 0) { - target->currentHP = 0; + target->curHP -= attackDamage; + if (target->curHP <= 0) { + target->curHP = 0; dispatchEvent = EVENT_DEATH; } } @@ -199,7 +199,7 @@ HitResult calc_item_damage_enemy(void) { return HIT_RESULT_NO_DAMAGE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_DEATH) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_DEATH) { battleStatus->lastAttackDamage = 0; dispatchEvent = EVENT_DEATH; hitResult = HIT_RESULT_HIT; @@ -212,7 +212,7 @@ HitResult calc_item_damage_enemy(void) { if (dispatchEvent == EVENT_ZERO_DAMAGE) { dispatchEvent = EVENT_IMMUNE; } - if (target->currentHP <= 0 && dispatchEvent == EVENT_IMMUNE) { + if (target->curHP <= 0 && dispatchEvent == EVENT_IMMUNE) { dispatchEvent = EVENT_DEATH; } } else if (dispatchEvent == EVENT_DEATH) { @@ -220,7 +220,7 @@ HitResult calc_item_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { - if (battleStatus->currentAttackElement & DAMAGE_TYPE_REMOVE_BUFFS) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_REMOVE_BUFFS) { dispatchEvent = EVENT_IMMUNE; if (targetPart->eventFlags & ACTOR_EVENT_FLAG_ENCHANTED) { dispatchEvent = EVENT_STAR_BEAM; @@ -237,7 +237,7 @@ HitResult calc_item_damage_enemy(void) { } } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_REMOVE_BUFFS) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_REMOVE_BUFFS) { if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { if ((target->attackBoost > 0 || target->defenseBoost > 0) || ((target->staticStatus == 0 && target->transparentStatus != 0) || target->staticStatus != 0)) @@ -263,7 +263,7 @@ HitResult calc_item_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { - if (battleStatus->currentAttackElement & DAMAGE_TYPE_PEACH_BEAM) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_PEACH_BEAM) { dispatchEvent = EVENT_IMMUNE; if (targetPart->eventFlags & ACTOR_EVENT_FLAG_ENCHANTED) { dispatchEvent = EVENT_PEACH_BEAM; @@ -277,7 +277,7 @@ HitResult calc_item_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { - if (battleStatus->currentAttackElement & DAMAGE_TYPE_SPIN_SMASH) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_SPIN_SMASH) { if (dispatchEvent == EVENT_HIT) { dispatchEvent = EVENT_SPIN_SMASH_HIT; } @@ -288,7 +288,7 @@ HitResult calc_item_damage_enemy(void) { } if ((gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) - && (battleStatus->currentAttackElement & (DAMAGE_TYPE_JUMP | DAMAGE_TYPE_POW)) + && (battleStatus->curAttackElement & (DAMAGE_TYPE_JUMP | DAMAGE_TYPE_POW)) && (targetPart->eventFlags & ACTOR_EVENT_FLAG_GROUNDABLE) ) { if (dispatchEvent == EVENT_HIT) { @@ -300,7 +300,7 @@ HitResult calc_item_damage_enemy(void) { } if ((gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) - && (battleStatus->currentAttackElement & DAMAGE_TYPE_POW) + && (battleStatus->curAttackElement & DAMAGE_TYPE_POW) && (targetPart->eventFlags & ACTOR_EVENT_FLAG_RIDING_BROOMSTICK) ) { if (dispatchEvent == EVENT_HIT) { @@ -312,7 +312,7 @@ HitResult calc_item_damage_enemy(void) { } if ((gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) - && (battleStatus->currentAttackElement & (DAMAGE_TYPE_JUMP | DAMAGE_TYPE_POW | DAMAGE_TYPE_QUAKE)) + && (battleStatus->curAttackElement & (DAMAGE_TYPE_JUMP | DAMAGE_TYPE_POW | DAMAGE_TYPE_QUAKE)) && (targetPart->eventFlags & ACTOR_EVENT_FLAG_FLIPABLE) ) { if (dispatchEvent == EVENT_HIT) { @@ -324,7 +324,7 @@ HitResult calc_item_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { - if (battleStatus->currentAttackElement & DAMAGE_TYPE_FIRE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_FIRE) { if (dispatchEvent == EVENT_HIT) { dispatchEvent = EVENT_BURN_HIT; } @@ -345,7 +345,7 @@ HitResult calc_item_damage_enemy(void) { // do-while-0 OR to wrap each one individually. It's more likely that it's a macro instead, and much cleaner #define INFLICT_STATUS(STATUS_TYPE) \ do { \ - if ((battleStatus->currentAttackStatus & STATUS_FLAG_##STATUS_TYPE) && \ + if ((battleStatus->curAttackStatus & STATUS_FLAG_##STATUS_TYPE) && \ try_inflict_status(target, STATUS_KEY_##STATUS_TYPE, STATUS_TURN_MOD_##STATUS_TYPE)) { \ wasStatusInflicted = TRUE; \ } \ @@ -377,7 +377,7 @@ HitResult calc_item_damage_enemy(void) { temp = target->actorBlueprint->spookChance; temp = (battleStatus->statusChance * temp) / 100; - if ((gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) && (battleStatus->currentAttackElement & DAMAGE_TYPE_FEAR)) { + if ((gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) && (battleStatus->curAttackElement & DAMAGE_TYPE_FEAR)) { if (rand_int(99) < temp && (target->debuff != STATUS_KEY_FEAR && target->debuff != STATUS_KEY_DIZZY @@ -410,7 +410,7 @@ HitResult calc_item_damage_enemy(void) { sfx_play_sound_at_position(SOUND_231, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->lastAttackDamage > 0 || (battleStatus->currentAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS) && sp1C) { + if (battleStatus->lastAttackDamage > 0 || (battleStatus->curAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS) && sp1C) { if (gBattleStatus.flags1 & BS_FLAGS1_40) { show_action_rating(ACTION_RATING_NICE, target, state->goalPos.x, state->goalPos.y, state->goalPos.z); } else { @@ -437,7 +437,7 @@ HitResult calc_item_damage_enemy(void) { show_immune_bonk(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 3); } } else if (!partImmuneToElement) { - if (battleStatus->currentAttackElement & (DAMAGE_TYPE_MULTIPLE_POPUPS | DAMAGE_TYPE_SMASH)) { + if (battleStatus->curAttackElement & (DAMAGE_TYPE_MULTIPLE_POPUPS | DAMAGE_TYPE_SMASH)) { show_next_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 0); } else { show_primary_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 0); @@ -465,42 +465,42 @@ HitResult calc_item_damage_enemy(void) { sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackStatus & STATUS_FLAG_SLEEP) && wasStatusInflicted) { + if ((battleStatus->curAttackStatus & STATUS_FLAG_SLEEP) && wasStatusInflicted) { script = start_script(&EVS_PlaySleepHitFX, EVT_PRIORITY_A, 0); script->varTable[0] = state->goalPos.x; script->varTable[1] = state->goalPos.y; script->varTable[2] = state->goalPos.z; sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackStatus & STATUS_FLAG_DIZZY) && wasStatusInflicted) { + if ((battleStatus->curAttackStatus & STATUS_FLAG_DIZZY) && wasStatusInflicted) { script = start_script(&EVS_PlayDizzyHitFX, EVT_PRIORITY_A, 0); script->varTable[0] = state->goalPos.x; script->varTable[1] = state->goalPos.y; script->varTable[2] = state->goalPos.z; sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackStatus & STATUS_FLAG_PARALYZE) && wasStatusInflicted) { + if ((battleStatus->curAttackStatus & STATUS_FLAG_PARALYZE) && wasStatusInflicted) { script = start_script(&EVS_PlayParalyzeHitFX, EVT_PRIORITY_A, 0); script->varTable[0] = state->goalPos.x; script->varTable[1] = state->goalPos.y; script->varTable[2] = state->goalPos.z; sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackStatus & STATUS_FLAG_POISON) && wasStatusInflicted) { + if ((battleStatus->curAttackStatus & STATUS_FLAG_POISON) && wasStatusInflicted) { script = start_script(&EVS_PlayPoisonHitFX, EVT_PRIORITY_A, 0); script->varTable[0] = state->goalPos.x; script->varTable[1] = state->goalPos.y; script->varTable[2] = state->goalPos.z; sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackStatus & STATUS_FLAG_STOP) && wasStatusInflicted) { + if ((battleStatus->curAttackStatus & STATUS_FLAG_STOP) && wasStatusInflicted) { script = start_script(&EVS_PlayStopHitFX, EVT_PRIORITY_A, 0); script->varTable[0] = state->goalPos.x; script->varTable[1] = state->goalPos.y; script->varTable[2] = state->goalPos.z; sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackStatus & STATUS_FLAG_FROZEN) && wasStatusInflicted) { + if ((battleStatus->curAttackStatus & STATUS_FLAG_FROZEN) && wasStatusInflicted) { script = start_script(&EVS_PlayFreezeHitFX, EVT_PRIORITY_A, 0); script->varTable[0] = state->goalPos.x; script->varTable[1] = state->goalPos.y; @@ -508,7 +508,7 @@ HitResult calc_item_damage_enemy(void) { script->varTablePtr[3] = target; sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackStatus & STATUS_FLAG_SHRINK) && wasStatusInflicted) { + if ((battleStatus->curAttackStatus & STATUS_FLAG_SHRINK) && wasStatusInflicted) { script = start_script(&EVS_PlayShrinkHitFX, EVT_PRIORITY_A, 0); script->varTable[0] = state->goalPos.x; script->varTable[1] = state->goalPos.y; @@ -516,7 +516,7 @@ HitResult calc_item_damage_enemy(void) { script->varTablePtr[3] = target; sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackElement & DAMAGE_TYPE_SMASH) && (target->actorType == ACTOR_TYPE_GOOMNUT_TREE)) { + if ((battleStatus->curAttackElement & DAMAGE_TYPE_SMASH) && (target->actorType == ACTOR_TYPE_GOOMNUT_TREE)) { sfx_play_sound_at_position(SOUND_SMASH_GOOMNUT_TREE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } @@ -542,10 +542,10 @@ ApiStatus ItemDamageEnemy(Evt* script, s32 isInitialCall) { Actor* actor; HitResult hitResult; - battleStatus->currentAttackElement = *args++; - battleStatus->currentAttackEventSuppression = 0; - battleStatus->currentAttackStatus = *args++; - battleStatus->currentAttackDamage = evt_get_variable(script, *args++); + battleStatus->curAttackElement = *args++; + battleStatus->curAttackEventSuppression = 0; + battleStatus->curAttackStatus = *args++; + battleStatus->curAttackDamage = evt_get_variable(script, *args++); flags = *args++; if ((flags & (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) == (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) { @@ -581,15 +581,15 @@ ApiStatus ItemDamageEnemy(Evt* script, s32 isInitialCall) { } actor = get_actor(script->owner1.actorID); - battleStatus->currentTargetID = actor->targetActorID; - battleStatus->currentTargetPart = actor->targetPartIndex; - battleStatus->statusChance = battleStatus->currentAttackStatus; + battleStatus->curTargetID = actor->targetActorID; + battleStatus->curTargetPart = actor->targetPartIndex; + battleStatus->statusChance = battleStatus->curAttackStatus; if (battleStatus->statusChance == STATUS_KEY_NEVER) { battleStatus->statusChance = 0; } - battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8; + battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8; hitResult = calc_item_damage_enemy(); if (hitResult < 0) { @@ -612,11 +612,11 @@ ApiStatus ItemSpookEnemy(Evt* script, s32 isInitialCall) { HitResult hitResult; s32 flags; - battleStatus->currentAttackElement = *args++; - battleStatus->currentAttackEventSuppression = 0; - battleStatus->currentAttackStatus = *args++; - battleStatus->currentAttackStatus |= evt_get_variable(script, *args++); - battleStatus->currentAttackDamage = evt_get_variable(script, *args++); + battleStatus->curAttackElement = *args++; + battleStatus->curAttackEventSuppression = 0; + battleStatus->curAttackStatus = *args++; + battleStatus->curAttackStatus |= evt_get_variable(script, *args++); + battleStatus->curAttackDamage = evt_get_variable(script, *args++); flags = *args++; if ((flags & (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) == (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) { @@ -651,15 +651,15 @@ ApiStatus ItemSpookEnemy(Evt* script, s32 isInitialCall) { } actor = get_actor(script->owner1.actorID); - battleStatus->currentTargetID = actor->targetActorID; - battleStatus->currentTargetPart = actor->targetPartIndex; - battleStatus->statusChance = battleStatus->currentAttackStatus; + battleStatus->curTargetID = actor->targetActorID; + battleStatus->curTargetPart = actor->targetPartIndex; + battleStatus->statusChance = battleStatus->curAttackStatus; if (battleStatus->statusChance == STATUS_KEY_NEVER) { battleStatus->statusChance = 0; } - battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8; + battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8; hitResult = calc_item_damage_enemy(); if (hitResult < 0) { @@ -682,10 +682,10 @@ ApiStatus ItemAfflictEnemy(Evt* script, s32 isInitialCall) { Actor* actor; HitResult hitResult; - battleStatus->currentAttackElement = *args++; - battleStatus->currentAttackEventSuppression = 0; - battleStatus->currentAttackStatus = evt_get_variable(script, *args++); - battleStatus->currentAttackDamage = evt_get_variable(script, *args++); + battleStatus->curAttackElement = *args++; + battleStatus->curAttackEventSuppression = 0; + battleStatus->curAttackStatus = evt_get_variable(script, *args++); + battleStatus->curAttackDamage = evt_get_variable(script, *args++); flags = *args++; if ((flags & (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) == (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) { @@ -720,15 +720,15 @@ ApiStatus ItemAfflictEnemy(Evt* script, s32 isInitialCall) { } actor = get_actor(script->owner1.actorID); - battleStatus->currentTargetID = actor->targetActorID; - battleStatus->currentTargetPart = actor->targetPartIndex; - battleStatus->statusChance = battleStatus->currentAttackStatus; + battleStatus->curTargetID = actor->targetActorID; + battleStatus->curTargetPart = actor->targetPartIndex; + battleStatus->statusChance = battleStatus->curAttackStatus; if (battleStatus->statusChance == STATUS_KEY_NEVER) { battleStatus->statusChance = 0; } - battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8; + battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8; hitResult = calc_item_damage_enemy(); if (hitResult < 0) { @@ -751,10 +751,10 @@ ApiStatus ItemCheckHit(Evt* script, s32 isInitialCall) { Actor* actor; HitResult hitResult; - battleStatus->currentAttackElement = *args++; - battleStatus->currentAttackEventSuppression = 0; - battleStatus->currentAttackStatus = *args++; - battleStatus->currentAttackDamage = evt_get_variable(script, *args++); + battleStatus->curAttackElement = *args++; + battleStatus->curAttackEventSuppression = 0; + battleStatus->curAttackStatus = *args++; + battleStatus->curAttackDamage = evt_get_variable(script, *args++); flags = *args++; if ((flags & (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) == (BS_FLAGS1_10 | BS_FLAGS1_SP_EVT_ACTIVE)) { @@ -789,15 +789,15 @@ ApiStatus ItemCheckHit(Evt* script, s32 isInitialCall) { } actor = get_actor(script->owner1.actorID); - battleStatus->currentTargetID = actor->targetActorID; - battleStatus->currentTargetPart = actor->targetPartIndex; - battleStatus->statusChance = battleStatus->currentAttackStatus; + battleStatus->curTargetID = actor->targetActorID; + battleStatus->curTargetPart = actor->targetPartIndex; + battleStatus->statusChance = battleStatus->curAttackStatus; if (battleStatus->statusChance == STATUS_KEY_NEVER) { battleStatus->statusChance = 0; } - battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8; + battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8; hitResult = calc_item_check_hit(); if (hitResult < 0) { diff --git a/src/181810.c b/src/181810.c index 974183067f..b8dfd7015a 100644 --- a/src/181810.c +++ b/src/181810.c @@ -141,14 +141,14 @@ ApiStatus ActorSpeak(Evt* script, s32 isInitialCall) { gSpeakingActor = actor; gSpeakingActorPart = part; - headX = actor->currentPos.x + actor->headOffset.x; + headX = actor->curPos.x + actor->headOffset.x; if (!(actor->flags & ACTOR_FLAG_8000)) { - headY = actor->size.y + (actor->currentPos.y + actor->headOffset.y); + headY = actor->size.y + (actor->curPos.y + actor->headOffset.y); } else { - headY = actor->currentPos.y + actor->headOffset.y + (actor->size.y / 2); + headY = actor->curPos.y + actor->headOffset.y + (actor->size.y / 2); } - headZ = actor->currentPos.z + actor->headOffset.z; + headZ = actor->curPos.z + actor->headOffset.z; get_screen_coords(CAM_BATTLE, headX, headY, headZ, &screenX, &screenY, &screenZ); gSpeakingActorPrintIsDone = FALSE; @@ -167,15 +167,15 @@ ApiStatus ActorSpeak(Evt* script, s32 isInitialCall) { actor = gSpeakingActor; part = gSpeakingActorPart; - headX = actor->currentPos.x + actor->headOffset.x; + headX = actor->curPos.x + actor->headOffset.x; if (!(actor->flags & ACTOR_FLAG_8000)) { - headY = actor->size.y + (actor->currentPos.y + actor->headOffset.y); + headY = actor->size.y + (actor->curPos.y + actor->headOffset.y); } else { headY = actor->headOffset.y; - headY = actor->currentPos.y + actor->headOffset.y + (actor->size.y / 2); + headY = actor->curPos.y + actor->headOffset.y + (actor->size.y / 2); } - headZ = actor->currentPos.z + actor->headOffset.z; + headZ = actor->curPos.z + actor->headOffset.z; get_screen_coords(CAM_BATTLE, headX, headY, headZ, &screenX, &screenY, &screenZ); msg_printer_set_origin_pos(gSpeakingActorPrintCtx, screenX, screenY); @@ -235,13 +235,13 @@ ApiStatus EndActorSpeech(Evt* script, s32 isInitialCall) { Actor* actor = gSpeakingActor; ActorPart* actorPart = gSpeakingActorPart; - x = actor->currentPos.x + actor->headOffset.x; + x = actor->curPos.x + actor->headOffset.x; if (!(gSpeakingActor->flags & ACTOR_FLAG_8000)) { - y = actor->currentPos.y + actor->headOffset.y + actor->size.y ; + y = actor->curPos.y + actor->headOffset.y + actor->size.y ; } else { - y = actor->currentPos.y + actor->headOffset.y + actor->size.y / 2; + y = actor->curPos.y + actor->headOffset.y + actor->size.y / 2; } - z = actor->currentPos.z + actor->headOffset.z; + z = actor->curPos.z + actor->headOffset.z; get_screen_coords(CAM_BATTLE, x, y, z, &screenX, &screenY, &screenZ); msg_printer_set_origin_pos(gSpeakingActorPrintCtx, screenX, screenY); @@ -282,9 +282,9 @@ ApiStatus ShowBattleChoice(Evt* script, s32 isInitialCall) { } if (script->functionTemp[1] == 1) { - u8 currentOption = D_8029FA64->currentOption; + u8 currentOption = D_8029FA64->curOption; - gSpeakingActorPrintCtx->currentOption = D_8029FA64->currentOption; + gSpeakingActorPrintCtx->curOption = D_8029FA64->curOption; script->varTable[0] = currentOption; return ApiStatus_DONE1; @@ -401,7 +401,7 @@ ApiStatus PlaySoundAtActor(Evt* script, s32 isInitialCall) { } actor = get_actor(actorID); - sfx_play_sound_at_position(soundID, SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(soundID, SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); return ApiStatus_DONE2; } @@ -418,7 +418,7 @@ ApiStatus PlaySoundAtPart(Evt* script, s32 isInitialCall) { } part = get_actor_part(get_actor(actorID), partID); - sfx_play_sound_at_position(soundID, SOUND_SPACE_MODE_0, part->currentPos.x, part->currentPos.y, part->currentPos.z); + sfx_play_sound_at_position(soundID, SOUND_SPACE_MODE_0, part->curPos.x, part->curPos.y, part->curPos.z); return ApiStatus_DONE2; } @@ -436,7 +436,7 @@ ApiStatus PlayLoopingSoundAtActor(Evt* script, s32 isInitialCall) { actor = get_actor(actorID); actor->loopingSoundID[idx] = soundID; - sfx_play_sound_at_position(soundID, SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(soundID, SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); return ApiStatus_DONE2; } diff --git a/src/182B30.c b/src/182B30.c index 88366dc586..cc0a87b8e9 100644 --- a/src/182B30.c +++ b/src/182B30.c @@ -210,16 +210,16 @@ void enable_actor_blur(Actor* actor) { decorationTable->unk_7D8 = 0; decorationTable->unk_7D9 = 0; for (j = 0; j < ARRAY_COUNT(decorationTable->posX); j++) { - decorationTable->posX[j] = partsTable->currentPos.x; - decorationTable->posY[j] = partsTable->currentPos.y; - decorationTable->posZ[j] = partsTable->currentPos.z; + decorationTable->posX[j] = partsTable->curPos.x; + decorationTable->posY[j] = partsTable->curPos.y; + decorationTable->posZ[j] = partsTable->curPos.z; decorationTable->yaw[j] = actor->yaw; - decorationTable->rotationPivotOffsetX[j] = (s32)(actor->rotationPivotOffset.x * actor->scalingFactor); - decorationTable->rotationPivotOffsetY[j] = (s32)(actor->rotationPivotOffset.y * actor->scalingFactor); + decorationTable->rotPivotOffsetX[j] = (s32)(actor->rotPivotOffset.x * actor->scalingFactor); + decorationTable->rotPivotOffsetY[j] = (s32)(actor->rotPivotOffset.y * actor->scalingFactor); - decorationTable->rotX[j] = clamp_angle(actor->rotation.x) * 0.5f; - decorationTable->rotY[j] = clamp_angle(actor->rotation.y) * 0.5f; - decorationTable->rotZ[j] = clamp_angle(actor->rotation.z) * 0.5f; + decorationTable->rotX[j] = clamp_angle(actor->rot.x) * 0.5f; + decorationTable->rotY[j] = clamp_angle(actor->rot.y) * 0.5f; + decorationTable->rotZ[j] = clamp_angle(actor->rot.z) * 0.5f; } } partsTable = partsTable->nextPart; @@ -297,16 +297,16 @@ void enable_player_blur(void) { decorationTable->unk_7D9 = 0; for (i = 0; i < ARRAY_COUNT(decorationTable->posX); i++) { - decorationTable->posX[i] = partsTable->currentPos.x; - decorationTable->posY[i] = partsTable->currentPos.y; - decorationTable->posZ[i] = partsTable->currentPos.z; + decorationTable->posX[i] = partsTable->curPos.x; + decorationTable->posY[i] = partsTable->curPos.y; + decorationTable->posZ[i] = partsTable->curPos.z; decorationTable->yaw[i] = playerActor->yaw; - decorationTable->rotationPivotOffsetX[i] = playerActor->rotationPivotOffset.x * playerActor->scalingFactor; - decorationTable->rotationPivotOffsetY[i] = playerActor->rotationPivotOffset.y * playerActor->scalingFactor; + decorationTable->rotPivotOffsetX[i] = playerActor->rotPivotOffset.x * playerActor->scalingFactor; + decorationTable->rotPivotOffsetY[i] = playerActor->rotPivotOffset.y * playerActor->scalingFactor; - decorationTable->rotX[i] = clamp_angle(playerActor->rotation.x) * 0.5f; - decorationTable->rotY[i] = clamp_angle(playerActor->rotation.y) * 0.5f; - decorationTable->rotZ[i] = clamp_angle(playerActor->rotation.z) * 0.5f; + decorationTable->rotX[i] = clamp_angle(playerActor->rot.x) * 0.5f; + decorationTable->rotY[i] = clamp_angle(playerActor->rot.y) * 0.5f; + decorationTable->rotZ[i] = clamp_angle(playerActor->rot.z) * 0.5f; } } @@ -357,17 +357,17 @@ void func_802549F4(Actor* actor) { if (!(partsTable->flags & ACTOR_PART_FLAG_INVISIBLE) && partsTable->idleAnimations != NULL) { s32 i = decorationTable->unk_7D9; - decorationTable->posX[i] = partsTable->currentPos.x; - decorationTable->posY[i] = partsTable->currentPos.y; - decorationTable->posZ[i] = partsTable->currentPos.z; + decorationTable->posX[i] = partsTable->curPos.x; + decorationTable->posY[i] = partsTable->curPos.y; + decorationTable->posZ[i] = partsTable->curPos.z; decorationTable->yaw[i] = actor->yaw; - decorationTable->rotationPivotOffsetX[i] = actor->rotationPivotOffset.x * actor->scalingFactor; - decorationTable->rotationPivotOffsetY[i] = actor->rotationPivotOffset.y * actor->scalingFactor; + decorationTable->rotPivotOffsetX[i] = actor->rotPivotOffset.x * actor->scalingFactor; + decorationTable->rotPivotOffsetY[i] = actor->rotPivotOffset.y * actor->scalingFactor; - decorationTable->rotX[i] = clamp_angle(actor->rotation.x) * 0.5f; - decorationTable->rotY[i] = clamp_angle(actor->rotation.y) * 0.5f; - decorationTable->rotZ[i] = clamp_angle(actor->rotation.z) * 0.5f; + decorationTable->rotX[i] = clamp_angle(actor->rot.x) * 0.5f; + decorationTable->rotY[i] = clamp_angle(actor->rot.y) * 0.5f; + decorationTable->rotZ[i] = clamp_angle(actor->rot.z) * 0.5f; i++; if (i >= ARRAY_COUNT(decorationTable->posX)) { @@ -436,8 +436,8 @@ void appendGfx_player_actor_blur(Actor* actor) { yaw = decorationTable->yaw[bufPos]; - pivotOffsetX = decorationTable->rotationPivotOffsetX[bufPos]; - pivotOffsetY = decorationTable->rotationPivotOffsetY[bufPos]; + pivotOffsetX = decorationTable->rotPivotOffsetX[bufPos]; + pivotOffsetY = decorationTable->rotPivotOffsetY[bufPos]; rotX = decorationTable->rotX[bufPos] * 2; rotY = decorationTable->rotY[bufPos] * 2; @@ -493,17 +493,17 @@ void func_802550BC(s32 arg0, Actor* actor) { decorationTable = partsTable->decorationTable; j = decorationTable->unk_7D9; - decorationTable->posX[j] = partsTable->currentPos.x; - decorationTable->posY[j] = partsTable->currentPos.y; - decorationTable->posZ[j] = partsTable->currentPos.z; + decorationTable->posX[j] = partsTable->curPos.x; + decorationTable->posY[j] = partsTable->curPos.y; + decorationTable->posZ[j] = partsTable->curPos.z; decorationTable->yaw[j] = actor->yaw; - decorationTable->rotationPivotOffsetX[j] = actor->rotationPivotOffset.x; - decorationTable->rotationPivotOffsetY[j] = actor->rotationPivotOffset.y; + decorationTable->rotPivotOffsetX[j] = actor->rotPivotOffset.x; + decorationTable->rotPivotOffsetY[j] = actor->rotPivotOffset.y; - decorationTable->rotX[j] = clamp_angle(actor->rotation.x) * 0.5f; - decorationTable->rotY[j] = clamp_angle(actor->rotation.y) * 0.5f; - decorationTable->rotZ[j] = clamp_angle(actor->rotation.z) * 0.5f; + decorationTable->rotX[j] = clamp_angle(actor->rot.x) * 0.5f; + decorationTable->rotY[j] = clamp_angle(actor->rot.y) * 0.5f; + decorationTable->rotZ[j] = clamp_angle(actor->rot.z) * 0.5f; j++; if (j >= ARRAY_COUNT(decorationTable->posX)) { @@ -535,9 +535,9 @@ void func_802552EC(s32 arg0, Actor* actor) { s32 temp; s32 flags; - guRotateF(mtxRotX, actor->rotation.x, 1.0f, 0.0f, 0.0f); - guRotateF(mtxRotY, actor->rotation.y, 0.0f, 1.0f, 0.0f); - guRotateF(mtxRotZ, actor->rotation.z, 0.0f, 0.0f, 1.0f); + guRotateF(mtxRotX, actor->rot.x, 1.0f, 0.0f, 0.0f); + guRotateF(mtxRotY, actor->rot.y, 0.0f, 1.0f, 0.0f); + guRotateF(mtxRotZ, actor->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(mtxRotX, mtxRotY, mtxTemp); guMtxCatF(mtxTemp, mtxRotZ, mtxRotation); guScaleF(mtxScale, actor->scale.x * SPRITE_WORLD_SCALE_D * actor->scalingFactor, @@ -607,8 +607,8 @@ void func_802552EC(s32 arg0, Actor* actor) { yaw = decorationTable->yaw[j]; - pivotX = decorationTable->rotationPivotOffsetX[j]; - pivotY = decorationTable->rotationPivotOffsetY[j]; + pivotX = decorationTable->rotPivotOffsetX[j]; + pivotY = decorationTable->rotPivotOffsetY[j]; rotX = decorationTable->rotX[j] * 2; rotY = decorationTable->rotY[j] * 2; @@ -709,13 +709,13 @@ void update_actor_shadow(s32 arg0, Actor* actor) { } actor->renderMode = RENDER_MODE_ALPHATEST; - x1 = actor->currentPos.x + actor->headOffset.x; + x1 = actor->curPos.x + actor->headOffset.x; if (!(actor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { - y1 = actor->currentPos.y + actor->headOffset.y; + y1 = actor->curPos.y + actor->headOffset.y; } else { - y1 = actor->currentPos.y - actor->headOffset.y; + y1 = actor->curPos.y - actor->headOffset.y; } - z1 = actor->currentPos.z + actor->headOffset.z; + z1 = actor->curPos.z + actor->headOffset.z; numParts = actor->numParts; actorPart = actor->partsTable; @@ -723,7 +723,7 @@ void update_actor_shadow(s32 arg0, Actor* actor) { if (!(actorPart->flags & ACTOR_PART_FLAG_INVISIBLE) && actorPart->idleAnimations != NULL) { spriteID = actorPart->spriteInstanceID; if (spriteID >= 0) { - spr_update_sprite(spriteID, actorPart->currentAnimation, actorPart->animationRate); + spr_update_sprite(spriteID, actorPart->curAnimation, actorPart->animationRate); actorPart->animNotifyValue = spr_get_notify_value(actorPart->spriteInstanceID); } @@ -737,25 +737,25 @@ void update_actor_shadow(s32 arg0, Actor* actor) { z2 = z1 + actorPart->partOffset.z + actorPart->visualOffset.z; yaw = actorPart->yaw = actor->yaw; } else { - x2 = actorPart->absolutePosition.x + actorPart->visualOffset.x; - y2 = actorPart->absolutePosition.y + actorPart->visualOffset.y; - z2 = actorPart->absolutePosition.z + actorPart->visualOffset.z; + x2 = actorPart->absolutePos.x + actorPart->visualOffset.x; + y2 = actorPart->absolutePos.y + actorPart->visualOffset.y; + z2 = actorPart->absolutePos.z + actorPart->visualOffset.z; yaw = actorPart->yaw; } - actorPart->currentPos.x = x2; - actorPart->currentPos.y = y2; - actorPart->currentPos.z = z2; + actorPart->curPos.x = x2; + actorPart->curPos.y = y2; + actorPart->curPos.z = z2; if (!(actorPart->flags & ACTOR_PART_FLAG_4)) { shadow = get_shadow_by_index(actorPart->shadowIndex); shadow->flags &= ~ENTITY_FLAG_HIDDEN; - x1 = actorPart->currentPos.x; + x1 = actorPart->curPos.x; if (!(actor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { - y1 = actorPart->currentPos.y + 12.0; + y1 = actorPart->curPos.y + 12.0; } else { - y1 = actorPart->currentPos.y - 12.0; + y1 = actorPart->curPos.y - 12.0; } - z1 = actorPart->currentPos.z; + z1 = actorPart->curPos.z; dist = 32767.0f; npc_raycast_down_sides(0, &x1, &y1, &z1, &dist); @@ -763,10 +763,10 @@ void update_actor_shadow(s32 arg0, Actor* actor) { if (200.0f < dist) { shadow->flags |= ENTITY_FLAG_HIDDEN; } - shadow->position.x = x1; - shadow->position.y = y1; - shadow->position.z = z1; - shadow->rotation.y = clamp_angle(yaw - camera->currentYaw); + shadow->pos.x = x1; + shadow->pos.y = y1; + shadow->pos.z = z1; + shadow->rot.y = clamp_angle(yaw - camera->curYaw); set_standard_shadow_scale(shadow, dist); shadow->scale.x *= actorPart->shadowScale; } @@ -782,13 +782,13 @@ void update_actor_shadow(s32 arg0, Actor* actor) { shadow->flags &= ~ENTITY_FLAG_HIDDEN; } - x1 = actor->currentPos.x + actor->headOffset.x; + x1 = actor->curPos.x + actor->headOffset.x; if (!(actor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { - y1 = actor->currentPos.y + actor->headOffset.y + 12.0; + y1 = actor->curPos.y + actor->headOffset.y + 12.0; } else { - y1 = actor->currentPos.y - actor->headOffset.y + 12.0; + y1 = actor->curPos.y - actor->headOffset.y + 12.0; } - z1 = actor->currentPos.z + actor->headOffset.z; + z1 = actor->curPos.z + actor->headOffset.z; dist = 32767.0f; npc_raycast_down_sides(0, &x1, &y1, &z1, &dist); @@ -796,10 +796,10 @@ void update_actor_shadow(s32 arg0, Actor* actor) { if (200.0f < dist) { shadow->flags |= ENTITY_FLAG_HIDDEN; } - shadow->position.x = x1; - shadow->position.y = y1; - shadow->position.z = z1 + bActorOffsets[actor->actorType].shadow; - shadow->rotation.y = clamp_angle(actor->yaw - camera->currentYaw); + shadow->pos.x = x1; + shadow->pos.y = y1; + shadow->pos.z = z1 + bActorOffsets[actor->actorType].shadow; + shadow->rot.y = clamp_angle(actor->yaw - camera->curYaw); set_standard_shadow_scale(shadow, dist); shadow->scale.x *= actor->shadowScale * actor->scalingFactor; } @@ -846,13 +846,13 @@ void appendGfx_npc_actor(s32 isPartner, s32 actorIndex) { } else { actor = battleStatus->partnerActor; } - actorPosX = actor->currentPos.x + actor->headOffset.x; + actorPosX = actor->curPos.x + actor->headOffset.x; if (!(actor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { - actorPosY = actor->currentPos.y + actor->headOffset.y + actor->verticalRenderOffset; + actorPosY = actor->curPos.y + actor->headOffset.y + actor->verticalRenderOffset; } else { - actorPosY = actor->currentPos.y - actor->headOffset.y + actor->verticalRenderOffset; + actorPosY = actor->curPos.y - actor->headOffset.y + actor->verticalRenderOffset; } - actorPosZ = actor->currentPos.z + actor->headOffset.z; + actorPosZ = actor->curPos.z + actor->headOffset.z; actor->disableEffect->data.disableX->pos.x = actorPosX + (actor->actorBlueprint->statusIconOffset.x + actor->statusIconOffset.x) * actor->scalingFactor; @@ -920,26 +920,26 @@ void appendGfx_npc_actor(s32 isPartner, s32 actorIndex) { if (!(actor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { guTranslateF(mtxPivotOn, - -actor->rotationPivotOffset.x * actor->scalingFactor, - -actor->rotationPivotOffset.y * actor->scalingFactor, - -actor->rotationPivotOffset.z * actor->scalingFactor); + -actor->rotPivotOffset.x * actor->scalingFactor, + -actor->rotPivotOffset.y * actor->scalingFactor, + -actor->rotPivotOffset.z * actor->scalingFactor); guTranslateF(mtxPivotOff, - actor->rotationPivotOffset.x * actor->scalingFactor, - actor->rotationPivotOffset.y * actor->scalingFactor, - actor->rotationPivotOffset.z * actor->scalingFactor); + actor->rotPivotOffset.x * actor->scalingFactor, + actor->rotPivotOffset.y * actor->scalingFactor, + actor->rotPivotOffset.z * actor->scalingFactor); } else { guTranslateF(mtxPivotOn, - -actor->rotationPivotOffset.x * actor->scalingFactor, - actor->rotationPivotOffset.y * actor->scalingFactor, - -actor->rotationPivotOffset.z * actor->scalingFactor); + -actor->rotPivotOffset.x * actor->scalingFactor, + actor->rotPivotOffset.y * actor->scalingFactor, + -actor->rotPivotOffset.z * actor->scalingFactor); guTranslateF(mtxPivotOff, - actor->rotationPivotOffset.x * actor->scalingFactor, - -actor->rotationPivotOffset.y * actor->scalingFactor, - actor->rotationPivotOffset.z * actor->scalingFactor); + actor->rotPivotOffset.x * actor->scalingFactor, + -actor->rotPivotOffset.y * actor->scalingFactor, + actor->rotPivotOffset.z * actor->scalingFactor); } - guRotateF(mtxRotX, actor->rotation.x, 1.0f, 0.0f, 0.0f); - guRotateF(mtxRotY, actor->rotation.y, 0.0f, 1.0f, 0.0f); - guRotateF(mtxRotZ, actor->rotation.z, 0.0f, 0.0f, 1.0f); + guRotateF(mtxRotX, actor->rot.x, 1.0f, 0.0f, 0.0f); + guRotateF(mtxRotY, actor->rot.y, 0.0f, 1.0f, 0.0f); + guRotateF(mtxRotZ, actor->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(mtxRotY, mtxRotX, mtxTemp); guMtxCatF(mtxTemp, mtxRotZ, mtxRotation); guScaleF(mtxScale, @@ -965,18 +965,18 @@ void appendGfx_npc_actor(s32 isPartner, s32 actorIndex) { partPosZ = actorPosZ + part->partOffset.z + part->visualOffset.z; partYaw = part->yaw = actor->yaw; } else { - partPosX = part->absolutePosition.x + part->visualOffset.x; - partPosY = part->absolutePosition.y + part->visualOffset.y; - partPosZ = part->absolutePosition.z + part->visualOffset.z; + partPosX = part->absolutePos.x + part->visualOffset.x; + partPosY = part->absolutePos.y + part->visualOffset.y; + partPosZ = part->absolutePos.z + part->visualOffset.z; guScaleF(mtxPartScale, actor->scale.x * SPRITE_WORLD_SCALE_D, actor->scale.y * SPRITE_WORLD_SCALE_D, actor->scale.z * SPRITE_WORLD_SCALE_D); partYaw = part->yaw; } - part->currentPos.x = partPosX; - part->currentPos.y = partPosY; - part->currentPos.z = partPosZ; + part->curPos.x = partPosX; + part->curPos.y = partPosY; + part->curPos.z = partPosZ; if (part->flags & ACTOR_PART_FLAG_INVISIBLE) { part = part->nextPart; @@ -994,7 +994,7 @@ void appendGfx_npc_actor(s32 isPartner, s32 actorIndex) { } do { - lastAnim = part->currentAnimation; + lastAnim = part->curAnimation; animChanged = FALSE; palChanged = FALSE; decorChanged = FALSE; @@ -1004,8 +1004,8 @@ void appendGfx_npc_actor(s32 isPartner, s32 actorIndex) { if ((gBattleStatus.flags2 & (BS_FLAGS2_10 | BS_FLAGS2_4)) == BS_FLAGS2_4) { do { if (actor->koStatus == 0) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_INACTIVE); - spr_update_sprite(part->spriteInstanceID, part->currentAnimation, part->animationRate); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_INACTIVE); + spr_update_sprite(part->spriteInstanceID, part->curAnimation, part->animationRate); animChanged = TRUE; } } while (0); // required to match @@ -1014,7 +1014,7 @@ void appendGfx_npc_actor(s32 isPartner, s32 actorIndex) { func_80266EE8(actor, UNK_PAL_EFFECT_0); decorChanged = TRUE; } - if (isPartner && (gPlayerData.currentPartner == PARTNER_WATT)) { + if (isPartner && (gPlayerData.curPartner == PARTNER_WATT)) { if (!palChanged) { set_actor_pal_adjustment(actor, PAL_ADJUST_WATT_IDLE); } @@ -1061,33 +1061,33 @@ void appendGfx_npc_actor(s32 isPartner, s32 actorIndex) { if (!(part->flags & ACTOR_PART_FLAG_20000000)) { if (actor->debuff == STATUS_KEY_FROZEN) { if (!animChanged) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_FROZEN); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_FROZEN); animChanged = TRUE; } } else if (actor->debuff != STATUS_KEY_SHRINK) { if (actor->debuff == STATUS_KEY_POISON) { if (!animChanged) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_POISON); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_POISON); animChanged = TRUE; } } else if (actor->debuff == STATUS_KEY_DIZZY) { if (!animChanged) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_DIZZY); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_DIZZY); animChanged = TRUE; } } else if (actor->debuff == STATUS_KEY_FEAR) { if (!animChanged) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_FEAR); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_FEAR); animChanged = TRUE; } } else if (actor->debuff == STATUS_KEY_SLEEP) { if (!animChanged) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_SLEEP); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_SLEEP); animChanged = TRUE; } } else if (actor->debuff == STATUS_KEY_PARALYZE) { if (!animChanged) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_PARALYZE); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_PARALYZE); animChanged = TRUE; } } @@ -1095,37 +1095,37 @@ void appendGfx_npc_actor(s32 isPartner, s32 actorIndex) { if (actor->staticStatus == STATUS_KEY_STATIC) { if (!animChanged) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_STATIC); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_STATIC); animChanged = TRUE; } do {} while (0); // required to match } if (!animChanged) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, 1); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, 1); } if (isPartner) { if (actor->koStatus == STATUS_KEY_DAZE) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_DAZE); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_DAZE); animChanged = TRUE; } else { s32 temp = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_NORMAL); do { if (temp == get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_DAZE)) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_NORMAL); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_NORMAL); } } while (0); // required to match } } if (actor->debuff == STATUS_KEY_STOP) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_STOP); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_STOP); create_status_debuff(actor->hudElementDataIndex, STATUS_KEY_STOP); } else if (!animChanged) { s32 temp = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_NORMAL); do { if (temp == get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_STOP)) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_NORMAL); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, STATUS_KEY_NORMAL); } } while (0); // required to match } @@ -1165,37 +1165,37 @@ void appendGfx_npc_actor(s32 isPartner, s32 actorIndex) { enable_status_chill_out(actor->hudElementDataIndex); } if (part->spriteInstanceID >= 0) { - if (lastAnim != part->currentAnimation) { - spr_update_sprite(part->spriteInstanceID, part->currentAnimation, part->animationRate); + if (lastAnim != part->curAnimation) { + spr_update_sprite(part->spriteInstanceID, part->curAnimation, part->animationRate); part->animNotifyValue = spr_get_notify_value(part->spriteInstanceID); } } if (!(actor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { guTranslateF(mtxPivotOn, - -part->rotationPivotOffset.x * actor->scalingFactor, - -part->rotationPivotOffset.y * actor->scalingFactor, - -part->rotationPivotOffset.z * actor->scalingFactor); + -part->rotPivotOffset.x * actor->scalingFactor, + -part->rotPivotOffset.y * actor->scalingFactor, + -part->rotPivotOffset.z * actor->scalingFactor); guTranslateF(mtxPivotOff, - part->rotationPivotOffset.x * actor->scalingFactor, - part->rotationPivotOffset.y * actor->scalingFactor, - part->rotationPivotOffset.z * actor->scalingFactor); + part->rotPivotOffset.x * actor->scalingFactor, + part->rotPivotOffset.y * actor->scalingFactor, + part->rotPivotOffset.z * actor->scalingFactor); } else { guTranslateF(mtxPivotOn, - -part->rotationPivotOffset.x * actor->scalingFactor, - part->rotationPivotOffset.y * actor->scalingFactor, - -part->rotationPivotOffset.z * actor->scalingFactor); + -part->rotPivotOffset.x * actor->scalingFactor, + part->rotPivotOffset.y * actor->scalingFactor, + -part->rotPivotOffset.z * actor->scalingFactor); guTranslateF(mtxPivotOff, - part->rotationPivotOffset.x * actor->scalingFactor, - -part->rotationPivotOffset.y * actor->scalingFactor, - part->rotationPivotOffset.z * actor->scalingFactor); + part->rotPivotOffset.x * actor->scalingFactor, + -part->rotPivotOffset.y * actor->scalingFactor, + part->rotPivotOffset.z * actor->scalingFactor); } guTranslateF(mtxTranslate, partPosX + part->palAnimPosOffset[0], partPosY + part->palAnimPosOffset[1], partPosZ); - guRotateF(mtxRotX, part->rotation.x, 1.0f, 0.0f, 0.0f); - guRotateF(mtxRotY, part->rotation.y, 0.0f, 1.0f, 0.0f); - guRotateF(mtxRotZ, part->rotation.z, 0.0f, 0.0f, 1.0f); + guRotateF(mtxRotX, part->rot.x, 1.0f, 0.0f, 0.0f); + guRotateF(mtxRotY, part->rot.y, 0.0f, 1.0f, 0.0f); + guRotateF(mtxRotZ, part->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(mtxRotY, mtxRotX, mtxTemp); guMtxCatF(mtxTemp, mtxRotZ, mtxRotation); guScaleF(mtxScale, part->scale.x, part->scale.y * part->verticalStretch, part->scale.z); @@ -1210,9 +1210,9 @@ void appendGfx_npc_actor(s32 isPartner, s32 actorIndex) { } guMtxCatF(mtxTemp, mtxTranslate, mtxTransform); - part->currentPos.x = partPosX + part->palAnimPosOffset[0]; - part->currentPos.y = partPosY + part->palAnimPosOffset[1]; - part->currentPos.z = partPosZ; + part->curPos.x = partPosX + part->palAnimPosOffset[0]; + part->curPos.y = partPosY + part->palAnimPosOffset[1]; + part->curPos.z = partPosZ; if (part->spriteInstanceID >= 0) { if (!isPartner) { @@ -1244,37 +1244,37 @@ void appendGfx_npc_actor_reflection(s32 flipYaw, Actor* actor) { s32 numParts; s32 i; - actorPosX = actor->currentPos.x + actor->headOffset.x; + actorPosX = actor->curPos.x + actor->headOffset.x; if (!(actor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { - actorPosY = actor->currentPos.y + actor->headOffset.y; + actorPosY = actor->curPos.y + actor->headOffset.y; } else { - actorPosY = actor->currentPos.y - actor->headOffset.y; + actorPosY = actor->curPos.y - actor->headOffset.y; } - actorPosZ = actor->currentPos.z + actor->headOffset.z - 5.0f; + actorPosZ = actor->curPos.z + actor->headOffset.z - 5.0f; if (!(actor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { guTranslateF(mtxPivotOn, - -actor->rotationPivotOffset.x * actor->scalingFactor, - -actor->rotationPivotOffset.y * actor->scalingFactor, - -actor->rotationPivotOffset.z * actor->scalingFactor); + -actor->rotPivotOffset.x * actor->scalingFactor, + -actor->rotPivotOffset.y * actor->scalingFactor, + -actor->rotPivotOffset.z * actor->scalingFactor); guTranslateF(mtxPivotOff, - actor->rotationPivotOffset.x * actor->scalingFactor, - actor->rotationPivotOffset.y * actor->scalingFactor, - actor->rotationPivotOffset.z * actor->scalingFactor); + actor->rotPivotOffset.x * actor->scalingFactor, + actor->rotPivotOffset.y * actor->scalingFactor, + actor->rotPivotOffset.z * actor->scalingFactor); } else { guTranslateF(mtxPivotOn, - -actor->rotationPivotOffset.x * actor->scalingFactor, - actor->rotationPivotOffset.y * actor->scalingFactor, - -actor->rotationPivotOffset.z * actor->scalingFactor); + -actor->rotPivotOffset.x * actor->scalingFactor, + actor->rotPivotOffset.y * actor->scalingFactor, + -actor->rotPivotOffset.z * actor->scalingFactor); guTranslateF(mtxPivotOff, - actor->rotationPivotOffset.x * actor->scalingFactor, - -actor->rotationPivotOffset.y * actor->scalingFactor, - actor->rotationPivotOffset.z * actor->scalingFactor); + actor->rotPivotOffset.x * actor->scalingFactor, + -actor->rotPivotOffset.y * actor->scalingFactor, + actor->rotPivotOffset.z * actor->scalingFactor); } - guRotateF(mtxRotX, actor->rotation.x, 1.0f, 0.0f, 0.0f); - guRotateF(mtxRotY, actor->rotation.y, 0.0f, 1.0f, 0.0f); - guRotateF(mtxRotZ, actor->rotation.z, 0.0f, 0.0f, 1.0f); + guRotateF(mtxRotX, actor->rot.x, 1.0f, 0.0f, 0.0f); + guRotateF(mtxRotY, actor->rot.y, 0.0f, 1.0f, 0.0f); + guRotateF(mtxRotZ, actor->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(mtxRotY, mtxRotX, mtxTemp); guMtxCatF(mtxTemp, mtxRotZ, mtxRotation); @@ -1301,9 +1301,9 @@ void appendGfx_npc_actor_reflection(s32 flipYaw, Actor* actor) { partPosZ = actorPosZ + part->partOffset.z + part->visualOffset.z; partYaw = part->yaw = actor->yaw; } else { - partPosX = part->absolutePosition.x + part->visualOffset.x; - partPosY = part->absolutePosition.y + part->visualOffset.y; - partPosZ = part->absolutePosition.z + part->visualOffset.z; + partPosX = part->absolutePos.x + part->visualOffset.x; + partPosY = part->absolutePos.y + part->visualOffset.y; + partPosZ = part->absolutePos.z + part->visualOffset.z; guScaleF(mtxPartScale, actor->scale.x * SPRITE_WORLD_SCALE_D, actor->scale.y * SPRITE_WORLD_SCALE_D, @@ -1322,31 +1322,31 @@ void appendGfx_npc_actor_reflection(s32 flipYaw, Actor* actor) { if (!(actor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { guTranslateF(mtxPivotOn, - -part->rotationPivotOffset.x * actor->scalingFactor, - -part->rotationPivotOffset.y * actor->scalingFactor, - -part->rotationPivotOffset.z * actor->scalingFactor); + -part->rotPivotOffset.x * actor->scalingFactor, + -part->rotPivotOffset.y * actor->scalingFactor, + -part->rotPivotOffset.z * actor->scalingFactor); guTranslateF(mtxPivotOff, - part->rotationPivotOffset.x * actor->scalingFactor, - part->rotationPivotOffset.y * actor->scalingFactor, - part->rotationPivotOffset.z * actor->scalingFactor); + part->rotPivotOffset.x * actor->scalingFactor, + part->rotPivotOffset.y * actor->scalingFactor, + part->rotPivotOffset.z * actor->scalingFactor); } else { guTranslateF(mtxPivotOn, - -part->rotationPivotOffset.x * actor->scalingFactor, - part->rotationPivotOffset.y * actor->scalingFactor, - -part->rotationPivotOffset.z * actor->scalingFactor); + -part->rotPivotOffset.x * actor->scalingFactor, + part->rotPivotOffset.y * actor->scalingFactor, + -part->rotPivotOffset.z * actor->scalingFactor); guTranslateF(mtxPivotOff, - part->rotationPivotOffset.x * actor->scalingFactor, - -part->rotationPivotOffset.y * actor->scalingFactor, - part->rotationPivotOffset.z * actor->scalingFactor); + part->rotPivotOffset.x * actor->scalingFactor, + -part->rotPivotOffset.y * actor->scalingFactor, + part->rotPivotOffset.z * actor->scalingFactor); } guTranslateF(mtxTranslate, partPosX + part->palAnimPosOffset[0], partPosY + part->palAnimPosOffset[1], partPosZ - 1.0f); - guRotateF(mtxRotX, part->rotation.x, 1.0f, 0.0f, 0.0f); - guRotateF(mtxRotY, part->rotation.y, 0.0f, 1.0f, 0.0f); - guRotateF(mtxRotZ, part->rotation.z, 0.0f, 0.0f, 1.0f); + guRotateF(mtxRotX, part->rot.x, 1.0f, 0.0f, 0.0f); + guRotateF(mtxRotY, part->rot.y, 0.0f, 1.0f, 0.0f); + guRotateF(mtxRotZ, part->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(mtxRotY, mtxRotX, mtxTemp); guMtxCatF(mtxTemp, mtxRotZ, mtxRotation); @@ -1403,7 +1403,7 @@ void update_player_actor_shadow(void) { Shadow* shadow; f32 x, y, z, distance; - parts->animNotifyValue = spr_update_player_sprite(PLAYER_SPRITE_MAIN, parts->currentAnimation, parts->animationRate); + parts->animNotifyValue = spr_update_player_sprite(PLAYER_SPRITE_MAIN, parts->curAnimation, parts->animationRate); if (player->flags & ACTOR_FLAG_BLUR_ENABLED) { func_802549F4(player); @@ -1419,18 +1419,18 @@ void update_player_actor_shadow(void) { } distance = 32767.0f; - x = player->currentPos.x + player->headOffset.x; - z = player->currentPos.z + player->headOffset.z; - y = player->currentPos.y + player->headOffset.y + 12.0; + x = player->curPos.x + player->headOffset.x; + z = player->curPos.z + player->headOffset.z; + y = player->curPos.y + player->headOffset.y + 12.0; npc_raycast_down_sides(0, &x, &y, &z, &distance); if (distance > 200.0f) { shadow->flags |= ENTITY_FLAG_HIDDEN; } - shadow->position.x = x; - shadow->position.y = y; - shadow->position.z = z; - shadow->rotation.y = clamp_angle(player->yaw - camera->currentYaw); + shadow->pos.x = x; + shadow->pos.y = y; + shadow->pos.z = z; + shadow->rot.y = clamp_angle(player->yaw - camera->curYaw); set_standard_shadow_scale(shadow, distance); shadow->scale.x *= player->shadowScale * player->scalingFactor; @@ -1461,9 +1461,9 @@ void appendGfx_player_actor(void* arg0) { partner = battleStatus->partnerActor; playerParts = player->partsTable; - playerPosX = player->currentPos.x + player->headOffset.x; - playerPosY = player->currentPos.y + player->headOffset.y + player->verticalRenderOffset; - playerPosZ = player->currentPos.z + player->headOffset.z; + playerPosX = player->curPos.x + player->headOffset.x; + playerPosY = player->curPos.y + player->headOffset.y + player->verticalRenderOffset; + playerPosZ = player->curPos.z + player->headOffset.z; playerYaw = playerParts->yaw = player->yaw; @@ -1601,7 +1601,7 @@ void appendGfx_player_actor(void* arg0) { if (FALSE) { // TODO required to match - also whyyyyyy compiler, whyyyyy back: - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_STOP); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_STOP); create_status_debuff(player->hudElementDataIndex, STATUS_KEY_STOP); goto end; } @@ -1614,7 +1614,7 @@ void appendGfx_player_actor(void* arg0) { palChanged = FALSE; cond3 = FALSE; cond4 = FALSE; - lastAnim = playerParts->currentAnimation; + lastAnim = playerParts->curAnimation; } while (0); // required to match if (((((gBattleStatus.flags2 & (BS_FLAGS2_8 | BS_FLAGS2_2)) == BS_FLAGS2_2) && (partner != NULL)) || (battleStatus->outtaSightActive > 0)) @@ -1632,15 +1632,15 @@ void appendGfx_player_actor(void* arg0) { ((battleStatus->outtaSightActive > 0) || (gBattleStatus.flags2 & BS_FLAGS2_2))) { if (is_ability_active(ABILITY_BERSERKER)) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_INACTIVE_BERSERK); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_INACTIVE_BERSERK); } else if (player->debuff == STATUS_KEY_SLEEP) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_INACTIVE_SLEEP); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_INACTIVE_SLEEP); } else if (player->debuff == STATUS_KEY_DIZZY) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_INACTIVE_DIZZY); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_INACTIVE_DIZZY); } else { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_INACTIVE); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_INACTIVE); } - spr_update_player_sprite(PLAYER_SPRITE_MAIN, playerParts->currentAnimation, playerParts->animationRate); + spr_update_player_sprite(PLAYER_SPRITE_MAIN, playerParts->curAnimation, playerParts->animationRate); animChanged = TRUE; } } @@ -1658,8 +1658,8 @@ void appendGfx_player_actor(void* arg0) { } if (player->stoneStatus == STATUS_KEY_STONE) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_STONE); - spr_update_player_sprite(PLAYER_SPRITE_MAIN, playerParts->currentAnimation, playerParts->animationRate); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_STONE); + spr_update_player_sprite(PLAYER_SPRITE_MAIN, playerParts->curAnimation, playerParts->animationRate); animChanged = TRUE; if (!palChanged) { @@ -1677,9 +1677,9 @@ void appendGfx_player_actor(void* arg0) { } if ((player->flags & ACTOR_FLAG_4000000) && !animChanged) { - s32 temp = playerParts->currentAnimation; + s32 temp = playerParts->curAnimation; if (temp == get_player_anim_for_status(STATUS_KEY_STONE)) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_NORMAL); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_NORMAL); } } @@ -1727,13 +1727,13 @@ void appendGfx_player_actor(void* arg0) { } if (player->flags & ACTOR_FLAG_4000000) { if (battleStatus->hustleTurns != 0) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_HUSTLE); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_HUSTLE); animChanged = TRUE; } else if (!animChanged) { s32 temp = get_player_anim_for_status(STATUS_KEY_NORMAL); do { if (temp == get_player_anim_for_status(STATUS_KEY_HUSTLE)) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_NORMAL); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_NORMAL); } } while (0); // required to match } @@ -1741,34 +1741,34 @@ void appendGfx_player_actor(void* arg0) { do { if (player->debuff == STATUS_KEY_FROZEN) { if (!animChanged) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_FROZEN); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_FROZEN); animChanged = TRUE; } } else if (player->debuff != STATUS_KEY_SHRINK) { if (player->debuff == STATUS_KEY_POISON) { if (!animChanged) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_POISON); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_POISON); animChanged = TRUE; } } else if (player->debuff == STATUS_KEY_DIZZY) { if (!animChanged) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_DIZZY); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_DIZZY); animChanged = TRUE; } } else if (player->debuff == STATUS_KEY_SLEEP) { if (!animChanged) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_SLEEP); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_SLEEP); animChanged = TRUE; } } else if (player->debuff == STATUS_KEY_PARALYZE) { if (!animChanged) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_PARALYZE); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_PARALYZE); animChanged = TRUE; } } else { if (player_team_is_ability_active(player, ABILITY_BERSERKER)) { if (!animChanged) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_BERSERK); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_BERSERK); animChanged = TRUE; } } @@ -1776,24 +1776,24 @@ void appendGfx_player_actor(void* arg0) { } if (is_ability_active(ABILITY_ZAP_TAP)) { if (!animChanged) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_STATIC); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_STATIC); animChanged = TRUE; } player->staticStatus = STATUS_KEY_STATIC; player->staticDuration = 127; } else if ((player->staticStatus == STATUS_KEY_STATIC) && !animChanged) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_STATIC); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_STATIC); animChanged = TRUE; } if ((player->transparentStatus == STATUS_KEY_TRANSPARENT) || (playerParts->flags & ACTOR_PART_FLAG_100)) { if (!animChanged) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_TRANSPARENT); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_TRANSPARENT); animChanged = TRUE; } create_status_transparent(player->hudElementDataIndex, STATUS_KEY_TRANSPARENT); } if (!animChanged) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_NORMAL); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_NORMAL); } } while (0); // needed to match } @@ -1831,9 +1831,9 @@ void appendGfx_player_actor(void* arg0) { if (player->debuff != STATUS_KEY_STOP) { if (!animChanged) { - s32 temp = playerParts->currentAnimation; + s32 temp = playerParts->curAnimation; if (temp == get_player_anim_for_status(STATUS_KEY_STOP)) { - playerParts->currentAnimation = get_player_anim_for_status(STATUS_KEY_NORMAL); + playerParts->curAnimation = get_player_anim_for_status(STATUS_KEY_NORMAL); } } } else { @@ -1854,23 +1854,23 @@ end: playerPosX += playerParts->palAnimPosOffset[0]; playerPosY += playerParts->palAnimPosOffset[1]; - playerParts->currentPos.x = playerPosX; - playerParts->currentPos.y = playerPosY; - playerParts->currentPos.z = playerPosZ; + playerParts->curPos.x = playerPosX; + playerParts->curPos.y = playerPosY; + playerParts->curPos.z = playerPosZ; guTranslateF(mtxTranslate, playerPosX, playerPosY, playerPosZ); guTranslateF(mtxPivotOn, - -player->rotationPivotOffset.x * player->scalingFactor, - -player->rotationPivotOffset.y * player->scalingFactor, - -player->rotationPivotOffset.z * player->scalingFactor); + -player->rotPivotOffset.x * player->scalingFactor, + -player->rotPivotOffset.y * player->scalingFactor, + -player->rotPivotOffset.z * player->scalingFactor); guTranslateF(mtxPivotOff, - player->rotationPivotOffset.x * player->scalingFactor, - player->rotationPivotOffset.y * player->scalingFactor, - player->rotationPivotOffset.z * player->scalingFactor); + player->rotPivotOffset.x * player->scalingFactor, + player->rotPivotOffset.y * player->scalingFactor, + player->rotPivotOffset.z * player->scalingFactor); - guRotateF(mtxRotX, player->rotation.x, 1.0f, 0.0f, 0.0f); - guRotateF(mtxRotY, player->rotation.y, 0.0f, 1.0f, 0.0f); - guRotateF(mtxRotZ, player->rotation.z, 0.0f, 0.0f, 1.0f); + guRotateF(mtxRotX, player->rot.x, 1.0f, 0.0f, 0.0f); + guRotateF(mtxRotY, player->rot.y, 0.0f, 1.0f, 0.0f); + guRotateF(mtxRotZ, player->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(mtxRotY, mtxRotX, mtxTemp); guMtxCatF(mtxTemp, mtxRotZ, mtxRotation); @@ -1884,8 +1884,8 @@ end: guMtxCatF(mtxTransform, mtxPivotOff, mtxTemp); guMtxCatF(mtxTemp, mtxTranslate, mtxTransform); - if (lastAnim != playerParts->currentAnimation) { - spr_update_player_sprite(PLAYER_SPRITE_MAIN, playerParts->currentAnimation, playerParts->animationRate); + if (lastAnim != playerParts->curAnimation) { + spr_update_player_sprite(PLAYER_SPRITE_MAIN, playerParts->curAnimation, playerParts->animationRate); } func_8025C840(0, playerParts, clamp_angle(playerYaw + 180.0f), 0); func_8025CCC8(0, playerParts, clamp_angle(playerYaw + 180.0f), 0); @@ -1902,27 +1902,27 @@ void appendGfx_player_actor_reflection(void* arg0) { f32 playerYaw = player->yaw; f32 dx, dy, dz; - dx = player->currentPos.x + player->headOffset.x; + dx = player->curPos.x + player->headOffset.x; dx += part->palAnimPosOffset[0]; - dy = player->currentPos.y + player->headOffset.y; + dy = player->curPos.y + player->headOffset.y; dy += part->palAnimPosOffset[1]; - dz = player->currentPos.z + player->headOffset.z - 5.0f; + dz = player->curPos.z + player->headOffset.z - 5.0f; part->yaw = playerYaw; guTranslateF(mtxTranslate, dx, dy, dz - 1.0f); guTranslateF(mtxPivotOn, - -player->rotationPivotOffset.x * player->scalingFactor, - -player->rotationPivotOffset.y * player->scalingFactor, - -player->rotationPivotOffset.z * player->scalingFactor); + -player->rotPivotOffset.x * player->scalingFactor, + -player->rotPivotOffset.y * player->scalingFactor, + -player->rotPivotOffset.z * player->scalingFactor); guTranslateF(mtxPivotOff, - player->rotationPivotOffset.x * player->scalingFactor, - player->rotationPivotOffset.y * player->scalingFactor, - player->rotationPivotOffset.z * player->scalingFactor); + player->rotPivotOffset.x * player->scalingFactor, + player->rotPivotOffset.y * player->scalingFactor, + player->rotPivotOffset.z * player->scalingFactor); - guRotateF(mtxRotX, player->rotation.x, 1.0f, 0.0f, 0.0f); - guRotateF(mtxRotY, player->rotation.y, 0.0f, 1.0f, 0.0f); - guRotateF(mtxRotZ, player->rotation.z, 0.0f, 0.0f, 1.0f); + guRotateF(mtxRotX, player->rot.x, 1.0f, 0.0f, 0.0f); + guRotateF(mtxRotY, player->rot.y, 0.0f, 1.0f, 0.0f); + guRotateF(mtxRotZ, player->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(mtxRotY, mtxRotX, mtxTemp); guMtxCatF(mtxTemp, mtxRotZ, mtxRotation); guScaleF(mtxScale, @@ -2062,7 +2062,7 @@ void func_8025950C(ActorPart* part, s32 yaw, Matrix4f mtx) { } if (decor->unk_768 != 0) { - decor->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 0x10); + decor->originalPalettesList = spr_get_npc_palettes(part->curAnimation >> 0x10); decor->originalPalettesCount = 0; while (decor->originalPalettesList[decor->originalPalettesCount] != (PAL_PTR) -1) { decor->originalPalettesCount++; @@ -2131,7 +2131,7 @@ void func_802597B0(ActorPart* part, s32 yaw, Matrix4f mtx) { } if (decor->unk_768 != 0) { - decor->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16); + decor->originalPalettesList = spr_get_player_palettes(part->curAnimation >> 16); decor->originalPalettesCount = 0; while (decor->originalPalettesList[decor->originalPalettesCount] != (PAL_PTR) -1) { @@ -2204,13 +2204,13 @@ void render_with_sleep_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, Matri if (decorationTable->resetPalAdjust) { if (isNpcSprite == SPRITE_MODE_PLAYER) { - decorationTable->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_player_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; } } else { - decorationTable->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_npc_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; @@ -2263,19 +2263,19 @@ void render_with_static_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, Matr if (decorationTable->resetPalAdjust) { if (isNpcSprite == SPRITE_MODE_PLAYER) { - decorationTable->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_player_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; } decorationTable->spriteColorVariations = SPR_PLAYER_COLOR_VARIATIONS; } else { - decorationTable->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_npc_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; } - decorationTable->spriteColorVariations = spr_get_npc_color_variations(part->currentAnimation >> 16); + decorationTable->spriteColorVariations = spr_get_npc_color_variations(part->curAnimation >> 16); } for (i = 0; i < decorationTable->originalPalettesCount; i++) { @@ -2379,13 +2379,13 @@ void render_with_fear_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, Matrix if (decorationTable->resetPalAdjust) { if (isNpcSprite == SPRITE_MODE_PLAYER) { - decorationTable->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_player_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 2; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; } } else { - decorationTable->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_npc_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; @@ -2448,19 +2448,19 @@ void render_with_poison_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, Matr if (decorationTable->resetPalAdjust) { if (isNpcSprite == SPRITE_MODE_PLAYER) { - decorationTable->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_player_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; } decorationTable->spriteColorVariations = SPR_PLAYER_COLOR_VARIATIONS; } else { - decorationTable->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_npc_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; } - decorationTable->spriteColorVariations = spr_get_npc_color_variations(part->currentAnimation >> 16); + decorationTable->spriteColorVariations = spr_get_npc_color_variations(part->curAnimation >> 16); } decorationTable->palAnimState = 0; @@ -2506,13 +2506,13 @@ void render_with_paralyze_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, Ma if (decorationTable->resetPalAdjust) { if (isNpcSprite == SPRITE_MODE_PLAYER) { - decorationTable->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_player_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; } } else { - decorationTable->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_npc_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; @@ -2607,14 +2607,14 @@ void render_with_berserk_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, Mat if (decorationTable->resetPalAdjust) { if (isNpcSprite == SPRITE_MODE_PLAYER) { - decorationTable->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_player_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; } decorationTable->palAnimState = 0; } else { - decorationTable->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_npc_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; @@ -2669,19 +2669,19 @@ void render_with_watt_idle_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, M if (decorationTable->resetPalAdjust) { if (isNpcSprite == SPRITE_MODE_PLAYER) { - decorationTable->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_player_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; } decorationTable->spriteColorVariations = SPR_PLAYER_COLOR_VARIATIONS; } else { - decorationTable->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_npc_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; } - decorationTable->spriteColorVariations = spr_get_npc_color_variations(part->currentAnimation >> 16); + decorationTable->spriteColorVariations = spr_get_npc_color_variations(part->curAnimation >> 16); } for (i = 0; i < decorationTable->originalPalettesCount; i++) { @@ -2781,19 +2781,19 @@ void render_with_watt_attack_palettes(b32 isNpcSprite, ActorPart* part, s32 yaw, if (decorationTable->resetPalAdjust) { if (isNpcSprite == SPRITE_MODE_PLAYER) { - decorationTable->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_player_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; } decorationTable->spriteColorVariations = SPR_PLAYER_COLOR_VARIATIONS; } else { - decorationTable->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_npc_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; } - decorationTable->spriteColorVariations = spr_get_npc_color_variations(part->currentAnimation >> 16); + decorationTable->spriteColorVariations = spr_get_npc_color_variations(part->curAnimation >> 16); } for (i = 0; i < decorationTable->originalPalettesCount; i++) { @@ -2892,7 +2892,7 @@ void render_with_player_debuff_palettes(b32 isNpcSprite, ActorPart* part, s32 ya if (decorationTable->resetPalAdjust) { if (isNpcSprite == SPRITE_MODE_PLAYER) { - decorationTable->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_player_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; @@ -2904,12 +2904,12 @@ void render_with_player_debuff_palettes(b32 isNpcSprite, ActorPart* part, s32 ya decorationTable->spriteColorVariations = SPR_PLAYER_COLOR_VARIATIONS; } } else { - decorationTable->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16); + decorationTable->originalPalettesList = spr_get_npc_palettes(part->curAnimation >> 16); decorationTable->originalPalettesCount = 0; while ((s32)decorationTable->originalPalettesList[decorationTable->originalPalettesCount] != -1) { decorationTable->originalPalettesCount++; } - decorationTable->spriteColorVariations = spr_get_npc_color_variations(part->currentAnimation >> 16); + decorationTable->spriteColorVariations = spr_get_npc_color_variations(part->curAnimation >> 16); } if (decorationTable->resetPalAdjust == TRUE) { @@ -3019,13 +3019,13 @@ void render_with_pal_blending(b32 isNpcSprite, ActorPart* part, s32 yaw, b32 has if (decor->resetPalAdjust != 0) { if (isNpcSprite == SPRITE_MODE_PLAYER) { - decor->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16); + decor->originalPalettesList = spr_get_player_palettes(part->curAnimation >> 16); decor->originalPalettesCount = 0; while ((s32)decor->originalPalettesList[decor->originalPalettesCount] != -1) { decor->originalPalettesCount++; } } else { - decor->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16); + decor->originalPalettesList = spr_get_npc_palettes(part->curAnimation >> 16); decor->originalPalettesCount = 0; while ((s32)decor->originalPalettesList[decor->originalPalettesCount] != -1) { decor->originalPalettesCount++; @@ -3191,18 +3191,18 @@ void render_with_palset_blending(b32 isNpcSprite, ActorPart* part, s32 yaw, Matr if (decor->resetPalAdjust != 0) { if (isNpcSprite == SPRITE_MODE_PLAYER) { - decor->originalPalettesList = spr_get_player_palettes(part->currentAnimation >> 16); + decor->originalPalettesList = spr_get_player_palettes(part->curAnimation >> 16); decor->originalPalettesCount = 0; while (decor->originalPalettesList[decor->originalPalettesCount] != (PAL_PTR) -1) { decor->originalPalettesCount++; } } else { - decor->originalPalettesList = spr_get_npc_palettes(part->currentAnimation >> 16); + decor->originalPalettesList = spr_get_npc_palettes(part->curAnimation >> 16); decor->originalPalettesCount = 0; while (decor->originalPalettesList[decor->originalPalettesCount] != (PAL_PTR) -1) { decor->originalPalettesCount++; } - decor->spriteColorVariations = spr_get_npc_color_variations(part->currentAnimation >> 16); + decor->spriteColorVariations = spr_get_npc_color_variations(part->curAnimation >> 16); } if (decor->resetPalAdjust == 1) { @@ -3658,7 +3658,7 @@ void func_8025D160(ActorPart* arg0, s32 index) { switch (table->state[index]) { case 0: - fx_aura(3, arg0->currentPos.x, arg0->currentPos.y, arg0->currentPos.z, 0.4f, &table->effect[index]); + fx_aura(3, arg0->curPos.x, arg0->curPos.y, arg0->curPos.z, 0.4f, &table->effect[index]); table->state[index] = 1; table->unk_8C6[index].unk00 = 40; table->unk_8C6[index].unk02 = 40; @@ -3667,9 +3667,9 @@ void func_8025D160(ActorPart* arg0, s32 index) { case 1: effect = table->effect[index]; data = effect->data.aura; - data->posA.x = arg0->currentPos.x + table->unk_8C6[index].unk04; - data->posA.y = arg0->currentPos.y; - data->posA.z = arg0->currentPos.z; + data->posA.x = arg0->curPos.x + table->unk_8C6[index].unk04; + data->posA.y = arg0->curPos.y; + data->posA.z = arg0->curPos.z; scale = table->unk_8C6[index].unk00; scale /= 100.0f; effect->data.aura->scale.x = scale; @@ -3690,9 +3690,9 @@ void func_8025D2B0(ActorPart* part, s32 decorationIndex) { switch (decor->state[decorationIndex]) { case 0: if (part->yaw > 90.0f) { - fx_sweat(0, part->currentPos.x, part->currentPos.y + part->size.y, part->currentPos.z, 5.0f, 45.0f, 20); + fx_sweat(0, part->curPos.x, part->curPos.y + part->size.y, part->curPos.z, 5.0f, 45.0f, 20); } else { - fx_sweat(0, part->currentPos.x, part->currentPos.y + part->size.y, part->currentPos.z, 5.0f, -45.0f, 20); + fx_sweat(0, part->curPos.x, part->curPos.y + part->size.y, part->curPos.z, 5.0f, -45.0f, 20); } decor->stateResetTimer[decorationIndex] = 10; decor->state[decorationIndex] = TRUE; @@ -3718,15 +3718,15 @@ void func_8025D3CC(ActorPart* part, s32 decorationIndex) { decor = part->decorationTable; switch (decor->state[decorationIndex]) { case 0: - fx_stars_orbiting(0, part->currentPos.x, part->currentPos.y + part->size.y, part->currentPos.z, + fx_stars_orbiting(0, part->curPos.x, part->curPos.y + part->size.y, part->curPos.z, 20.0f, 3, &decor->effect[decorationIndex]); decor->state[decorationIndex] = 1; break; case 1: data = decor->effect[decorationIndex]->data.starsOrbiting; - data->pos.x = part->currentPos.x; - data->pos.y = part->currentPos.y + part->size.y; - data->pos.z = part->currentPos.z; + data->pos.x = part->curPos.x; + data->pos.y = part->curPos.y + part->size.y; + data->pos.z = part->curPos.z; break; } } @@ -3743,7 +3743,7 @@ void func_8025D4C8(ActorPart* part, s32 decorationIndex) { switch (decor->state[decorationIndex]) { case 0: - fx_aura(1, part->currentPos.x, part->currentPos.y, part->currentPos.z, 0.4f, &decor->effect[decorationIndex]); + fx_aura(1, part->curPos.x, part->curPos.y, part->curPos.z, 0.4f, &decor->effect[decorationIndex]); decor->state[decorationIndex] = 1; decor->unk_8C6[decorationIndex].unk00 = 40; decor->unk_8C6[decorationIndex].unk02 = 40; @@ -3756,9 +3756,9 @@ void func_8025D4C8(ActorPart* part, s32 decorationIndex) { case 1: effect = decor->effect[decorationIndex]; data = effect->data.aura; - data->posA.x = part->currentPos.x; - data->posA.y = part->currentPos.y; - data->posA.z = part->currentPos.z + decor->unk_8C6[decorationIndex].unk06; + data->posA.x = part->curPos.x; + data->posA.y = part->curPos.y; + data->posA.z = part->curPos.z + decor->unk_8C6[decorationIndex].unk06; scale = decor->unk_8C6[decorationIndex].unk00; scale /= 100.0f; @@ -3781,14 +3781,14 @@ void func_8025D640(ActorPart* part, s32 decorationIndex) { switch (decor->state[decorationIndex]) { case 0: - decor->effect[decorationIndex] = fx_effect_65(1, part->currentPos.x, part->currentPos.y, part->currentPos.z, 1.0f, 0); + decor->effect[decorationIndex] = fx_effect_65(1, part->curPos.x, part->curPos.y, part->curPos.z, 1.0f, 0); decor->state[decorationIndex] = 1; break; case 1: effect = decor->effect[decorationIndex]; - effect->data.unk_65->pos.x = part->currentPos.x; - effect->data.unk_65->pos.y = part->currentPos.y; - effect->data.unk_65->pos.z = part->currentPos.z; + effect->data.unk_65->pos.x = part->curPos.x; + effect->data.unk_65->pos.y = part->curPos.y; + effect->data.unk_65->pos.z = part->curPos.z; break; } } @@ -3803,15 +3803,15 @@ void func_8025D71C(ActorPart* part, s32 decorationIndex) { switch (decor->state[decorationIndex]) { case 0: - decor->effect[decorationIndex] = fx_effect_65(2, part->currentPos.x, part->currentPos.y, part->currentPos.z, 1.0f, 0); + decor->effect[decorationIndex] = fx_effect_65(2, part->curPos.x, part->curPos.y, part->curPos.z, 1.0f, 0); decor->unk_8C6[decorationIndex].unk00 = 1; decor->state[decorationIndex] = 1; break; case 1: effect = decor->effect[decorationIndex]; - effect->data.unk_65->pos.x = part->currentPos.x; - effect->data.unk_65->pos.y = part->currentPos.y; - effect->data.unk_65->pos.z = part->currentPos.z; + effect->data.unk_65->pos.x = part->curPos.x; + effect->data.unk_65->pos.y = part->curPos.y; + effect->data.unk_65->pos.z = part->curPos.z; effect->data.unk_65->scale = decor->unk_8C6[decorationIndex].unk00 / 100.0f; break; } @@ -3827,14 +3827,14 @@ void func_8025D830(ActorPart* part, s32 decorationIndex) { switch (decor->state[decorationIndex]) { case 0: - decor->effect[decorationIndex] = fx_whirlwind(2, part->currentPos.x, part->currentPos.y, part->currentPos.z, 1.0f, 0); + decor->effect[decorationIndex] = fx_whirlwind(2, part->curPos.x, part->curPos.y, part->curPos.z, 1.0f, 0); decor->state[decorationIndex] = 1; break; case 1: effect = decor->effect[decorationIndex]; - effect->data.whirlwind->pos.x = part->currentPos.x; - effect->data.whirlwind->pos.y = part->currentPos.y; - effect->data.whirlwind->pos.z = part->currentPos.z; + effect->data.whirlwind->pos.x = part->curPos.x; + effect->data.whirlwind->pos.y = part->curPos.y; + effect->data.whirlwind->pos.z = part->curPos.z; break; } } @@ -3860,9 +3860,9 @@ void func_8025D90C(ActorPart* part, s32 decorationIndex) { sinA = sin_rad(angle); cosA = cos_rad(angle); fx_walking_dust(0, - part->currentPos.x + (part->size.x * sinA * 0.2f), - part->currentPos.y + 1.5f, - part->currentPos.z + (part->size.x * cosA * 0.2f), + part->curPos.x + (part->size.x * sinA * 0.2f), + part->curPos.y + 1.5f, + part->curPos.z + (part->size.x * cosA * 0.2f), sinA, cosA); } break; @@ -3883,9 +3883,9 @@ void func_8025DA68(ActorPart* part, s32 decorationIndex) { decor->state[decorationIndex] = 1; // fallthrough case 1: - x = part->currentPos.x; - y = part->currentPos.y + (part->size.y / 2); - z = part->currentPos.z - 5.0f; + x = part->curPos.x; + y = part->curPos.y + (part->size.y / 2); + z = part->curPos.z - 5.0f; // @bug? perhaps this should be % 4? if ((gGameStatusPtr->frameCounter / 4) == 0) { fx_sparkles(FX_SPARKLES_1, x, y, z, 10.0f); @@ -3911,7 +3911,7 @@ void func_8025DBD0(ActorPart* part, s32 decorationIndex) { switch (decor->state[decorationIndex]) { case 0: - fx_aura(2, part->currentPos.x, part->currentPos.y, part->currentPos.z, 1.2f, &decor->effect[decorationIndex]); + fx_aura(2, part->curPos.x, part->curPos.y, part->curPos.z, 1.2f, &decor->effect[decorationIndex]); decor->state[decorationIndex] = 1; decor->unk_8C6[decorationIndex].unk00 = 150; decor->unk_8C6[decorationIndex].unk02 = 150; @@ -3921,9 +3921,9 @@ void func_8025DBD0(ActorPart* part, s32 decorationIndex) { case 1: effect = decor->effect[decorationIndex]; data = effect->data.aura; - data->posA.x = part->currentPos.x; - data->posA.y = part->currentPos.y; - data->posA.z = part->currentPos.z + decor->unk_8C6[decorationIndex].unk06; + data->posA.x = part->curPos.x; + data->posA.y = part->curPos.y; + data->posA.z = part->curPos.z + decor->unk_8C6[decorationIndex].unk06; scale = decor->unk_8C6[decorationIndex].unk00; scale /= 100.0f; @@ -3948,7 +3948,7 @@ void func_8025DD60(ActorPart* part, s32 decorationIndex) { switch (decor->state[decorationIndex]) { case 0: - decor->effect[decorationIndex] = fx_energy_in_out(4, part->currentPos.x, part->currentPos.y, part->currentPos.z, 1.2f, 0); + decor->effect[decorationIndex] = fx_energy_in_out(4, part->curPos.x, part->curPos.y, part->curPos.z, 1.2f, 0); decor->state[decorationIndex] = 1; decor->unk_8C6[decorationIndex].unk00 = 120; decor->unk_8C6[decorationIndex].unk02 = 0; @@ -3958,9 +3958,9 @@ void func_8025DD60(ActorPart* part, s32 decorationIndex) { scale = decor->unk_8C6[decorationIndex].unk00; scale /= 100.0f; data->unk_44 = scale; - data->pos.x = part->currentPos.x; - data->pos.y = (part->currentPos.y + (scale * 41.0f)); - data->pos.z = (part->currentPos.z + decor->unk_8C6[decorationIndex].unk02); + data->pos.x = part->curPos.x; + data->pos.y = (part->curPos.y + (scale * 41.0f)); + data->pos.z = (part->curPos.z + decor->unk_8C6[decorationIndex].unk02); break; } } diff --git a/src/18C790.c b/src/18C790.c index c719c5e6ef..877b0e7895 100644 --- a/src/18C790.c +++ b/src/18C790.c @@ -633,13 +633,13 @@ void btl_state_update_celebration(void) { if (CelebrateSubstateTime == 18) { playerData->curHP = playerData->curMaxHP; playerData->curFP = playerData->curMaxFP; - x = player->currentPos.x + 0.0f; - y = player->currentPos.y + 35.0f; - z = player->currentPos.z; + x = player->curPos.x + 0.0f; + y = player->curPos.y + 35.0f; + z = player->curPos.z; fx_recover(0, x, y, z, playerData->curHP); - x = player->currentPos.x + 20.0f; - y = player->currentPos.y + 25.0f; - z = player->currentPos.z; + x = player->curPos.x + 20.0f; + y = player->curPos.y + 25.0f; + z = player->curPos.z; fx_recover(1, x, y, z, playerData->curFP); playerData->specialBarsFilled = playerData->maxStarPower * 256; } @@ -919,7 +919,7 @@ void btl_state_update_celebration(void) { id = LevelUpSelectTextID = hud_element_create(&HES_level_up_select_one_to_upgrade); hud_element_set_render_pos(id, 0, 0); hud_element_set_flags(id, HUD_ELEMENT_FLAG_80); - battleStatus->currentSubmenu = 1; + battleStatus->curSubmenu = 1; CelebrateSubstateTime = 10; gBattleSubState = BTL_SUBSTATE_CELEBRATE_LEVEL_UP_SHOW_HUD; @@ -978,8 +978,8 @@ void btl_state_update_celebration(void) { } break; case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CHOOSE: - if (battleStatus->currentButtonsPressed & BUTTON_A) { - if (!CantLevelUpStat[battleStatus->currentSubmenu]) { + if (battleStatus->curButtonsPressed & BUTTON_A) { + if (!CantLevelUpStat[battleStatus->curSubmenu]) { sfx_play_sound(SOUND_MENU_NEXT); sfx_play_sound(SOUND_349 | SOUND_ID_TRIGGER_CHANGE_SOUND); gBattleSubState = BTL_SUBSTATE_CELEBRATE_LEVEL_UP_UPGRADE; @@ -990,11 +990,11 @@ void btl_state_update_celebration(void) { break; } - newSubmenu = currentSubmenu = battleStatus->currentSubmenu; - if (battleStatus->currentButtonsHeld & BUTTON_STICK_LEFT) { + newSubmenu = currentSubmenu = battleStatus->curSubmenu; + if (battleStatus->curButtonsHeld & BUTTON_STICK_LEFT) { newSubmenu--; } - if (battleStatus->currentButtonsHeld & BUTTON_STICK_RIGHT) { + if (battleStatus->curButtonsHeld & BUTTON_STICK_RIGHT) { newSubmenu++; } if (newSubmenu < 0) { @@ -1005,7 +1005,7 @@ void btl_state_update_celebration(void) { } if (newSubmenu != currentSubmenu) { sfx_play_sound(SOUND_MENU_CHANGE_SELECTION); - battleStatus->currentSubmenu = newSubmenu; + battleStatus->curSubmenu = newSubmenu; } CelebrateStateTime++; @@ -1018,7 +1018,7 @@ void btl_state_update_celebration(void) { hud_element_free(LevelUpSpotlightID); set_window_update(WINDOW_ID_8, WINDOW_UPDATE_HIDE); - switch (battleStatus->currentSubmenu) { + switch (battleStatus->curSubmenu) { case 0: playerData->hardMaxHP += 5; playerData->curMaxHP += 5; @@ -1030,7 +1030,7 @@ void btl_state_update_celebration(void) { playerData->curHP = playerData->curMaxHP; } player->maxHP = playerData->curMaxHP; - player->currentHP = playerData->curHP; + player->curHP = playerData->curHP; break; case 1: playerData->hardMaxFP += 5; @@ -1067,7 +1067,7 @@ void btl_state_update_celebration(void) { break; case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_FADE_OUT: if ((gGameStatusPtr->frameCounter % 2) != 0) { - switch (battleStatus->currentSubmenu) { + switch (battleStatus->curSubmenu) { case 0: hud_element_set_flags(LevelUpStatEmblemIDs[0], HUD_ELEMENT_FLAG_DISABLED); break; @@ -1080,7 +1080,7 @@ void btl_state_update_celebration(void) { break; } } else { - switch (battleStatus->currentSubmenu) { + switch (battleStatus->curSubmenu) { case 0: hud_element_clear_flags(LevelUpStatEmblemIDs[0], HUD_ELEMENT_FLAG_DISABLED); break; @@ -1140,7 +1140,7 @@ void btl_state_update_celebration(void) { gBattleSubState = BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CHOOSE; break; case BTL_SUBSTATE_CELEBRATE_SKIPPABLE_END_DELAY: - if (battleStatus->currentButtonsPressed & (BUTTON_A | BUTTON_B)) { + if (battleStatus->curButtonsPressed & (BUTTON_A | BUTTON_B)) { CelebrateStateTime = 99; } if (CelebrateStateTime >= 99) { @@ -1151,7 +1151,7 @@ void btl_state_update_celebration(void) { btl_cam_set_params(1, 270, 100, 8, 0, 0x2400, 0, 100); set_animation(0, 0, ANIM_MarioB1_AdjustCap); if (partner != NULL) { - set_animation(ACTOR_PARTNER, 0, D_80284154[playerData->currentPartner]); + set_animation(ACTOR_PARTNER, 0, D_80284154[playerData->curPartner]); } CelebrateSubstateTime = 6; gBattleSubState = BTL_SUBSTATE_CELEBRATE_WALK_AWAY; @@ -1170,9 +1170,9 @@ void btl_state_update_celebration(void) { partner->yaw = 0.0f; } - player->currentPos.x += 4.0f; + player->curPos.x += 4.0f; if (partner != NULL) { - partner->currentPos.x += 4.0f; + partner->curPos.x += 4.0f; } } if (bFadeToBlackAmt == 255) { @@ -1213,7 +1213,7 @@ void btl_draw_upgrade_windows(s32 phase) { d3 = 100; break; case 1: // choosing - switch (battleStatus->currentSubmenu) { + switch (battleStatus->curSubmenu) { case MENU_HP: d1 = 0; d2 = 100; @@ -1284,7 +1284,7 @@ void btl_state_draw_celebration(void) { case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CHOOSE: case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_INVALID: case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_INVALID_DELAY: - switch (battleStatus->currentSubmenu) { + switch (battleStatus->curSubmenu) { case 0: rotZ = 152; hud_element_set_tint(LevelUpStatEmblemIDs[0], 255, 255, 255); @@ -1459,7 +1459,7 @@ void draw_content_level_up_textbox(void* data, s32 posX, s32 posY) { case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_CHOOSE: case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_INVALID: case BTL_SUBSTATE_CELEBRATE_LEVEL_UP_INVALID_DELAY: - switch (battleStatus->currentSubmenu) { + switch (battleStatus->curSubmenu) { case MENU_HP: if (!CantLevelUpStat[MENU_HP]) { msgID = MSG_Menus_LevelUp_HP; diff --git a/src/18F340.c b/src/18F340.c index 85199d64fe..07120dabfc 100644 --- a/src/18F340.c +++ b/src/18F340.c @@ -74,7 +74,7 @@ API_CALLABLE(ActivateDefend) { API_CALLABLE(DoesMarioStatusPreventHappyAnimation) { Actor* player = gBattleStatus.playerActor; - show_action_rating(ACTION_RATING_LUCKY, player, player->currentPos.x, player->currentPos.y + 20.0f, player->currentPos.z); + show_action_rating(ACTION_RATING_LUCKY, player, player->curPos.x, player->curPos.y + 20.0f, player->curPos.z); sfx_play_sound(SOUND_3FC); script->varTable[0] = FALSE; if (player->debuff == STATUS_KEY_FEAR || player->debuff == STATUS_KEY_DIZZY || player->debuff == STATUS_KEY_PARALYZE || @@ -176,7 +176,7 @@ API_CALLABLE(GiveRefund) { f32 angle = 0.0f; s32 delayTime = 0; f32 posX, posY, posZ; - posY = player->currentPos.y + player->size.y; + posY = player->curPos.y + player->size.y; if (player_team_is_ability_active(player, ABILITY_REFUND) && sellValue > 0) { s32 i; @@ -186,8 +186,8 @@ API_CALLABLE(GiveRefund) { sellValue = (sellValue * 75 + 99) / 100; for (i = 0; i < sellValue; i++) { - posX = player->currentPos.x; - posZ = player->currentPos.z; + posX = player->curPos.x; + posZ = player->curPos.z; make_item_entity(ITEM_COIN, posX, posY, posZ, ITEM_SPAWN_MODE_TOSS_FADE1, (i * 3) + 1, angle, 0); add_coins(1); @@ -196,9 +196,9 @@ API_CALLABLE(GiveRefund) { delayTime = (i * 3) + 30; - posX = player->currentPos.x; - posY = player->currentPos.y; - posZ = player->currentPos.z; + posX = player->curPos.x; + posY = player->curPos.y; + posZ = player->curPos.z; get_screen_coords(gCurrentCameraID, posX, posY, posZ, &iconPosX, &iconPosY, &iconPosZ); RefundHudElem = hud_element_create(&HES_Refund); hud_element_set_render_pos(RefundHudElem, iconPosX + 36, iconPosY - 63); @@ -568,29 +568,29 @@ API_CALLABLE(func_80261DF4) { switch (script->functionTemp[1]) { case 0: script->functionTemp[0]--; - item->position.y += script->functionTemp[0]; - if (item->position.y < 0.0f) { - item->position.y = 0.0f; + item->pos.y += script->functionTemp[0]; + if (item->pos.y < 0.0f) { + item->pos.y = 0.0f; script->functionTemp[0] = 8; script->functionTemp[1] = 1; } break; case 1: script->functionTemp[0]--; - item->position.y += script->functionTemp[0]; - item->position.x += 1.5; - if (item->position.y < 0.0f) { - item->position.y = 0.0f; + item->pos.y += script->functionTemp[0]; + item->pos.x += 1.5; + if (item->pos.y < 0.0f) { + item->pos.y = 0.0f; script->functionTemp[0] = 4; script->functionTemp[1] = 2; } break; case 2: script->functionTemp[0]--; - item->position.y += script->functionTemp[0]; - item->position.x += 1.2; - if (item->position.y < 0.0f) { - item->position.y = 0.0f; + item->pos.y += script->functionTemp[0]; + item->pos.x += 1.2; + if (item->pos.y < 0.0f) { + item->pos.y = 0.0f; script->functionTemp[1] = 3; } break; @@ -619,16 +619,16 @@ API_CALLABLE(func_80261FB4) { switch (script->functionTemp[0]) { case 0: ft1 = script->functionTemp[1]; - deltaX = player->currentPos.x - item->position.x; - deltaY = player->currentPos.y + 12.0f - item->position.y; - deltaZ = player->currentPos.z - 5.0f - item->position.z; + deltaX = player->curPos.x - item->pos.x; + deltaY = player->curPos.y + 12.0f - item->pos.y; + deltaZ = player->curPos.z - 5.0f - item->pos.z; - item->position.x += deltaX / ft1; - item->position.y += deltaY / ft1; - item->position.z += deltaZ / ft1; + item->pos.x += deltaX / ft1; + item->pos.y += deltaY / ft1; + item->pos.z += deltaZ / ft1; - item->position.y += dist2D(item->position.x, item->position.y, player->currentPos.x, - player->currentPos.y + 12.0f) / 5.0f; + item->pos.y += dist2D(item->pos.x, item->pos.y, player->curPos.x, + player->curPos.y + 12.0f) / 5.0f; if (script->functionTemp[1] == 1) { script->functionTemp[0] = script->functionTemp[1]; diff --git a/src/190B20.c b/src/190B20.c index f54ef3b25a..bdd9861fb8 100644 --- a/src/190B20.c +++ b/src/190B20.c @@ -88,18 +88,18 @@ void create_target_list(Actor* actor, s32 arg1) { s32 row; s32 skip; - if (battleStatus->currentTargetListFlags & TARGET_FLAG_80000000) { + if (battleStatus->curTargetListFlags & TARGET_FLAG_80000000) { actor->targetListLength = -1; return; } - if (battleStatus->currentTargetListFlags & TARGET_FLAG_PLAYER) { + if (battleStatus->curTargetListFlags & TARGET_FLAG_PLAYER) { targetDataList->actorID = ACTOR_PLAYER; targetDataList->partID = 1; if (!arg1) { - targetDataList->posA.x = playerActor->currentPos.x + playerActor->size.x * 0.3 * playerActor->scalingFactor; - targetDataList->posA.y = playerActor->currentPos.y + playerActor->size.y * 0.9 * playerActor->scalingFactor; - targetDataList->posA.z = playerActor->currentPos.z; + targetDataList->posA.x = playerActor->curPos.x + playerActor->size.x * 0.3 * playerActor->scalingFactor; + targetDataList->posA.y = playerActor->curPos.y + playerActor->size.y * 0.9 * playerActor->scalingFactor; + targetDataList->posA.z = playerActor->curPos.z; } else { targetDataList->posA.x = playerActor->homePos.x + playerActor->size.x * 0.3 * playerActor->scalingFactor; targetDataList->posA.y = playerActor->homePos.y + playerActor->size.y * 0.9 * playerActor->scalingFactor; @@ -110,13 +110,13 @@ void create_target_list(Actor* actor, s32 arg1) { targetDataList++; } - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_100) && partnerActor != NULL) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_100) && partnerActor != NULL) { targetDataList->actorID = ACTOR_PARTNER; targetDataList->partID = 1; if (!arg1) { - targetDataList->posA.x = partnerActor->currentPos.x + partnerActor->size.x * 0.1 * partnerActor->scalingFactor; - targetDataList->posA.y = partnerActor->currentPos.y + partnerActor->size.y * 0.8 * partnerActor->scalingFactor; - targetDataList->posA.z = partnerActor->currentPos.z; + targetDataList->posA.x = partnerActor->curPos.x + partnerActor->size.x * 0.1 * partnerActor->scalingFactor; + targetDataList->posA.y = partnerActor->curPos.y + partnerActor->size.y * 0.8 * partnerActor->scalingFactor; + targetDataList->posA.z = partnerActor->curPos.z; } else { targetDataList->posA.x = partnerActor->homePos.x + partnerActor->size.x * 0.1 * partnerActor->scalingFactor; targetDataList->posA.y = partnerActor->homePos.y + partnerActor->size.y * 0.8 * partnerActor->scalingFactor; @@ -132,7 +132,7 @@ void create_target_list(Actor* actor, s32 arg1) { if (targetActor == NULL) { continue; } - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_100) || (battleStatus->currentTargetListFlags & TARGET_FLAG_PLAYER)) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_100) || (battleStatus->curTargetListFlags & TARGET_FLAG_PLAYER)) { break; } targetPart = targetActor->partsTable; @@ -144,9 +144,9 @@ void create_target_list(Actor* actor, s32 arg1) { if (!(targetPart->flags & ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION)) { row = !arg1; // required to match if (row) { - targetX = targetActor->currentPos.x; - targetY = targetActor->currentPos.y; - targetZ = targetActor->currentPos.z; + targetX = targetActor->curPos.x; + targetY = targetActor->curPos.y; + targetZ = targetActor->curPos.z; } else { targetX = targetActor->homePos.x; targetY = targetActor->homePos.y; @@ -166,9 +166,9 @@ void create_target_list(Actor* actor, s32 arg1) { targetY = f2 + targetPart->targetOffset.y * targetActor->scalingFactor; } } else { - targetY = targetPart->absolutePosition.y; - targetZ = targetPart->absolutePosition.z; - f12 = targetPart->absolutePosition.x; + targetY = targetPart->absolutePos.y; + targetZ = targetPart->absolutePos.z; + f12 = targetPart->absolutePos.x; f2 = targetY; f14 = targetZ + 5.0f; targetX = f12 + targetPart->targetOffset.x; @@ -248,7 +248,7 @@ void create_target_list(Actor* actor, s32 arg1) { if (targetData->actorID == ACTOR_PLAYER || targetData->actorID == ACTOR_PARTNER) { continue; } - if (battleStatus->currentTargetListFlags & TARGET_FLAG_80000000) { + if (battleStatus->curTargetListFlags & TARGET_FLAG_80000000) { skip = TRUE; goto END2; } @@ -260,7 +260,7 @@ void create_target_list(Actor* actor, s32 arg1) { goto END2; } } - if (battleStatus->currentTargetListFlags & TARGET_FLAG_8000) { + if (battleStatus->curTargetListFlags & TARGET_FLAG_8000) { if (!(targetPart->flags & ACTOR_PART_FLAG_MULTI_TARGET) || (targetActor->flags & ACTOR_FLAG_40) || (targetPart->flags & ACTOR_PART_FLAG_40)) @@ -288,48 +288,48 @@ END2: continue; } do { - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_800) && (targetPart->targetFlags & ACTOR_PART_TARGET_FLAG_1)) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_800) && (targetPart->targetFlags & ACTOR_PART_TARGET_FLAG_1)) { skip = TRUE; goto END; } } while (0); do { - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_1000) && (targetPart->targetFlags & ACTOR_PART_TARGET_FLAG_2)) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_1000) && (targetPart->targetFlags & ACTOR_PART_TARGET_FLAG_2)) { skip = TRUE; goto END; } } while (0); do { - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_20000) && ((targetActor->flags & ACTOR_FLAG_80) || (targetPart->flags & ACTOR_PART_FLAG_80))) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_20000) && ((targetActor->flags & ACTOR_FLAG_80) || (targetPart->flags & ACTOR_PART_FLAG_80))) { skip = TRUE; goto END; } } while (0); - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_400) && (targetActor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_400) && (targetActor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { skip = TRUE; goto END; } - if (!(battleStatus->currentTargetListFlags & TARGET_FLAG_10000) && (targetActor->flags & ACTOR_FLAG_TARGET_ONLY)) { + if (!(battleStatus->curTargetListFlags & TARGET_FLAG_10000) && (targetActor->flags & ACTOR_FLAG_TARGET_ONLY)) { skip = TRUE; goto END; } - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_40000) && (targetActor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_40000) && (targetActor->flags & ACTOR_FLAG_UPSIDE_DOWN)) { skip = TRUE; goto END; } - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_4) && targetData->homeRow != 0) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_4) && targetData->homeRow != 0) { skip = TRUE; goto END; } - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_10) && targetData->homeRow >= 2) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_10) && targetData->homeRow >= 2) { skip = TRUE; goto END; } - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_40) && targetData->homeRow <= 0) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_40) && targetData->homeRow <= 0) { skip = TRUE; goto END; } - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_4000) && !(targetPart->flags & ACTOR_PART_FLAG_20)) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_4000) && !(targetPart->flags & ACTOR_PART_FLAG_20)) { s32 cond = FALSE; do { for (j = 0; j < numTargets; j++) { @@ -349,7 +349,7 @@ END2: goto END; } } - if (battleStatus->currentTargetListFlags & TARGET_FLAG_2000) { + if (battleStatus->curTargetListFlags & TARGET_FLAG_2000) { s32 cond = FALSE; for (j = 0; j < numTargets; j++) { @@ -370,55 +370,55 @@ END2: } } do { - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_20) && (targetActor->flags & ACTOR_FLAG_FLYING)) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_20) && (targetActor->flags & ACTOR_FLAG_FLYING)) { skip = TRUE; goto END; } } while (0); do { - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_100000) && targetData->homeRow == row + 1) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_100000) && targetData->homeRow == row + 1) { skip = TRUE; goto END; } } while (0); do { - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_200000) && targetData->homeRow == row - 1) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_200000) && targetData->homeRow == row - 1) { skip = TRUE; goto END; } } while (0); do { - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_400000) && targetData->homeCol == col - 1) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_400000) && targetData->homeCol == col - 1) { skip = TRUE; goto END; } } while (0); do { - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_800000) && targetData->homeCol == col + 1) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_800000) && targetData->homeCol == col + 1) { skip = TRUE; goto END; } } while (0); do { - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_100000) && targetData->homeRow < row) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_100000) && targetData->homeRow < row) { skip = TRUE; goto END; } } while (0); do { - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_200000) && targetData->homeRow > row) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_200000) && targetData->homeRow > row) { skip = TRUE; goto END; } } while (0); do { - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_400000) && targetData->homeCol > col) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_400000) && targetData->homeCol > col) { skip = TRUE; goto END; } } while (0); do { - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_800000) && targetData->homeCol < col) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_800000) && targetData->homeCol < col) { skip = TRUE; goto END; } @@ -495,9 +495,9 @@ s32 func_80263064(Actor* actor0, Actor* actor1, s32 unused) { f32 x, y, z; if (!(part->flags & ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION)) { - x = actor1->currentPos.x; - y = actor1->currentPos.y; - z = actor1->currentPos.z; + x = actor1->curPos.x; + y = actor1->curPos.y; + z = actor1->curPos.z; x += part->partOffset.x; if (!(actor1->flags & ACTOR_FLAG_UPSIDE_DOWN)) { @@ -514,9 +514,9 @@ s32 func_80263064(Actor* actor0, Actor* actor1, s32 unused) { y -= part->targetOffset.y; } } else { - x = part->absolutePosition.x; - y = part->absolutePosition.y; - z = part->absolutePosition.z; + x = part->absolutePos.x; + y = part->absolutePos.y; + z = part->absolutePos.z; x += part->targetOffset.x; if (!(actor1->flags & ACTOR_FLAG_UPSIDE_DOWN)) { @@ -574,7 +574,7 @@ void func_80263268(void) { battleStatus->changePartnerAllowed = 0; } else if (partner->debuff == STATUS_KEY_FROZEN) { battleStatus->changePartnerAllowed = 0; - } else if (playerData->currentPartner == PARTNER_GOOMPA) { + } else if (playerData->curPartner == PARTNER_GOOMPA) { battleStatus->changePartnerAllowed = -1; } } else { @@ -604,7 +604,7 @@ void func_80263300(void) { if (itemData->typeFlags & ITEM_TYPE_FLAG_BATTLE_USABLE) { battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; battleStatus->moveArgument = playerData->invItems[i]; - battleStatus->currentTargetListFlags = itemData->targetFlags; + battleStatus->curTargetListFlags = itemData->targetFlags; player_create_target_list(player); if (player->targetListLength != 0) { @@ -718,7 +718,7 @@ void btl_init_menu_boots(void) { // See if there are any targets for this move battleStatus->moveCategory = BTL_MENU_TYPE_JUMP; battleStatus->moveArgument = playerData->bootsLevel; - battleStatus->currentTargetListFlags = move->flags; // Controls target filters + battleStatus->curTargetListFlags = move->flags; // Controls target filters player_create_target_list(player); // If there are targets, enable the move @@ -812,7 +812,7 @@ void btl_init_menu_hammer(void) { // See if there are any targets for this move battleStatus->moveCategory = BTL_MENU_TYPE_SMASH; battleStatus->moveArgument = playerData->hammerLevel; - battleStatus->currentTargetListFlags = move->flags; + battleStatus->curTargetListFlags = move->flags; player_create_target_list(player); // If there are targets, enable the move @@ -873,14 +873,14 @@ void btl_init_menu_partner(void) { // Offsets 0,1,2 battleStatus->submenuMoves[0] = - playerData->currentPartner * 6 + playerData->curPartner * 6 + (MOVE_HEADBONK1 - 6) + partner->actorBlueprint->level; // Offsets 3,4,5 for (i = 1; i < battleStatus->submenuMoveCount; i++) { battleStatus->submenuMoves[i] = - playerData->currentPartner * 6 + playerData->curPartner * 6 + (MOVE_TATTLE - 6) + (i - 1); } @@ -900,7 +900,7 @@ void btl_init_menu_partner(void) { battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER; battleStatus->moveArgument = partner->actorBlueprint->level; - battleStatus->currentTargetListFlags = move->flags; + battleStatus->curTargetListFlags = move->flags; player_create_target_list(partner); if (partner->targetListLength != 0){ @@ -1005,8 +1005,8 @@ void set_animation(s32 actorID, s32 partID, AnimID animID) { switch (actorID & ACTOR_CLASS_MASK) { case ACTOR_CLASS_PLAYER: part = &actor->partsTable[0]; - if (part->currentAnimation != animID) { - part->currentAnimation = animID; + if (part->curAnimation != animID) { + part->curAnimation = animID; spr_update_player_sprite(PLAYER_SPRITE_MAIN, animID, part->animationRate); } break; @@ -1021,16 +1021,16 @@ void set_animation(s32 actorID, s32 partID, AnimID animID) { part = &actor->partsTable[0]; } - if (part->currentAnimation != animID) { - part->currentAnimation = animID; + if (part->curAnimation != animID) { + part->curAnimation = animID; spr_update_sprite(part->spriteInstanceID, animID, part->animationRate); part->animNotifyValue = spr_get_notify_value(part->spriteInstanceID); } break; case ACTOR_CLASS_ENEMY: part = get_actor_part(actor, partID); - if (part->currentAnimation != animID) { - part->currentAnimation = animID; + if (part->curAnimation != animID) { + part->curAnimation = animID; spr_update_sprite(part->spriteInstanceID, animID, part->animationRate); part->animNotifyValue = spr_get_notify_value(part->spriteInstanceID); } @@ -1043,15 +1043,15 @@ void func_80263E08(Actor* actor, ActorPart* part, AnimID anim) { if ((s32) anim >= 0) { switch (actor->actorID & ACTOR_CLASS_MASK) { case ACTOR_CLASS_PLAYER: - if (part->currentAnimation != anim) { - part->currentAnimation = anim; + if (part->curAnimation != anim) { + part->curAnimation = anim; spr_update_player_sprite(PLAYER_SPRITE_MAIN, anim, part->animationRate); } break; case ACTOR_CLASS_PARTNER: case ACTOR_CLASS_ENEMY: - if (part->currentAnimation != anim) { - part->currentAnimation = anim; + if (part->curAnimation != anim) { + part->curAnimation = anim; spr_update_sprite(part->spriteInstanceID, anim, part->animationRate); part->animNotifyValue = spr_get_notify_value(part->spriteInstanceID); } @@ -1220,24 +1220,24 @@ void load_player_actor(void) { player->actorType = bPlayerActorBlueprint.type; if ((gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) || (gGameStatusPtr->demoFlags & 2)) { - player->homePos.x = player->currentPos.x = -130.0f; - player->homePos.y = player->currentPos.y = 0.0f; - player->homePos.z = player->currentPos.z = -10.0f; + player->homePos.x = player->curPos.x = -130.0f; + player->homePos.y = player->curPos.y = 0.0f; + player->homePos.z = player->curPos.z = -10.0f; } else { - player->homePos.x = player->currentPos.x = -95.0f; - player->homePos.y = player->currentPos.y = 0.0f; - player->homePos.z = player->currentPos.z = 0.0f; + player->homePos.x = player->curPos.x = -95.0f; + player->homePos.y = player->curPos.y = 0.0f; + player->homePos.z = player->curPos.z = 0.0f; } player->headOffset.x = 0; player->headOffset.y = 0; player->headOffset.z = 0; - player->rotation.x = 0.0f; - player->rotation.y = 0.0f; - player->rotation.z = 0.0f; - player->rotationPivotOffset.x = 0; - player->rotationPivotOffset.y = 0; - player->rotationPivotOffset.z = 0; + player->rot.x = 0.0f; + player->rot.y = 0.0f; + player->rot.z = 0.0f; + player->rotPivotOffset.x = 0; + player->rotPivotOffset.y = 0; + player->rotPivotOffset.z = 0; player->verticalRenderOffset = 0; player->yaw = 0.0f; player->renderMode = RENDER_MODE_ALPHATEST; @@ -1250,9 +1250,9 @@ void load_player_actor(void) { player->size.x = player->actorBlueprint->size.x; player->size.y = player->actorBlueprint->size.y; player->actorID = 0; - player->healthBarPos.x = player->currentPos.x; - player->healthBarPos.y = player->currentPos.y; - player->healthBarPos.z = player->currentPos.z; + player->healthBarPos.x = player->curPos.x; + player->healthBarPos.y = player->curPos.y; + player->healthBarPos.z = player->curPos.z; player->scalingFactor = 1.0f; player->attackResultEffect = NULL; player->actionRatingCombo = 0; @@ -1321,15 +1321,15 @@ void load_player_actor(void) { part->partOffsetFloat.x = 0.0f; part->partOffsetFloat.y = 0.0f; part->partOffsetFloat.z = 0.0f; - part->rotationPivotOffset.x = 0; - part->rotationPivotOffset.y = 0; - part->rotationPivotOffset.z = 0; + part->rotPivotOffset.x = 0; + part->rotPivotOffset.y = 0; + part->rotPivotOffset.z = 0; part->visualOffset.x = 0; part->visualOffset.y = 0; part->visualOffset.z = 0; - part->absolutePosition.x = 0.0f; - part->absolutePosition.y = 0.0f; - part->absolutePosition.z = 0.0f; + part->absolutePos.x = 0.0f; + part->absolutePos.y = 0.0f; + part->absolutePos.z = 0.0f; part->defenseTable = bMarioDefenseTable; if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { @@ -1347,9 +1347,9 @@ void load_player_actor(void) { part->targetOffset.x = 0; part->targetOffset.y = 0; part->unk_70 = 0; - part->rotation.x = 0.0f; - part->rotation.y = 0.0f; - part->rotation.z = 0.0f; + part->rot.x = 0.0f; + part->rot.y = 0.0f; + part->rot.z = 0.0f; part->scale.x = 1.0f; part->scale.y = 1.0f; part->scale.z = 1.0f; @@ -1357,7 +1357,7 @@ void load_player_actor(void) { part->palAnimPosOffset[0] = 0; part->palAnimPosOffset[1] = 0; part->animationRate = 1.0f; - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, 1U); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, 1U); part->nextPart = NULL; part->partTypeData[0] = bActorSoundTable[player->actorType].walk[0]; part->partTypeData[1] = bActorSoundTable[player->actorType].walk[1]; @@ -1384,9 +1384,9 @@ void load_player_actor(void) { decorationTable->unk_7D9 = 0; for (j = 0; j < ARRAY_COUNT(decorationTable->posX); j++) { - decorationTable->posX[j] = player->currentPos.x; - decorationTable->posY[j] = player->currentPos.y; - decorationTable->posZ[j] = player->currentPos.z; + decorationTable->posX[j] = player->curPos.x; + decorationTable->posY[j] = player->curPos.y; + decorationTable->posZ[j] = player->curPos.z; } decorationTable->unk_7DA = 3; @@ -1402,7 +1402,7 @@ void load_player_actor(void) { partMovement = part->movement = heap_malloc(sizeof(*partMovement)); ASSERT(partMovement != NULL); - player->shadow.id = create_shadow_type(0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + player->shadow.id = create_shadow_type(0, player->curPos.x, player->curPos.y, player->curPos.z); player->shadowScale = player->size.x / 24.0; player->hudElementDataIndex = create_status_icon_set(); player->disableEffect = fx_disable_x(0, -142.0f, 34.0f, 1.0f, 0); @@ -1430,7 +1430,7 @@ void load_partner_actor(void) { s32 i; s32 i2; - currentPartner = playerData->currentPartner; + currentPartner = playerData->curPartner; battleStatus->partnerActor = NULL; if (currentPartner != PARTNER_NONE) { @@ -1456,19 +1456,19 @@ void load_partner_actor(void) { ASSERT(partnerActor != NULL); - actorBP->level = playerData->partners[playerData->currentPartner].level; + actorBP->level = playerData->partners[playerData->curPartner].level; partnerActor->unk_134 = battleStatus->unk_93++; partnerActor->footStepCounter = 0; partnerActor->actorBlueprint = actorBP; partnerActor->actorType = actorBP->type; partnerActor->flags = actorBP->flags; - partnerActor->homePos.x = partnerActor->currentPos.x = x; - partnerActor->homePos.y = partnerActor->currentPos.y = y; - partnerActor->homePos.z = partnerActor->currentPos.z = z; + partnerActor->homePos.x = partnerActor->curPos.x = x; + partnerActor->homePos.y = partnerActor->curPos.y = y; + partnerActor->homePos.z = partnerActor->curPos.z = z; partnerActor->headOffset.x = 0; partnerActor->headOffset.y = 0; partnerActor->headOffset.z = 0; - partnerActor->currentHP = actorBP->maxHP; + partnerActor->curHP = actorBP->maxHP; partnerActor->numParts = partCount; partnerActor->idleSource = NULL; partnerActor->takeTurnSource = actorBP->initScript; @@ -1481,12 +1481,12 @@ void load_partner_actor(void) { partnerActor->turnPriority = 0; partnerActor->enemyIndex = 0; partnerActor->yaw = 0.0f; - partnerActor->rotation.x = 0.0f; - partnerActor->rotation.y = 0.0f; - partnerActor->rotation.z = 0.0f; - partnerActor->rotationPivotOffset.x = 0; - partnerActor->rotationPivotOffset.y = 0; - partnerActor->rotationPivotOffset.z = 0; + partnerActor->rot.x = 0.0f; + partnerActor->rot.y = 0.0f; + partnerActor->rot.z = 0.0f; + partnerActor->rotPivotOffset.x = 0; + partnerActor->rotPivotOffset.y = 0; + partnerActor->rotPivotOffset.z = 0; partnerActor->scale.x = 1.0f; partnerActor->scale.y = 1.0f; partnerActor->scale.z = 1.0f; @@ -1561,9 +1561,9 @@ void load_partner_actor(void) { part->visualOffset.x = 0; part->visualOffset.y = 0; part->visualOffset.z = 0; - part->absolutePosition.x = 0.0f; - part->absolutePosition.y = 0.0f; - part->absolutePosition.z = 0.0f; + part->absolutePos.x = 0.0f; + part->absolutePos.y = 0.0f; + part->absolutePos.z = 0.0f; part->defenseTable = ActorPartBlueprint->defenseTable; part->idleAnimations = ActorPartBlueprint->idleAnimations; part->eventFlags = ActorPartBlueprint->eventFlags; @@ -1575,12 +1575,12 @@ void load_partner_actor(void) { part->targetOffset.x = ActorPartBlueprint->targetOffset.x; part->targetOffset.y = ActorPartBlueprint->targetOffset.y; part->unk_70 = 0; - part->rotationPivotOffset.x = 0; - part->rotationPivotOffset.y = 0; - part->rotationPivotOffset.z = 0; - part->rotation.x = 0.0f; - part->rotation.y = 0.0f; - part->rotation.z = 0.0f; + part->rotPivotOffset.x = 0; + part->rotPivotOffset.y = 0; + part->rotPivotOffset.z = 0; + part->rot.x = 0.0f; + part->rot.y = 0.0f; + part->rot.z = 0.0f; part->scale.x = 1.0f; part->scale.y = 1.0f; part->scale.z = 1.0f; @@ -1613,9 +1613,9 @@ void load_partner_actor(void) { decorationTable->unk_7D9 = 0; for (j = 0; j < ARRAY_COUNT(decorationTable->posX); j++) { - decorationTable->posX[j] = partnerActor->currentPos.x; - decorationTable->posY[j] = partnerActor->currentPos.y; - decorationTable->posZ[j] = partnerActor->currentPos.z; + decorationTable->posX[j] = partnerActor->curPos.x; + decorationTable->posY[j] = partnerActor->curPos.y; + decorationTable->posZ[j] = partnerActor->curPos.z; } decorationTable->unk_7DA = 3; @@ -1634,12 +1634,12 @@ void load_partner_actor(void) { } part->animationRate = 1.0f; - part->currentAnimation = 0; + part->curAnimation = 0; part->spriteInstanceID = -1; if (part->idleAnimations != NULL) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, 1); - part->spriteInstanceID = spr_load_npc_sprite(part->currentAnimation | SPRITE_ID_TAIL_ALLOCATE, NULL); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, 1); + part->spriteInstanceID = spr_load_npc_sprite(part->curAnimation | SPRITE_ID_TAIL_ALLOCATE, NULL); } if (i + 1 >= partCount) { @@ -1656,7 +1656,7 @@ void load_partner_actor(void) { part->nextPart = NULL; } - partnerActor->shadow.id = create_shadow_type(0, partnerActor->currentPos.x, partnerActor->currentPos.y, partnerActor->currentPos.z); + partnerActor->shadow.id = create_shadow_type(0, partnerActor->curPos.x, partnerActor->curPos.y, partnerActor->curPos.z); partnerActor->shadowScale = partnerActor->size.x / 24.0; partnerActor->hudElementDataIndex = create_status_icon_set(); partnerActor->disableEffect = fx_disable_x(0, -142.0f, 34.0f, 1.0f, 0); @@ -1708,13 +1708,13 @@ Actor* create_actor(Formation formation) { actor->actorBlueprint = formationActor; actor->actorType = formationActor->type; actor->flags = formationActor->flags; - actor->homePos.x = actor->currentPos.x = x; - actor->homePos.y = actor->currentPos.y = y; - actor->homePos.z = actor->currentPos.z = z; + actor->homePos.x = actor->curPos.x = x; + actor->homePos.y = actor->curPos.y = y; + actor->homePos.z = actor->curPos.z = z; actor->headOffset.x = 0; actor->headOffset.y = 0; actor->headOffset.z = 0; - actor->maxHP = actor->currentHP = formationActor->maxHP; + actor->maxHP = actor->curHP = formationActor->maxHP; actor->numParts = partCount; actor->idleSource = NULL; actor->takeTurnSource = formationActor->initScript; @@ -1726,12 +1726,12 @@ Actor* create_actor(Formation formation) { actor->turnPriority = formation->priority; actor->enemyIndex = i; actor->yaw = 0.0f; - actor->rotation.x = 0.0f; - actor->rotation.y = 0.0f; - actor->rotation.z = 0.0f; - actor->rotationPivotOffset.x = 0; - actor->rotationPivotOffset.y = 0; - actor->rotationPivotOffset.z = 0; + actor->rot.x = 0.0f; + actor->rot.y = 0.0f; + actor->rot.z = 0.0f; + actor->rotPivotOffset.x = 0; + actor->rotPivotOffset.y = 0; + actor->rotPivotOffset.z = 0; actor->scale.x = 1.0f; actor->scale.y = 1.0f; actor->scale.z = 1.0f; @@ -1754,11 +1754,11 @@ Actor* create_actor(Formation formation) { actor->actionRatingCombo = 0; actor->actionRatingTime = 0; - actor->healthBarPos.x = actor->currentPos.x + formationActor->healthBarOffset.x; - actor->healthBarPos.y = actor->currentPos.y + formationActor->healthBarOffset.y; - actor->healthBarPos.z = actor->currentPos.z; + actor->healthBarPos.x = actor->curPos.x + formationActor->healthBarOffset.x; + actor->healthBarPos.y = actor->curPos.y + formationActor->healthBarOffset.y; + actor->healthBarPos.z = actor->curPos.z; if (actor->flags & ACTOR_FLAG_UPSIDE_DOWN) { - actor->healthBarPos.y = actor->currentPos.y - actor->size.y - formationActor->healthBarOffset.y; + actor->healthBarPos.y = actor->curPos.y - actor->size.y - formationActor->healthBarOffset.y; } actor->statusTable = formationActor->statusTable; @@ -1819,12 +1819,12 @@ Actor* create_actor(Formation formation) { part->visualOffset.y = 0; part->visualOffset.z = 0; - part->absolutePosition.x = actor->currentPos.x; - part->absolutePosition.y = actor->currentPos.y; - part->absolutePosition.z = actor->currentPos.z; - part->currentPos.x = actor->currentPos.x; - part->currentPos.y = actor->currentPos.y; - part->currentPos.z = actor->currentPos.z; + part->absolutePos.x = actor->curPos.x; + part->absolutePos.y = actor->curPos.y; + part->absolutePos.z = actor->curPos.z; + part->curPos.x = actor->curPos.x; + part->curPos.y = actor->curPos.y; + part->curPos.z = actor->curPos.z; part->defenseTable = actorPartBP->defenseTable; part->idleAnimations = actorPartBP->idleAnimations; part->eventFlags = actorPartBP->eventFlags; @@ -1841,12 +1841,12 @@ Actor* create_actor(Formation formation) { part->unk_70 = 0; part->projectileTargetOffset.x = actorPartBP->projectileTargetOffset.x; part->projectileTargetOffset.y = actorPartBP->projectileTargetOffset.y; - part->rotation.x = 0.0f; - part->rotation.y = 0.0f; - part->rotation.z = 0.0f; - part->rotationPivotOffset.x = 0; - part->rotationPivotOffset.y = 0; - part->rotationPivotOffset.z = 0; + part->rot.x = 0.0f; + part->rot.y = 0.0f; + part->rot.z = 0.0f; + part->rotPivotOffset.x = 0; + part->rotPivotOffset.y = 0; + part->rotPivotOffset.z = 0; part->scale.x = 1.0f; part->scale.y = 1.0f; part->scale.z = 1.0f; @@ -1875,9 +1875,9 @@ Actor* create_actor(Formation formation) { decorationTable->unk_7D9 = 0; for (k = 0; k < ARRAY_COUNT(decorationTable->posX); k++) { - decorationTable->posX[k] = actor->currentPos.x; - decorationTable->posY[k] = actor->currentPos.y; - decorationTable->posZ[k] = actor->currentPos.z; + decorationTable->posX[k] = actor->curPos.x; + decorationTable->posY[k] = actor->curPos.y; + decorationTable->posZ[k] = actor->curPos.z; } decorationTable->unk_7DA = 3; @@ -1901,12 +1901,12 @@ Actor* create_actor(Formation formation) { } part->animationRate = 1.0f; - part->currentAnimation = 0; + part->curAnimation = 0; part->spriteInstanceID = -1; if (part->idleAnimations != NULL) { - part->currentAnimation = get_npc_anim_for_status(part->idleAnimations, 1) & ~SPRITE_ID_TAIL_ALLOCATE; - part->spriteInstanceID = spr_load_npc_sprite(part->currentAnimation, NULL); + part->curAnimation = get_npc_anim_for_status(part->idleAnimations, 1) & ~SPRITE_ID_TAIL_ALLOCATE; + part->spriteInstanceID = spr_load_npc_sprite(part->curAnimation, NULL); } if (j + 1 >= partCount) { @@ -1928,7 +1928,7 @@ Actor* create_actor(Formation formation) { takeTurnScript = start_script(actor->takeTurnSource, EVT_PRIORITY_A, 0); actor->takeTurnScriptID = takeTurnScript->id; takeTurnScript->owner1.enemyID = actor->enemyIndex | ACTOR_CLASS_ENEMY; - actor->shadow.id = create_shadow_type(0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + actor->shadow.id = create_shadow_type(0, actor->curPos.x, actor->curPos.y, actor->curPos.z); actor->shadowScale = actor->size.x / 24.0; actor->disableEffect = fx_disable_x(0, -142.0f, 34.0f, 1.0f, 0); actor->icePillarEffect = NULL; @@ -2110,8 +2110,8 @@ s32 inflict_status(Actor* target, s32 statusTypeKey, s32 duration) { if (effect != NULL) { effect->flags |= FX_INSTANCE_FLAG_DISMISS; } - target->icePillarEffect = fx_ice_pillar(0, target->currentPos.x, target->currentPos.y, - target->currentPos.z, 1.0f, 0); + target->icePillarEffect = fx_ice_pillar(0, target->curPos.x, target->curPos.y, + target->curPos.z, 1.0f, 0); create_status_debuff(target->hudElementDataIndex, STATUS_KEY_FROZEN); } return TRUE; @@ -2341,11 +2341,11 @@ void show_damage_fx(Actor* actor, f32 x, f32 y, f32 z, s32 damage) { } do { - if (battleStatus->currentAttackElement & DAMAGE_TYPE_FIRE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_FIRE) { fx_ring_blast(0, x, y, z, 1.0f, 24); - } else if (battleStatus->currentAttackElement & DAMAGE_TYPE_SHOCK) { + } else if (battleStatus->curAttackElement & DAMAGE_TYPE_SHOCK) { apply_shock_effect(actor); - } else if (battleStatus->currentAttackElement & DAMAGE_TYPE_WATER) { + } else if (battleStatus->curAttackElement & DAMAGE_TYPE_WATER) { fx_water_splash(0, x, y, z, 1.0f, 24); } else { fx_firework(0, x, y, z, 1.0, intensity); @@ -2541,7 +2541,7 @@ s32 try_inflict_status(Actor* actor, s32 statusTypeKey, s32 statusKey) { duration = 0; if (actor->statusTable != NULL) { - if (!(battleStatus->currentAttackStatus & STATUS_FLAG_RIGHT_ON)) { + if (!(battleStatus->curAttackStatus & STATUS_FLAG_RIGHT_ON)) { chance = lookup_status_chance(actor->statusTable, statusTypeKey); } else { if (lookup_status_chance(actor->statusTable, statusTypeKey) != 0) { @@ -2564,7 +2564,7 @@ s32 try_inflict_status(Actor* actor, s32 statusTypeKey, s32 statusKey) { meow: if (duration > 0) { - if (battleStatus->currentAttackStatus < 0) { + if (battleStatus->curAttackStatus < 0) { duration = battleStatus->statusDuration; duration += lookup_status_duration_mod(actor->statusTable, statusKey); inflict_status(actor, statusTypeKey, duration); @@ -2814,7 +2814,7 @@ void create_part_shadow(s32 actorID, s32 partID) { ActorPart* part = get_actor_part(get_actor(actorID), partID); part->flags &= ~ACTOR_PART_FLAG_4; - part->shadowIndex = create_shadow_type(0, part->currentPos.x, part->currentPos.y, part->currentPos.z); + part->shadowIndex = create_shadow_type(0, part->curPos.x, part->curPos.y, part->curPos.z); part->shadowScale = part->size.x / 24.0; } @@ -2827,7 +2827,7 @@ void remove_part_shadow(s32 actorID, s32 partID) { void create_part_shadow_by_ref(UNK_TYPE arg0, ActorPart* part) { part->flags &= ~ACTOR_PART_FLAG_4; - part->shadowIndex = create_shadow_type(0, part->currentPos.x, part->currentPos.y, part->currentPos.z); + part->shadowIndex = create_shadow_type(0, part->curPos.x, part->curPos.y, part->curPos.z); part->shadowScale = part->size.x / 24.0; } @@ -2869,10 +2869,10 @@ void remove_player_buffs(s32 buffs) { battleStatus->buffEffect->data.partnerBuff->unk_0C[FX_BUFF_DATA_WATER_BLOCK].turnsLeft = 0; battleStatus->waterBlockEffect->flags |= FX_INSTANCE_FLAG_DISMISS; - fx_water_block(1, player->currentPos.x, player->currentPos.y + 18.0f, player->currentPos.z + 5.0f, 1.5f, 0xA); - fx_water_splash(0, player->currentPos.x - 10.0f, player->currentPos.y + 5.0f, player->currentPos.z + 5.0f, 1.0f, 0x18); - fx_water_splash(0, player->currentPos.x - 15.0f, player->currentPos.y + 32.0f, player->currentPos.z + 5.0f, 1.0f, 0x18); - fx_water_splash(1, player->currentPos.x + 15.0f, player->currentPos.y + 22.0f, player->currentPos.z + 5.0f, 1.0f, 0x18); + fx_water_block(1, player->curPos.x, player->curPos.y + 18.0f, player->curPos.z + 5.0f, 1.5f, 0xA); + fx_water_splash(0, player->curPos.x - 10.0f, player->curPos.y + 5.0f, player->curPos.z + 5.0f, 1.0f, 0x18); + fx_water_splash(0, player->curPos.x - 15.0f, player->curPos.y + 32.0f, player->curPos.z + 5.0f, 1.0f, 0x18); + fx_water_splash(1, player->curPos.x + 15.0f, player->curPos.y + 22.0f, player->curPos.z + 5.0f, 1.0f, 0x18); battleStatus->waterBlockEffect = NULL; sfx_play_sound(SOUND_299); @@ -2989,7 +2989,7 @@ void reset_all_actor_sounds(Actor* actor) { } void hide_foreground_models_unchecked(void) { - Stage* stage = gBattleStatus.currentStage; + Stage* stage = gBattleStatus.curStage; if (stage != NULL && stage->foregroundModelList != NULL) { s32* idList = stage->foregroundModelList; @@ -3004,7 +3004,7 @@ void hide_foreground_models_unchecked(void) { } void show_foreground_models_unchecked(void) { - Stage* stage = gBattleStatus.currentStage; + Stage* stage = gBattleStatus.curStage; if (stage != NULL && stage->foregroundModelList != NULL) { s32* idList = stage->foregroundModelList; @@ -3019,7 +3019,7 @@ void show_foreground_models_unchecked(void) { } void hide_foreground_models(void) { - Stage* stage = gBattleStatus.currentStage; + Stage* stage = gBattleStatus.curStage; if (stage != NULL && stage->foregroundModelList != NULL) { s32* idList = stage->foregroundModelList; @@ -3037,7 +3037,7 @@ void hide_foreground_models(void) { } void show_foreground_models(void) { - Stage* stage = gBattleStatus.currentStage; + Stage* stage = gBattleStatus.curStage; if (stage != NULL && stage->foregroundModelList != NULL) { s32* idList = stage->foregroundModelList; diff --git a/src/19FAF0.c b/src/19FAF0.c index dfee802ad6..9e089054e2 100644 --- a/src/19FAF0.c +++ b/src/19FAF0.c @@ -180,13 +180,13 @@ HitResult calc_player_test_enemy(void) { BattleStatus* battleStatus = &gBattleStatus; Actor* player = battleStatus->playerActor; ActorState* state = &player->state; - s32 targetActorID = battleStatus->currentTargetID; - s32 targetPartIdx = battleStatus->currentTargetPart; + s32 targetActorID = battleStatus->curTargetID; + s32 targetPartIdx = battleStatus->curTargetPart; Actor* target; ActorPart* targetPart; - battleStatus->currentTargetID2 = battleStatus->currentTargetID; - battleStatus->currentTargetPart2 = battleStatus->currentTargetPart; + battleStatus->curTargetID2 = battleStatus->curTargetID; + battleStatus->curTargetPart2 = battleStatus->curTargetPart; target = get_actor(targetActorID); if (target == NULL) { @@ -202,7 +202,7 @@ HitResult calc_player_test_enemy(void) { if (target->transparentStatus == STATUS_KEY_TRANSPARENT || (targetPart->eventFlags & ACTOR_EVENT_FLAG_800) - && !(battleStatus->currentAttackElement & DAMAGE_TYPE_QUAKE)) + && !(battleStatus->curAttackElement & DAMAGE_TYPE_QUAKE)) { return HIT_RESULT_MISS; } @@ -212,7 +212,7 @@ HitResult calc_player_test_enemy(void) { return HIT_RESULT_IMMUNE; } - if ((battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP) + if ((battleStatus->curAttackElement & DAMAGE_TYPE_JUMP) && (targetPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP) && !player_team_is_ability_active(player, ABILITY_SPIKE_SHIELD)) { @@ -220,9 +220,9 @@ HitResult calc_player_test_enemy(void) { return HIT_RESULT_LANDED_ON_SPIKE; } - if (!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_JUMP)) + if (!(battleStatus->curAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_JUMP)) && (targetPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_FRONT) - && (!(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SPIKY_FRONT) + && (!(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SPIKY_FRONT) && !player_team_is_ability_active(player, ABILITY_SPIKE_SHIELD))) { sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); @@ -241,8 +241,8 @@ HitResult calc_player_test_enemy(void) { HitResult calc_player_damage_enemy(void) { BattleStatus* battleStatus = &gBattleStatus; Actor* player = battleStatus->playerActor; - s32 currentTargetID = battleStatus->currentTargetID; - s32 currentTargetPartID = battleStatus->currentTargetPart; + s32 currentTargetID = battleStatus->curTargetID; + s32 currentTargetPartID = battleStatus->curTargetPart; ActorState* state; Evt* evt; Actor* target; @@ -275,8 +275,8 @@ HitResult calc_player_damage_enemy(void) { battleStatus->wasStatusInflicted = FALSE; battleStatus->lastAttackDamage = 0; battleStatus->attackerActorID = player->actorID; - battleStatus->currentTargetID2 = battleStatus->currentTargetID; - battleStatus->currentTargetPart2 = battleStatus->currentTargetPart; + battleStatus->curTargetID2 = battleStatus->curTargetID; + battleStatus->curTargetPart2 = battleStatus->curTargetPart; target = get_actor(currentTargetID); state = &player->state; @@ -295,15 +295,15 @@ HitResult calc_player_damage_enemy(void) { dispatchEvent = EVENT_ZERO_DAMAGE; } else { if (player_team_is_ability_active(player, ABILITY_ICE_POWER)) { - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT)) { - battleStatus->currentAttackElement |= DAMAGE_TYPE_ICE; + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT)) { + battleStatus->curAttackElement |= DAMAGE_TYPE_ICE; } } if (targetPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY || (target->transparentStatus == STATUS_KEY_TRANSPARENT || targetPart->eventFlags & ACTOR_EVENT_FLAG_800 - && !(battleStatus->currentAttackElement & DAMAGE_TYPE_QUAKE)) + && !(battleStatus->curAttackElement & DAMAGE_TYPE_QUAKE)) ) { return HIT_RESULT_MISS; } @@ -318,11 +318,11 @@ HitResult calc_player_damage_enemy(void) { return HIT_RESULT_HIT; } - if (targetPart->elementalImmunities & battleStatus->currentAttackElement) { + if (targetPart->elementalImmunities & battleStatus->curAttackElement) { partImmuneToElement = TRUE; } - if ((battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP) + if ((battleStatus->curAttackElement & DAMAGE_TYPE_JUMP) && (targetPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP) && !player_team_is_ability_active(player, ABILITY_SPIKE_SHIELD)) { @@ -332,7 +332,7 @@ HitResult calc_player_damage_enemy(void) { return HIT_RESULT_BACKFIRE; } - if (!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SMASH))) { + if (!(battleStatus->curAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SMASH))) { if (targetPart->eventFlags & ACTOR_EVENT_FLAG_EXPLODE_ON_CONTACT) { sfx_play_sound_at_position(SOUND_HIT_PLAYER_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); dispatch_damage_event_player_1(1, EVENT_BURN_CONTACT); @@ -341,7 +341,7 @@ HitResult calc_player_damage_enemy(void) { } if (targetPart->eventFlags & ACTOR_EVENT_FLAG_FIREY - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_BURN_CONTACT) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_BURN_CONTACT) && !(player_team_is_ability_active(player, ABILITY_FIRE_SHIELD)) && !(player_team_is_ability_active(player, ABILITY_ICE_POWER)) ) { @@ -353,7 +353,7 @@ HitResult calc_player_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE - && battleStatus->currentAttackElement & DAMAGE_TYPE_FIRE + && battleStatus->curAttackElement & DAMAGE_TYPE_FIRE && targetPart->eventFlags & (ACTOR_EVENT_FLAG_FIRE_EXPLODE | ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION) ) { sfx_play_sound_at_position(SOUND_HIT_PLAYER_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); @@ -364,9 +364,9 @@ HitResult calc_player_damage_enemy(void) { return HIT_RESULT_HIT; } - if (!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SMASH)) + if (!(battleStatus->curAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SMASH)) && targetPart->eventFlags & ACTOR_EVENT_FLAG_200000 - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_FLAG_80) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_FLAG_80) && !player_team_is_ability_active(player, ABILITY_SPIKE_SHIELD) ) { sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); @@ -375,22 +375,22 @@ HitResult calc_player_damage_enemy(void) { return HIT_RESULT_BACKFIRE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_FIRE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_FIRE) { fx_ring_blast(0, state->goalPos.x, state->goalPos.y, state->goalPos.z * 5.0f, 1.0f, 24); isFireDamage = TRUE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_SHOCK) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_SHOCK) { apply_shock_effect(target); isShockDamage = TRUE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_WATER) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_WATER) { fx_water_splash(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f, 1.0f, 24); isWaterDamage = TRUE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_ICE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_ICE) { fx_big_snowflakes(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f); isIceDamage = TRUE; } @@ -425,20 +425,20 @@ HitResult calc_player_damage_enemy(void) { if (!is_ability_active(ABILITY_ZAP_TAP) && player->staticStatus != STATUS_KEY_STATIC && (target->staticStatus == STATUS_KEY_STATIC || targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED) - && !(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SHOCK)) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT) + && !(battleStatus->curAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SHOCK)) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT) ) { gBattleStatus.flags1 |= BS_FLAGS1_SP_EVT_ACTIVE; sp20 = TRUE; } if (targetPart->eventFlags & (ACTOR_EVENT_FLAG_STAR_ROD_ENCHANTED | ACTOR_EVENT_FLAG_ENCHANTED)) { - battleStatus->currentAttackElement &= ~DAMAGE_TYPE_IGNORE_DEFENSE; + battleStatus->curAttackElement &= ~DAMAGE_TYPE_IGNORE_DEFENSE; } - targetDefense = get_defense(target, targetPart->defenseTable, battleStatus->currentAttackElement); + targetDefense = get_defense(target, targetPart->defenseTable, battleStatus->curAttackElement); - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_IGNORE_DEFENSE)) { + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_IGNORE_DEFENSE)) { targetDefense += target->defenseBoost; } @@ -446,19 +446,19 @@ HitResult calc_player_damage_enemy(void) { targetDefense += 127; } - currentAttackDamage = battleStatus->currentAttackDamage; - currentAttackDamage += count_power_plus(battleStatus->currentAttackElement); + currentAttackDamage = battleStatus->curAttackDamage; + currentAttackDamage += count_power_plus(battleStatus->curAttackElement); - if (battleStatus->merleeAttackBoost > 0 && (gBattleStatus.flags1 & BS_FLAGS1_10 || battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP)) { + if (battleStatus->merleeAttackBoost > 0 && (gBattleStatus.flags1 & BS_FLAGS1_10 || battleStatus->curAttackElement & DAMAGE_TYPE_JUMP)) { currentAttackDamage += battleStatus->merleeAttackBoost; } - if (battleStatus->jumpCharge && battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP) { + if (battleStatus->jumpCharge && battleStatus->curAttackElement & DAMAGE_TYPE_JUMP) { currentAttackDamage += battleStatus->jumpCharge; gBattleStatus.flags1 &= ~BS_FLAGS1_JUMP_CHARGED; } - if (battleStatus->hammerCharge && battleStatus->currentAttackElement & (DAMAGE_TYPE_QUAKE_HAMMER | DAMAGE_TYPE_THROW | DAMAGE_TYPE_SMASH)) { + if (battleStatus->hammerCharge && battleStatus->curAttackElement & (DAMAGE_TYPE_QUAKE_HAMMER | DAMAGE_TYPE_THROW | DAMAGE_TYPE_SMASH)) { currentAttackDamage += battleStatus->hammerCharge; gBattleStatus.flags1 &= ~BS_FLAGS1_HAMMER_CHARGED; } @@ -516,7 +516,7 @@ HitResult calc_player_damage_enemy(void) { } if (gBattleStatus.flags2 & BS_FLAGS2_HAS_RUSH && (gBattleStatus.flags1 & BS_FLAGS1_10 || - battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP)) { + battleStatus->curAttackElement & DAMAGE_TYPE_JUMP)) { if (battleStatus->rushFlags & RUSH_FLAG_POWER) { currentAttackDamage += 2; } @@ -552,14 +552,14 @@ HitResult calc_player_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE - && battleStatus->currentAttackElement & DAMAGE_TYPE_BLAST + && battleStatus->curAttackElement & DAMAGE_TYPE_BLAST && targetPart->eventFlags & ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION ) { targetDefense = 0; - currentAttackDamage = target->currentHP; + currentAttackDamage = target->curHP; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS) { targetDefense = 0; currentAttackDamage = 0; } @@ -579,7 +579,7 @@ HitResult calc_player_damage_enemy(void) { currentAttackDamage = 0; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_POWER_BOUNCE && currentAttackDamage > 0) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_POWER_BOUNCE && currentAttackDamage > 0) { currentAttackDamage += battleStatus->powerBounceCounter; if (currentAttackDamage < 1) { @@ -593,11 +593,11 @@ HitResult calc_player_damage_enemy(void) { target->hpChangeCounter = 0; hitResult = HIT_RESULT_NO_DAMAGE; - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS)) { + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS)) { dispatchEvent = EVENT_ZERO_DAMAGE; sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } else { - if (target->currentHP < 1) { + if (target->curHP < 1) { dispatchEvent = EVENT_DEATH; } else { dispatchEvent = EVENT_ZERO_DAMAGE; @@ -616,10 +616,10 @@ HitResult calc_player_damage_enemy(void) { && !partImmuneToElement && !(targetPart->targetFlags & ACTOR_PART_TARGET_FLAG_4) ) { - target->currentHP -= currentAttackDamage; + target->curHP -= currentAttackDamage; - if (target->currentHP < 1) { - target->currentHP = 0; + if (target->curHP < 1) { + target->curHP = 0; dispatchEvent = EVENT_DEATH; } } @@ -633,9 +633,9 @@ HitResult calc_player_damage_enemy(void) { if (!is_ability_active(ABILITY_ZAP_TAP) && player->staticStatus != STATUS_KEY_STATIC && (target->staticStatus == STATUS_KEY_STATIC || (targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED)) - && !(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT) - && !(battleStatus->currentAttackElement & DAMAGE_TYPE_SHOCK) + && !(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT) + && !(battleStatus->curAttackElement & DAMAGE_TYPE_SHOCK) ) { sfx_play_sound_at_position(SOUND_HIT_PLAYER_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); apply_shock_effect(player); @@ -654,7 +654,7 @@ HitResult calc_player_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { - if (battleStatus->currentAttackElement & DAMAGE_TYPE_FEAR + if (battleStatus->curAttackElement & DAMAGE_TYPE_FEAR && rand_int(99) < (target->actorBlueprint->escapeChance * battleStatus->statusChance) / 100 && (target->debuff != STATUS_KEY_FEAR && target->debuff != STATUS_KEY_DIZZY @@ -682,7 +682,7 @@ HitResult calc_player_damage_enemy(void) { dispatchEvent = EVENT_IMMUNE; } - if (target->currentHP < 1) { + if (target->curHP < 1) { if (dispatchEvent == EVENT_IMMUNE) { dispatchEvent = EVENT_DEATH; } @@ -696,7 +696,7 @@ HitResult calc_player_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { - if (battleStatus->currentAttackElement & DAMAGE_TYPE_SPIN_SMASH) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_SPIN_SMASH) { PlayerData* playerData = &gPlayerData; if (target->actorBlueprint->spinSmashReq != 255 @@ -727,7 +727,7 @@ HitResult calc_player_damage_enemy(void) { } if ((gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) - && !(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) + && !(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT) && targetPart->eventFlags & ACTOR_EVENT_FLAG_POWER_BOUNCE ) { if (dispatchEvent == EVENT_HIT_COMBO) { @@ -752,7 +752,7 @@ HitResult calc_player_damage_enemy(void) { } if ((gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) - && (battleStatus->currentAttackElement & (DAMAGE_TYPE_POW | DAMAGE_TYPE_JUMP)) + && (battleStatus->curAttackElement & (DAMAGE_TYPE_POW | DAMAGE_TYPE_JUMP)) && targetPart->eventFlags & ACTOR_EVENT_FLAG_GROUNDABLE ) { if (dispatchEvent == EVENT_HIT) { @@ -767,7 +767,7 @@ HitResult calc_player_damage_enemy(void) { } if ((gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) - && (battleStatus->currentAttackElement & (DAMAGE_TYPE_QUAKE | DAMAGE_TYPE_POW | DAMAGE_TYPE_JUMP)) + && (battleStatus->curAttackElement & (DAMAGE_TYPE_QUAKE | DAMAGE_TYPE_POW | DAMAGE_TYPE_JUMP)) && targetPart->eventFlags & ACTOR_EVENT_FLAG_FLIPABLE ) { if (dispatchEvent == EVENT_HIT) { @@ -785,7 +785,7 @@ HitResult calc_player_damage_enemy(void) { } if (!(gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) - && battleStatus->currentAttackElement & (DAMAGE_TYPE_QUAKE | DAMAGE_TYPE_POW | DAMAGE_TYPE_JUMP) + && battleStatus->curAttackElement & (DAMAGE_TYPE_QUAKE | DAMAGE_TYPE_POW | DAMAGE_TYPE_JUMP) && targetPart->eventFlags & ACTOR_EVENT_FLAG_FLIPABLE ) { if (dispatchEvent == EVENT_HIT_COMBO) { @@ -802,7 +802,7 @@ HitResult calc_player_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE - && battleStatus->currentAttackElement & DAMAGE_TYPE_SHELL_CRACK + && battleStatus->curAttackElement & DAMAGE_TYPE_SHELL_CRACK && targetPart->eventFlags & ACTOR_EVENT_FLAG_FLIPABLE ) { if (dispatchEvent == EVENT_HIT) { @@ -816,7 +816,7 @@ HitResult calc_player_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE - && (battleStatus->currentAttackElement & (DAMAGE_TYPE_BLAST | DAMAGE_TYPE_FIRE)) + && (battleStatus->curAttackElement & (DAMAGE_TYPE_BLAST | DAMAGE_TYPE_FIRE)) ) { if (dispatchEvent == EVENT_HIT) { dispatchEvent = EVENT_BURN_HIT; @@ -838,7 +838,7 @@ HitResult calc_player_damage_enemy(void) { && !(targetPart->targetFlags & ACTOR_PART_TARGET_FLAG_4) ) { #define INFLICT_STATUS(STATUS_TYPE) \ - if ((battleStatus->currentAttackStatus & STATUS_FLAG_##STATUS_TYPE) && \ + if ((battleStatus->curAttackStatus & STATUS_FLAG_##STATUS_TYPE) && \ try_inflict_status(target, STATUS_KEY_##STATUS_TYPE, STATUS_TURN_MOD_##STATUS_TYPE)) { \ tempBinary = TRUE; \ wasStatusInflicted = TRUE; \ @@ -879,7 +879,7 @@ HitResult calc_player_damage_enemy(void) { } } } else if (!partImmuneToElement) { - if (battleStatus->currentAttackElement & (DAMAGE_TYPE_MULTIPLE_POPUPS | DAMAGE_TYPE_SMASH)) { + if (battleStatus->curAttackElement & (DAMAGE_TYPE_MULTIPLE_POPUPS | DAMAGE_TYPE_SMASH)) { show_next_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 0); } else { show_primary_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 0); @@ -901,8 +901,8 @@ HitResult calc_player_damage_enemy(void) { sfx_play_sound(SOUND_231); } - if (battleStatus->lastAttackDamage > 0 || battleStatus->currentAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS && tempBinary) { - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_MULTI_BOUNCE)) { + if (battleStatus->lastAttackDamage > 0 || battleStatus->curAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS && tempBinary) { + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_MULTI_BOUNCE)) { show_action_rating(ACTION_RATING_NICE, target, state->goalPos.x, state->goalPos.y, state->goalPos.z); } else { show_action_rating(ACTION_RATING_NICE_SUPER_COMBO, target, state->goalPos.x, state->goalPos.y, state->goalPos.z); @@ -937,7 +937,7 @@ HitResult calc_player_damage_enemy(void) { sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackStatus & STATUS_FLAG_SLEEP && wasStatusInflicted) { + if (battleStatus->curAttackStatus & STATUS_FLAG_SLEEP && wasStatusInflicted) { evt = start_script(&EVS_PlaySleepHitFX, EVT_PRIORITY_A, 0); evt->varTable[0] = state->goalPos.x; evt->varTable[1] = state->goalPos.y; @@ -945,7 +945,7 @@ HitResult calc_player_damage_enemy(void) { sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackStatus & STATUS_FLAG_DIZZY && wasStatusInflicted) { + if (battleStatus->curAttackStatus & STATUS_FLAG_DIZZY && wasStatusInflicted) { evt = start_script(&EVS_PlayDizzyHitFX, EVT_PRIORITY_A, 0); evt->varTable[0] = state->goalPos.x; evt->varTable[1] = state->goalPos.y; @@ -953,7 +953,7 @@ HitResult calc_player_damage_enemy(void) { sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackStatus & STATUS_FLAG_PARALYZE && wasStatusInflicted) { + if (battleStatus->curAttackStatus & STATUS_FLAG_PARALYZE && wasStatusInflicted) { evt = start_script(&EVS_PlayParalyzeHitFX, EVT_PRIORITY_A, 0); evt->varTable[0] = state->goalPos.x; evt->varTable[1] = state->goalPos.y; @@ -961,7 +961,7 @@ HitResult calc_player_damage_enemy(void) { sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackStatus & STATUS_FLAG_POISON && wasStatusInflicted) { + if (battleStatus->curAttackStatus & STATUS_FLAG_POISON && wasStatusInflicted) { evt = start_script(&EVS_PlayPoisonHitFX, EVT_PRIORITY_A, 0); evt->varTable[0] = state->goalPos.x; evt->varTable[1] = state->goalPos.y; @@ -969,7 +969,7 @@ HitResult calc_player_damage_enemy(void) { sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackStatus & STATUS_FLAG_STOP && wasStatusInflicted) { + if (battleStatus->curAttackStatus & STATUS_FLAG_STOP && wasStatusInflicted) { evt = start_script(&EVS_PlayStopHitFX, EVT_PRIORITY_A, 0); evt->varTable[0] = state->goalPos.x; evt->varTable[1] = state->goalPos.y; @@ -977,7 +977,7 @@ HitResult calc_player_damage_enemy(void) { sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackStatus & STATUS_FLAG_FROZEN && wasStatusInflicted) { + if (battleStatus->curAttackStatus & STATUS_FLAG_FROZEN && wasStatusInflicted) { evt = start_script(&EVS_PlayFreezeHitFX, EVT_PRIORITY_A, 0); evt->varTable[0] = state->goalPos.x; evt->varTable[1] = state->goalPos.y; @@ -986,7 +986,7 @@ HitResult calc_player_damage_enemy(void) { sfx_play_sound_at_position(SOUND_HIT_PLAYER_ICE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackStatus & STATUS_FLAG_SHRINK && wasStatusInflicted) { + if (battleStatus->curAttackStatus & STATUS_FLAG_SHRINK && wasStatusInflicted) { evt = start_script(&EVS_PlayShrinkHitFX, EVT_PRIORITY_A, 0); evt->varTable[0] = state->goalPos.x; evt->varTable[1] = state->goalPos.y; @@ -995,7 +995,7 @@ HitResult calc_player_damage_enemy(void) { sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_SMASH && target->actorType == ACTOR_TYPE_GOOMNUT_TREE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_SMASH && target->actorType == ACTOR_TYPE_GOOMNUT_TREE) { sfx_play_sound_at_position(SOUND_SMASH_GOOMNUT_TREE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } @@ -1013,8 +1013,8 @@ HitResult calc_player_damage_enemy(void) { if (!is_ability_active(ABILITY_ZAP_TAP) && (player->staticStatus != STATUS_KEY_STATIC) && (target->staticStatus == STATUS_KEY_STATIC || targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED) - && !(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SHOCK)) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT) + && !(battleStatus->curAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SHOCK)) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT) ) { sfx_play_sound_at_position(SOUND_HIT_PLAYER_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); apply_shock_effect(player); @@ -1036,29 +1036,29 @@ s32 dispatch_damage_event_player(s32 damageAmount, s32 event, s32 arg2) { s32 oldPlayerHP; s32 temp; - battleStatus->currentAttackDamage = damageAmount; + battleStatus->curAttackDamage = damageAmount; temp = (s16)damageAmount; //TODO usage of temp here required to match player->hpChangeCounter += temp; temp = player->hpChangeCounter; - player->currentHP = playerData->curHP; + player->curHP = playerData->curHP; player->damageCounter += temp; player->hpChangeCounter -= temp; battleStatus->lastAttackDamage = 0; - player->currentHP -= temp; + player->curHP -= temp; battleStatus->damageTaken += temp; - oldPlayerHP = player->currentHP; + oldPlayerHP = player->curHP; dispatchEvent = event; - if (player->currentHP < 1) { + if (player->curHP < 1) { battleStatus->lastAttackDamage += oldPlayerHP; - player->currentHP = 0; + player->curHP = 0; dispatchEvent = EVENT_DEATH; } battleStatus->lastAttackDamage += temp; - playerData->curHP = player->currentHP; + playerData->curHP = player->curHP; if (dispatchEvent == EVENT_HIT_COMBO) { dispatchEvent = EVENT_HIT; @@ -1099,8 +1099,8 @@ s32 dispatch_damage_event_player(s32 damageAmount, s32 event, s32 arg2) { s32 dispatch_damage_event_player_0(s32 damageAmount, s32 event) { BattleStatus* battleStatus = &gBattleStatus; - battleStatus->currentAttackElement = ELEMENT_END; - battleStatus->currentDamageSource = DMG_SRC_DEFAULT; + battleStatus->curAttackElement = ELEMENT_END; + battleStatus->curDamageSource = DMG_SRC_DEFAULT; return dispatch_damage_event_player(damageAmount, event, FALSE); } @@ -1142,83 +1142,83 @@ ApiStatus func_80273444(Evt* script, s32 isInitialCall) { player->state.moveArcAmplitude = evt_get_variable(script, *args++); script->functionTemp[1] = evt_get_variable(script, *args++); - player->state.currentPos.x = player->currentPos.x; - player->state.currentPos.y = player->currentPos.y; - player->state.currentPos.z = player->currentPos.z; + player->state.curPos.x = player->curPos.x; + player->state.curPos.y = player->curPos.y; + player->state.curPos.z = player->curPos.z; - x = player->state.currentPos.x; - y = player->state.currentPos.y; - z = player->state.currentPos.z; + x = player->state.curPos.x; + y = player->state.curPos.y; + z = player->state.curPos.z; goalX = player->state.goalPos.x; goalY = player->state.goalPos.y; goalZ = player->state.goalPos.z; player->state.angle = atan2(x, z, goalX, goalZ); - player->state.distance = dist2D(x, z, goalX, goalZ); + player->state.dist = dist2D(x, z, goalX, goalZ); y = goalY - y; if (player->state.moveTime == 0) { - player->state.moveTime = player->state.distance / player->state.speed; - var_f8 = player->state.distance - (player->state.moveTime * player->state.speed); + player->state.moveTime = player->state.dist / player->state.speed; + var_f8 = player->state.dist - (player->state.moveTime * player->state.speed); } else { - player->state.speed = player->state.distance / player->state.moveTime; - var_f8 = player->state.distance - (player->state.moveTime * player->state.speed); + player->state.speed = player->state.dist / player->state.moveTime; + var_f8 = player->state.dist - (player->state.moveTime * player->state.speed); } playerState->speed += var_f8 / playerState->moveTime; - playerState->velocity = (playerState->acceleration * playerState->moveTime * 0.5f) + (y / playerState->moveTime); + playerState->vel = (playerState->acceleration * playerState->moveTime * 0.5f) + (y / playerState->moveTime); set_animation(0, 0, playerState->animJumpRise); playerState->unk_24 = 90.0f; playerState->unk_28 = 180 / playerState->moveTime; playerState->unk_2C = playerState->goalPos.y; if (script->functionTemp[1] != 2) { - sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); } script->functionTemp[0] = TRUE; } - if (playerState->velocity < 0.0f) { + if (playerState->vel < 0.0f) { set_animation(0, 0, playerState->animJumpFall); } - playerVel = playerState->velocity; + playerVel = playerState->vel; switch (playerState->moveArcAmplitude) { case 0: break; case 1: - if (playerState->currentPos.y - playerState->unk_2C > 45.0f) { + if (playerState->curPos.y - playerState->unk_2C > 45.0f) { playerVel *= 0.25f; } break; case 2: - if (playerState->currentPos.y - playerState->unk_2C > 54.9) { + if (playerState->curPos.y - playerState->unk_2C > 54.9) { playerVel *= 0.25f; } break; } - playerState->currentPos.y += playerVel; - playerState->velocity -= playerState->acceleration; + playerState->curPos.y += playerVel; + playerState->vel -= playerState->acceleration; playerSpeed = playerState->speed; - add_xz_vec3f(&playerState->currentPos, playerSpeed + sin_rad(DEG_TO_RAD(playerState->unk_24)), playerState->angle); + add_xz_vec3f(&playerState->curPos, playerSpeed + sin_rad(DEG_TO_RAD(playerState->unk_24)), playerState->angle); playerState->unk_24 += playerState->unk_28; playerState->unk_24 = clamp_angle(playerState->unk_24); - player->currentPos.x = playerState->currentPos.x; - player->currentPos.y = playerState->currentPos.y; - player->currentPos.z = playerState->currentPos.z; + player->curPos.x = playerState->curPos.x; + player->curPos.y = playerState->curPos.y; + player->curPos.z = playerState->curPos.z; playerState->moveTime--; if (playerState->moveTime >= 0) { return ApiStatus_BLOCK; } - player->currentPos.y = playerState->goalPos.y; + player->curPos.y = playerState->goalPos.y; if (script->functionTemp[1] != 1) { - play_movement_dust_effects(2, player->currentPos.x, player->currentPos.y, player->currentPos.z, player->yaw); + play_movement_dust_effects(2, player->curPos.x, player->curPos.y, player->curPos.z, player->yaw); } if (script->functionTemp[1] != 2) { - sfx_play_sound_at_position(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + sfx_play_sound_at_position(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); } return ApiStatus_DONE1; @@ -1238,13 +1238,13 @@ ApiStatus PlayerFallToGoal(Evt* script, s32 isInitialCall) { if (!script->functionTemp[0]) { s32 moveTime = evt_get_variable(script, *args++); - player->state.currentPos.x = player->currentPos.x; - player->state.currentPos.y = player->currentPos.y; - player->state.currentPos.z = player->currentPos.z; + player->state.curPos.x = player->curPos.x; + player->state.curPos.y = player->curPos.y; + player->state.curPos.z = player->curPos.z; - x = player->state.currentPos.x; - y = player->state.currentPos.y; - z = player->state.currentPos.z; + x = player->state.curPos.x; + y = player->state.curPos.y; + z = player->state.curPos.z; goalX = player->state.goalPos.x; goalY = player->state.goalPos.y; goalZ = player->state.goalPos.z; @@ -1252,41 +1252,41 @@ ApiStatus PlayerFallToGoal(Evt* script, s32 isInitialCall) { state->moveTime = moveTime; player->state.angle = atan2(x, z, goalX, goalZ); - player->state.distance = dist2D(x, z, goalX, goalZ); + player->state.dist = dist2D(x, z, goalX, goalZ); y = goalY - y; if (state->moveTime == 0) { - state->moveTime = state->distance / state->speed; + state->moveTime = state->dist / state->speed; } else { - state->speed = state->distance / state->moveTime; + state->speed = state->dist / state->moveTime; } - state->velocity = 0.0f; - state->acceleration = ((y / state->moveTime) - state->velocity) / (-state->moveTime * 0.5); + state->vel = 0.0f; + state->acceleration = ((y / state->moveTime) - state->vel) / (-state->moveTime * 0.5); set_animation(ACTOR_PLAYER, 0, state->animJumpRise); script->functionTemp[0] = TRUE; } - if (state->velocity < 0.0f) { + if (state->vel < 0.0f) { set_animation(ACTOR_PLAYER, 0, state->animJumpFall); } - state->currentPos.y += state->velocity; - state->velocity -= state->acceleration; - add_xz_vec3f(&state->currentPos, state->speed, state->angle); + state->curPos.y += state->vel; + state->vel -= state->acceleration; + add_xz_vec3f(&state->curPos, state->speed, state->angle); - player->currentPos.x = state->currentPos.x; - player->currentPos.y = state->currentPos.y; - player->currentPos.z = state->currentPos.z; + player->curPos.x = state->curPos.x; + player->curPos.y = state->curPos.y; + player->curPos.z = state->curPos.z; state->moveTime--; if (state->moveTime < 0) { - player->currentPos.x = state->goalPos.x; - player->currentPos.y = state->goalPos.y; - player->currentPos.z = state->goalPos.z; - play_movement_dust_effects(2, player->currentPos.x, player->currentPos.y, player->currentPos.z, player->yaw); - sfx_play_sound_at_position(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + player->curPos.x = state->goalPos.x; + player->curPos.y = state->goalPos.y; + player->curPos.z = state->goalPos.z; + play_movement_dust_effects(2, player->curPos.x, player->curPos.y, player->curPos.z, player->yaw); + sfx_play_sound_at_position(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); return ApiStatus_DONE1; } return ApiStatus_BLOCK; @@ -1301,38 +1301,38 @@ ApiStatus PlayerLandJump(Evt* script, s32 isInitialCall) { } if (script->functionTemp[0] == 0) { - walkMovement->currentPos.x = player->currentPos.x; - walkMovement->currentPos.y = player->currentPos.y; - walkMovement->currentPos.z = player->currentPos.z; + walkMovement->curPos.x = player->curPos.x; + walkMovement->curPos.y = player->curPos.y; + walkMovement->curPos.z = player->curPos.z; script->functionTemp[0] = 1; } - if (walkMovement->velocity > 0.0f) { + if (walkMovement->vel > 0.0f) { if (walkMovement->animJumpRise != 0) { set_animation(0, 0, walkMovement->animJumpRise); } } - if (walkMovement->velocity < 0.0f) { + if (walkMovement->vel < 0.0f) { if (walkMovement->animJumpFall != 0) { set_animation(0, 0, walkMovement->animJumpFall); } } - walkMovement->currentPos.y += walkMovement->velocity; - walkMovement->velocity -= walkMovement->acceleration; + walkMovement->curPos.y += walkMovement->vel; + walkMovement->vel -= walkMovement->acceleration; - add_xz_vec3f(&walkMovement->currentPos, walkMovement->speed, walkMovement->angle); + add_xz_vec3f(&walkMovement->curPos, walkMovement->speed, walkMovement->angle); - player->currentPos.x = walkMovement->currentPos.x; - player->currentPos.y = walkMovement->currentPos.y; - player->currentPos.z = walkMovement->currentPos.z; + player->curPos.x = walkMovement->curPos.x; + player->curPos.y = walkMovement->curPos.y; + player->curPos.z = walkMovement->curPos.z; - if (player->currentPos.y < 0.0f) { - player->currentPos.y = 0.0f; + if (player->curPos.y < 0.0f) { + player->curPos.y = 0.0f; - play_movement_dust_effects(2, player->currentPos.x, player->currentPos.y, player->currentPos.z, player->yaw); - sfx_play_sound_at_position(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + play_movement_dust_effects(2, player->curPos.x, player->curPos.y, player->curPos.z, player->yaw); + sfx_play_sound_at_position(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); return ApiStatus_DONE1; } @@ -1353,58 +1353,58 @@ ApiStatus PlayerRunToGoal(Evt* script, s32 isInitialCall) { if (!script->functionTemp[0]) { player->state.moveTime = evt_get_variable(script, *args++); - player->state.currentPos.x = player->currentPos.x; - player->state.currentPos.y = player->currentPos.y; - player->state.currentPos.z = player->currentPos.z; + player->state.curPos.x = player->curPos.x; + player->state.curPos.y = player->curPos.y; + player->state.curPos.z = player->curPos.z; goalX = player->state.goalPos.x; goalZ = player->state.goalPos.z; - currentX = player->state.currentPos.x; - currentZ = player->state.currentPos.z; + currentX = player->state.curPos.x; + currentZ = player->state.curPos.z; player->state.angle = atan2(currentX, currentZ, goalX, goalZ); - player->state.distance = dist2D(currentX, currentZ, goalX, goalZ); + player->state.dist = dist2D(currentX, currentZ, goalX, goalZ); if (player->state.moveTime == 0) { - player->state.moveTime = player->state.distance / player->state.speed; + player->state.moveTime = player->state.dist / player->state.speed; if (player->state.moveTime == 0) { player->state.moveTime = 1; } - player->state.speed += (player->state.distance - (player->state.moveTime * player->state.speed)) / player->state.moveTime; + player->state.speed += (player->state.dist - (player->state.moveTime * player->state.speed)) / player->state.moveTime; } else { - player->state.speed = player->state.distance / player->state.moveTime; + player->state.speed = player->state.dist / player->state.moveTime; } - playerState->distance = player->actorTypeData1b[0] + 1; + playerState->dist = player->actorTypeData1b[0] + 1; script->functionTemp[0] = TRUE; } - add_xz_vec3f(&playerState->currentPos, playerState->speed, playerState->angle); + add_xz_vec3f(&playerState->curPos, playerState->speed, playerState->angle); - player->currentPos.x = playerState->currentPos.x; - player->currentPos.y = playerState->currentPos.y; - player->currentPos.z = playerState->currentPos.z; + player->curPos.x = playerState->curPos.x; + player->curPos.y = playerState->curPos.y; + player->curPos.z = playerState->curPos.z; if (playerState->speed < 4.0f) { - play_movement_dust_effects(0, player->currentPos.x, player->currentPos.y, player->currentPos.z, player->yaw); + play_movement_dust_effects(0, player->curPos.x, player->curPos.y, player->curPos.z, player->yaw); } else { - play_movement_dust_effects(1, player->currentPos.x, player->currentPos.y, player->currentPos.z, player->yaw); + play_movement_dust_effects(1, player->curPos.x, player->curPos.y, player->curPos.z, player->yaw); } - playerState->distance += playerState->speed; - if (playerState->distance > player->actorTypeData1b[0]) { + playerState->dist += playerState->speed; + if (playerState->dist > player->actorTypeData1b[0]) { player->footStepCounter++; - playerState->distance = 0.0f; + playerState->dist = 0.0f; if ((player->footStepCounter % 2) != 0) { - sfx_play_sound_at_position(SOUND_STEP_NORMAL1, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + sfx_play_sound_at_position(SOUND_STEP_NORMAL1, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); } else { - sfx_play_sound_at_position(SOUND_STEP_NORMAL2, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + sfx_play_sound_at_position(SOUND_STEP_NORMAL2, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); } } playerState->moveTime--; if (playerState->moveTime <= 0) { - player->currentPos.x = playerState->goalPos.x; - player->currentPos.z = playerState->goalPos.z; + player->curPos.x = playerState->goalPos.x; + player->curPos.z = playerState->goalPos.z; return ApiStatus_DONE2; } return ApiStatus_BLOCK; @@ -1424,24 +1424,24 @@ ApiStatus CancelablePlayerRunToGoal(Evt* script, s32 isInitialCall) { if (!script->functionTemp[0]) { player->state.moveTime = evt_get_variable(script, *args++); script->functionTemp[1] = *args++; - player->state.currentPos.x = player->currentPos.x; - player->state.currentPos.y = player->currentPos.y; - player->state.currentPos.z = player->currentPos.z; + player->state.curPos.x = player->curPos.x; + player->state.curPos.y = player->curPos.y; + player->state.curPos.z = player->curPos.z; goalX = player->state.goalPos.x; goalZ = player->state.goalPos.z; - currentX = player->state.currentPos.x; - currentZ = player->state.currentPos.z; + currentX = player->state.curPos.x; + currentZ = player->state.curPos.z; player->state.angle = atan2(currentX, currentZ, goalX, goalZ); - player->state.distance = dist2D(currentX, currentZ, goalX, goalZ); + player->state.dist = dist2D(currentX, currentZ, goalX, goalZ); if (player->state.moveTime == 0) { - player->state.moveTime = player->state.distance / player->state.speed; - player->state.speed += (player->state.distance - (player->state.moveTime * player->state.speed)) / player->state.moveTime; + player->state.moveTime = player->state.dist / player->state.speed; + player->state.speed += (player->state.dist - (player->state.moveTime * player->state.speed)) / player->state.moveTime; } else { - player->state.speed = player->state.distance / player->state.moveTime; + player->state.speed = player->state.dist / player->state.moveTime; } - playerState->distance = player->actorTypeData1b[0] + 1; + playerState->dist = player->actorTypeData1b[0] + 1; if (playerState->moveTime == 0) { return ApiStatus_DONE2; @@ -1452,38 +1452,38 @@ ApiStatus CancelablePlayerRunToGoal(Evt* script, s32 isInitialCall) { script->functionTemp[0] = TRUE; } - add_xz_vec3f(&playerState->currentPos, playerState->speed, playerState->angle); + add_xz_vec3f(&playerState->curPos, playerState->speed, playerState->angle); - player->currentPos.x = playerState->currentPos.x; - player->currentPos.y = playerState->currentPos.y; - player->currentPos.z = playerState->currentPos.z; + player->curPos.x = playerState->curPos.x; + player->curPos.y = playerState->curPos.y; + player->curPos.z = playerState->curPos.z; if (playerState->speed < 4.0f) { - play_movement_dust_effects(0, player->currentPos.x, player->currentPos.y, player->currentPos.z, player->yaw); + play_movement_dust_effects(0, player->curPos.x, player->curPos.y, player->curPos.z, player->yaw); } else { - play_movement_dust_effects(1, player->currentPos.x, player->currentPos.y, player->currentPos.z, player->yaw); + play_movement_dust_effects(1, player->curPos.x, player->curPos.y, player->curPos.z, player->yaw); } - playerState->distance += playerState->speed; - if (playerState->distance > player->actorTypeData1b[0]) { + playerState->dist += playerState->speed; + if (playerState->dist > player->actorTypeData1b[0]) { player->footStepCounter++; - playerState->distance = 0.0f; + playerState->dist = 0.0f; if ((player->footStepCounter % 2) != 0) { - sfx_play_sound_at_position(SOUND_STEP_NORMAL1, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + sfx_play_sound_at_position(SOUND_STEP_NORMAL1, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); } else { - sfx_play_sound_at_position(SOUND_STEP_NORMAL2, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + sfx_play_sound_at_position(SOUND_STEP_NORMAL2, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); } } if (script->functionTemp[3] > 12) { if (!script->functionTemp[2]) { - if (!(battleStatus->currentButtonsDown & BUTTON_A)) { + if (!(battleStatus->curButtonsDown & BUTTON_A)) { script->functionTemp[2] = TRUE; } } if (script->functionTemp[2]) { - if (battleStatus->currentButtonsPressed & BUTTON_A) { + if (battleStatus->curButtonsPressed & BUTTON_A) { evt_set_variable(script, script->functionTemp[1], 1); return ApiStatus_DONE2; } @@ -1497,8 +1497,8 @@ ApiStatus CancelablePlayerRunToGoal(Evt* script, s32 isInitialCall) { return ApiStatus_BLOCK; } - player->currentPos.x = playerState->goalPos.x; - player->currentPos.z = playerState->goalPos.z; + player->curPos.x = playerState->goalPos.x; + player->curPos.z = playerState->goalPos.z; evt_set_variable(script, script->functionTemp[1], 0); return ApiStatus_DONE2; } @@ -1516,10 +1516,10 @@ ApiStatus PlayerDamageEnemy(Evt* script, s32 isInitialCall) { Actor* target; HitResult hitResult; - battleStatus->currentAttackElement = *args++; - battleStatus->currentAttackEventSuppression = *args++; - battleStatus->currentAttackStatus = *args++; - battleStatus->currentAttackDamage = evt_get_variable(script, *args++); + battleStatus->curAttackElement = *args++; + battleStatus->curAttackEventSuppression = *args++; + battleStatus->curAttackStatus = *args++; + battleStatus->curAttackDamage = evt_get_variable(script, *args++); battleStatus->powerBounceCounter = 0; flags = *args++; @@ -1559,13 +1559,13 @@ ApiStatus PlayerDamageEnemy(Evt* script, s32 isInitialCall) { } target = get_actor(script->owner1.actorID); - battleStatus->currentTargetID = target->targetActorID; - battleStatus->currentTargetPart = target->targetPartIndex; - battleStatus->statusChance = battleStatus->currentAttackStatus; + battleStatus->curTargetID = target->targetActorID; + battleStatus->curTargetPart = target->targetPartIndex; + battleStatus->statusChance = battleStatus->curAttackStatus; if (battleStatus->statusChance == STATUS_KEY_NEVER) { battleStatus->statusChance = 0; } - battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8; + battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8; hitResult = calc_player_damage_enemy(); if (hitResult < 0) { @@ -1588,10 +1588,10 @@ ApiStatus PlayerPowerBounceEnemy(Evt* script, s32 isInitialCall) { Actor* target; HitResult hitResult; - battleStatus->currentAttackElement = *args++; - battleStatus->currentAttackEventSuppression = *args++; - battleStatus->currentAttackStatus = *args++; - battleStatus->currentAttackDamage = evt_get_variable(script, *args++); + battleStatus->curAttackElement = *args++; + battleStatus->curAttackEventSuppression = *args++; + battleStatus->curAttackStatus = *args++; + battleStatus->curAttackDamage = evt_get_variable(script, *args++); battleStatus->powerBounceCounter = evt_get_variable(script, *args++); flags = *args++; @@ -1630,13 +1630,13 @@ ApiStatus PlayerPowerBounceEnemy(Evt* script, s32 isInitialCall) { } target = get_actor(script->owner1.actorID); - battleStatus->currentTargetID = target->targetActorID; - battleStatus->currentTargetPart = target->targetPartIndex; - battleStatus->statusChance = battleStatus->currentAttackStatus; + battleStatus->curTargetID = target->targetActorID; + battleStatus->curTargetPart = target->targetPartIndex; + battleStatus->statusChance = battleStatus->curAttackStatus; if (battleStatus->statusChance == STATUS_KEY_NEVER) { battleStatus->statusChance = 0; } - battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8; + battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8; hitResult = calc_player_damage_enemy(); if (hitResult < 0) { @@ -1659,10 +1659,10 @@ ApiStatus PlayerTestEnemy(Evt* script, s32 isInitialCall) { Actor* target; HitResult hitResult; - battleStatus->currentAttackElement = *args++; - battleStatus->currentAttackEventSuppression = *args++; - battleStatus->currentAttackStatus = *args++; - battleStatus->currentAttackDamage = evt_get_variable(script, *args++); + battleStatus->curAttackElement = *args++; + battleStatus->curAttackEventSuppression = *args++; + battleStatus->curAttackStatus = *args++; + battleStatus->curAttackDamage = evt_get_variable(script, *args++); battleStatus->powerBounceCounter = 0; flags = *args++; @@ -1701,13 +1701,13 @@ ApiStatus PlayerTestEnemy(Evt* script, s32 isInitialCall) { } target = get_actor(script->owner1.actorID); - battleStatus->currentTargetID = target->targetActorID; - battleStatus->currentTargetPart = target->targetPartIndex; - battleStatus->statusChance = battleStatus->currentAttackStatus; + battleStatus->curTargetID = target->targetActorID; + battleStatus->curTargetPart = target->targetPartIndex; + battleStatus->statusChance = battleStatus->curAttackStatus; if (battleStatus->statusChance == STATUS_KEY_NEVER) { battleStatus->statusChance = 0; } - battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8; + battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8; hitResult = calc_player_test_enemy(); if (hitResult < 0) { @@ -1781,36 +1781,36 @@ ApiStatus func_80274A18(Evt* script, s32 isInitialCall) { } if (script->functionTemp[0] == 0) { - playerState->currentPos.x = player->currentPos.x; - playerState->currentPos.y = player->currentPos.y; - playerState->currentPos.z = player->currentPos.z; + playerState->curPos.x = player->curPos.x; + playerState->curPos.y = player->curPos.y; + playerState->curPos.z = player->curPos.z; goalX = playerState->goalPos.x; goalZ = playerState->goalPos.z; - posX = playerState->currentPos.x; - posY = playerState->currentPos.y; - posZ = playerState->currentPos.z; + posX = playerState->curPos.x; + posY = playerState->curPos.y; + posZ = playerState->curPos.z; playerState->angle = atan2(posX, posZ, goalX, goalZ); - playerState->distance = dist2D(posX, posZ, goalX, goalZ); + playerState->dist = dist2D(posX, posZ, goalX, goalZ); if (playerState->moveTime == 0) { - playerState->moveTime = playerState->distance / playerState->speed; - temp = playerState->distance - (playerState->moveTime * playerState->speed); + playerState->moveTime = playerState->dist / playerState->speed; + temp = playerState->dist - (playerState->moveTime * playerState->speed); } else { - playerState->speed = playerState->distance / playerState->moveTime; - temp = playerState->distance - (playerState->moveTime * playerState->speed); + playerState->speed = playerState->dist / playerState->moveTime; + temp = playerState->dist - (playerState->moveTime * playerState->speed); } if (playerState->moveTime == 0) { return ApiStatus_DONE2; } - playerState->unk_30.x = (playerState->goalPos.x - playerState->currentPos.x) / playerState->moveTime; - playerState->unk_30.y = (playerState->goalPos.y - playerState->currentPos.y) / playerState->moveTime; - playerState->unk_30.z = (playerState->goalPos.z - playerState->currentPos.z) / playerState->moveTime; + playerState->unk_30.x = (playerState->goalPos.x - playerState->curPos.x) / playerState->moveTime; + playerState->unk_30.y = (playerState->goalPos.y - playerState->curPos.y) / playerState->moveTime; + playerState->unk_30.z = (playerState->goalPos.z - playerState->curPos.z) / playerState->moveTime; playerState->acceleration = PI_S / playerState->moveTime; - playerState->velocity = 0.0f; + playerState->vel = 0.0f; playerState->speed += temp / playerState->moveTime; if (playerState->moveArcAmplitude < 3) { - temp = playerState->distance; + temp = playerState->dist; temp -= 20.0; temp /= 6.0; temp += 47.0; @@ -1822,11 +1822,11 @@ ApiStatus func_80274A18(Evt* script, s32 isInitialCall) { } playerState->unk_18.x = 0.0f; playerState->unk_18.y = 0.0f; - vel1 = playerState->velocity; + vel1 = playerState->vel; acc1 = playerState->acceleration; - playerState->velocity = vel1 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * acc1) + acc1); + playerState->vel = vel1 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * acc1) + acc1); } else { - temp = playerState->distance; + temp = playerState->dist; temp -= 20.0; temp /= 6.0; temp += 47.0; @@ -1838,47 +1838,47 @@ ApiStatus func_80274A18(Evt* script, s32 isInitialCall) { } playerState->unk_18.x = 0.0f; playerState->unk_18.y = 0.0f; - vel2 = playerState->velocity; + vel2 = playerState->vel; acc2 = playerState->acceleration; - playerState->velocity = vel2 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.8 * acc2) + acc2); + playerState->vel = vel2 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.8 * acc2) + acc2); } set_animation(0, 0, playerState->animJumpRise); - sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); script->functionTemp[0] = 1; } switch (script->functionTemp[0]) { case 1: - if (playerState->velocity > PI_S / 2) { + if (playerState->vel > PI_S / 2) { set_animation(ACTOR_PLAYER, 0, playerState->animJumpFall); } - playerState->currentPos.x += playerState->unk_30.x; - playerState->currentPos.y += playerState->unk_30.y; - playerState->currentPos.z += playerState->unk_30.z; - playerState->unk_18.x = player->currentPos.y; - player->currentPos.x = playerState->currentPos.x; - player->currentPos.y = playerState->currentPos.y + (playerState->bounceDivisor * sin_rad(playerState->velocity)); - player->currentPos.z = playerState->currentPos.z; - if (playerState->goalPos.y > player->currentPos.y && playerState->moveTime < 3) { - player->currentPos.y = playerState->goalPos.y; + playerState->curPos.x += playerState->unk_30.x; + playerState->curPos.y += playerState->unk_30.y; + playerState->curPos.z += playerState->unk_30.z; + playerState->unk_18.x = player->curPos.y; + player->curPos.x = playerState->curPos.x; + player->curPos.y = playerState->curPos.y + (playerState->bounceDivisor * sin_rad(playerState->vel)); + player->curPos.z = playerState->curPos.z; + if (playerState->goalPos.y > player->curPos.y && playerState->moveTime < 3) { + player->curPos.y = playerState->goalPos.y; } - playerState->unk_18.y = player->currentPos.y; + playerState->unk_18.y = player->curPos.y; if (playerState->moveArcAmplitude < 3) { - vel3 = playerState->velocity; + vel3 = playerState->vel; acc3 = playerState->acceleration; - playerState->velocity = vel3 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * acc3) + acc3); + playerState->vel = vel3 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * acc3) + acc3); } else { - vel4 = playerState->velocity; + vel4 = playerState->vel; acc4 = playerState->acceleration; - playerState->velocity = vel4 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.8 * acc4) + acc4); + playerState->vel = vel4 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.8 * acc4) + acc4); } playerState->unk_24 += playerState->unk_28; playerState->unk_24 = clamp_angle(playerState->unk_24); playerState->moveTime--; if (playerState->moveTime == 0) { - player->currentPos.y = playerState->goalPos.y; + player->curPos.y = playerState->goalPos.y; playerState->acceleration = 1.8f; - playerState->velocity = -(playerState->unk_18.x - playerState->unk_18.y); + playerState->vel = -(playerState->unk_18.x - playerState->unk_18.y); set_animation(ACTOR_PLAYER, 0, playerState->animJumpLand); return ApiStatus_DONE1; } @@ -1890,23 +1890,23 @@ ApiStatus func_80274A18(Evt* script, s32 isInitialCall) { playerState->moveTime = 1; playerState->acceleration = 1.8f; playerState->unk_24 = 90.0f; - playerState->velocity = -(playerState->unk_18.x - playerState->unk_18.y); + playerState->vel = -(playerState->unk_18.x - playerState->unk_18.y); playerState->bounceDivisor = fabsf(playerState->unk_18.x - playerState->unk_18.y) / 16.5; playerState->unk_28 = 360 / playerState->moveTime; - playerState->currentPos.x = player->currentPos.x; - playerState->currentPos.y = player->currentPos.y; - playerState->currentPos.z = player->currentPos.z; + playerState->curPos.x = player->curPos.x; + playerState->curPos.y = player->curPos.y; + playerState->curPos.z = player->curPos.z; script->functionTemp[0] = 3; // fallthrough case 3: - temp_f20_2 = playerState->currentPos.x; - playerState->currentPos.x = temp_f20_2 + ((playerState->bounceDivisor * sin_rad(DEG_TO_RAD(playerState->unk_24))) / 33.0); - playerState->currentPos.y -= (playerState->bounceDivisor * sin_rad(DEG_TO_RAD(playerState->unk_24))); + temp_f20_2 = playerState->curPos.x; + playerState->curPos.x = temp_f20_2 + ((playerState->bounceDivisor * sin_rad(DEG_TO_RAD(playerState->unk_24))) / 33.0); + playerState->curPos.y -= (playerState->bounceDivisor * sin_rad(DEG_TO_RAD(playerState->unk_24))); playerState->unk_24 += playerState->unk_28; playerState->unk_24 = clamp_angle(playerState->unk_24); - player->currentPos.x = playerState->currentPos.x; - player->currentPos.y = playerState->currentPos.y; - player->currentPos.z = playerState->currentPos.z; + player->curPos.x = playerState->curPos.x; + player->curPos.y = playerState->curPos.y; + player->curPos.z = playerState->curPos.z; if (gBattleStatus.flags1 & BS_FLAGS1_2000) { return ApiStatus_DONE2; } @@ -1954,37 +1954,37 @@ ApiStatus func_802752AC(Evt* script, s32 isInitialCall) { switch (script->functionTemp[0]) { case 0: - playerState->currentPos.x = player->currentPos.x; - playerState->currentPos.y = player->currentPos.y; - playerState->currentPos.z = player->currentPos.z; + playerState->curPos.x = player->curPos.x; + playerState->curPos.y = player->curPos.y; + playerState->curPos.z = player->curPos.z; goalX = playerState->goalPos.x; goalZ = playerState->goalPos.z; - posX = playerState->currentPos.x; - posY = playerState->currentPos.y; - posZ = playerState->currentPos.z; + posX = playerState->curPos.x; + posY = playerState->curPos.y; + posZ = playerState->curPos.z; playerState->angle = atan2(posX, posZ, goalX, goalZ); - playerState->distance = dist2D(posX, posZ, goalX, goalZ); + playerState->dist = dist2D(posX, posZ, goalX, goalZ); if (playerState->moveTime == 0) { - playerState->moveTime = playerState->distance / playerState->speed; - temp = playerState->distance - (playerState->moveTime * playerState->speed); + playerState->moveTime = playerState->dist / playerState->speed; + temp = playerState->dist - (playerState->moveTime * playerState->speed); } else { - playerState->speed = playerState->distance / playerState->moveTime; - temp = playerState->distance - (playerState->moveTime * playerState->speed); + playerState->speed = playerState->dist / playerState->moveTime; + temp = playerState->dist - (playerState->moveTime * playerState->speed); } if (playerState->moveTime == 0) { return ApiStatus_DONE2; } - playerState->unk_30.x = (playerState->goalPos.x - playerState->currentPos.x) / playerState->moveTime; - playerState->unk_30.y = (playerState->goalPos.y - playerState->currentPos.y) / playerState->moveTime; - playerState->unk_30.z = (playerState->goalPos.z - playerState->currentPos.z) / playerState->moveTime; + playerState->unk_30.x = (playerState->goalPos.x - playerState->curPos.x) / playerState->moveTime; + playerState->unk_30.y = (playerState->goalPos.y - playerState->curPos.y) / playerState->moveTime; + playerState->unk_30.z = (playerState->goalPos.z - playerState->curPos.z) / playerState->moveTime; playerState->acceleration = (PI_S / 2) / playerState->moveTime; - playerState->velocity = 0.0f; + playerState->vel = 0.0f; playerState->speed += temp / playerState->moveTime; set_animation(ACTOR_PLAYER, 0, playerState->animJumpRise); - sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); playerState->unk_24 = 90.0f; playerState->bounceDivisor = 45.0f; playerState->unk_28 = 360 / playerState->moveTime; @@ -1994,42 +1994,42 @@ ApiStatus func_802752AC(Evt* script, s32 isInitialCall) { playerState->unk_18.x = 0.0f; playerState->unk_18.y = 0.0f; if (playerState->moveArcAmplitude == 0) { - vel1 = playerState->velocity; + vel1 = playerState->vel; acc1 = playerState->acceleration; - playerState->velocity = (vel1 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * acc1) + acc1)); + playerState->vel = (vel1 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * acc1) + acc1)); } else { - vel2 = playerState->velocity; + vel2 = playerState->vel; acc2 = playerState->acceleration; - playerState->velocity = (vel2 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.01 * acc2) + acc2)); + playerState->vel = (vel2 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.01 * acc2) + acc2)); } script->functionTemp[0] = 1; break; case 10: - playerState->currentPos.x = player->currentPos.x; - playerState->currentPos.y = player->currentPos.y; - playerState->currentPos.z = player->currentPos.z; + playerState->curPos.x = player->curPos.x; + playerState->curPos.y = player->curPos.y; + playerState->curPos.z = player->curPos.z; goalX = playerState->goalPos.x; goalZ = playerState->goalPos.z; - posX = playerState->currentPos.x; - posY = playerState->currentPos.y; - posZ = playerState->currentPos.z; + posX = playerState->curPos.x; + posY = playerState->curPos.y; + posZ = playerState->curPos.z; playerState->angle = atan2(posX, posZ, goalX, goalZ); - playerState->distance = dist2D(posX, posZ, goalX, goalZ); + playerState->dist = dist2D(posX, posZ, goalX, goalZ); if (playerState->moveTime == 0) { - playerState->moveTime = playerState->distance / playerState->speed; - temp = playerState->distance - (playerState->moveTime * playerState->speed); + playerState->moveTime = playerState->dist / playerState->speed; + temp = playerState->dist - (playerState->moveTime * playerState->speed); } else { - playerState->speed = playerState->distance / playerState->moveTime; - temp = playerState->distance - (playerState->moveTime * playerState->speed); + playerState->speed = playerState->dist / playerState->moveTime; + temp = playerState->dist - (playerState->moveTime * playerState->speed); } if (playerState->moveTime == 0) { return ApiStatus_DONE2; } - playerState->unk_30.x = (playerState->goalPos.x - playerState->currentPos.x) / playerState->moveTime; - playerState->unk_30.y = (playerState->goalPos.y - playerState->currentPos.y) / playerState->moveTime; - playerState->unk_30.z = (playerState->goalPos.z - playerState->currentPos.z) / playerState->moveTime; - playerState->velocity = (PI_S / 2); + playerState->unk_30.x = (playerState->goalPos.x - playerState->curPos.x) / playerState->moveTime; + playerState->unk_30.y = (playerState->goalPos.y - playerState->curPos.y) / playerState->moveTime; + playerState->unk_30.z = (playerState->goalPos.z - playerState->curPos.z) / playerState->moveTime; + playerState->vel = (PI_S / 2); playerState->acceleration = (PI_S / 4) / (playerState->moveTime + 1); playerState->speed += temp / playerState->moveTime; set_animation(ACTOR_PLAYER, 0, playerState->animJumpLand); @@ -2042,15 +2042,15 @@ ApiStatus func_802752AC(Evt* script, s32 isInitialCall) { playerState->unk_18.x = 0.0f; playerState->unk_18.y = 0.0f; if (playerState->moveArcAmplitude == 1) { - vel3 = playerState->velocity; + vel3 = playerState->vel; acc3 = playerState->acceleration; - playerState->velocity = (vel3 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * acc3) + acc3)); + playerState->vel = (vel3 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * acc3) + acc3)); } else { - vel4 = playerState->velocity; + vel4 = playerState->vel; acc4 = playerState->acceleration; - playerState->velocity = (vel4 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.01 * acc4) + acc4)); + playerState->vel = (vel4 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.01 * acc4) + acc4)); } - playerState->currentPos.y = player->currentPos.y - playerState->bounceDivisor; + playerState->curPos.y = player->curPos.y - playerState->bounceDivisor; script->functionTemp[0] = 11; break; case 20: @@ -2058,9 +2058,9 @@ ApiStatus func_802752AC(Evt* script, s32 isInitialCall) { playerState->unk_24 = 90.0f; playerState->bounceDivisor = (fabsf(playerState->unk_18.x - playerState->unk_18.y) / 16.5); playerState->unk_28 = (360 / playerState->moveTime); - playerState->currentPos.x = player->currentPos.x; - playerState->currentPos.y = player->currentPos.y; - playerState->currentPos.z = player->currentPos.z; + playerState->curPos.x = player->curPos.x; + playerState->curPos.y = player->curPos.y; + playerState->curPos.z = player->curPos.z; script->functionTemp[0] = 21; break; } @@ -2068,87 +2068,87 @@ ApiStatus func_802752AC(Evt* script, s32 isInitialCall) { switch (script->functionTemp[0]) { case 1: if (playerState->moveArcAmplitude == 0) { - vel5 = playerState->velocity; + vel5 = playerState->vel; acc5 = playerState->acceleration; - playerState->velocity = (vel5 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * acc5) + acc5)); + playerState->vel = (vel5 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * acc5) + acc5)); } else { - vel6 = playerState->velocity; + vel6 = playerState->vel; acc6 = playerState->acceleration; - playerState->velocity = (vel6 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.01 * acc6) + acc6)); + playerState->vel = (vel6 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.01 * acc6) + acc6)); } - playerState->currentPos.x += playerState->unk_30.x; - playerState->currentPos.y += playerState->unk_30.y; - playerState->currentPos.z += playerState->unk_30.z; - playerState->unk_18.x = player->currentPos.y; - player->currentPos.x = playerState->currentPos.x; - player->currentPos.y = playerState->currentPos.y + (playerState->bounceDivisor * sin_rad(sin_rad(sin_rad(playerState->velocity) * (PI_S / 2)) * (PI_S / 2))); - player->currentPos.z = playerState->currentPos.z; - playerState->unk_18.y = player->currentPos.y; + playerState->curPos.x += playerState->unk_30.x; + playerState->curPos.y += playerState->unk_30.y; + playerState->curPos.z += playerState->unk_30.z; + playerState->unk_18.x = player->curPos.y; + player->curPos.x = playerState->curPos.x; + player->curPos.y = playerState->curPos.y + (playerState->bounceDivisor * sin_rad(sin_rad(sin_rad(playerState->vel) * (PI_S / 2)) * (PI_S / 2))); + player->curPos.z = playerState->curPos.z; + playerState->unk_18.y = player->curPos.y; playerState->unk_24 += playerState->unk_28; playerState->unk_24 = clamp_angle(playerState->unk_24); playerState->moveTime--; if (playerState->moveTime == 0) { - sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); set_animation(ACTOR_PLAYER, 0, playerState->animJumpFall); - player->rotationPivotOffset.y = 14; - player->rotation.z -= 66.0f; + player->rotPivotOffset.y = 14; + player->rot.z -= 66.0f; playerState->moveTime = 7; script->functionTemp[0] = 2; } break; case 2: - player->rotationPivotOffset.y = 14; - player->rotation.z -= 66.0f; + player->rotPivotOffset.y = 14; + player->rot.z -= 66.0f; playerState->moveTime--; if (playerState->moveTime == 0) { - player->rotation.z = 0.0f; - player->rotationPivotOffset.y = 0; + player->rot.z = 0.0f; + player->rotPivotOffset.y = 0; set_animation(ACTOR_PLAYER, 0, playerState->animJumpLand); return ApiStatus_DONE1; } break; case 11: - playerState->currentPos.x += playerState->unk_30.x; - playerState->currentPos.y += playerState->unk_30.y; - playerState->currentPos.z += playerState->unk_30.z; - playerState->unk_18.x = player->currentPos.y; - player->currentPos.x = playerState->currentPos.x; - player->currentPos.y = playerState->currentPos.y + (playerState->bounceDivisor * sin_rad(playerState->velocity)); - player->currentPos.z = playerState->currentPos.z; - if (playerState->goalPos.y > player->currentPos.y) { - player->currentPos.y = playerState->goalPos.y; + playerState->curPos.x += playerState->unk_30.x; + playerState->curPos.y += playerState->unk_30.y; + playerState->curPos.z += playerState->unk_30.z; + playerState->unk_18.x = player->curPos.y; + player->curPos.x = playerState->curPos.x; + player->curPos.y = playerState->curPos.y + (playerState->bounceDivisor * sin_rad(playerState->vel)); + player->curPos.z = playerState->curPos.z; + if (playerState->goalPos.y > player->curPos.y) { + player->curPos.y = playerState->goalPos.y; } - playerState->unk_18.y = player->currentPos.y; + playerState->unk_18.y = player->curPos.y; if (playerState->moveArcAmplitude == 1) { - vel7 = playerState->velocity; + vel7 = playerState->vel; acc7 = playerState->acceleration; - playerState->velocity = (vel7 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * acc7) + acc7)); + playerState->vel = (vel7 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * acc7) + acc7)); } else { - vel8 = playerState->velocity; + vel8 = playerState->vel; acc8 = playerState->acceleration; - playerState->velocity = (vel8 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.01 * acc8) + acc8)); + playerState->vel = (vel8 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.01 * acc8) + acc8)); } playerState->unk_24 += playerState->unk_28; playerState->unk_24 = clamp_angle(playerState->unk_24); playerState->moveTime--; if (playerState->moveTime == 0) { - player->currentPos.y = playerState->goalPos.y; + player->curPos.y = playerState->goalPos.y; set_animation(ACTOR_PLAYER, 0, 0x1000C); return ApiStatus_DONE1; } break; case 21: - temp_f20 = playerState->currentPos.x; + temp_f20 = playerState->curPos.x; temp_f20 += (playerState->bounceDivisor * sin_rad(DEG_TO_RAD(playerState->unk_24))) / 33.0; - playerState->currentPos.x = temp_f20; - playerState->currentPos.y -= playerState->bounceDivisor * sin_rad(DEG_TO_RAD(playerState->unk_24)); + playerState->curPos.x = temp_f20; + playerState->curPos.y -= playerState->bounceDivisor * sin_rad(DEG_TO_RAD(playerState->unk_24)); playerState->unk_24 += playerState->unk_28; playerState->unk_24 = clamp_angle(playerState->unk_24); - player->currentPos.x = playerState->currentPos.x; - player->currentPos.y = playerState->currentPos.y; - player->currentPos.z = playerState->currentPos.z; + player->curPos.x = playerState->curPos.x; + player->curPos.y = playerState->curPos.y; + player->curPos.z = playerState->curPos.z; if (gBattleStatus.flags1 & BS_FLAGS1_2000) { return ApiStatus_DONE2; } @@ -2204,130 +2204,130 @@ ApiStatus func_80275F00(Evt* script, s32 isInitialCall) { switch (script->functionTemp[0]) { case 0: - playerState->currentPos.x = player->currentPos.x; - playerState->currentPos.y = player->currentPos.y; - playerState->currentPos.z = player->currentPos.z; + playerState->curPos.x = player->curPos.x; + playerState->curPos.y = player->curPos.y; + playerState->curPos.z = player->curPos.z; goalX = playerState->goalPos.x; goalZ = playerState->goalPos.z; - posX = playerState->currentPos.x; - posY = playerState->currentPos.y; - posZ = playerState->currentPos.z; + posX = playerState->curPos.x; + posY = playerState->curPos.y; + posZ = playerState->curPos.z; playerState->angle = atan2(posX, posZ, goalX, goalZ); - playerState->distance = dist2D(posX, posZ, goalX, goalZ); + playerState->dist = dist2D(posX, posZ, goalX, goalZ); if (playerState->moveTime == 0) { - playerState->moveTime = playerState->distance / playerState->speed; - temp = playerState->distance - (playerState->moveTime * playerState->speed); + playerState->moveTime = playerState->dist / playerState->speed; + temp = playerState->dist - (playerState->moveTime * playerState->speed); } else { - playerState->speed = playerState->distance / playerState->moveTime; - temp = playerState->distance - (playerState->moveTime * playerState->speed); + playerState->speed = playerState->dist / playerState->moveTime; + temp = playerState->dist - (playerState->moveTime * playerState->speed); } playerState->acceleration = PI_S / playerState->moveTime; - playerState->velocity = 0.0f; - playerState->unk_30.x = (playerState->goalPos.x - playerState->currentPos.x) / playerState->moveTime; - playerState->unk_30.y = (playerState->goalPos.y - playerState->currentPos.y) / playerState->moveTime; - playerState->unk_30.z = (playerState->goalPos.z - playerState->currentPos.z) / playerState->moveTime; + playerState->vel = 0.0f; + playerState->unk_30.x = (playerState->goalPos.x - playerState->curPos.x) / playerState->moveTime; + playerState->unk_30.y = (playerState->goalPos.y - playerState->curPos.y) / playerState->moveTime; + playerState->unk_30.z = (playerState->goalPos.z - playerState->curPos.z) / playerState->moveTime; playerState->speed += temp / playerState->moveTime; set_animation(ACTOR_PLAYER, 0, playerState->animJumpFall); - sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); - sfx_play_sound_at_position(SOUND_TORNADO_JUMP, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); + sfx_play_sound_at_position(SOUND_TORNADO_JUMP, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); playerState->unk_18.x = 0.0f; playerState->unk_18.y = 0.0f; playerState->unk_24 = 90.0f; - temp = playerState->distance; + temp = playerState->dist; temp -= 20.0; temp /= 6.0; temp += 47.0; playerState->bounceDivisor = temp; - temp_f20 = playerState->velocity; + temp_f20 = playerState->vel; temp_f22 = playerState->acceleration; playerState->unk_28 = 360 / playerState->moveTime; - playerState->velocity = temp_f20 + (((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53) * temp_f22) + temp_f22); + playerState->vel = temp_f20 + (((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53) * temp_f22) + temp_f22); script->functionTemp[0] = 1; break; case 10: - playerState->currentPos.x = player->currentPos.x; - playerState->currentPos.y = player->currentPos.y; - playerState->currentPos.z = player->currentPos.z; + playerState->curPos.x = player->curPos.x; + playerState->curPos.y = player->curPos.y; + playerState->curPos.z = player->curPos.z; goalX = playerState->goalPos.x; goalZ = playerState->goalPos.z; - posX = playerState->currentPos.x; - posY = playerState->currentPos.y; - posZ = playerState->currentPos.z; + posX = playerState->curPos.x; + posY = playerState->curPos.y; + posZ = playerState->curPos.z; playerState->angle = atan2(posX, posZ, goalX, goalZ); - playerState->distance = dist2D(posX, posZ, goalX, goalZ); + playerState->dist = dist2D(posX, posZ, goalX, goalZ); if (playerState->moveTime == 0) { - playerState->moveTime = playerState->distance / playerState->speed; - temp = playerState->distance - (playerState->moveTime * playerState->speed); + playerState->moveTime = playerState->dist / playerState->speed; + temp = playerState->dist - (playerState->moveTime * playerState->speed); } else { - speed = playerState->distance / playerState->moveTime; + speed = playerState->dist / playerState->moveTime; playerState->speed = speed; - temp = playerState->distance - (playerState->moveTime * speed); + temp = playerState->dist - (playerState->moveTime * speed); } playerState->acceleration = PI_S / playerState->moveTime; - playerState->velocity = 0.0f; - playerState->unk_30.x = (playerState->goalPos.x - playerState->currentPos.x) / playerState->moveTime; - playerState->unk_30.y = (playerState->goalPos.y - playerState->currentPos.y) / playerState->moveTime; - playerState->unk_30.z = (playerState->goalPos.z - playerState->currentPos.z) / playerState->moveTime; + playerState->vel = 0.0f; + playerState->unk_30.x = (playerState->goalPos.x - playerState->curPos.x) / playerState->moveTime; + playerState->unk_30.y = (playerState->goalPos.y - playerState->curPos.y) / playerState->moveTime; + playerState->unk_30.z = (playerState->goalPos.z - playerState->curPos.z) / playerState->moveTime; playerState->speed += temp / playerState->moveTime; set_animation(ACTOR_PLAYER, 0, playerState->animJumpRise); - sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); - sfx_play_sound_at_position(SOUND_TORNADO_JUMP, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); + sfx_play_sound_at_position(SOUND_TORNADO_JUMP, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); playerState->unk_18.x = 0.0f; playerState->unk_18.y = 0.0f; playerState->unk_24 = 90.0f; - temp_f20_2 = playerState->velocity; + temp_f20_2 = playerState->vel; temp_f22_2 = playerState->acceleration; - temp = playerState->distance; + temp = playerState->dist; temp -= 20.0; temp /= 6.0; temp += 47.0; playerState->bounceDivisor = temp; playerState->unk_28 = 360 / playerState->moveTime; - playerState->velocity = temp_f20_2 + (((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53) * temp_f22_2) + temp_f22_2); + playerState->vel = temp_f20_2 + (((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53) * temp_f22_2) + temp_f22_2); script->functionTemp[0] = 11; break; case 20: playerState->moveTime = 1; set_animation(ACTOR_PLAYER, 1, 0x1000C); - player->rotation.y = 0.0f; + player->rot.y = 0.0f; playerState->unk_24 = 90.0f; playerState->bounceDivisor = fabsf(playerState->unk_18.x - playerState->unk_18.y) / 16.5; playerState->unk_28 = 360 / playerState->moveTime; - playerState->currentPos.x = player->currentPos.x; - playerState->currentPos.y = player->currentPos.y; - playerState->currentPos.z = player->currentPos.z; + playerState->curPos.x = player->curPos.x; + playerState->curPos.y = player->curPos.y; + playerState->curPos.z = player->curPos.z; script->functionTemp[0] = 21; break; case 30: - playerState->currentPos.x = player->currentPos.x; - playerState->currentPos.y = player->currentPos.y; - playerState->currentPos.z = player->currentPos.z; + playerState->curPos.x = player->curPos.x; + playerState->curPos.y = player->curPos.y; + playerState->curPos.z = player->curPos.z; goalX = playerState->goalPos.x; goalZ = playerState->goalPos.z; - posX = playerState->currentPos.x; - posY = playerState->currentPos.y; - posZ = playerState->currentPos.z; + posX = playerState->curPos.x; + posY = playerState->curPos.y; + posZ = playerState->curPos.z; playerState->angle = atan2(posX, posZ, goalX, goalZ); - playerState->distance = dist2D(posX, posZ, goalX, goalZ); + playerState->dist = dist2D(posX, posZ, goalX, goalZ); if (playerState->moveTime == 0) { - playerState->moveTime = playerState->distance / playerState->speed; - temp = playerState->distance - (playerState->moveTime * playerState->speed); + playerState->moveTime = playerState->dist / playerState->speed; + temp = playerState->dist - (playerState->moveTime * playerState->speed); } else { - playerState->speed = playerState->distance / playerState->moveTime; - temp = playerState->distance - (playerState->moveTime * playerState->speed); + playerState->speed = playerState->dist / playerState->moveTime; + temp = playerState->dist - (playerState->moveTime * playerState->speed); } playerState->acceleration = PI_S / (playerState->moveTime + 1); - playerState->velocity = 0.0f; - playerState->unk_30.x = (playerState->goalPos.x - playerState->currentPos.x) / playerState->moveTime; - playerState->unk_30.y = (playerState->goalPos.y - playerState->currentPos.y) / playerState->moveTime; - playerState->unk_30.z = (playerState->goalPos.z - playerState->currentPos.z) / playerState->moveTime; + playerState->vel = 0.0f; + playerState->unk_30.x = (playerState->goalPos.x - playerState->curPos.x) / playerState->moveTime; + playerState->unk_30.y = (playerState->goalPos.y - playerState->curPos.y) / playerState->moveTime; + playerState->unk_30.z = (playerState->goalPos.z - playerState->curPos.z) / playerState->moveTime; playerState->speed += temp / playerState->moveTime; set_animation(ACTOR_PLAYER, 0, playerState->animJumpRise); - sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->currentPos.x, player->currentPos.y, player->currentPos.z); + sfx_play_sound_at_position(SOUND_160, SOUND_SPACE_MODE_0, player->curPos.x, player->curPos.y, player->curPos.z); playerState->unk_24 = 90.0f; playerState->bounceDivisor = 45.0f; playerState->unk_28 = 360 / playerState->moveTime; @@ -2337,30 +2337,30 @@ ApiStatus func_80275F00(Evt* script, s32 isInitialCall) { playerState->unk_18.x = 0.0f; playerState->unk_18.y = 0.0f; temp_f22_3 = playerState->acceleration; - temp_f22_7 = playerState->velocity; + temp_f22_7 = playerState->vel; temp_f22_7 = temp_f22_7 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * temp_f22_3) + temp_f22_3); - playerState->velocity = temp_f22_7; + playerState->vel = temp_f22_7; script->functionTemp[0] = 31; break; } switch (script->functionTemp[0]) { case 1: - temp_f22_4 = playerState->velocity; + temp_f22_4 = playerState->vel; temp_f20_4 = playerState->acceleration; - playerState->velocity = temp_f22_4 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * temp_f20_4) + temp_f20_4); - playerState->currentPos.x += playerState->unk_30.x; - playerState->currentPos.y += playerState->unk_30.y; - playerState->currentPos.z += playerState->unk_30.z; - playerState->unk_18.x = player->currentPos.y; - player->currentPos.x = playerState->currentPos.x; - player->currentPos.y = playerState->currentPos.y + (playerState->bounceDivisor * sin_rad(playerState->velocity)); - player->currentPos.z = playerState->currentPos.z; - playerState->unk_18.y = player->currentPos.y; + playerState->vel = temp_f22_4 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * temp_f20_4) + temp_f20_4); + playerState->curPos.x += playerState->unk_30.x; + playerState->curPos.y += playerState->unk_30.y; + playerState->curPos.z += playerState->unk_30.z; + playerState->unk_18.x = player->curPos.y; + player->curPos.x = playerState->curPos.x; + player->curPos.y = playerState->curPos.y + (playerState->bounceDivisor * sin_rad(playerState->vel)); + player->curPos.z = playerState->curPos.z; + playerState->unk_18.y = player->curPos.y; playerState->unk_24 += playerState->unk_28; playerState->unk_24 = clamp_angle(playerState->unk_24); - player->rotation.y += 133.0f; - player->rotation.y = clamp_angle(player->rotation.y); + player->rot.y += 133.0f; + player->rot.y = clamp_angle(player->rot.y); if (gBattleStatus.flags1 & BS_FLAGS1_2000) { return ApiStatus_DONE2; } @@ -2370,46 +2370,46 @@ ApiStatus func_80275F00(Evt* script, s32 isInitialCall) { } break; case 11: - temp_f22_6 = playerState->velocity; + temp_f22_6 = playerState->vel; temp_f20_7 = playerState->acceleration; - playerState->velocity = temp_f22_6 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * temp_f20_7) + temp_f20_7); - playerState->currentPos.x += playerState->unk_30.x; - playerState->currentPos.y += playerState->unk_30.y; - playerState->currentPos.z += playerState->unk_30.z; - playerState->unk_18.x = player->currentPos.y; - player->currentPos.x = playerState->currentPos.x; - player->currentPos.y = playerState->currentPos.y + (playerState->bounceDivisor * sin_rad(playerState->velocity)); - player->currentPos.z = playerState->currentPos.z; - if (playerState->goalPos.y > player->currentPos.y && playerState->moveTime < 3) { - player->currentPos.y = playerState->goalPos.y; + playerState->vel = temp_f22_6 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * temp_f20_7) + temp_f20_7); + playerState->curPos.x += playerState->unk_30.x; + playerState->curPos.y += playerState->unk_30.y; + playerState->curPos.z += playerState->unk_30.z; + playerState->unk_18.x = player->curPos.y; + player->curPos.x = playerState->curPos.x; + player->curPos.y = playerState->curPos.y + (playerState->bounceDivisor * sin_rad(playerState->vel)); + player->curPos.z = playerState->curPos.z; + if (playerState->goalPos.y > player->curPos.y && playerState->moveTime < 3) { + player->curPos.y = playerState->goalPos.y; } - playerState->unk_18.y = player->currentPos.y; + playerState->unk_18.y = player->curPos.y; playerState->unk_24 += playerState->unk_28; playerState->unk_24 = clamp_angle(playerState->unk_24); set_animation(ACTOR_PLAYER, 0, playerState->animJumpFall); - player->rotation.y += 133.0f; - player->rotation.y = clamp_angle(player->rotation.y); + player->rot.y += 133.0f; + player->rot.y = clamp_angle(player->rot.y); playerState->moveTime--; if (playerState->moveTime == 0) { playerState->acceleration = 1.8f; - playerState->velocity = -(playerState->unk_18.x - playerState->unk_18.y); - player->currentPos.y = playerState->goalPos.y; - player->rotation.y = 0.0f; + playerState->vel = -(playerState->unk_18.x - playerState->unk_18.y); + player->curPos.y = playerState->goalPos.y; + player->rot.y = 0.0f; set_animation(ACTOR_PLAYER, 0, playerState->animJumpLand); - play_movement_dust_effects(2, player->currentPos.x, player->currentPos.y, player->currentPos.z, player->yaw); + play_movement_dust_effects(2, player->curPos.x, player->curPos.y, player->curPos.z, player->yaw); return ApiStatus_DONE1; } break; case 21: - temp_f20_5 = playerState->currentPos.x; + temp_f20_5 = playerState->curPos.x; temp_f20_5 += (playerState->bounceDivisor * sin_rad(DEG_TO_RAD(playerState->unk_24))) / 33.0; - playerState->currentPos.x = temp_f20_5; - playerState->currentPos.y -= playerState->bounceDivisor * sin_rad(DEG_TO_RAD(playerState->unk_24)); + playerState->curPos.x = temp_f20_5; + playerState->curPos.y -= playerState->bounceDivisor * sin_rad(DEG_TO_RAD(playerState->unk_24)); playerState->unk_24 += playerState->unk_28; playerState->unk_24 = clamp_angle(playerState->unk_24); - player->currentPos.x = playerState->currentPos.x; - player->currentPos.y = playerState->currentPos.y; - player->currentPos.z = playerState->currentPos.z; + player->curPos.x = playerState->curPos.x; + player->curPos.y = playerState->curPos.y; + player->curPos.z = playerState->curPos.z; if (gBattleStatus.flags1 & BS_FLAGS1_2000) { return ApiStatus_DONE2; } @@ -2419,32 +2419,32 @@ ApiStatus func_80275F00(Evt* script, s32 isInitialCall) { } break; case 31: - temp_f22_5 = playerState->velocity; + temp_f22_5 = playerState->vel; temp_f20_6 = playerState->acceleration; - playerState->velocity = temp_f22_5 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * temp_f20_6) + temp_f20_6); - playerState->currentPos.x += playerState->unk_30.x; - playerState->currentPos.y += playerState->unk_30.y; - playerState->currentPos.z += playerState->unk_30.z; - playerState->unk_18.x = player->currentPos.y; - player->currentPos.x = playerState->currentPos.x; - player->currentPos.y = playerState->currentPos.y + (playerState->bounceDivisor * sin_rad(playerState->velocity)); - player->currentPos.z = playerState->currentPos.z; - if (playerState->goalPos.y > player->currentPos.y && playerState->moveTime < 3) { - player->currentPos.y = playerState->goalPos.y; + playerState->vel = temp_f22_5 + ((sin_rad(DEG_TO_RAD(playerState->unk_24)) * 0.53 * temp_f20_6) + temp_f20_6); + playerState->curPos.x += playerState->unk_30.x; + playerState->curPos.y += playerState->unk_30.y; + playerState->curPos.z += playerState->unk_30.z; + playerState->unk_18.x = player->curPos.y; + player->curPos.x = playerState->curPos.x; + player->curPos.y = playerState->curPos.y + (playerState->bounceDivisor * sin_rad(playerState->vel)); + player->curPos.z = playerState->curPos.z; + if (playerState->goalPos.y > player->curPos.y && playerState->moveTime < 3) { + player->curPos.y = playerState->goalPos.y; } - playerState->unk_18.y = player->currentPos.y; + playerState->unk_18.y = player->curPos.y; playerState->unk_24 += playerState->unk_28; playerState->unk_24 = clamp_angle(playerState->unk_24); set_animation(ACTOR_PLAYER, 0, playerState->animJumpFall); - player->rotation.y += 133.0f; - player->rotation.y = clamp_angle(player->rotation.y); + player->rot.y += 133.0f; + player->rot.y = clamp_angle(player->rot.y); playerState->moveTime--; if (playerState->moveTime == 0) { - player->currentPos.y = playerState->goalPos.y; - player->rotation.y = 0.0f; + player->curPos.y = playerState->goalPos.y; + player->rot.y = 0.0f; set_animation(ACTOR_PLAYER, 0, playerState->animJumpLand); playerState->acceleration = 1.8f; - playerState->velocity = -(playerState->unk_18.x - playerState->unk_18.y); + playerState->vel = -(playerState->unk_18.x - playerState->unk_18.y); return ApiStatus_DONE1; } break; diff --git a/src/1A5830.c b/src/1A5830.c index bd34f1f547..1ace4fc994 100644 --- a/src/1A5830.c +++ b/src/1A5830.c @@ -129,16 +129,16 @@ void dispatch_event_actor(Actor* actor, s32 event) { HitResult calc_enemy_test_target(Actor* actor) { PlayerData* playerData = &gPlayerData; BattleStatus* battleStatus = &gBattleStatus; - s32 targetID = battleStatus->currentTargetID; - s32 targetPartIdx = battleStatus->currentTargetPart; + s32 targetID = battleStatus->curTargetID; + s32 targetPartIdx = battleStatus->curTargetPart; Actor* target; Actor* target2; ActorPart* targetPart; s32 actorClass; s32 hitResult; - battleStatus->currentTargetID2 = battleStatus->currentTargetID; - battleStatus->currentTargetPart2 = battleStatus->currentTargetPart; + battleStatus->curTargetID2 = battleStatus->curTargetID; + battleStatus->curTargetPart2 = battleStatus->curTargetPart; target = get_actor(targetID); if (target == NULL) { @@ -151,16 +151,16 @@ HitResult calc_enemy_test_target(Actor* actor) { actorClass = targetID & ACTOR_CLASS_MASK; switch (actorClass) { case ACTOR_CLASS_PLAYER: - target->currentHP = playerData->curHP; + target->curHP = playerData->curHP; break; case ACTOR_CLASS_PARTNER: - target->currentHP = 127; + target->curHP = 127; break; case ACTOR_CLASS_ENEMY: break; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_TRIGGER_LUCKY) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_TRIGGER_LUCKY) { dispatch_event_general(target, EVENT_LUCKY); return HIT_RESULT_HIT; } @@ -168,7 +168,7 @@ HitResult calc_enemy_test_target(Actor* actor) { hitResult = HIT_RESULT_HIT; target2 = target; if (targetPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY || battleStatus->outtaSightActive || target2->transparentStatus == STATUS_KEY_TRANSPARENT) { - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_MAGIC)) { + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_MAGIC)) { hitResult = HIT_RESULT_MISS; } } @@ -191,7 +191,7 @@ HitResult calc_enemy_test_target(Actor* actor) { break; } } - if (player_team_is_ability_active(target2, ABILITY_CLOSE_CALL) && (target2->currentHP < 6)) { + if (player_team_is_ability_active(target2, ABILITY_CLOSE_CALL) && (target2->curHP < 6)) { if (rand_int(100) < 30) { hitResult = HIT_RESULT_LUCKY; break; @@ -233,8 +233,8 @@ HitResult calc_enemy_test_target(Actor* actor) { HitResult calc_enemy_damage_target(Actor* attacker) { BattleStatus* battleStatus = &gBattleStatus; ActorState* state = &attacker->state; - s32 targetID = battleStatus->currentTargetID; - s32 targetPartIdx = battleStatus->currentTargetPart; + s32 targetID = battleStatus->curTargetID; + s32 targetPartIdx = battleStatus->curTargetPart; s32 actorClass; Actor* target; ActorPart* targetPart; @@ -257,8 +257,8 @@ HitResult calc_enemy_damage_target(Actor* attacker) { battleStatus->lastAttackDamage = 0; battleStatus->attackerActorID = attacker->actorID; - battleStatus->currentTargetID2 = targetID; - battleStatus->currentTargetPart2 = targetPartIdx; + battleStatus->curTargetID2 = targetID; + battleStatus->curTargetPart2 = targetPartIdx; target = get_actor(targetID); if (target == NULL) { @@ -273,10 +273,10 @@ HitResult calc_enemy_damage_target(Actor* attacker) { switch (actorClass) { case ACTOR_CLASS_PLAYER: - target->currentHP = gPlayerData.curHP; + target->curHP = gPlayerData.curHP; break; case ACTOR_CLASS_PARTNER: - target->currentHP = 127; + target->curHP = 127; break; case ACTOR_CLASS_ENEMY: break; @@ -290,7 +290,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { if (target->transparentStatus == STATUS_KEY_TRANSPARENT || targetPart->eventFlags & ACTOR_EVENT_FLAG_800 - && !(battleStatus->currentAttackElement & DAMAGE_TYPE_QUAKE) + && !(battleStatus->curAttackElement & DAMAGE_TYPE_QUAKE) ) { return HIT_RESULT_MISS; } @@ -305,8 +305,8 @@ HitResult calc_enemy_damage_target(Actor* attacker) { // handle attack element - if (battleStatus->currentAttackElement & DAMAGE_TYPE_BLAST) { - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) + if (battleStatus->curAttackElement & DAMAGE_TYPE_BLAST) { + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT) && (targetPart->eventFlags & ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION) ) { do { @@ -316,31 +316,31 @@ HitResult calc_enemy_damage_target(Actor* attacker) { return HIT_RESULT_BACKFIRE; } } - if ((battleStatus->currentAttackElement & DAMAGE_TYPE_QUAKE) && (target->flags & ACTOR_FLAG_FLYING)) { + if ((battleStatus->curAttackElement & DAMAGE_TYPE_QUAKE) && (target->flags & ACTOR_FLAG_FLYING)) { play_hit_sound(attacker, state->goalPos.x, state->goalPos.y, state->goalPos.z, 1); return HIT_RESULT_NO_DAMAGE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_FIRE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_FIRE) { fx_ring_blast(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f, 1.0f, 24); isFire = TRUE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_SHOCK) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_SHOCK) { apply_shock_effect(target); isElectric = TRUE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_WATER) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_WATER) { fx_water_splash(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f, 1.0f, 24); isWater = TRUE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_ICE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_ICE) { fx_big_snowflakes(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f); isIce = TRUE; } if (!(attacker->staticStatus == STATUS_KEY_STATIC) && ((target->staticStatus == STATUS_KEY_STATIC) || (targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED)) - && !(battleStatus->currentAttackElement & (DAMAGE_TYPE_SHOCK | DAMAGE_TYPE_NO_CONTACT)) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT) + && !(battleStatus->curAttackElement & (DAMAGE_TYPE_SHOCK | DAMAGE_TYPE_NO_CONTACT)) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT) && !has_enchanted_part(attacker)) // enchanted attacks ignore electrified defenders { madeElectricContact = TRUE; @@ -351,14 +351,14 @@ HitResult calc_enemy_damage_target(Actor* attacker) { gBattleStatus.flags1 &= ~BS_FLAGS1_ATK_BLOCKED; - defense = get_defense(target, targetPart->defenseTable, battleStatus->currentAttackElement); + defense = get_defense(target, targetPart->defenseTable, battleStatus->curAttackElement); - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_IGNORE_DEFENSE)) { + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_IGNORE_DEFENSE)) { defense += target->defenseBoost; if (actorClass == ACTOR_CLASS_PLAYER) { if (battleStatus->waterBlockTurnsLeft > 0) { - if ((battleStatus->currentAttackElement & (DAMAGE_TYPE_BLAST | DAMAGE_TYPE_FIRE))) { + if ((battleStatus->curAttackElement & (DAMAGE_TYPE_BLAST | DAMAGE_TYPE_FIRE))) { defense += 2; } else { defense += 1; @@ -371,7 +371,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { } } - damage = battleStatus->currentAttackDamage; + damage = battleStatus->curAttackDamage; switch (actorClass) { case ACTOR_CLASS_PLAYER: @@ -407,7 +407,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { isPlayer = actorClass == ACTOR_CLASS_PLAYER; if (isPlayer) { if (player_team_is_ability_active(target, ABILITY_FIRE_SHIELD)) { - if (battleStatus->currentAttackElement & DAMAGE_TYPE_FIRE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_FIRE) { damage--; } } @@ -416,7 +416,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { damage -= player_team_is_ability_active(target, ABILITY_P_DOWN_D_UP); damage += player_team_is_ability_active(target, ABILITY_P_UP_D_DOWN); - if (target->currentHP <= 5) { + if (target->curHP <= 5) { if (player_team_is_ability_active(target, ABILITY_LAST_STAND)) { damage /= 2; } @@ -426,7 +426,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { switch (actorClass) { case ACTOR_CLASS_PLAYER: // TODO figure out how to better write target->debuff >= STATUS_KEY_POISON - if ((target->debuff == 0 || target->debuff >= STATUS_KEY_POISON) && (target->stoneStatus == 0) && !(battleStatus->currentAttackElement & DAMAGE_TYPE_UNBLOCKABLE)) { + if ((target->debuff == 0 || target->debuff >= STATUS_KEY_POISON) && (target->stoneStatus == 0) && !(battleStatus->curAttackElement & DAMAGE_TYPE_UNBLOCKABLE)) { s32 blocked; if (player_team_is_ability_active(target, ABILITY_BERSERKER)) { @@ -448,7 +448,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { break; case ACTOR_CLASS_PARTNER: if (target->stoneStatus == 0) { - if (target->koStatus == 0 && !(battleStatus->currentAttackElement & DAMAGE_TYPE_UNBLOCKABLE)) { + if (target->koStatus == 0 && !(battleStatus->curAttackElement & DAMAGE_TYPE_UNBLOCKABLE)) { if (check_block_input(BUTTON_A)) { damage = 0; sfx_play_sound_at_position(SOUND_231, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); @@ -471,13 +471,13 @@ HitResult calc_enemy_damage_target(Actor* attacker) { event = EVENT_HIT_COMBO; if (damage < 1) { target->hpChangeCounter = 0; - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS)) { + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS)) { hitResult = HIT_RESULT_NO_DAMAGE; event = EVENT_ZERO_DAMAGE; } else { hitResult = HIT_RESULT_NO_DAMAGE; event = EVENT_ZERO_DAMAGE; - if (target->currentHP < 1) { + if (target->curHP < 1) { event = EVENT_DEATH; } } @@ -491,11 +491,11 @@ HitResult calc_enemy_damage_target(Actor* attacker) { && !(gBattleStatus.flags1 & BS_FLAGS1_TUTORIAL_BATTLE) ) { if (!(target->flags & ACTOR_FLAG_NO_DMG_APPLY)) { - target->currentHP -= damage; + target->curHP -= damage; } - if (target->currentHP < 1) { - target->currentHP = 0; + if (target->curHP < 1) { + target->curHP = 0; event = EVENT_DEATH; } } @@ -505,7 +505,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { if (actorClass == ACTOR_CLASS_PLAYER) { battleStatus->damageTaken += damage; - gPlayerData.curHP = target->currentHP; + gPlayerData.curHP = target->curHP; } } @@ -516,7 +516,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { if (event == EVENT_ZERO_DAMAGE) { event = EVENT_IMMUNE; } - if (target->currentHP < 1 && event == EVENT_IMMUNE) { + if (target->curHP < 1 && event == EVENT_IMMUNE) { event = EVENT_DEATH; } } else if (event == EVENT_DEATH) { @@ -528,7 +528,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { } if ((gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) - && (battleStatus->currentAttackElement & (DAMAGE_TYPE_POW | DAMAGE_TYPE_QUAKE | DAMAGE_TYPE_JUMP)) + && (battleStatus->curAttackElement & (DAMAGE_TYPE_POW | DAMAGE_TYPE_QUAKE | DAMAGE_TYPE_JUMP)) && (targetPart->eventFlags & ACTOR_EVENT_FLAG_FLIPABLE) ) { if (event == EVENT_HIT) { @@ -540,7 +540,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { } if (!(gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) - && (battleStatus->currentAttackElement & (DAMAGE_TYPE_POW | DAMAGE_TYPE_QUAKE | DAMAGE_TYPE_JUMP)) + && (battleStatus->curAttackElement & (DAMAGE_TYPE_POW | DAMAGE_TYPE_QUAKE | DAMAGE_TYPE_JUMP)) && (targetPart->eventFlags & ACTOR_EVENT_FLAG_FLIPABLE) ) { if (event == EVENT_HIT_COMBO) { @@ -552,7 +552,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { } if ((gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) - && (battleStatus->currentAttackElement & (DAMAGE_TYPE_FIRE | DAMAGE_TYPE_BLAST | DAMAGE_TYPE_4000)) + && (battleStatus->curAttackElement & (DAMAGE_TYPE_FIRE | DAMAGE_TYPE_BLAST | DAMAGE_TYPE_4000)) ) { if (event == EVENT_HIT) { event = EVENT_BURN_HIT; @@ -592,54 +592,54 @@ HitResult calc_enemy_damage_target(Actor* attacker) { && !(gBattleStatus.flags2 & BS_FLAGS2_1000000) && !(actorClass == ACTOR_PLAYER && is_ability_active(ABILITY_HEALTHY_HEALTHY) && (rand_int(100) < 50))) { - if (battleStatus->currentAttackStatus & STATUS_FLAG_SHRINK && try_inflict_status(target, STATUS_KEY_SHRINK, STATUS_TURN_MOD_SHRINK)) { + if (battleStatus->curAttackStatus & STATUS_FLAG_SHRINK && try_inflict_status(target, STATUS_KEY_SHRINK, STATUS_TURN_MOD_SHRINK)) { statusInflicted = one; statusInflicted2 = one; } - if (battleStatus->currentAttackStatus & STATUS_FLAG_POISON && try_inflict_status(target, STATUS_KEY_POISON, STATUS_TURN_MOD_POISON)) { + if (battleStatus->curAttackStatus & STATUS_FLAG_POISON && try_inflict_status(target, STATUS_KEY_POISON, STATUS_TURN_MOD_POISON)) { statusInflicted = one; statusInflicted2 = one; } - if (battleStatus->currentAttackStatus & STATUS_FLAG_STONE && try_inflict_status(target, STATUS_KEY_STONE, STATUS_TURN_MOD_STONE)) { + if (battleStatus->curAttackStatus & STATUS_FLAG_STONE && try_inflict_status(target, STATUS_KEY_STONE, STATUS_TURN_MOD_STONE)) { statusInflicted = one; statusInflicted2 = one; } - if (battleStatus->currentAttackStatus & STATUS_FLAG_SLEEP && try_inflict_status(target, STATUS_KEY_SLEEP, STATUS_TURN_MOD_SLEEP)) { + if (battleStatus->curAttackStatus & STATUS_FLAG_SLEEP && try_inflict_status(target, STATUS_KEY_SLEEP, STATUS_TURN_MOD_SLEEP)) { statusInflicted = one; statusInflicted2 = one; } - if (battleStatus->currentAttackStatus & STATUS_FLAG_DIZZY && try_inflict_status(target, STATUS_KEY_DIZZY, STATUS_TURN_MOD_DIZZY)) { + if (battleStatus->curAttackStatus & STATUS_FLAG_DIZZY && try_inflict_status(target, STATUS_KEY_DIZZY, STATUS_TURN_MOD_DIZZY)) { statusInflicted = one; statusInflicted2 = one; } - if (battleStatus->currentAttackStatus & STATUS_FLAG_STOP && try_inflict_status(target, STATUS_KEY_STOP, STATUS_TURN_MOD_STOP)) { + if (battleStatus->curAttackStatus & STATUS_FLAG_STOP && try_inflict_status(target, STATUS_KEY_STOP, STATUS_TURN_MOD_STOP)) { statusInflicted = one; statusInflicted2 = one; } - if (battleStatus->currentAttackStatus & STATUS_FLAG_STATIC && try_inflict_status(target, STATUS_KEY_STATIC, STATUS_TURN_MOD_STATIC)) { + if (battleStatus->curAttackStatus & STATUS_FLAG_STATIC && try_inflict_status(target, STATUS_KEY_STATIC, STATUS_TURN_MOD_STATIC)) { statusInflicted = one; statusInflicted2 = one; } - if (battleStatus->currentAttackStatus & STATUS_FLAG_PARALYZE && try_inflict_status(target, STATUS_KEY_PARALYZE, STATUS_TURN_MOD_PARALYZE)) { + if (battleStatus->curAttackStatus & STATUS_FLAG_PARALYZE && try_inflict_status(target, STATUS_KEY_PARALYZE, STATUS_TURN_MOD_PARALYZE)) { statusInflicted = one; statusInflicted2 = one; } - if (battleStatus->currentAttackStatus & STATUS_FLAG_FEAR && try_inflict_status(target, STATUS_KEY_FEAR, STATUS_TURN_MOD_FEAR)) { + if (battleStatus->curAttackStatus & STATUS_FLAG_FEAR && try_inflict_status(target, STATUS_KEY_FEAR, STATUS_TURN_MOD_FEAR)) { statusInflicted = one; statusInflicted2 = one; } // @bug? repeated paralyze and dizzy infliction - if (battleStatus->currentAttackStatus & STATUS_FLAG_PARALYZE && try_inflict_status(target, STATUS_KEY_PARALYZE, STATUS_TURN_MOD_PARALYZE)) { + if (battleStatus->curAttackStatus & STATUS_FLAG_PARALYZE && try_inflict_status(target, STATUS_KEY_PARALYZE, STATUS_TURN_MOD_PARALYZE)) { statusInflicted = one; statusInflicted2 = one; } - if (battleStatus->currentAttackStatus & STATUS_FLAG_DIZZY && try_inflict_status(target, STATUS_KEY_DIZZY, STATUS_TURN_MOD_DIZZY)) { + if (battleStatus->curAttackStatus & STATUS_FLAG_DIZZY && try_inflict_status(target, STATUS_KEY_DIZZY, STATUS_TURN_MOD_DIZZY)) { statusInflicted = one; statusInflicted2 = one; } - if (battleStatus->currentAttackStatus & STATUS_FLAG_FROZEN && target->debuff != STATUS_KEY_FROZEN && try_inflict_status(target, STATUS_KEY_FROZEN, STATUS_TURN_MOD_FROZEN)) { + if (battleStatus->curAttackStatus & STATUS_FLAG_FROZEN && target->debuff != STATUS_KEY_FROZEN && try_inflict_status(target, STATUS_KEY_FROZEN, STATUS_TURN_MOD_FROZEN)) { statusInflicted = one; statusInflicted2 = one; } @@ -687,7 +687,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { // immune star fx? show_immune_bonk(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, -3); } - } else if (battleStatus->currentAttackElement & (DAMAGE_TYPE_MULTIPLE_POPUPS | DAMAGE_TYPE_SMASH)) { + } else if (battleStatus->curAttackElement & (DAMAGE_TYPE_MULTIPLE_POPUPS | DAMAGE_TYPE_SMASH)) { show_next_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 1); show_damage_fx(target, state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage); } else { @@ -701,7 +701,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { if (!statusInflicted2 && !statusInflicted) { show_immune_bonk(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 3); } - } else if (battleStatus->currentAttackElement & (DAMAGE_TYPE_MULTIPLE_POPUPS | DAMAGE_TYPE_SMASH)) { + } else if (battleStatus->curAttackElement & (DAMAGE_TYPE_MULTIPLE_POPUPS | DAMAGE_TYPE_SMASH)) { show_next_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 0); show_damage_fx(target, state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage); } else { @@ -736,42 +736,42 @@ HitResult calc_enemy_damage_target(Actor* attacker) { sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackStatus & STATUS_FLAG_SLEEP) && statusInflicted) { + if ((battleStatus->curAttackStatus & STATUS_FLAG_SLEEP) && statusInflicted) { script = start_script(&EVS_PlaySleepHitFX, EVT_PRIORITY_A, 0); script->varTable[0] = state->goalPos.x; script->varTable[1] = state->goalPos.y; script->varTable[2] = state->goalPos.z; sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackStatus & STATUS_FLAG_DIZZY) && statusInflicted) { + if ((battleStatus->curAttackStatus & STATUS_FLAG_DIZZY) && statusInflicted) { script = start_script(&EVS_PlayDizzyHitFX, EVT_PRIORITY_A, 0); script->varTable[0] = state->goalPos.x; script->varTable[1] = state->goalPos.y; script->varTable[2] = state->goalPos.z; sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackStatus & STATUS_FLAG_PARALYZE) && statusInflicted) { + if ((battleStatus->curAttackStatus & STATUS_FLAG_PARALYZE) && statusInflicted) { script = start_script(&EVS_PlayParalyzeHitFX, EVT_PRIORITY_A, 0); script->varTable[0] = state->goalPos.x; script->varTable[1] = state->goalPos.y; script->varTable[2] = state->goalPos.z; sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackStatus & STATUS_FLAG_POISON) && statusInflicted) { + if ((battleStatus->curAttackStatus & STATUS_FLAG_POISON) && statusInflicted) { script = start_script(&EVS_PlayPoisonHitFX, EVT_PRIORITY_A, 0); script->varTable[0] = state->goalPos.x; script->varTable[1] = state->goalPos.y; script->varTable[2] = state->goalPos.z; sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackStatus & STATUS_FLAG_STOP) && statusInflicted) { + if ((battleStatus->curAttackStatus & STATUS_FLAG_STOP) && statusInflicted) { script = start_script(&EVS_PlayStopHitFX, EVT_PRIORITY_A, 0); script->varTable[0] = state->goalPos.x; script->varTable[1] = state->goalPos.y; script->varTable[2] = state->goalPos.z; sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackStatus & STATUS_FLAG_FROZEN) && statusInflicted) { + if ((battleStatus->curAttackStatus & STATUS_FLAG_FROZEN) && statusInflicted) { script = start_script(&EVS_PlayFreezeHitFX, EVT_PRIORITY_A, 0); script->varTable[0] = state->goalPos.x; script->varTable[1] = state->goalPos.y; @@ -779,7 +779,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { script->varTablePtr[3] = target; sfx_play_sound_at_position(SOUND_HIT_ICE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackStatus & STATUS_FLAG_SHRINK) && statusInflicted) { + if ((battleStatus->curAttackStatus & STATUS_FLAG_SHRINK) && statusInflicted) { script = start_script(&EVS_PlayShrinkHitFX, EVT_PRIORITY_A, 0); script->varTable[0] = state->goalPos.x; script->varTable[1] = state->goalPos.y; @@ -788,7 +788,7 @@ HitResult calc_enemy_damage_target(Actor* attacker) { sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if ((battleStatus->currentAttackElement & DAMAGE_TYPE_SMASH) && target->actorType == ACTOR_TYPE_GOOMNUT_TREE) { + if ((battleStatus->curAttackElement & DAMAGE_TYPE_SMASH) && target->actorType == ACTOR_TYPE_GOOMNUT_TREE) { sfx_play_sound_at_position(SOUND_SMASH_GOOMNUT_TREE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } @@ -796,8 +796,8 @@ HitResult calc_enemy_damage_target(Actor* attacker) { if (attacker->staticStatus != STATUS_KEY_STATIC && (target->staticStatus == STATUS_KEY_STATIC || targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED) - && !(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT) + && !(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT) && (attacker->transparentStatus != STATUS_KEY_TRANSPARENT) && !has_enchanted_part(attacker)) { @@ -820,7 +820,7 @@ s32 dispatch_damage_event_actor(Actor* actor, s32 damageAmount, s32 originalEven s32 flagCheck; s32 new_var; - battleStatus->currentAttackDamage = damageAmount; + battleStatus->curAttackDamage = damageAmount; hpChange = (s16) damageAmount; actor->hpChangeCounter += hpChange; new_var = actor->hpChangeCounter; @@ -828,17 +828,17 @@ s32 dispatch_damage_event_actor(Actor* actor, s32 damageAmount, s32 originalEven actor->damageCounter += hpChange; actor->hpChangeCounter -= hpChange; battleStatus->lastAttackDamage = 0; - actor->currentHP -= hpChange; + actor->curHP -= hpChange; - if (actor->currentHP <= 0) { + if (actor->curHP <= 0) { dispatchEvent = EVENT_DEATH; - battleStatus->lastAttackDamage += actor->currentHP; - actor->currentHP = 0; + battleStatus->lastAttackDamage += actor->curHP; + actor->curHP = 0; } battleStatus->lastAttackDamage += hpChange; actor->lastDamageTaken = battleStatus->lastAttackDamage; - battleStatus->currentDamageSource = DMG_SRC_DEFAULT; + battleStatus->curDamageSource = DMG_SRC_DEFAULT; if (battleStatus->flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { if (dispatchEvent == EVENT_HIT_COMBO) { dispatchEvent = EVENT_HIT; @@ -1043,18 +1043,18 @@ ApiStatus JumpToGoal(Evt* script, s32 isInitialCall) { script->functionTemp[3] |= 2; } - actorState->currentPos.x = actor->currentPos.x; - actorState->currentPos.y = actor->currentPos.y; - actorState->currentPos.z = actor->currentPos.z; + actorState->curPos.x = actor->curPos.x; + actorState->curPos.y = actor->curPos.y; + actorState->curPos.z = actor->curPos.z; - posX = actorState->currentPos.x; - posY = actorState->currentPos.y; - posZ = actorState->currentPos.z; + posX = actorState->curPos.x; + posY = actorState->curPos.y; + posZ = actorState->curPos.z; goalX = actorState->goalPos.x; goalY = actorState->goalPos.y; goalZ = actorState->goalPos.z; actorState->angle = atan2(posX, posZ, goalX, goalZ); - actorState->distance = dist2D(posX, posZ, goalX, goalZ); + actorState->dist = dist2D(posX, posZ, goalX, goalZ); // make relative posX = (goalX - posX); @@ -1062,25 +1062,25 @@ ApiStatus JumpToGoal(Evt* script, s32 isInitialCall) { posZ = (goalZ - posZ); if (actorState->moveTime == 0) { - actorState->moveTime = actorState->distance / actorState->speed; - moveDist = actorState->distance - (actorState->moveTime * actorState->speed); + actorState->moveTime = actorState->dist / actorState->speed; + moveDist = actorState->dist - (actorState->moveTime * actorState->speed); } else { - actorState->speed = actorState->distance / actorState->moveTime; - moveDist = actorState->distance - (actorState->moveTime * actorState->speed); + actorState->speed = actorState->dist / actorState->moveTime; + moveDist = actorState->dist - (actorState->moveTime * actorState->speed); } if (actorState->moveTime == 0) { return ApiStatus_DONE2; } - actorState->velocity = (actorState->acceleration * actorState->moveTime * 0.5f) + (posY / actorState->moveTime); + actorState->vel = (actorState->acceleration * actorState->moveTime * 0.5f) + (posY / actorState->moveTime); actorState->speed += (moveDist / actorState->moveTime); if (script->functionTemp[2] != 0) { set_animation(actor->actorID, (s8) actor->state.jumpPartIndex, actor->state.animJumpRise); } if (!(script->functionTemp[3] & 2) && (actor->actorTypeData1[4] != 0)) { - sfx_play_sound_at_position(actor->actorTypeData1[4], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(actor->actorTypeData1[4], SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } script->functionTemp[0] = 1; } @@ -1088,22 +1088,22 @@ ApiStatus JumpToGoal(Evt* script, s32 isInitialCall) { actor = script->functionTempPtr[1]; actorState = &actor->state; - actorState->currentPos.y += actorState->velocity; - actorState->velocity -= actorState->acceleration; + actorState->curPos.y += actorState->vel; + actorState->vel -= actorState->acceleration; - if ((script->functionTemp[2] != 0) && (actorState->velocity < 0.0f)) { + if ((script->functionTemp[2] != 0) && (actorState->vel < 0.0f)) { set_animation(actor->actorID, (s8) actorState->jumpPartIndex, actorState->animJumpFall); } - if (actorState->velocity < 0.0f) { - if (actorState->currentPos.y < actorState->goalPos.y) { - actorState->currentPos.y = actorState->goalPos.y; + if (actorState->vel < 0.0f) { + if (actorState->curPos.y < actorState->goalPos.y) { + actorState->curPos.y = actorState->goalPos.y; } } - add_xz_vec3f(&actorState->currentPos, actorState->speed, actorState->angle); - actor->currentPos.x = actorState->currentPos.x; - actor->currentPos.y = actorState->currentPos.y; - actor->currentPos.z = actorState->currentPos.z; + add_xz_vec3f(&actorState->curPos, actorState->speed, actorState->angle); + actor->curPos.x = actorState->curPos.x; + actor->curPos.y = actorState->curPos.y; + actor->curPos.z = actorState->curPos.z; actorState->moveTime--; if (actorState->moveTime > 0) { @@ -1113,9 +1113,9 @@ ApiStatus JumpToGoal(Evt* script, s32 isInitialCall) { if (script->functionTemp[3] & 1) { play_movement_dust_effects(2, actorState->goalPos.x, actorState->goalPos.y, actorState->goalPos.z, actorState->angle); } - actor->currentPos.x = actorState->goalPos.x; - actor->currentPos.y = actorState->goalPos.y; - actor->currentPos.z = actorState->goalPos.z; + actor->curPos.x = actorState->goalPos.x; + actor->curPos.y = actorState->goalPos.y; + actor->curPos.z = actorState->goalPos.z; if (script->functionTemp[2] != 0) { set_animation(actor->actorID, (s8) actorState->jumpPartIndex, actorState->animJumpLand); } @@ -1148,18 +1148,18 @@ ApiStatus IdleJumpToGoal(Evt* script, s32 isInitialCall) { script->functionTemp[2] = evt_get_variable(script, *args++); script->functionTemp[3] = evt_get_variable(script, *args++); - movement->currentPos.x = actor->currentPos.x; - movement->currentPos.y = actor->currentPos.y; - movement->currentPos.z = actor->currentPos.z; + movement->curPos.x = actor->curPos.x; + movement->curPos.y = actor->curPos.y; + movement->curPos.z = actor->curPos.z; - posX = movement->currentPos.x; - posY = movement->currentPos.y; - posZ = movement->currentPos.z; + posX = movement->curPos.x; + posY = movement->curPos.y; + posZ = movement->curPos.z; goalX = movement->goalPos.x; goalY = movement->goalPos.y; goalZ = movement->goalPos.z; movement->angle = atan2(posX, posZ, goalX, goalZ); - movement->distance = dist2D(posX, posZ, goalX, goalZ); + movement->dist = dist2D(posX, posZ, goalX, goalZ); // make relative posX = (goalX - posX); @@ -1167,18 +1167,18 @@ ApiStatus IdleJumpToGoal(Evt* script, s32 isInitialCall) { posZ = (goalZ - posZ); if (movement->flyTime == 0) { - movement->flyTime = movement->distance / movement->speed; - moveDist = movement->distance - (movement->flyTime * movement->speed); + movement->flyTime = movement->dist / movement->speed; + moveDist = movement->dist - (movement->flyTime * movement->speed); } else { - movement->speed = movement->distance / movement->flyTime; - moveDist = movement->distance - (movement->flyTime * movement->speed); + movement->speed = movement->dist / movement->flyTime; + moveDist = movement->dist - (movement->flyTime * movement->speed); } if (movement->flyTime == 0) { return ApiStatus_DONE2; } - movement->velocity = (movement->acceleration * movement->flyTime * 0.5f) + (posY / movement->flyTime); + movement->vel = (movement->acceleration * movement->flyTime * 0.5f) + (posY / movement->flyTime); movement->speed += moveDist / movement->flyTime; script->functionTemp[0] = TRUE; } @@ -1186,24 +1186,24 @@ ApiStatus IdleJumpToGoal(Evt* script, s32 isInitialCall) { actor = script->functionTempPtr[1]; movement = &actor->fly; - movement->currentPos.y += movement->velocity; - movement->velocity -= movement->acceleration; - if (movement->velocity < 0.0f && movement->goalPos.y > movement->currentPos.y) { - movement->currentPos.y = movement->goalPos.y; + movement->curPos.y += movement->vel; + movement->vel -= movement->acceleration; + if (movement->vel < 0.0f && movement->goalPos.y > movement->curPos.y) { + movement->curPos.y = movement->goalPos.y; } - add_xz_vec3f_copy2(&movement->currentPos, movement->speed, movement->angle); - actor->currentPos.x = movement->currentPos.x; - actor->currentPos.y = movement->currentPos.y; - actor->currentPos.z = movement->currentPos.z; + add_xz_vec3f_copy2(&movement->curPos, movement->speed, movement->angle); + actor->curPos.x = movement->curPos.x; + actor->curPos.y = movement->curPos.y; + actor->curPos.z = movement->curPos.z; movement->flyTime--; if (movement->flyTime <= 0) { if (script->functionTemp[3] != 0) { play_movement_dust_effects(2, movement->goalPos.x, movement->goalPos.y, movement->goalPos.z, movement->angle); } - actor->currentPos.x = movement->goalPos.x; - actor->currentPos.y = movement->goalPos.y; - actor->currentPos.z = movement->goalPos.z; + actor->curPos.x = movement->goalPos.x; + actor->curPos.y = movement->goalPos.y; + actor->curPos.z = movement->goalPos.z; return ApiStatus_DONE1; } @@ -1233,18 +1233,18 @@ ApiStatus JumpToGoalSimple2(Evt* script, s32 isInitialCall) { state = &actor->state; state->moveTime = evt_get_variable(script, *args++); - state->currentPos.x = actor->currentPos.x; - state->currentPos.y = actor->currentPos.y; - state->currentPos.z = actor->currentPos.z; + state->curPos.x = actor->curPos.x; + state->curPos.y = actor->curPos.y; + state->curPos.z = actor->curPos.z; - posX = state->currentPos.x; - posY = state->currentPos.y; - posZ = state->currentPos.z; + posX = state->curPos.x; + posY = state->curPos.y; + posZ = state->curPos.z; goalX = state->goalPos.x; goalY = state->goalPos.y; goalZ = state->goalPos.z; state->angle = atan2(posX, posZ, goalX, goalZ); - state->distance = dist2D(posX, posZ, goalX, goalZ); + state->dist = dist2D(posX, posZ, goalX, goalZ); // make relative (note: negated) posX = (posX - goalX); @@ -1252,21 +1252,21 @@ ApiStatus JumpToGoalSimple2(Evt* script, s32 isInitialCall) { posZ = (posZ - goalZ); if (state->moveTime == 0) { - state->moveTime = state->distance / state->speed; - moveDist = state->distance - (state->moveTime * state->speed); + state->moveTime = state->dist / state->speed; + moveDist = state->dist - (state->moveTime * state->speed); } else { - state->speed = state->distance / state->moveTime; - moveDist = state->distance - (state->moveTime * state->speed); + state->speed = state->dist / state->moveTime; + moveDist = state->dist - (state->moveTime * state->speed); } if (state->moveTime == 0) { return ApiStatus_DONE2; } - state->velocity = ((state->acceleration * state->moveTime) * 0.5f) + (posY / state->moveTime); + state->vel = ((state->acceleration * state->moveTime) * 0.5f) + (posY / state->moveTime); state->speed += moveDist / state->moveTime; if (actor->actorTypeData1[4] != 0) { - sfx_play_sound_at_position(actor->actorTypeData1[4], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(actor->actorTypeData1[4], SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } script->functionTemp[0] = TRUE; } @@ -1274,22 +1274,22 @@ ApiStatus JumpToGoalSimple2(Evt* script, s32 isInitialCall) { actor = script->functionTempPtr[1]; state = &actor->state; - state->currentPos.y -= state->velocity; - state->velocity -= state->acceleration; - if (state->velocity > 0.0f && state->goalPos.y < state->currentPos.y) { - state->currentPos.y = state->goalPos.y; + state->curPos.y -= state->vel; + state->vel -= state->acceleration; + if (state->vel > 0.0f && state->goalPos.y < state->curPos.y) { + state->curPos.y = state->goalPos.y; } - add_xz_vec3f(&state->currentPos, state->speed, state->angle); - actor->currentPos.x = state->currentPos.x; - actor->currentPos.y = state->currentPos.y; - actor->currentPos.z = state->currentPos.z; + add_xz_vec3f(&state->curPos, state->speed, state->angle); + actor->curPos.x = state->curPos.x; + actor->curPos.y = state->curPos.y; + actor->curPos.z = state->curPos.z; state->moveTime--; if (state->moveTime <= 0) { play_movement_dust_effects(2, state->goalPos.x, state->goalPos.y, state->goalPos.z, state->angle); - actor->currentPos.x = state->goalPos.x; - actor->currentPos.y = state->goalPos.y; - actor->currentPos.z = state->goalPos.z; + actor->curPos.x = state->goalPos.x; + actor->curPos.y = state->goalPos.y; + actor->curPos.z = state->goalPos.z; return ApiStatus_DONE1; } @@ -1320,18 +1320,18 @@ ApiStatus JumpWithBounce(Evt* script, s32 isInitialCall) { actorState->moveTime = evt_get_variable(script, *args++); actorState->bounceDivisor = evt_get_float_variable(script, *args++); - actorState->currentPos.x = actor->currentPos.x; - actorState->currentPos.y = actor->currentPos.y; - actorState->currentPos.z = actor->currentPos.z; + actorState->curPos.x = actor->curPos.x; + actorState->curPos.y = actor->curPos.y; + actorState->curPos.z = actor->curPos.z; - posX = actorState->currentPos.x; - posY = actorState->currentPos.y; - posZ = actorState->currentPos.z; + posX = actorState->curPos.x; + posY = actorState->curPos.y; + posZ = actorState->curPos.z; goalX = actorState->goalPos.x; goalZ = actorState->goalPos.z; goalY = actorState->goalPos.y; actorState->angle = atan2(posX, posZ, goalX, goalZ); - actorState->distance = dist2D(posX, posZ, goalX, goalZ); + actorState->dist = dist2D(posX, posZ, goalX, goalZ); // make relative posX = (goalX - posX); @@ -1339,22 +1339,22 @@ ApiStatus JumpWithBounce(Evt* script, s32 isInitialCall) { posZ = (goalZ - posZ); if (actorState->moveTime == 0) { - actorState->moveTime = (s32) (actorState->distance / actorState->speed); - moveDist = actorState->distance - (actorState->moveTime * actorState->speed); + actorState->moveTime = (s32) (actorState->dist / actorState->speed); + moveDist = actorState->dist - (actorState->moveTime * actorState->speed); } else { - actorState->speed = actorState->distance / actorState->moveTime; - moveDist = actorState->distance - (actorState->moveTime * actorState->speed); + actorState->speed = actorState->dist / actorState->moveTime; + moveDist = actorState->dist - (actorState->moveTime * actorState->speed); } if (actorState->moveTime == 0) { return ApiStatus_DONE2; } - actorState->velocity = (actorState->acceleration * actorState->moveTime * 0.5f) + (posY / actorState->moveTime); + actorState->vel = (actorState->acceleration * actorState->moveTime * 0.5f) + (posY / actorState->moveTime); actorState->speed += moveDist / actorState->moveTime; if (actor->actorTypeData1[4] != 0) { - sfx_play_sound_at_position(actor->actorTypeData1[4], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(actor->actorTypeData1[4], SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } script->functionTemp[0] = TRUE; } @@ -1364,37 +1364,37 @@ ApiStatus JumpWithBounce(Evt* script, s32 isInitialCall) { switch (script->functionTemp[0]) { case 1: - actorState->currentPos.y += actorState->velocity; - actorState->velocity -= actorState->acceleration; - if ((actorState->velocity < 0.0f) && (actorState->currentPos.y < actorState->goalPos.y)) { + actorState->curPos.y += actorState->vel; + actorState->vel -= actorState->acceleration; + if ((actorState->vel < 0.0f) && (actorState->curPos.y < actorState->goalPos.y)) { actorState->acceleration = -actorState->acceleration; - actorState->velocity /= actorState->bounceDivisor; + actorState->vel /= actorState->bounceDivisor; script->functionTemp[0] = 2; } - add_xz_vec3f(&actorState->currentPos, actorState->speed, actorState->angle); + add_xz_vec3f(&actorState->curPos, actorState->speed, actorState->angle); break; case 2: - actorState->currentPos.y += actorState->velocity; - actorState->velocity -= actorState->acceleration; - if (actorState->velocity > 0.0f) { - if (actorState->goalPos.y < actorState->currentPos.y) { - actorState->currentPos.y = actorState->goalPos.y; + actorState->curPos.y += actorState->vel; + actorState->vel -= actorState->acceleration; + if (actorState->vel > 0.0f) { + if (actorState->goalPos.y < actorState->curPos.y) { + actorState->curPos.y = actorState->goalPos.y; script->functionTemp[0] = 3; } } - add_xz_vec3f(&actorState->currentPos, actorState->speed, actorState->angle); - actor->currentPos.x = actorState->currentPos.x; - actor->currentPos.y = actorState->currentPos.y; - actor->currentPos.z = actorState->currentPos.z; + add_xz_vec3f(&actorState->curPos, actorState->speed, actorState->angle); + actor->curPos.x = actorState->curPos.x; + actor->curPos.y = actorState->curPos.y; + actor->curPos.z = actorState->curPos.z; break; case 3: return ApiStatus_DONE2; } - actor->currentPos.x = actorState->currentPos.x; - actor->currentPos.y = actorState->currentPos.y; - actor->currentPos.z = actorState->currentPos.z; + actor->curPos.x = actorState->curPos.x; + actor->curPos.y = actorState->curPos.y; + actor->curPos.z = actorState->curPos.z; return ApiStatus_BLOCK; } @@ -1415,24 +1415,24 @@ ApiStatus LandJump(Evt* script, s32 isInitialCall) { actor = get_actor(actorID); script->functionTempPtr[1] = actor; - actor->state.currentPos.x = actor->currentPos.x; - actor->state.currentPos.y = actor->currentPos.y; - actor->state.currentPos.z = actor->currentPos.z; + actor->state.curPos.x = actor->curPos.x; + actor->state.curPos.y = actor->curPos.y; + actor->state.curPos.z = actor->curPos.z; script->functionTemp[0] = TRUE; } actor = script->functionTempPtr[1]; - actor->state.currentPos.y += actor->state.velocity; - actor->state.velocity -= actor->state.acceleration; + actor->state.curPos.y += actor->state.vel; + actor->state.vel -= actor->state.acceleration; - add_xz_vec3f(&actor->state.currentPos, actor->state.speed, actor->state.angle); - actor->currentPos.x = actor->state.currentPos.x; - actor->currentPos.y = actor->state.currentPos.y; - actor->currentPos.z = actor->state.currentPos.z; + add_xz_vec3f(&actor->state.curPos, actor->state.speed, actor->state.angle); + actor->curPos.x = actor->state.curPos.x; + actor->curPos.y = actor->state.curPos.y; + actor->curPos.z = actor->state.curPos.z; - if (actor->currentPos.y < 0.0f) { - actor->currentPos.y = 0.0f; - play_movement_dust_effects(2, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z, actor->yaw); + if (actor->curPos.y < 0.0f) { + actor->curPos.y = 0.0f; + play_movement_dust_effects(2, actor->curPos.x, actor->curPos.y, actor->curPos.z, actor->yaw); return ApiStatus_DONE1; } @@ -1462,19 +1462,19 @@ ApiStatus FallToGoal(Evt* script, s32 isInitialCall) { actor->state.moveTime = evt_get_variable(script, *args++); - actor->state.currentPos.x = actor->currentPos.x; - actor->state.currentPos.y = actor->currentPos.y; - actor->state.currentPos.z = actor->currentPos.z; + actor->state.curPos.x = actor->curPos.x; + actor->state.curPos.y = actor->curPos.y; + actor->state.curPos.z = actor->curPos.z; - posX = actor->state.currentPos.x; - posY = actor->state.currentPos.y; - posZ = actor->state.currentPos.z; + posX = actor->state.curPos.x; + posY = actor->state.curPos.y; + posZ = actor->state.curPos.z; goalX = actor->state.goalPos.x; goalY = actor->state.goalPos.y; goalZ = actor->state.goalPos.z; actor->state.angle = atan2(posX, posZ, goalX, goalZ); - actor->state.distance = dist2D(posX, posZ, goalX, goalZ); + actor->state.dist = dist2D(posX, posZ, goalX, goalZ); // make relative posX = (goalX - posX); @@ -1482,34 +1482,34 @@ ApiStatus FallToGoal(Evt* script, s32 isInitialCall) { posZ = (goalZ - posZ); if (actor->state.moveTime == 0) { - actor->state.moveTime = actor->state.distance / actor->state.speed; + actor->state.moveTime = actor->state.dist / actor->state.speed; } else { - actor->state.speed = actor->state.distance / actor->state.moveTime; + actor->state.speed = actor->state.dist / actor->state.moveTime; } - state->velocity = 0.0f; - state->acceleration = (posY / state->moveTime - state->velocity) / (-state->moveTime * 0.5); + state->vel = 0.0f; + state->acceleration = (posY / state->moveTime - state->vel) / (-state->moveTime * 0.5); if (actor->actorTypeData1[4] != 0) { - sfx_play_sound_at_position(actor->actorTypeData1[4], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(actor->actorTypeData1[4], SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } script->functionTemp[0] = 1; } actor = script->functionTempPtr[1]; - actor->state.currentPos.y += actor->state.velocity; - actor->state.velocity -= actor->state.acceleration; - add_xz_vec3f(&actor->state.currentPos, actor->state.speed, actor->state.angle); - actor->currentPos.x = actor->state.currentPos.x; - actor->currentPos.y = actor->state.currentPos.y; - actor->currentPos.z = actor->state.currentPos.z; + actor->state.curPos.y += actor->state.vel; + actor->state.vel -= actor->state.acceleration; + add_xz_vec3f(&actor->state.curPos, actor->state.speed, actor->state.angle); + actor->curPos.x = actor->state.curPos.x; + actor->curPos.y = actor->state.curPos.y; + actor->curPos.z = actor->state.curPos.z; actor->state.moveTime--; if (actor->state.moveTime <= 0) { play_movement_dust_effects(2, actor->state.goalPos.x, actor->state.goalPos.y, actor->state.goalPos.z, actor->state.angle); - actor->currentPos.x = actor->state.goalPos.x; - actor->currentPos.y = actor->state.goalPos.y; - actor->currentPos.z = actor->state.goalPos.z; + actor->curPos.x = actor->state.goalPos.x; + actor->curPos.y = actor->state.goalPos.y; + actor->curPos.z = actor->state.goalPos.z; return ApiStatus_DONE1; } else { return ApiStatus_BLOCK; @@ -1539,41 +1539,41 @@ ApiStatus RunToGoal(Evt* script, s32 isInitialCall) { actorState->moveTime = evt_get_variable(script, *args++); script->functionTemp[2] = evt_get_variable(script, *args++); - actorState->currentPos.x = actor->currentPos.x; - actorState->currentPos.y = actor->currentPos.y; - actorState->currentPos.z = actor->currentPos.z; + actorState->curPos.x = actor->curPos.x; + actorState->curPos.y = actor->curPos.y; + actorState->curPos.z = actor->curPos.z; goalX = actorState->goalPos.x; goalY = actorState->goalPos.y; goalZ = actorState->goalPos.z; - posX = actorState->currentPos.x; - posY = actorState->currentPos.y; - posZ = actorState->currentPos.z; + posX = actorState->curPos.x; + posY = actorState->curPos.y; + posZ = actorState->curPos.z; actorState->unk_18.x = goalX; actorState->unk_18.y = goalY; actorState->unk_18.z = goalZ; actorState->angle = atan2(posX, posZ, goalX, goalZ); - actorState->distance = dist2D(posX, posZ, goalX, goalZ); + actorState->dist = dist2D(posX, posZ, goalX, goalZ); if (actorState->moveTime == 0) { - actorState->moveTime = actorState->distance / actorState->speed; + actorState->moveTime = actorState->dist / actorState->speed; if (actorState->moveTime == 0) { actorState->moveTime = 1; } - actorState->speed += (actorState->distance - (actorState->moveTime * actorState->speed)) / actorState->moveTime; + actorState->speed += (actorState->dist - (actorState->moveTime * actorState->speed)) / actorState->moveTime; } else { - actorState->speed = actorState->distance / actorState->moveTime; + actorState->speed = actorState->dist / actorState->moveTime; } if (actor->actorTypeData1b[0] >= 0) { - actorState->distance = actor->actorTypeData1b[0] + 1; + actorState->dist = actor->actorTypeData1b[0] + 1; } else { - actorState->distance = ~actor->actorTypeData1b[0]; //TODO optimization? + actorState->dist = ~actor->actorTypeData1b[0]; //TODO optimization? } if ((actor->actorTypeData1[0] != 0) && (actor->actorTypeData1[1] == 0)) { - sfx_play_sound_at_position(actor->actorTypeData1[0], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(actor->actorTypeData1[0], SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } script->functionTemp[0] = TRUE; } @@ -1581,45 +1581,45 @@ ApiStatus RunToGoal(Evt* script, s32 isInitialCall) { actor = script->functionTempPtr[1]; actorState = &actor->state; - add_xz_vec3f(&actorState->currentPos, actorState->speed, actorState->angle); + add_xz_vec3f(&actorState->curPos, actorState->speed, actorState->angle); if (script->functionTemp[2] == 0) { if (actorState->speed < 4.0f) { - play_movement_dust_effects(0, actorState->currentPos.x, actorState->currentPos.y, actorState->currentPos.z, actorState->angle); + play_movement_dust_effects(0, actorState->curPos.x, actorState->curPos.y, actorState->curPos.z, actorState->angle); } else { - play_movement_dust_effects(1, actorState->currentPos.x, actorState->currentPos.y, actorState->currentPos.z, actorState->angle); + play_movement_dust_effects(1, actorState->curPos.x, actorState->curPos.y, actorState->curPos.z, actorState->angle); } } - actor->currentPos.x = actorState->currentPos.x; - actor->currentPos.z = actorState->currentPos.z; + actor->curPos.x = actorState->curPos.x; + actor->curPos.z = actorState->curPos.z; if ((actor->actorTypeData1[0] != 0) && (actor->actorTypeData1[1] != 0)) { if (actor->actorTypeData1b[0] >= 0) { - actorState->distance += actorState->speed; - if (actor->actorTypeData1b[0] < actorState->distance) { + actorState->dist += actorState->speed; + if (actor->actorTypeData1b[0] < actorState->dist) { actor->footStepCounter++; - actorState->distance = 0.0f; + actorState->dist = 0.0f; if (actor->footStepCounter & 1) { if (actor->actorTypeData1[0] != 0) { - sfx_play_sound_at_position(actor->actorTypeData1[0], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(actor->actorTypeData1[0], SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } } else { if (actor->actorTypeData1[1] != 0) { - sfx_play_sound_at_position(actor->actorTypeData1[1], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(actor->actorTypeData1[1], SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } } } } else { - actorState->distance += 1.0f; - if (-actor->actorTypeData1b[0] <= actorState->distance) { + actorState->dist += 1.0f; + if (-actor->actorTypeData1b[0] <= actorState->dist) { actor->footStepCounter++; - actorState->distance = 0.0f; + actorState->dist = 0.0f; if (actor->footStepCounter & 1) { if (actor->actorTypeData1[0] != 0) { - sfx_play_sound_at_position(actor->actorTypeData1[0], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(actor->actorTypeData1[0], SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } } else { if (actor->actorTypeData1[1] != 0) { - sfx_play_sound_at_position(actor->actorTypeData1[1], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(actor->actorTypeData1[1], SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } } } @@ -1631,8 +1631,8 @@ ApiStatus RunToGoal(Evt* script, s32 isInitialCall) { return ApiStatus_BLOCK; } - actor->currentPos.x = actorState->unk_18.x; - actor->currentPos.z = actorState->unk_18.z; + actor->curPos.x = actorState->unk_18.x; + actor->curPos.z = actorState->unk_18.z; if (actor->actorTypeData1[0] != 0) { if (actor->actorTypeData1[1] == 0) { snd_stop_sound(actor->actorTypeData1[0]); @@ -1663,40 +1663,40 @@ ApiStatus IdleRunToGoal(Evt* script, s32 isInitialCall) { movement->flyTime = evt_get_variable(script, *args++); - movement->currentPos.x = actor->currentPos.x; - movement->currentPos.y = actor->currentPos.y; - movement->currentPos.z = actor->currentPos.z; + movement->curPos.x = actor->curPos.x; + movement->curPos.y = actor->curPos.y; + movement->curPos.z = actor->curPos.z; goalX = movement->goalPos.x; goalY = movement->goalPos.y; goalZ = movement->goalPos.z; - posX = movement->currentPos.x; - posY = movement->currentPos.y; - posZ = movement->currentPos.z; + posX = movement->curPos.x; + posY = movement->curPos.y; + posZ = movement->curPos.z; movement->unk_18.x = goalX; movement->unk_18.y = goalY; movement->unk_18.z = goalZ; movement->angle = atan2(posX, posZ, goalX, goalZ); - movement->distance = dist2D(posX, posZ, goalX, goalZ); + movement->dist = dist2D(posX, posZ, goalX, goalZ); if (movement->flyTime == 0) { - movement->flyTime = movement->distance / movement->speed; + movement->flyTime = movement->dist / movement->speed; if (movement->flyTime == 0) { movement->flyTime = 1; } // this simplifies to: flyMotion->speed = flyMotion->distance / flyMotion->flyTime - movement->speed += (movement->distance - movement->flyTime * movement->speed) / movement->flyTime; + movement->speed += (movement->dist - movement->flyTime * movement->speed) / movement->flyTime; } else { - movement->speed = movement->distance / movement->flyTime; + movement->speed = movement->dist / movement->flyTime; } if (actor->actorTypeData1b[0] >= 0) { - movement->distance = actor->actorTypeData1b[0] + 1; + movement->dist = actor->actorTypeData1b[0] + 1; } else { - movement->distance = ~actor->actorTypeData1b[0]; + movement->dist = ~actor->actorTypeData1b[0]; } script->functionTemp[0] = TRUE; } @@ -1704,22 +1704,22 @@ ApiStatus IdleRunToGoal(Evt* script, s32 isInitialCall) { actor = script->functionTempPtr[1]; movement = &actor->fly; - add_xz_vec3f_copy2(&movement->currentPos, movement->speed, movement->angle); + add_xz_vec3f_copy2(&movement->curPos, movement->speed, movement->angle); if (movement->speed < 4.0f) { - play_movement_dust_effects(0, movement->currentPos.x, movement->currentPos.y, movement->currentPos.z, movement->angle); + play_movement_dust_effects(0, movement->curPos.x, movement->curPos.y, movement->curPos.z, movement->angle); } else { - play_movement_dust_effects(1, movement->currentPos.x, movement->currentPos.y, movement->currentPos.z, movement->angle); + play_movement_dust_effects(1, movement->curPos.x, movement->curPos.y, movement->curPos.z, movement->angle); } - actor->currentPos.x = movement->currentPos.x; - actor->currentPos.z = movement->currentPos.z; + actor->curPos.x = movement->curPos.x; + actor->curPos.z = movement->curPos.z; movement->flyTime--; if (movement->flyTime > 0) { return ApiStatus_BLOCK; } - actor->currentPos.x = movement->unk_18.x; - actor->currentPos.z = movement->unk_18.z; + actor->curPos.x = movement->unk_18.x; + actor->curPos.z = movement->unk_18.z; if (actor->actorTypeData1[0] != 0 && actor->actorTypeData1[1] == 0) { snd_stop_sound(actor->actorTypeData1[0]); } @@ -1766,16 +1766,16 @@ ApiStatus JumpPartTo(Evt* script, s32 isInitialCall) { goalY = movement->goalPos.y; goalZ = movement->goalPos.z; - movement->absolutePosition.x = part->absolutePosition.x; - movement->absolutePosition.y = part->absolutePosition.y; - movement->absolutePosition.z = part->absolutePosition.z; + movement->absolutePos.x = part->absolutePos.x; + movement->absolutePos.y = part->absolutePos.y; + movement->absolutePos.z = part->absolutePos.z; - posX = movement->absolutePosition.x; - posY = movement->absolutePosition.y; - posZ = movement->absolutePosition.z; + posX = movement->absolutePos.x; + posY = movement->absolutePos.y; + posZ = movement->absolutePos.z; movement->angle = atan2(posX, posZ, goalX, goalZ); - movement->distance = dist2D(posX, posZ, goalX, goalZ); + movement->dist = dist2D(posX, posZ, goalX, goalZ); // make relative posX = (goalX - posX); @@ -1783,37 +1783,37 @@ ApiStatus JumpPartTo(Evt* script, s32 isInitialCall) { posZ = (goalZ - posZ); if (movement->moveTime == 0) { - movement->moveTime = movement->distance / movement->moveSpeed; - deltaDist = movement->distance - movement->moveTime * movement->moveSpeed; + movement->moveTime = movement->dist / movement->moveSpeed; + deltaDist = movement->dist - movement->moveTime * movement->moveSpeed; } else { - movement->moveSpeed = movement->distance / movement->moveTime; - deltaDist = movement->distance - movement->moveTime * movement->moveSpeed; + movement->moveSpeed = movement->dist / movement->moveTime; + deltaDist = movement->dist - movement->moveTime * movement->moveSpeed; } movement->moveSpeed += deltaDist / movement->moveTime; movement->unk_2C = movement->jumpScale * movement->moveTime * 0.5f + posY / movement->moveTime; if (part->partTypeData[4] != 0) { - sfx_play_sound_at_position(part->partTypeData[4], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z); + sfx_play_sound_at_position(part->partTypeData[4], SOUND_SPACE_MODE_0, part->absolutePos.x, part->absolutePos.y, part->absolutePos.z); } script->functionTemp[0] = 1; } part = script->functionTempPtr[2]; movement = part->movement; - movement->absolutePosition.y += movement->unk_2C; + movement->absolutePos.y += movement->unk_2C; movement->unk_2C -= movement->jumpScale; - add_xz_vec3f_copy1(&movement->absolutePosition, movement->moveSpeed, movement->angle); - part->absolutePosition.x = movement->absolutePosition.x; - part->absolutePosition.y = movement->absolutePosition.y; - part->absolutePosition.z = movement->absolutePosition.z; + add_xz_vec3f_copy1(&movement->absolutePos, movement->moveSpeed, movement->angle); + part->absolutePos.x = movement->absolutePos.x; + part->absolutePos.y = movement->absolutePos.y; + part->absolutePos.z = movement->absolutePos.z; movement->moveTime--; if (movement->moveTime <= 0) { if (script->functionTemp[3] != 0) { play_movement_dust_effects(2, movement->goalPos.x, movement->goalPos.y, movement->goalPos.z, movement->angle); } - part->absolutePosition.x = movement->goalPos.x; - part->absolutePosition.y = movement->goalPos.y; - part->absolutePosition.z = movement->goalPos.z; + part->absolutePos.x = movement->goalPos.x; + part->absolutePos.y = movement->goalPos.y; + part->absolutePos.z = movement->goalPos.z; return ApiStatus_DONE1; } else { return ApiStatus_BLOCK; @@ -1858,16 +1858,16 @@ ApiStatus FallPartTo(Evt* script, s32 isInitialCall) { goalY = movement->goalPos.y; goalZ = movement->goalPos.z; - movement->absolutePosition.x = part->absolutePosition.x; - movement->absolutePosition.y = part->absolutePosition.y; - movement->absolutePosition.z = part->absolutePosition.z; + movement->absolutePos.x = part->absolutePos.x; + movement->absolutePos.y = part->absolutePos.y; + movement->absolutePos.z = part->absolutePos.z; - posX = movement->absolutePosition.x; - posY = movement->absolutePosition.y; - posZ = movement->absolutePosition.z; + posX = movement->absolutePos.x; + posY = movement->absolutePos.y; + posZ = movement->absolutePos.z; movement->angle = atan2(posX, posZ, goalX, goalZ); - movement->distance = dist2D(posX, posZ, goalX, goalZ); + movement->dist = dist2D(posX, posZ, goalX, goalZ); // make relative posX = (goalX - posX); @@ -1875,34 +1875,34 @@ ApiStatus FallPartTo(Evt* script, s32 isInitialCall) { posZ = (goalZ - posZ); if (movement->moveTime == 0) { - movement->moveTime = movement->distance / movement->moveSpeed; + movement->moveTime = movement->dist / movement->moveSpeed; } else { - movement->moveSpeed = movement->distance / movement->moveTime; + movement->moveSpeed = movement->dist / movement->moveTime; } movement->unk_2C = 0.0f; movement->jumpScale = (posY / movement->moveTime - movement->unk_2C) / (-movement->moveTime * 0.5); if (part->partTypeData[4] != 0) { - sfx_play_sound_at_position(part->partTypeData[4], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z); + sfx_play_sound_at_position(part->partTypeData[4], SOUND_SPACE_MODE_0, part->absolutePos.x, part->absolutePos.y, part->absolutePos.z); } script->functionTemp[0] = 1; } part = script->functionTempPtr[2]; movement = part->movement; - movement->absolutePosition.y += movement->unk_2C; + movement->absolutePos.y += movement->unk_2C; movement->unk_2C -= movement->jumpScale; - add_xz_vec3f_copy1(&movement->absolutePosition, movement->moveSpeed, movement->angle); - part->absolutePosition.x = movement->absolutePosition.x; - part->absolutePosition.y = movement->absolutePosition.y; - part->absolutePosition.z = movement->absolutePosition.z; + add_xz_vec3f_copy1(&movement->absolutePos, movement->moveSpeed, movement->angle); + part->absolutePos.x = movement->absolutePos.x; + part->absolutePos.y = movement->absolutePos.y; + part->absolutePos.z = movement->absolutePos.z; movement->moveTime--; if (movement->moveTime <= 0) { play_movement_dust_effects(2, movement->goalPos.x, movement->goalPos.y, movement->goalPos.z, movement->angle); - part->absolutePosition.x = movement->goalPos.x; - part->absolutePosition.y = movement->goalPos.y; - part->absolutePosition.z = movement->goalPos.z; + part->absolutePos.x = movement->goalPos.x; + part->absolutePos.y = movement->goalPos.y; + part->absolutePos.z = movement->goalPos.z; return ApiStatus_DONE1; } else { return ApiStatus_BLOCK; @@ -1932,24 +1932,24 @@ ApiStatus LandJumpPart(Evt* script, s32 isInitialCall) { script->functionTempPtr[1] = actor; script->functionTempPtr[2] = part; movement = part->movement; - movement->absolutePosition.x = part->absolutePosition.x; - movement->absolutePosition.y = part->absolutePosition.y; - movement->absolutePosition.z = part->absolutePosition.z; + movement->absolutePos.x = part->absolutePos.x; + movement->absolutePos.y = part->absolutePos.y; + movement->absolutePos.z = part->absolutePos.z; script->functionTemp[0] = 1; } part = script->functionTempPtr[2]; movement = part->movement; - movement->absolutePosition.y += movement->unk_2C; + movement->absolutePos.y += movement->unk_2C; movement->unk_2C -= movement->jumpScale; - add_xz_vec3f_copy1(&movement->absolutePosition, movement->moveSpeed, movement->angle); - part->absolutePosition.x = movement->absolutePosition.x; - part->absolutePosition.y = movement->absolutePosition.y; - part->absolutePosition.z = movement->absolutePosition.z; + add_xz_vec3f_copy1(&movement->absolutePos, movement->moveSpeed, movement->angle); + part->absolutePos.x = movement->absolutePos.x; + part->absolutePos.y = movement->absolutePos.y; + part->absolutePos.z = movement->absolutePos.z; - if (part->absolutePosition.y < 0.0f) { - part->absolutePosition.y = 0.0f; - play_movement_dust_effects(2, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z, part->yaw); + if (part->absolutePos.y < 0.0f) { + part->absolutePos.y = 0.0f; + play_movement_dust_effects(2, part->absolutePos.x, part->absolutePos.y, part->absolutePos.z, part->yaw); return ApiStatus_DONE1; } @@ -1995,29 +1995,29 @@ ApiStatus RunPartTo(Evt* script, s32 isInitialCall) { goalY = movement->goalPos.y; goalZ = movement->goalPos.z; - movement->absolutePosition.x = part->absolutePosition.x; - movement->absolutePosition.y = part->absolutePosition.y; - movement->absolutePosition.z = part->absolutePosition.z; + movement->absolutePos.x = part->absolutePos.x; + movement->absolutePos.y = part->absolutePos.y; + movement->absolutePos.z = part->absolutePos.z; - posX = movement->absolutePosition.x; - posY = movement->absolutePosition.y; - posZ = movement->absolutePosition.z; + posX = movement->absolutePos.x; + posY = movement->absolutePos.y; + posZ = movement->absolutePos.z; movement->angle = atan2(posX, posZ, goalX, goalZ); - movement->distance = dist2D(posX, posZ, goalX, goalZ); + movement->dist = dist2D(posX, posZ, goalX, goalZ); if (movement->moveTime == 0) { - movement->moveTime = movement->distance / movement->moveSpeed; + movement->moveTime = movement->dist / movement->moveSpeed; } else { - movement->moveSpeed = movement->distance / movement->moveTime; + movement->moveSpeed = movement->dist / movement->moveTime; } if (part->actorTypeData2b[0] >= 0) { - movement->distance = part->actorTypeData2b[0] + 1; + movement->dist = part->actorTypeData2b[0] + 1; } else { - movement->distance = ~part->actorTypeData2b[0]; + movement->dist = ~part->actorTypeData2b[0]; } if (part->partTypeData[0] != 0 && part->partTypeData[1] == 0) { - sfx_play_sound_at_position(part->partTypeData[0], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z); + sfx_play_sound_at_position(part->partTypeData[0], SOUND_SPACE_MODE_0, part->absolutePos.x, part->absolutePos.y, part->absolutePos.z); } script->functionTemp[0] = 1; } @@ -2026,44 +2026,44 @@ ApiStatus RunPartTo(Evt* script, s32 isInitialCall) { movement = part->movement; actor = script->functionTempPtr[1]; - add_xz_vec3f_copy1(&movement->absolutePosition, movement->moveSpeed, movement->angle); + add_xz_vec3f_copy1(&movement->absolutePos, movement->moveSpeed, movement->angle); if (movement->moveSpeed < 4.0f) { - play_movement_dust_effects(0, movement->absolutePosition.x, movement->absolutePosition.y, movement->absolutePosition.z, movement->angle); + play_movement_dust_effects(0, movement->absolutePos.x, movement->absolutePos.y, movement->absolutePos.z, movement->angle); } else { - play_movement_dust_effects(1, movement->absolutePosition.x, movement->absolutePosition.y, movement->absolutePosition.z, movement->angle); + play_movement_dust_effects(1, movement->absolutePos.x, movement->absolutePos.y, movement->absolutePos.z, movement->angle); } - part->absolutePosition.x = movement->absolutePosition.x; - part->absolutePosition.y = movement->absolutePosition.y; - part->absolutePosition.z = movement->absolutePosition.z; + part->absolutePos.x = movement->absolutePos.x; + part->absolutePos.y = movement->absolutePos.y; + part->absolutePos.z = movement->absolutePos.z; if (part->partTypeData[0] != 0 && part->partTypeData[1] != 0) { if (part->actorTypeData2b[0] >= 0) { - movement->distance += movement->moveSpeed; - if (part->actorTypeData2b[0] < movement->distance) { + movement->dist += movement->moveSpeed; + if (part->actorTypeData2b[0] < movement->dist) { actor->footStepCounter++; - movement->distance = 0; + movement->dist = 0; if (actor->footStepCounter % 2 != 0) { if (part->partTypeData[0] != 0) { - sfx_play_sound_at_position(part->partTypeData[0], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z); + sfx_play_sound_at_position(part->partTypeData[0], SOUND_SPACE_MODE_0, part->absolutePos.x, part->absolutePos.y, part->absolutePos.z); } } else { if (part->partTypeData[1] != 0) { - sfx_play_sound_at_position(part->partTypeData[1], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z); + sfx_play_sound_at_position(part->partTypeData[1], SOUND_SPACE_MODE_0, part->absolutePos.x, part->absolutePos.y, part->absolutePos.z); } } } } else { - movement->distance += 1.0f; - if (-part->actorTypeData2b[0] <= movement->distance) { + movement->dist += 1.0f; + if (-part->actorTypeData2b[0] <= movement->dist) { actor->footStepCounter++; - movement->distance = 0; + movement->dist = 0; if (actor->footStepCounter % 2 != 0) { if (part->partTypeData[0] != 0) { - sfx_play_sound_at_position(part->partTypeData[0], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z); + sfx_play_sound_at_position(part->partTypeData[0], SOUND_SPACE_MODE_0, part->absolutePos.x, part->absolutePos.y, part->absolutePos.z); } } else { if (part->partTypeData[1] != 0) { - sfx_play_sound_at_position(part->partTypeData[1], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z); + sfx_play_sound_at_position(part->partTypeData[1], SOUND_SPACE_MODE_0, part->absolutePos.x, part->absolutePos.y, part->absolutePos.z); } } } @@ -2074,8 +2074,8 @@ ApiStatus RunPartTo(Evt* script, s32 isInitialCall) { if (movement->moveTime > 0) { return ApiStatus_BLOCK; } else { - part->absolutePosition.x = movement->goalPos.x; - part->absolutePosition.z = movement->goalPos.z; + part->absolutePos.x = movement->goalPos.x; + part->absolutePos.z = movement->goalPos.z; if (part->partTypeData[0] != 0 && part->partTypeData[1] == 0) { snd_stop_sound(part->partTypeData[0]); } @@ -2180,27 +2180,27 @@ ApiStatus FlyToGoal(Evt* script, s32 isInitialCall) { goalY = actorState->goalPos.y; goalZ = actorState->goalPos.z; - posX = actor->currentPos.x; - posY = actor->currentPos.y; - posZ = actor->currentPos.z; + posX = actor->curPos.x; + posY = actor->curPos.y; + posZ = actor->curPos.z; deltaX = posX - goalX; deltaY = posY - goalY; deltaZ = posZ - goalZ; - actorState->currentPos.x = posX; + actorState->curPos.x = posX; actorState->unk_18.x = posX; - actorState->currentPos.y = posY; + actorState->curPos.y = posY; actorState->unk_18.y = posY; - actorState->currentPos.z = posZ; + actorState->curPos.z = posZ; actorState->unk_18.z = posZ; - actorState->distance = sqrtf(SQ(deltaX) + SQ(deltaY) + SQ(deltaZ)); + actorState->dist = sqrtf(SQ(deltaX) + SQ(deltaY) + SQ(deltaZ)); if (actorState->moveTime == 0) { - actorState->moveTime = actorState->distance / actorState->speed; + actorState->moveTime = actorState->dist / actorState->speed; } else { - actorState->speed = actorState->distance / actorState->moveTime; + actorState->speed = actorState->dist / actorState->moveTime; } if (actorState->moveTime == 0) { return ApiStatus_DONE2; @@ -2209,32 +2209,32 @@ ApiStatus FlyToGoal(Evt* script, s32 isInitialCall) { actorState->bounceDivisor = 0.0f; actorState->angle = 0.0f; if (actor->actorTypeData1b[1] >= 0) { - actorState->velocity = actor->actorTypeData1b[1] + 1; + actorState->vel = actor->actorTypeData1b[1] + 1; } else { - actorState->velocity = ~actor->actorTypeData1b[1]; + actorState->vel = ~actor->actorTypeData1b[1]; } if ((actor->actorTypeData1[2] != 0) && (actor->actorTypeData1[3] == 0)) { - sfx_play_sound_at_position(actor->actorTypeData1[2], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(actor->actorTypeData1[2], SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } } actor = script->functionTempPtr[1]; actorState = &actor->state; - actorState->currentPos.x = update_lerp_battle(script->functionTemp[3], actorState->unk_18.x, actorState->goalPos.x, actorState->bounceDivisor, actorState->moveTime); - actorState->currentPos.y = update_lerp_battle(script->functionTemp[3], actorState->unk_18.y, actorState->goalPos.y, actorState->bounceDivisor, actorState->moveTime); - actorState->currentPos.z = update_lerp_battle(script->functionTemp[3], actorState->unk_18.z, actorState->goalPos.z, actorState->bounceDivisor, actorState->moveTime); - if ((actorState->functionTemp[0]) && (actorState->currentPos.y < 0.0f)) { + actorState->curPos.x = update_lerp_battle(script->functionTemp[3], actorState->unk_18.x, actorState->goalPos.x, actorState->bounceDivisor, actorState->moveTime); + actorState->curPos.y = update_lerp_battle(script->functionTemp[3], actorState->unk_18.y, actorState->goalPos.y, actorState->bounceDivisor, actorState->moveTime); + actorState->curPos.z = update_lerp_battle(script->functionTemp[3], actorState->unk_18.z, actorState->goalPos.z, actorState->bounceDivisor, actorState->moveTime); + if ((actorState->functionTemp[0]) && (actorState->curPos.y < 0.0f)) { actorState->bounceDivisor = actorState->moveTime; - actorState->goalPos.x = actorState->currentPos.x; + actorState->goalPos.x = actorState->curPos.x; actorState->goalPos.y = 0.0f; - actorState->goalPos.z = actorState->currentPos.z; + actorState->goalPos.z = actorState->curPos.z; } actorState->bounceDivisor += 1.0f; if (actorState->moveTime < actorState->bounceDivisor) { - actor->currentPos.x = actorState->goalPos.x; - actor->currentPos.y = actorState->goalPos.y; - actor->currentPos.z = actorState->goalPos.z; + actor->curPos.x = actorState->goalPos.x; + actor->curPos.y = actorState->goalPos.y; + actor->curPos.z = actorState->goalPos.z; if (actor->actorTypeData1[2] != 0) { if (actor->actorTypeData1[3] == 0) { snd_stop_sound(actor->actorTypeData1[2]); @@ -2244,49 +2244,49 @@ ApiStatus FlyToGoal(Evt* script, s32 isInitialCall) { } if ((actor->actorTypeData1[2] != 0) && (actor->actorTypeData1[3] != 0)) { if (actor->actorTypeData1b[1] >= 0) { - actorState->velocity += actorState->speed; - if (actor->actorTypeData1b[1] < actorState->velocity) { + actorState->vel += actorState->speed; + if (actor->actorTypeData1b[1] < actorState->vel) { actor->footStepCounter++; - actorState->velocity = 0.0f; + actorState->vel = 0.0f; if (actor->footStepCounter & 1) { if (actor->actorTypeData1[2] != 0) { - sfx_play_sound_at_position(actor->actorTypeData1[2], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(actor->actorTypeData1[2], SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } } else { if (actor->actorTypeData1[3] != 0) { - sfx_play_sound_at_position(actor->actorTypeData1[3], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(actor->actorTypeData1[3], SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } } } } else { - actorState->velocity += 1.0f; - if (-actor->actorTypeData1b[1] <= actorState->velocity) { + actorState->vel += 1.0f; + if (-actor->actorTypeData1b[1] <= actorState->vel) { actor->footStepCounter++; - actorState->velocity = 0.0f; + actorState->vel = 0.0f; if (actor->footStepCounter & 1) { if (actor->actorTypeData1[2] != 0) { - sfx_play_sound_at_position(actor->actorTypeData1[2], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(actor->actorTypeData1[2], SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } } else { if (actor->actorTypeData1[3] != 0) { - sfx_play_sound_at_position(actor->actorTypeData1[3], SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(actor->actorTypeData1[3], SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } } } } } - deltaX = actorState->goalPos.x - actorState->currentPos.x; - deltaY = actorState->goalPos.y - actorState->currentPos.y; - deltaZ = actorState->goalPos.z - actorState->currentPos.z; + deltaX = actorState->goalPos.x - actorState->curPos.x; + deltaY = actorState->goalPos.y - actorState->curPos.y; + deltaZ = actorState->goalPos.z - actorState->curPos.z; dist3D = sqrtf(SQ(deltaX) + SQ(deltaY) + SQ(deltaZ)); if (dist3D == 0.0f) { dist3D = 1.0f; } - if (actorState->distance == 0.0f) { - actorState->distance = 1.0f; + if (actorState->dist == 0.0f) { + actorState->dist = 1.0f; } - offsetY = sin_deg((1.0 - (dist3D / actorState->distance)) * 180.0); + offsetY = sin_deg((1.0 - (dist3D / actorState->dist)) * 180.0); if (actorState->moveArcAmplitude == 0) { offsetY = 0.0f; } @@ -2296,9 +2296,9 @@ ApiStatus FlyToGoal(Evt* script, s32 isInitialCall) { if (actorState->moveArcAmplitude > 0) { offsetY = offsetY * actorState->moveArcAmplitude; } - actor->currentPos.x = actorState->currentPos.x; - actor->currentPos.y = actorState->currentPos.y + offsetY; - actor->currentPos.z = actorState->currentPos.z; + actor->curPos.x = actorState->curPos.x; + actor->curPos.y = actorState->curPos.y + offsetY; + actor->curPos.z = actorState->curPos.z; return ApiStatus_BLOCK; } @@ -2329,27 +2329,27 @@ ApiStatus IdleFlyToGoal(Evt* script, s32 isInitialCall) { goalY = movement->goalPos.y; goalZ = movement->goalPos.z; - posX = actor->currentPos.x; - posY = actor->currentPos.y; - posZ = actor->currentPos.z; + posX = actor->curPos.x; + posY = actor->curPos.y; + posZ = actor->curPos.z; deltaX = posX - goalX; deltaY = posY - goalY; deltaZ = posZ - goalZ; - movement->currentPos.x = posX; + movement->curPos.x = posX; movement->unk_18.x = posX; - movement->currentPos.y = posY; + movement->curPos.y = posY; movement->unk_18.y = posY; - movement->currentPos.z = posZ; + movement->curPos.z = posZ; movement->unk_18.z = posZ; - movement->distance = sqrtf(SQ(deltaX) + SQ(deltaY) + SQ(deltaZ)); + movement->dist = sqrtf(SQ(deltaX) + SQ(deltaY) + SQ(deltaZ)); if (movement->flyTime == 0) { - movement->flyTime = movement->distance / movement->speed; + movement->flyTime = movement->dist / movement->speed; } else { - movement->speed = movement->distance / movement->flyTime; + movement->speed = movement->dist / movement->flyTime; } if (movement->flyTime == 0) { return ApiStatus_DONE2; @@ -2357,36 +2357,36 @@ ApiStatus IdleFlyToGoal(Evt* script, s32 isInitialCall) { movement->flyElapsed = 0.0f; movement->angle = 0.0f; - movement->velocity = 0.0f; + movement->vel = 0.0f; } actor = script->functionTempPtr[1]; movement = &actor->fly; - movement->currentPos.x = update_lerp_battle(script->functionTemp[3], movement->unk_18.x, movement->goalPos.x, movement->flyElapsed, movement->flyTime); - movement->currentPos.y = update_lerp_battle(script->functionTemp[3], movement->unk_18.y, movement->goalPos.y, movement->flyElapsed, movement->flyTime); - movement->currentPos.z = update_lerp_battle(script->functionTemp[3], movement->unk_18.z, movement->goalPos.z, movement->flyElapsed, movement->flyTime); + movement->curPos.x = update_lerp_battle(script->functionTemp[3], movement->unk_18.x, movement->goalPos.x, movement->flyElapsed, movement->flyTime); + movement->curPos.y = update_lerp_battle(script->functionTemp[3], movement->unk_18.y, movement->goalPos.y, movement->flyElapsed, movement->flyTime); + movement->curPos.z = update_lerp_battle(script->functionTemp[3], movement->unk_18.z, movement->goalPos.z, movement->flyElapsed, movement->flyTime); movement->flyElapsed += 1.0f; if (movement->flyTime < movement->flyElapsed) { - actor->currentPos.x = movement->goalPos.x; - actor->currentPos.y = movement->goalPos.y; - actor->currentPos.z = movement->goalPos.z; + actor->curPos.x = movement->goalPos.x; + actor->curPos.y = movement->goalPos.y; + actor->curPos.z = movement->goalPos.z; return ApiStatus_DONE2; } - deltaX = movement->goalPos.x - movement->currentPos.x; - deltaY = movement->goalPos.y - movement->currentPos.y; - deltaZ = movement->goalPos.z - movement->currentPos.z; + deltaX = movement->goalPos.x - movement->curPos.x; + deltaY = movement->goalPos.y - movement->curPos.y; + deltaZ = movement->goalPos.z - movement->curPos.z; dist3D = sqrtf(SQ(deltaX) + SQ(deltaY) + SQ(deltaZ)); if (dist3D == 0.0f) { dist3D = 1.0f; } - if (movement->distance == 0.0f) { - movement->distance = 1.0f; + if (movement->dist == 0.0f) { + movement->dist = 1.0f; } - offsetY = sin_deg((1.0 - (dist3D / movement->distance)) * 180.0); + offsetY = sin_deg((1.0 - (dist3D / movement->dist)) * 180.0); if (movement->flyArcAmplitude == 0) { offsetY = 0.0f; } @@ -2397,9 +2397,9 @@ ApiStatus IdleFlyToGoal(Evt* script, s32 isInitialCall) { offsetY = offsetY * movement->flyArcAmplitude; } - actor->currentPos.x = movement->currentPos.x; - actor->currentPos.y = movement->currentPos.y + offsetY; - actor->currentPos.z = movement->currentPos.z; + actor->curPos.x = movement->curPos.x; + actor->curPos.y = movement->curPos.y + offsetY; + actor->curPos.z = movement->curPos.z; return ApiStatus_BLOCK; } @@ -2438,29 +2438,29 @@ ApiStatus FlyPartTo(Evt* script, s32 isInitialCall) { script->functionTemp[3] = evt_get_variable(script, *args++); goalX = partMovement->goalPos.x; - posX = part->absolutePosition.x; + posX = part->absolutePos.x; deltaX = posX - goalX; - partMovement->absolutePosition.x = posX; + partMovement->absolutePos.x = posX; partMovement->unk_18.x = posX; goalY = partMovement->goalPos.y; - posY = part->absolutePosition.y; + posY = part->absolutePos.y; deltaY = posY - goalY; - partMovement->absolutePosition.y = posY; + partMovement->absolutePos.y = posY; partMovement->unk_18.y = posY; goalZ = partMovement->goalPos.z; - posZ = part->absolutePosition.z; + posZ = part->absolutePos.z; deltaZ = posZ - goalZ; - partMovement->absolutePosition.z = posZ; + partMovement->absolutePos.z = posZ; partMovement->unk_18.z = posZ; - partMovement->distance = sqrtf(SQ(deltaX) + SQ(deltaY) + SQ(deltaZ)); + partMovement->dist = sqrtf(SQ(deltaX) + SQ(deltaY) + SQ(deltaZ)); if (partMovement->moveTime == 0) { - partMovement->moveTime = partMovement->distance / partMovement->moveSpeed; + partMovement->moveTime = partMovement->dist / partMovement->moveSpeed; } else { - partMovement->moveSpeed = partMovement->distance / partMovement->moveTime; + partMovement->moveSpeed = partMovement->dist / partMovement->moveTime; } if (partMovement->moveTime == 0) { @@ -2468,7 +2468,7 @@ ApiStatus FlyPartTo(Evt* script, s32 isInitialCall) { } if (part->partTypeData[2] != 0 && part->partTypeData[3] == 0) { - sfx_play_sound_at_position(part->partTypeData[2], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z); + sfx_play_sound_at_position(part->partTypeData[2], SOUND_SPACE_MODE_0, part->absolutePos.x, part->absolutePos.y, part->absolutePos.z); } partMovement->unk_3C = 0; partMovement->angle = 0.0f; @@ -2483,15 +2483,15 @@ ApiStatus FlyPartTo(Evt* script, s32 isInitialCall) { part = script->functionTempPtr[2]; actor = script->functionTempPtr[1]; partMovement = part->movement; - partMovement->absolutePosition.x = update_lerp_battle(script->functionTemp[3], partMovement->unk_18.x, partMovement->goalPos.x, partMovement->unk_3C, partMovement->moveTime); - partMovement->absolutePosition.y = update_lerp_battle(script->functionTemp[3], partMovement->unk_18.y, partMovement->goalPos.y, partMovement->unk_3C, partMovement->moveTime); - partMovement->absolutePosition.z = update_lerp_battle(script->functionTemp[3], partMovement->unk_18.z, partMovement->goalPos.z, partMovement->unk_3C, partMovement->moveTime); + partMovement->absolutePos.x = update_lerp_battle(script->functionTemp[3], partMovement->unk_18.x, partMovement->goalPos.x, partMovement->unk_3C, partMovement->moveTime); + partMovement->absolutePos.y = update_lerp_battle(script->functionTemp[3], partMovement->unk_18.y, partMovement->goalPos.y, partMovement->unk_3C, partMovement->moveTime); + partMovement->absolutePos.z = update_lerp_battle(script->functionTemp[3], partMovement->unk_18.z, partMovement->goalPos.z, partMovement->unk_3C, partMovement->moveTime); partMovement->unk_3C++; if (partMovement->moveTime < partMovement->unk_3C) { - part->absolutePosition.x = partMovement->goalPos.x; - part->absolutePosition.y = partMovement->goalPos.y; - part->absolutePosition.z = partMovement->goalPos.z; + part->absolutePos.x = partMovement->goalPos.x; + part->absolutePos.y = partMovement->goalPos.y; + part->absolutePos.z = partMovement->goalPos.z; if (part->partTypeData[2] != 0 && part->partTypeData[3] == 0) { snd_stop_sound(part->partTypeData[2]); } @@ -2506,11 +2506,11 @@ ApiStatus FlyPartTo(Evt* script, s32 isInitialCall) { partMovement->unk_2C = 0; if (actor->footStepCounter % 2 != 0) { if (part->partTypeData[2] != 0) { - sfx_play_sound_at_position(part->partTypeData[2], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z); + sfx_play_sound_at_position(part->partTypeData[2], SOUND_SPACE_MODE_0, part->absolutePos.x, part->absolutePos.y, part->absolutePos.z); } } else { if (part->partTypeData[3] != 0) { - sfx_play_sound_at_position(part->partTypeData[3], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z); + sfx_play_sound_at_position(part->partTypeData[3], SOUND_SPACE_MODE_0, part->absolutePos.x, part->absolutePos.y, part->absolutePos.z); } } } @@ -2521,29 +2521,29 @@ ApiStatus FlyPartTo(Evt* script, s32 isInitialCall) { partMovement->unk_2C = 0; if (actor->footStepCounter % 2 != 0) { if (part->partTypeData[2] != 0) { - sfx_play_sound_at_position(part->partTypeData[2], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z); + sfx_play_sound_at_position(part->partTypeData[2], SOUND_SPACE_MODE_0, part->absolutePos.x, part->absolutePos.y, part->absolutePos.z); } } else { if (part->partTypeData[3] != 0) { - sfx_play_sound_at_position(part->partTypeData[3], SOUND_SPACE_MODE_0, part->absolutePosition.x, part->absolutePosition.y, part->absolutePosition.z); + sfx_play_sound_at_position(part->partTypeData[3], SOUND_SPACE_MODE_0, part->absolutePos.x, part->absolutePos.y, part->absolutePos.z); } } } } } - deltaX = partMovement->goalPos.x - partMovement->absolutePosition.x; - deltaY = partMovement->goalPos.y - partMovement->absolutePosition.y; - deltaZ = partMovement->goalPos.z - partMovement->absolutePosition.z; + deltaX = partMovement->goalPos.x - partMovement->absolutePos.x; + deltaY = partMovement->goalPos.y - partMovement->absolutePos.y; + deltaZ = partMovement->goalPos.z - partMovement->absolutePos.z; dist3D = sqrtf(SQ(deltaX) + SQ(deltaY) + SQ(deltaZ)); if (dist3D == 0.0f) { dist3D = 1.0f; } - if (partMovement->distance == 0.0f) { - partMovement->distance = 1.0f; + if (partMovement->dist == 0.0f) { + partMovement->dist = 1.0f; } - offsetY = sin_deg((1.0 - dist3D / partMovement->distance) * 180.0); + offsetY = sin_deg((1.0 - dist3D / partMovement->dist) * 180.0); if (partMovement->unk_3A == 0) { offsetY = 0.0f; } @@ -2554,9 +2554,9 @@ ApiStatus FlyPartTo(Evt* script, s32 isInitialCall) { offsetY = offsetY * partMovement->unk_3A; } - part->absolutePosition.x = partMovement->absolutePosition.x; - part->absolutePosition.y = partMovement->absolutePosition.y + offsetY; - part->absolutePosition.z = partMovement->absolutePosition.z; + part->absolutePos.x = partMovement->absolutePos.x; + part->absolutePos.y = partMovement->absolutePos.y + offsetY; + part->absolutePos.z = partMovement->absolutePos.z; return ApiStatus_BLOCK; } @@ -2604,12 +2604,12 @@ ApiStatus SetEnemyHP(Evt* script, s32 isInitialCall) { newHP = evt_get_variable(script, *args++); actor = get_actor(actorID); - actor->currentHP = newHP; + actor->curHP = newHP; if (newHP > actor->maxHP) { - actor->currentHP = actor->maxHP; + actor->curHP = actor->maxHP; } - actor->healthFraction = (actor->currentHP * 25) / actor->maxHP; + actor->healthFraction = (actor->curHP * 25) / actor->maxHP; return ApiStatus_DONE2; } @@ -2637,7 +2637,7 @@ ApiStatus GetActorHP(Evt* script, s32 isInitialCall) { outVal = 99; break; default: - outVal = actor->currentHP; + outVal = actor->curHP; break; } @@ -2737,7 +2737,7 @@ ApiStatus DropStarPoints(Evt* script, s32 isInitialCall) { for (i = 0; i < numToDrop; i++) { make_item_entity_delayed(ITEM_STAR_POINT, - dropper->currentPos.x, dropper->currentPos.y, dropper->currentPos.z, spawnMode, i, 0); + dropper->curPos.x, dropper->curPos.y, dropper->curPos.z, spawnMode, i, 0); } battleStatus->incrementStarPointDelay = 40; @@ -2829,10 +2829,10 @@ ApiStatus EnemyDamageTarget(Evt* script, s32 isInitialCall) { actor = get_actor(actorID); outVar = *args++; - battleStatus->currentAttackElement = *args++; - battleStatus->currentAttackEventSuppression = *args++; - battleStatus->currentAttackStatus = *args++; - battleStatus->currentAttackDamage = evt_get_variable(script, *args++); + battleStatus->curAttackElement = *args++; + battleStatus->curAttackEventSuppression = *args++; + battleStatus->curAttackStatus = *args++; + battleStatus->curAttackDamage = evt_get_variable(script, *args++); battleFlagsModifier = *args++; if (battleFlagsModifier & BS_FLAGS1_10) { @@ -2862,14 +2862,14 @@ ApiStatus EnemyDamageTarget(Evt* script, s32 isInitialCall) { gBattleStatus.flags1 &= ~BS_FLAGS1_80; } - battleStatus->currentTargetID = actor->targetActorID; - battleStatus->currentTargetPart = actor->targetPartIndex; + battleStatus->curTargetID = actor->targetActorID; + battleStatus->curTargetPart = actor->targetPartIndex; - battleStatus->statusChance = battleStatus->currentAttackStatus & 0xFF; + battleStatus->statusChance = battleStatus->curAttackStatus & 0xFF; if (battleStatus->statusChance == STATUS_KEY_NEVER) { battleStatus->statusChance = 0; } - battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8; + battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8; hitResult = calc_enemy_damage_target(actor); if (hitResult < 0) { @@ -2900,15 +2900,15 @@ ApiStatus EnemyFollowupAfflictTarget(Evt* script, s32 isInitialCall) { actor = get_actor(actorID); outVar = *args++; - battleStatus->currentTargetID = actor->targetActorID; - battleStatus->currentTargetPart = actor->targetPartIndex; - battleStatus->statusChance = battleStatus->currentAttackStatus; + battleStatus->curTargetID = actor->targetActorID; + battleStatus->curTargetPart = actor->targetPartIndex; + battleStatus->statusChance = battleStatus->curAttackStatus; if (battleStatus->statusChance == STATUS_KEY_NEVER) { battleStatus->statusChance = 0; } - anotherBattleStatus->statusDuration = (anotherBattleStatus->currentAttackStatus & 0xF00) >> 8; + anotherBattleStatus->statusDuration = (anotherBattleStatus->curAttackStatus & 0xF00) >> 8; hitResults = calc_enemy_damage_target(actor); if (hitResults < 0) { @@ -2939,10 +2939,10 @@ ApiStatus EnemyTestTarget(Evt* script, s32 isInitialCall) { actor = get_actor(actorID); outVar = *args++; - battleStatus->currentAttackElement = *args++; - battleStatus->currentAttackEventSuppression = 0; - battleStatus->currentAttackStatus = *args++; - battleStatus->currentAttackDamage = evt_get_variable(script, *args++); + battleStatus->curAttackElement = *args++; + battleStatus->curAttackEventSuppression = 0; + battleStatus->curAttackStatus = *args++; + battleStatus->curAttackDamage = evt_get_variable(script, *args++); battleFlagsModifier = *args++; if (battleFlagsModifier & BS_FLAGS1_10) { @@ -2972,17 +2972,17 @@ ApiStatus EnemyTestTarget(Evt* script, s32 isInitialCall) { gBattleStatus.flags1 &= ~BS_FLAGS1_80; } - attackStatus = battleStatus->currentAttackStatus; - battleStatus->currentTargetID = actor->targetActorID; + attackStatus = battleStatus->curAttackStatus; + battleStatus->curTargetID = actor->targetActorID; - battleStatus->currentTargetPart = actor->targetPartIndex; + battleStatus->curTargetPart = actor->targetPartIndex; battleStatus->statusChance = attackStatus; if ((attackStatus & 0xFF) == 0xFF) { battleStatus->statusChance = 0; } - battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8; + battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8; hitResult = calc_enemy_test_target(actor); if (hitResult < 0) { diff --git a/src/1AC760.c b/src/1AC760.c index 35f23c61af..3728cdc043 100644 --- a/src/1AC760.c +++ b/src/1AC760.c @@ -48,14 +48,14 @@ void dispatch_event_partner_continue_turn(s8 lastEventType) { HitResult calc_partner_test_enemy(void) { BattleStatus* battleStatus = &gBattleStatus; Actor* partner = battleStatus->partnerActor; - s32 currentTargetID = battleStatus->currentTargetID; - s32 currentTargetPart = battleStatus->currentTargetPart; + s32 currentTargetID = battleStatus->curTargetID; + s32 currentTargetPart = battleStatus->curTargetPart; Actor* target; ActorState* state; ActorPart* part; - battleStatus->currentTargetID2 = battleStatus->currentTargetID; - battleStatus->currentTargetPart2 = battleStatus->currentTargetPart; + battleStatus->curTargetID2 = battleStatus->curTargetID; + battleStatus->curTargetPart2 = battleStatus->curTargetPart; target = get_actor(currentTargetID); state = &partner->state; @@ -75,7 +75,7 @@ HitResult calc_partner_test_enemy(void) { } // check partner jumping on top-spiky enemy (cannot be suppressed) - if ((battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP) + if ((battleStatus->curAttackElement & DAMAGE_TYPE_JUMP) && (part->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP) && !(target->flags2 & ACTOR_FLAG_UPSIDE_DOWN) ) { @@ -84,9 +84,9 @@ HitResult calc_partner_test_enemy(void) { } // check partner contacting front-spiky enemy - if (!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_JUMP)) + if (!(battleStatus->curAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_JUMP)) && (part->eventFlags & ACTOR_EVENT_FLAG_SPIKY_FRONT) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SPIKY_FRONT) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SPIKY_FRONT) && !player_team_is_ability_active(partner, ABILITY_SPIKE_SHIELD) ) { sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); @@ -96,9 +96,9 @@ HitResult calc_partner_test_enemy(void) { } // check partner contacting fiery enemy - if (!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SMASH)) + if (!(battleStatus->curAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SMASH)) && (part->eventFlags & ACTOR_EVENT_FLAG_FIREY) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_BURN_CONTACT) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_BURN_CONTACT) ) { sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); dispatch_damage_event_partner_1(1, EVENT_BURN_CONTACT); @@ -107,12 +107,12 @@ HitResult calc_partner_test_enemy(void) { } // specifal handling for air lift - if (battleStatus->currentAttackElement & DAMAGE_TYPE_AIR_LIFT) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_AIR_LIFT) { // check partner airlifting top-spiky enemy - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT)) { + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT)) { if ((part->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP) && !(target->flags & ACTOR_FLAG_UPSIDE_DOWN) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SPIKY_TOP) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SPIKY_TOP) ) { sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); dispatch_damage_event_partner_1(1, EVENT_SPIKE_CONTACT); @@ -120,10 +120,10 @@ HitResult calc_partner_test_enemy(void) { return HIT_RESULT_BACKFIRE; } - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT) && (part->eventFlags & ACTOR_EVENT_FLAG_200000) && !(target->flags & ACTOR_FLAG_UPSIDE_DOWN) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_FLAG_80) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_FLAG_80) ) { sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); dispatch_damage_event_partner_1(1, EVENT_SPIKE_CONTACT); @@ -135,8 +135,8 @@ HitResult calc_partner_test_enemy(void) { // check partner airlifting electrified enemy if (partner->staticStatus != STATUS_KEY_STATIC && (target->staticStatus == STATUS_KEY_STATIC || (part->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED)) - && !(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT)) + && !(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT)) { sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); apply_shock_effect(partner); @@ -145,9 +145,9 @@ HitResult calc_partner_test_enemy(void) { } // check partner airlifting fiery enemy - if (!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SMASH)) + if (!(battleStatus->curAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SMASH)) && (part->eventFlags & ACTOR_EVENT_FLAG_FIREY) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_BURN_CONTACT)) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_BURN_CONTACT)) { sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); dispatch_damage_event_partner_1(1, EVENT_BURN_CONTACT); @@ -162,8 +162,8 @@ HitResult calc_partner_test_enemy(void) { HitResult calc_partner_damage_enemy(void) { BattleStatus* battleStatus = &gBattleStatus; Actor* partner = battleStatus->partnerActor; - s32 currentTargetID = battleStatus->currentTargetID; - s32 currentTargetPartID = battleStatus->currentTargetPart; + s32 currentTargetID = battleStatus->curTargetID; + s32 currentTargetPartID = battleStatus->curTargetPart; s32 retVal; s32 partImmuneToElement = FALSE; s32 isFireDamage = FALSE; @@ -183,8 +183,8 @@ HitResult calc_partner_damage_enemy(void) { battleStatus->wasStatusInflicted = FALSE; battleStatus->lastAttackDamage = 0; battleStatus->attackerActorID = partner->actorID; - battleStatus->currentTargetID2 = battleStatus->currentTargetID; - battleStatus->currentTargetPart2 = battleStatus->currentTargetPart; + battleStatus->curTargetID2 = battleStatus->curTargetID; + battleStatus->curTargetPart2 = battleStatus->curTargetPart; target = get_actor(currentTargetID); state = &partner->state; @@ -205,7 +205,7 @@ HitResult calc_partner_damage_enemy(void) { } else { if (targetPart->eventFlags & ACTOR_EVENT_FLAG_ILLUSORY || target->transparentStatus == STATUS_KEY_TRANSPARENT - || (targetPart->eventFlags & ACTOR_EVENT_FLAG_800 && !(battleStatus->currentAttackElement & DAMAGE_TYPE_QUAKE)) + || (targetPart->eventFlags & ACTOR_EVENT_FLAG_800 && !(battleStatus->curAttackElement & DAMAGE_TYPE_QUAKE)) ) { return HIT_RESULT_MISS; } @@ -220,12 +220,12 @@ HitResult calc_partner_damage_enemy(void) { return HIT_RESULT_HIT; } - if (targetPart->elementalImmunities & battleStatus->currentAttackElement) { + if (targetPart->elementalImmunities & battleStatus->curAttackElement) { partImmuneToElement = TRUE; } // check jumping on spiky enemy - if (battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP + if (battleStatus->curAttackElement & DAMAGE_TYPE_JUMP && targetPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP ) { sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); @@ -235,12 +235,12 @@ HitResult calc_partner_damage_enemy(void) { } // check explode on contact - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT) && targetPart->eventFlags & ACTOR_EVENT_FLAG_EXPLODE_ON_CONTACT ) { dispatch_event_actor(target, EVENT_EXPLODE_TRIGGER); - if (!(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_EXPLODE_CONTACT)) { + if (!(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_EXPLODE_CONTACT)) { sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); dispatch_damage_event_partner_1(1, EVENT_BURN_CONTACT); return HIT_RESULT_BACKFIRE; @@ -254,9 +254,9 @@ HitResult calc_partner_damage_enemy(void) { } // check touching fiery enemy - if (!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SMASH)) + if (!(battleStatus->curAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SMASH)) && targetPart->eventFlags & ACTOR_EVENT_FLAG_FIREY - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_BURN_CONTACT) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_BURN_CONTACT) ) { sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); dispatch_damage_event_partner_1(1, EVENT_BURN_CONTACT); @@ -265,9 +265,9 @@ HitResult calc_partner_damage_enemy(void) { } // check touching spiky-front enemy - if (!(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_JUMP)) + if (!(battleStatus->curAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_JUMP)) && targetPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_FRONT - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SPIKY_FRONT) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SPIKY_FRONT) ) { sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); dispatch_damage_event_partner_1(1, EVENT_SPIKE_CONTACT); @@ -277,7 +277,7 @@ HitResult calc_partner_damage_enemy(void) { // check explode on ignition if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE - && battleStatus->currentAttackElement & DAMAGE_TYPE_FIRE + && battleStatus->curAttackElement & DAMAGE_TYPE_FIRE && targetPart->eventFlags & (ACTOR_EVENT_FLAG_FIRE_EXPLODE | ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION) ) { sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); @@ -289,10 +289,10 @@ HitResult calc_partner_damage_enemy(void) { } // unknown alternate spiky #1 - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT) && targetPart->eventFlags & ACTOR_EVENT_FLAG_200000 && !(target->flags & ACTOR_FLAG_UPSIDE_DOWN) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_FLAG_80) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_FLAG_80) ) { sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); dispatch_damage_event_partner_1(1, EVENT_SPIKE_CONTACT); @@ -301,10 +301,10 @@ HitResult calc_partner_damage_enemy(void) { } // unknown alternate spiky top - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT) && targetPart->eventFlags & ACTOR_EVENT_FLAG_SPIKY_TOP && !(target->flags & ACTOR_FLAG_UPSIDE_DOWN) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SPIKY_TOP) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SPIKY_TOP) ) { sfx_play_sound_at_position(SOUND_108, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); dispatch_damage_event_partner_1(1, EVENT_SPIKE_CONTACT); @@ -314,7 +314,7 @@ HitResult calc_partner_damage_enemy(void) { // check explode on ignition (duplicate of previous check) if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE - && battleStatus->currentAttackElement & DAMAGE_TYPE_FIRE + && battleStatus->curAttackElement & DAMAGE_TYPE_FIRE && targetPart->eventFlags & (ACTOR_EVENT_FLAG_FIRE_EXPLODE | ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION) ) { sfx_play_sound_at_position(SOUND_HIT_FIRE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); @@ -326,11 +326,11 @@ HitResult calc_partner_damage_enemy(void) { } // check shock contact for airlift - if (battleStatus->currentAttackElement & DAMAGE_TYPE_AIR_LIFT) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_AIR_LIFT) { if (partner->staticStatus != STATUS_KEY_STATIC && (target->staticStatus == STATUS_KEY_STATIC || targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED) - && !(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT) + && !(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT) ) { sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); apply_shock_effect(partner); @@ -340,56 +340,56 @@ HitResult calc_partner_damage_enemy(void) { return HIT_RESULT_HIT; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_FIRE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_FIRE) { fx_ring_blast(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f, 1.0f, 24); isFireDamage = TRUE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_SHOCK) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_SHOCK) { apply_shock_effect(target); isShockDamage = TRUE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_WATER) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_WATER) { fx_water_splash(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f, 1.0f, 24); isWaterDamage = TRUE; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_ICE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_ICE) { fx_big_snowflakes(0, state->goalPos.x, state->goalPos.y, state->goalPos.z + 5.0f); isIceDamage = TRUE; } if (partner->staticStatus != STATUS_KEY_STATIC && (target->staticStatus == STATUS_KEY_STATIC || targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED) - && !(battleStatus->currentAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SHOCK)) - && !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT) + && !(battleStatus->curAttackElement & (DAMAGE_TYPE_NO_CONTACT | DAMAGE_TYPE_SHOCK)) + && !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT) ) { gBattleStatus.flags1 |= BS_FLAGS1_SP_EVT_ACTIVE; } if (targetPart->eventFlags & (ACTOR_EVENT_FLAG_STAR_ROD_ENCHANTED | ACTOR_EVENT_FLAG_ENCHANTED)) { - battleStatus->currentAttackElement &= ~DAMAGE_TYPE_IGNORE_DEFENSE; + battleStatus->curAttackElement &= ~DAMAGE_TYPE_IGNORE_DEFENSE; } - statusChanceOrDefense = get_defense(target, targetPart->defenseTable, battleStatus->currentAttackElement); + statusChanceOrDefense = get_defense(target, targetPart->defenseTable, battleStatus->curAttackElement); - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_IGNORE_DEFENSE)) { + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_IGNORE_DEFENSE)) { statusChanceOrDefense += target->defenseBoost; } - damageDealt = battleStatus->currentAttackDamage + partner->attackBoost; + damageDealt = battleStatus->curAttackDamage + partner->attackBoost; if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { - if (battleStatus->currentAttackElement & DAMAGE_TYPE_BLAST + if (battleStatus->curAttackElement & DAMAGE_TYPE_BLAST && targetPart->eventFlags & ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION ) { statusChanceOrDefense = 0; - damageDealt = target->currentHP; + damageDealt = target->curHP; } } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS) { statusChanceOrDefense = 0; damageDealt = 0; } @@ -419,7 +419,7 @@ HitResult calc_partner_damage_enemy(void) { damageDealt = 0; } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_POWER_BOUNCE && damageDealt > 0) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_POWER_BOUNCE && damageDealt > 0) { damageDealt += battleStatus->powerBounceCounter; if (damageDealt < 1) { @@ -432,13 +432,13 @@ HitResult calc_partner_damage_enemy(void) { if (damageDealt < 1) { target->hpChangeCounter = 0; - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS)) { + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS)) { retVal = 2; dispatchEvent = EVENT_ZERO_DAMAGE; sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } else { retVal = 2; - if (target->currentHP < 1) { + if (target->curHP < 1) { dispatchEvent = EVENT_DEATH; } else { dispatchEvent = EVENT_ZERO_DAMAGE; @@ -458,10 +458,10 @@ HitResult calc_partner_damage_enemy(void) { && !partImmuneToElement && !(targetPart->targetFlags & ACTOR_PART_TARGET_FLAG_4) ) { - target->currentHP -= damageDealt; + target->curHP -= damageDealt; - if (target->currentHP < 1) { - target->currentHP = 0; + if (target->curHP < 1) { + target->curHP = 0; dispatchEvent = EVENT_DEATH; } } @@ -474,8 +474,8 @@ HitResult calc_partner_damage_enemy(void) { if (targetPart->flags & ACTOR_PART_FLAG_2000) { if (partner->staticStatus == STATUS_KEY_STATIC || !(target->staticStatus == STATUS_KEY_STATIC || (targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED)) - || battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT - || battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT + || battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT + || battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT ) { dispatchEvent = (!(gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE)) ? EVENT_ZERO_DAMAGE : EVENT_IMMUNE; sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); @@ -503,7 +503,7 @@ HitResult calc_partner_damage_enemy(void) { dispatchEvent = EVENT_IMMUNE; } - if (target->currentHP < 1) { + if (target->curHP < 1) { if (dispatchEvent == EVENT_IMMUNE) { dispatchEvent = EVENT_DEATH; } @@ -517,7 +517,7 @@ HitResult calc_partner_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { - if (battleStatus->currentAttackElement & DAMAGE_TYPE_SPIN_SMASH) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_SPIN_SMASH) { if (dispatchEvent == EVENT_HIT) { dispatchEvent = EVENT_SPIN_SMASH_HIT; } @@ -530,7 +530,7 @@ HitResult calc_partner_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { - if (!(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) && targetPart->eventFlags & ACTOR_EVENT_FLAG_POWER_BOUNCE) { + if (!(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT) && targetPart->eventFlags & ACTOR_EVENT_FLAG_POWER_BOUNCE) { if (dispatchEvent == EVENT_HIT_COMBO) { dispatchEvent = EVENT_POWER_BOUNCE_HIT; } @@ -553,7 +553,7 @@ HitResult calc_partner_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { - if (battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP && targetPart->eventFlags & ACTOR_EVENT_FLAG_GROUNDABLE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_JUMP && targetPart->eventFlags & ACTOR_EVENT_FLAG_GROUNDABLE) { if (dispatchEvent == EVENT_HIT) { dispatchEvent = EVENT_FALL_TRIGGER; } @@ -566,7 +566,7 @@ HitResult calc_partner_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { - if (battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP && targetPart->eventFlags & ACTOR_EVENT_FLAG_FLIPABLE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_JUMP && targetPart->eventFlags & ACTOR_EVENT_FLAG_FLIPABLE) { if (dispatchEvent == EVENT_HIT) { dispatchEvent = EVENT_FLIP_TRIGGER; } @@ -585,7 +585,7 @@ HitResult calc_partner_damage_enemy(void) { } if (!(gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) - && battleStatus->currentAttackElement & DAMAGE_TYPE_JUMP + && battleStatus->curAttackElement & DAMAGE_TYPE_JUMP && targetPart->eventFlags & ACTOR_EVENT_FLAG_FLIPABLE ) { if (dispatchEvent == EVENT_HIT_COMBO) { @@ -602,7 +602,7 @@ HitResult calc_partner_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE - && battleStatus->currentAttackElement & DAMAGE_TYPE_BLAST + && battleStatus->curAttackElement & DAMAGE_TYPE_BLAST && targetPart->eventFlags & ACTOR_EVENT_FLAG_EXPLODE_ON_IGNITION ) { if (dispatchEvent == EVENT_DEATH) { @@ -622,7 +622,7 @@ HitResult calc_partner_damage_enemy(void) { } if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { - if (battleStatus->currentAttackElement & (DAMAGE_TYPE_BLAST | DAMAGE_TYPE_FIRE)) { + if (battleStatus->curAttackElement & (DAMAGE_TYPE_BLAST | DAMAGE_TYPE_FIRE)) { if (dispatchEvent == EVENT_HIT) { dispatchEvent = EVENT_BURN_HIT; } @@ -643,7 +643,7 @@ HitResult calc_partner_damage_enemy(void) { && !(targetPart->targetFlags & ACTOR_PART_TARGET_FLAG_4) ) { #define INFLICT_STATUS(STATUS_TYPE) \ - if ((battleStatus->currentAttackStatus & STATUS_FLAG_##STATUS_TYPE) && \ + if ((battleStatus->curAttackStatus & STATUS_FLAG_##STATUS_TYPE) && \ try_inflict_status(target, STATUS_KEY_##STATUS_TYPE, STATUS_TURN_MOD_##STATUS_TYPE)) { \ tempBinary = TRUE; \ wasStatusInflicted = TRUE; \ @@ -669,7 +669,7 @@ HitResult calc_partner_damage_enemy(void) { statusChanceOrDefense = (battleStatus->statusChance * statusChanceOrDefense) / 100; - if (battleStatus->currentAttackStatus & STATUS_FLAG_400000) { + if (battleStatus->curAttackStatus & STATUS_FLAG_400000) { if (rand_int(99) < statusChanceOrDefense) { if (!(target->debuff == STATUS_KEY_FEAR || target->debuff == STATUS_KEY_DIZZY @@ -712,7 +712,7 @@ HitResult calc_partner_damage_enemy(void) { statusChanceOrDefense = (battleStatus->statusChance * statusChanceOrDefense) / 100; if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { - if (battleStatus->currentAttackElement & DAMAGE_TYPE_FEAR) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_FEAR) { if (rand_int(99) < statusChanceOrDefense) { if (!(target->debuff == STATUS_KEY_FEAR || target->debuff == STATUS_KEY_DIZZY || @@ -746,7 +746,7 @@ HitResult calc_partner_damage_enemy(void) { show_immune_bonk(state->goalPos.x, state->goalPos.y, state->goalPos.z, 0, 1, 3); } } else if (!partImmuneToElement) { - if (battleStatus->currentAttackElement & (DAMAGE_TYPE_MULTIPLE_POPUPS | DAMAGE_TYPE_SMASH)) { + if (battleStatus->curAttackElement & (DAMAGE_TYPE_MULTIPLE_POPUPS | DAMAGE_TYPE_SMASH)) { show_next_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 0); } else { show_primary_damage_popup(state->goalPos.x, state->goalPos.y, state->goalPos.z, battleStatus->lastAttackDamage, 0); @@ -767,7 +767,7 @@ HitResult calc_partner_damage_enemy(void) { sfx_play_sound_at_position(SOUND_231, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->lastAttackDamage > 0 || (battleStatus->currentAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS && tempBinary)) { + if (battleStatus->lastAttackDamage > 0 || (battleStatus->curAttackElement & DAMAGE_TYPE_STATUS_ALWAYS_HITS && tempBinary)) { if (gBattleStatus.flags1 & BS_FLAGS1_40) { show_action_rating(ACTION_RATING_NICE, target, state->goalPos.x, state->goalPos.y, state->goalPos.z); } else { @@ -807,7 +807,7 @@ HitResult calc_partner_damage_enemy(void) { sfx_play_sound_at_position(SOUND_IMMUNE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackStatus & STATUS_FLAG_SLEEP && wasStatusInflicted) { + if (battleStatus->curAttackStatus & STATUS_FLAG_SLEEP && wasStatusInflicted) { evt = start_script((EvtScript*) EVS_PlaySleepHitFX, EVT_PRIORITY_A, 0); evt->varTable[0] = state->goalPos.x; evt->varTable[1] = state->goalPos.y; @@ -815,7 +815,7 @@ HitResult calc_partner_damage_enemy(void) { sfx_play_sound_at_position(SOUND_INFLICT_SLEEP, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackStatus & STATUS_FLAG_DIZZY && wasStatusInflicted) { + if (battleStatus->curAttackStatus & STATUS_FLAG_DIZZY && wasStatusInflicted) { evt = start_script((EvtScript*) EVS_PlayDizzyHitFX, EVT_PRIORITY_A, 0); evt->varTable[0] = state->goalPos.x; evt->varTable[1] = state->goalPos.y; @@ -823,7 +823,7 @@ HitResult calc_partner_damage_enemy(void) { sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackStatus & STATUS_FLAG_PARALYZE && wasStatusInflicted) { + if (battleStatus->curAttackStatus & STATUS_FLAG_PARALYZE && wasStatusInflicted) { evt = start_script((EvtScript*) EVS_PlayParalyzeHitFX, EVT_PRIORITY_A, 0); evt->varTable[0] = state->goalPos.x; evt->varTable[1] = state->goalPos.y; @@ -831,7 +831,7 @@ HitResult calc_partner_damage_enemy(void) { sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackStatus & STATUS_FLAG_POISON && wasStatusInflicted) { + if (battleStatus->curAttackStatus & STATUS_FLAG_POISON && wasStatusInflicted) { evt = start_script((EvtScript*) EVS_PlayPoisonHitFX, EVT_PRIORITY_A, 0); evt->varTable[0] = state->goalPos.x; evt->varTable[1] = state->goalPos.y; @@ -839,7 +839,7 @@ HitResult calc_partner_damage_enemy(void) { sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackStatus & STATUS_FLAG_STOP && wasStatusInflicted) { + if (battleStatus->curAttackStatus & STATUS_FLAG_STOP && wasStatusInflicted) { evt = start_script((EvtScript*) EVS_PlayStopHitFX, EVT_PRIORITY_A, 0); evt->varTable[0] = state->goalPos.x; evt->varTable[1] = state->goalPos.y; @@ -847,7 +847,7 @@ HitResult calc_partner_damage_enemy(void) { sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackStatus & STATUS_FLAG_FROZEN && wasStatusInflicted) { + if (battleStatus->curAttackStatus & STATUS_FLAG_FROZEN && wasStatusInflicted) { evt = start_script((EvtScript*) EVS_PlayFreezeHitFX, EVT_PRIORITY_A, 0); evt->varTable[0] = state->goalPos.x; evt->varTable[1] = state->goalPos.y; @@ -856,7 +856,7 @@ HitResult calc_partner_damage_enemy(void) { sfx_play_sound_at_position(SOUND_HIT_ICE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackStatus & STATUS_FLAG_SHRINK && wasStatusInflicted) { + if (battleStatus->curAttackStatus & STATUS_FLAG_SHRINK && wasStatusInflicted) { evt = start_script((EvtScript*) EVS_PlayShrinkHitFX, EVT_PRIORITY_A, 0); evt->varTable[0] = state->goalPos.x; evt->varTable[1] = state->goalPos.y; @@ -865,7 +865,7 @@ HitResult calc_partner_damage_enemy(void) { sfx_play_sound_at_position(SOUND_INFLICT_STATUS, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } - if (battleStatus->currentAttackElement & DAMAGE_TYPE_SMASH && target->actorType == ACTOR_TYPE_GOOMNUT_TREE) { + if (battleStatus->curAttackElement & DAMAGE_TYPE_SMASH && target->actorType == ACTOR_TYPE_GOOMNUT_TREE) { sfx_play_sound_at_position(SOUND_SMASH_GOOMNUT_TREE, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); } @@ -882,8 +882,8 @@ HitResult calc_partner_damage_enemy(void) { } if (partner->staticStatus != STATUS_KEY_STATIC && (target->staticStatus == STATUS_KEY_STATIC || - targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED) && !(battleStatus->currentAttackElement & DAMAGE_TYPE_NO_CONTACT) && - !(battleStatus->currentAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT)) { + targetPart->eventFlags & ACTOR_EVENT_FLAG_ELECTRIFIED) && !(battleStatus->curAttackElement & DAMAGE_TYPE_NO_CONTACT) && + !(battleStatus->curAttackEventSuppression & SUPPRESS_EVENT_SHOCK_CONTACT)) { sfx_play_sound_at_position(SOUND_HIT_SHOCK, SOUND_SPACE_MODE_0, state->goalPos.x, state->goalPos.y, state->goalPos.z); apply_shock_effect(partner); dispatch_damage_event_partner_1(1, EVENT_SHOCK_HIT); @@ -900,27 +900,27 @@ s32 dispatch_damage_event_partner(s32 damageAmount, s32 event, s32 stopMotion) { s32 hpChange; s32 flagCheck; - battleStatus->currentAttackDamage = damageAmount; + battleStatus->curAttackDamage = damageAmount; hpChange = (s16)damageAmount; partner->hpChangeCounter += hpChange; hpChange = partner->hpChangeCounter; - partner->currentHP = 127; + partner->curHP = 127; partner->damageCounter += hpChange; partner->hpChangeCounter -= hpChange; battleStatus->lastAttackDamage = 0; - partner->currentHP -= hpChange; + partner->curHP -= hpChange; - if (partner->currentHP <= 0) { + if (partner->curHP <= 0) { event = EVENT_DEATH; - battleStatus->lastAttackDamage += partner->currentHP; - partner->currentHP = 0; + battleStatus->lastAttackDamage += partner->curHP; + partner->curHP = 0; } battleStatus->lastAttackDamage += hpChange; partner->lastDamageTaken = battleStatus->lastAttackDamage; - battleStatus->currentDamageSource = DMG_SRC_DEFAULT; + battleStatus->curDamageSource = DMG_SRC_DEFAULT; if (gBattleStatus.flags1 & BS_FLAGS1_SP_EVT_ACTIVE) { if (event == EVENT_HIT_COMBO) { event = EVENT_HIT; @@ -1043,10 +1043,10 @@ ApiStatus PartnerDamageEnemy(Evt* script, s32 isInitialCall) { s32 damageResult; u8 statusChance; - gBattleStatus.currentAttackElement = *args++; - gBattleStatus.currentAttackEventSuppression = *args++; - gBattleStatus.currentAttackStatus = *args++; - gBattleStatus.currentAttackDamage = evt_get_variable(script, *args++); + gBattleStatus.curAttackElement = *args++; + gBattleStatus.curAttackEventSuppression = *args++; + gBattleStatus.curAttackStatus = *args++; + gBattleStatus.curAttackDamage = evt_get_variable(script, *args++); gBattleStatus.powerBounceCounter = 0; flags = *args++; @@ -1088,16 +1088,16 @@ ApiStatus PartnerDamageEnemy(Evt* script, s32 isInitialCall) { gBattleStatus.flags1 &= ~BS_FLAGS1_FORCE_HIT_IMMUNE; } - statusChance = battleStatus->currentAttackStatus; - battleStatus->currentTargetID = enemy->targetActorID; - battleStatus->currentTargetPart = enemy->targetPartIndex; + statusChance = battleStatus->curAttackStatus; + battleStatus->curTargetID = enemy->targetActorID; + battleStatus->curTargetPart = enemy->targetPartIndex; battleStatus->statusChance = statusChance; if (statusChance == STATUS_KEY_NEVER) { battleStatus->statusChance = 0; } - battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8; + battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8; damageResult = calc_partner_damage_enemy(); if (damageResult < 0) { @@ -1122,11 +1122,11 @@ ApiStatus PartnerAfflictEnemy(Evt* script, s32 isInitialCall) { u8 statusChance; s32 damageResult; - battleStatus->currentAttackElement = *args++; - battleStatus->currentAttackEventSuppression = *args++; - battleStatus->currentAttackStatus = *args++; - battleStatus->currentAttackStatus |= evt_get_variable(script, *args++); - battleStatus->currentAttackDamage = evt_get_variable(script, *args++); + battleStatus->curAttackElement = *args++; + battleStatus->curAttackEventSuppression = *args++; + battleStatus->curAttackStatus = *args++; + battleStatus->curAttackStatus |= evt_get_variable(script, *args++); + battleStatus->curAttackDamage = evt_get_variable(script, *args++); battleStatus->powerBounceCounter = 0; flags = *args++; @@ -1165,16 +1165,16 @@ ApiStatus PartnerAfflictEnemy(Evt* script, s32 isInitialCall) { gBattleStatus.flags1 &= ~BS_FLAGS1_FORCE_HIT_IMMUNE; } - statusChance = battleStatus->currentAttackStatus; - battleStatus->currentTargetID = actor->targetActorID; - battleStatus->currentTargetPart = actor->targetPartIndex; + statusChance = battleStatus->curAttackStatus; + battleStatus->curTargetID = actor->targetActorID; + battleStatus->curTargetPart = actor->targetPartIndex; battleStatus->statusChance = statusChance; if (statusChance == STATUS_KEY_NEVER) { battleStatus->statusChance = 0; } - battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8; + battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8; damageResult = calc_partner_damage_enemy(); if (damageResult < 0) { @@ -1199,10 +1199,10 @@ ApiStatus PartnerPowerBounceEnemy(Evt* script, s32 isInitialCall) { u8 statusChance; s32 damageResult; - battleStatus->currentAttackElement = *args++; - battleStatus->currentAttackEventSuppression = *args++; - battleStatus->currentAttackStatus = *args++; - battleStatus->currentAttackDamage = evt_get_variable(script, *args++); + battleStatus->curAttackElement = *args++; + battleStatus->curAttackEventSuppression = *args++; + battleStatus->curAttackStatus = *args++; + battleStatus->curAttackDamage = evt_get_variable(script, *args++); battleStatus->powerBounceCounter = evt_get_variable(script, *args++); flags = *args++; @@ -1241,16 +1241,16 @@ ApiStatus PartnerPowerBounceEnemy(Evt* script, s32 isInitialCall) { gBattleStatus.flags1 &= ~BS_FLAGS1_FORCE_HIT_IMMUNE; } - statusChance = battleStatus->currentAttackStatus; - battleStatus->currentTargetID = actor->targetActorID; - battleStatus->currentTargetPart = actor->targetPartIndex; + statusChance = battleStatus->curAttackStatus; + battleStatus->curTargetID = actor->targetActorID; + battleStatus->curTargetPart = actor->targetPartIndex; battleStatus->statusChance = statusChance; if (statusChance == STATUS_KEY_NEVER) { battleStatus->statusChance = 0; } - battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8; + battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8; damageResult = calc_partner_damage_enemy(); if (damageResult < 0) { @@ -1277,10 +1277,10 @@ ApiStatus PartnerTestEnemy(Evt* script, s32 isInitialCall) { u8 statusChance; temp_s4 = *args++; - gBattleStatus.currentAttackElement = *args++; - gBattleStatus.currentAttackEventSuppression = *args++; - gBattleStatus.currentAttackStatus = *args++; - gBattleStatus.currentAttackDamage = evt_get_variable(script, *args++); + gBattleStatus.curAttackElement = *args++; + gBattleStatus.curAttackEventSuppression = *args++; + gBattleStatus.curAttackStatus = *args++; + gBattleStatus.curAttackDamage = evt_get_variable(script, *args++); gBattleStatus.powerBounceCounter = 0; flags = *args++; @@ -1322,16 +1322,16 @@ ApiStatus PartnerTestEnemy(Evt* script, s32 isInitialCall) { gBattleStatus.flags1 &= ~BS_FLAGS1_FORCE_HIT_IMMUNE; } - statusChance = battleStatus->currentAttackStatus; - battleStatus->currentTargetID = enemy->targetActorID; - battleStatus->currentTargetPart = enemy->targetPartIndex; + statusChance = battleStatus->curAttackStatus; + battleStatus->curTargetID = enemy->targetActorID; + battleStatus->curTargetPart = enemy->targetPartIndex; battleStatus->statusChance = statusChance; if (statusChance == STATUS_KEY_NEVER) { battleStatus->statusChance = 0; } - battleStatus->statusDuration = (battleStatus->currentAttackStatus & 0xF00) >> 8; + battleStatus->statusDuration = (battleStatus->curAttackStatus & 0xF00) >> 8; damageResult = calc_partner_test_enemy(); if (damageResult < 0) { @@ -1350,8 +1350,8 @@ ApiStatus func_8028070C(Evt* script, s32 isInitialCall) { s32 damageAmount = evt_get_variable(script, *args++); s32 event = evt_get_variable(script, *args++); - battleStatus->currentTargetID = actor->targetActorID; - battleStatus->currentTargetPart = actor->targetPartIndex; + battleStatus->curTargetID = actor->targetActorID; + battleStatus->curTargetPart = actor->targetPartIndex; if (dispatch_damage_event_partner_0(damageAmount, event, (s32) battleStatus) >= 0) { return does_script_exist_by_ref(script) ? ApiStatus_DONE2 : ApiStatus_BLOCK; diff --git a/src/23680.c b/src/23680.c index 6f4e81969f..604dc11b7f 100644 --- a/src/23680.c +++ b/src/23680.c @@ -39,7 +39,7 @@ void spawn_drops(Enemy* enemy) { spawnCounter = 0; availableRenderTasks = 256 - 10 - gLastRenderTaskCount; - angle = clamp_angle(camera->currentYaw + 90.0f); + angle = clamp_angle(camera->curYaw + 90.0f); x = npc->pos.x; y = npc->pos.y + (npc->collisionHeight / 2); z = npc->pos.z; @@ -436,14 +436,14 @@ s32 basic_ai_check_player_dist(EnemyDetectVolume* territory, Enemy* enemy, f32 r return FALSE; } - if (territory->halfHeight <= fabsf(npc->pos.y - playerStatus->position.y) + if (territory->halfHeight <= fabsf(npc->pos.y - playerStatus->pos.y) && !(territory->detectFlags & AI_TERRITORY_IGNORE_ELEVATION)) { return FALSE; } if (territory->sizeX | territory->sizeZ && is_point_within_region(territory->shape, territory->pointX, territory->pointZ, - playerStatus->position.x, playerStatus->position.z, + playerStatus->pos.x, playerStatus->pos.z, territory->sizeX, territory->sizeZ)) { return FALSE; } @@ -457,10 +457,10 @@ s32 basic_ai_check_player_dist(EnemyDetectVolume* territory, Enemy* enemy, f32 r x = npc->pos.x; y = npc->pos.y + npc->collisionHeight * 0.5; z = npc->pos.z; - dist = dist2D(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + dist = dist2D(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); if (npc_test_move_simple_with_slipping(COLLISION_CHANNEL_10000 | COLLISION_IGNORE_ENTITIES, &x, &y, &z, - dist, atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z), + dist, atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z), 0.1f, 0.1f)) { return FALSE; } @@ -487,7 +487,7 @@ s32 basic_ai_check_player_dist(EnemyDetectVolume* territory, Enemy* enemy, f32 r } else { add_vec2D_polar(&x, &z, fwdPosOffset, 270.0f - npc->renderYaw); } - if (dist2D(x, z, playerStatus->position.x, playerStatus->position.z) <= radius) { + if (dist2D(x, z, playerStatus->pos.x, playerStatus->pos.z) <= radius) { return TRUE; } } @@ -514,7 +514,7 @@ s32 ai_check_player_dist(Enemy* enemy, s32 chance, f32 radius, f32 moveSpeed) { posZ = npc->pos.z; add_vec2D_polar(&posX, &posZ, moveSpeed, 270.0f - npc->renderYaw); - if (dist2D(posX, posZ, playerStatus->position.x, playerStatus->position.z) <= radius) { + if (dist2D(posX, posZ, playerStatus->pos.x, playerStatus->pos.z) <= radius) { return TRUE; } } @@ -554,7 +554,7 @@ void basic_ai_wander_init(Evt* script, MobileAISettings* npcAISettings, EnemyDet // chose a random direction and move time npc->duration = (npcAISettings->moveTime / 2) + rand_int((npcAISettings->moveTime / 2) + 1); npc->yaw = clamp_angle(npc->yaw + rand_int(60) - 30.0f); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; script->functionTemp[1] = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { @@ -583,7 +583,7 @@ void basic_ai_wander(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolum x = npc->pos.x; y = npc->pos.y; z = npc->pos.z; - yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); if (!npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, aiSettings->chaseSpeed, yaw, npc->collisionHeight, npc->collisionDiameter)) { npc->yaw = yaw; ai_enemy_play_sound(npc, SOUND_2F4, SOUND_PARAM_MORE_QUIET); @@ -664,7 +664,7 @@ void basic_ai_loiter_init(Evt* script, MobileAISettings* aiSettings, EnemyDetect npc->duration = (aiSettings->waitTime / 2) + rand_int((aiSettings->waitTime / 2) + 1); npc->yaw = clamp_angle(npc->yaw + rand_int(180) - 90.0f); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; script->AI_TEMP_STATE = AI_STATE_LOITER; } @@ -680,7 +680,7 @@ void basic_ai_loiter(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolum x = npc->pos.x; y = npc->pos.y; z = npc->pos.z; - yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); if (!npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, aiSettings->chaseSpeed, yaw, npc->collisionHeight, npc->collisionDiameter)) { npc->yaw = yaw; ai_enemy_play_sound(npc, SOUND_2F4, SOUND_PARAM_MORE_QUIET); @@ -717,8 +717,8 @@ void basic_ai_found_player_jump_init(Evt* script, MobileAISettings* npcAISetting Npc* npc = get_npc_unsafe(enemy->npcID); ai_enemy_play_sound(npc, SOUND_3E1, 0); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_JUMP]; - npc->jumpVelocity = 10.0f; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_JUMP]; + npc->jumpVel = 10.0f; npc->jumpScale = 2.5f; npc->moveToPos.y = npc->pos.y; npc->flags |= NPC_FLAG_JUMPING; @@ -729,7 +729,7 @@ void basic_ai_found_player_jump(Evt* script, MobileAISettings* npcAISettings, En Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID); s32 done = FALSE; - if (npc->jumpVelocity <= 0.0) { + if (npc->jumpVel <= 0.0) { if (npc->pos.y <= npc->moveToPos.y) { npc->pos.y = npc->moveToPos.y; done = TRUE; @@ -737,10 +737,10 @@ void basic_ai_found_player_jump(Evt* script, MobileAISettings* npcAISettings, En } if (!done) { - npc->pos.y += npc->jumpVelocity; - npc->jumpVelocity -= npc->jumpScale; + npc->pos.y += npc->jumpVel; + npc->jumpVel -= npc->jumpScale; } else { - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; npc->flags &= ~NPC_FLAG_JUMPING; script->AI_TEMP_STATE = AI_STATE_CHASE_INIT; } @@ -753,13 +753,13 @@ void basic_ai_chase_init(Evt* script, MobileAISettings* npcAISettings, EnemyDete if ((gPlayerStatusPtr->actionState == ACTION_STATE_JUMP || gPlayerStatusPtr->actionState == ACTION_STATE_BOUNCE || gPlayerStatusPtr->actionState == ACTION_STATE_HOP || gPlayerStatusPtr->actionState == ACTION_STATE_FALLING) && - (f64)dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) < npc->collisionDiameter) + (f64)dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z) < npc->collisionDiameter) { skipTurnAround = TRUE; } if (!skipTurnAround) { - f32 angle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + f32 angle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); f32 deltaAngleToPlayer = get_clamped_angle_diff(npc->yaw, angle); if (npcAISettings->chaseTurnRate < fabsf(deltaAngleToPlayer)) { @@ -776,7 +776,7 @@ void basic_ai_chase_init(Evt* script, MobileAISettings* npcAISettings, EnemyDete npc->duration = 0; } - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_CHASE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_CHASE]; npc->moveSpeed = npcAISettings->chaseSpeed; script->AI_TEMP_STATE = AI_STATE_CHASE; } @@ -789,20 +789,20 @@ void basic_ai_chase(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolume if (!basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 1)) { fx_emote(EMOTE_QUESTION, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &sp28); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->duration = 20; script->AI_TEMP_STATE = AI_STATE_LOSE_PLAYER; return; } if (enemy->npcSettings->actionFlags & AI_ACTION_04) { - if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) > (npc->moveSpeed * 5.0)) { + if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z) > (npc->moveSpeed * 5.0)) { x = npc->pos.x; y = npc->pos.y; z = npc->pos.z; if (npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, 1.0f, npc->yaw, npc->collisionHeight, npc->collisionDiameter)) { fx_emote(EMOTE_QUESTION, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xC, &sp28); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->duration = 15; script->AI_TEMP_STATE = AI_STATE_LOSE_PLAYER; return; @@ -857,7 +857,7 @@ ApiStatus BasicAI_Main(Evt* script, s32 isInitialCall) { script->AI_TEMP_STATE = AI_STATE_WANDER_INIT; npc->duration = 0; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; if (!enemy->territory->wander.isFlying) { diff --git a/src/38F00.c b/src/38F00.c index 34e12bf80a..f79791713b 100644 --- a/src/38F00.c +++ b/src/38F00.c @@ -105,7 +105,7 @@ ApiStatus func_8005DB00(Evt* script, s32 isInitialCall) { npc->duration = evt_get_variable(script, LVar1); script->functionTemp[1] = evt_get_variable(script, LVar2); script->functionTemp[2] = evt_get_variable(script, LVar3) / 2; - npc->currentAnim = script->varTable[10]; + npc->curAnim = script->varTable[10]; script->functionTemp[0] = 1; break; case 1: @@ -115,10 +115,10 @@ ApiStatus func_8005DB00(Evt* script, s32 isInitialCall) { } if (npc->duration == 0) { - if (sqrtf(SQ((playerStatus->position.x - npc->pos.x)) + - SQ((playerStatus->position.y - npc->pos.y)) + - SQ((playerStatus->position.z - npc->pos.z))) <= npc->planarFlyDist) { - targetDir = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + if (sqrtf(SQ((playerStatus->pos.x - npc->pos.x)) + + SQ((playerStatus->pos.y - npc->pos.y)) + + SQ((playerStatus->pos.z - npc->pos.z))) <= npc->planarFlyDist) { + targetDir = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); npcYaw = script->functionTemp[1] == -1 ? npc->yaw : script->functionTemp[1]; if (fabsf(get_clamped_angle_diff(npcYaw, targetDir)) < script->functionTemp[2]) { @@ -127,8 +127,8 @@ ApiStatus func_8005DB00(Evt* script, s32 isInitialCall) { } } } else { - if (dist2D(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z) <= npc->planarFlyDist) { - targetDir = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + if (dist2D(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z) <= npc->planarFlyDist) { + targetDir = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); npcYaw = script->functionTemp[1] == -1 ? npc->yaw : script->functionTemp[1]; if (fabsf(get_clamped_angle_diff(npcYaw, targetDir)) < script->functionTemp[2]) { diff --git a/src/39210_len_aa0.c b/src/39210_len_aa0.c index d266e7aacf..7556eaaa74 100644 --- a/src/39210_len_aa0.c +++ b/src/39210_len_aa0.c @@ -17,9 +17,9 @@ void get_npc_pos(s32 npcID, f32* outX, f32* outY, f32* outZ, s32* outAirborne) { *outAirborne = FALSE; if (npcID == NPC_SELF) { - *outX = playerStatus->position.x; - *outY = playerStatus->position.y; - *outZ = playerStatus->position.z; + *outX = playerStatus->pos.x; + *outY = playerStatus->pos.y; + *outZ = playerStatus->pos.z; if (playerStatus->flags & (PS_FLAG_FALLING | PS_FLAG_JUMPING)) { *outAirborne = TRUE; } @@ -44,9 +44,9 @@ void npc_follow_init(Npc* npc, s32 targetNpcID, FollowAnims* anims, f32 walkSpee ASSERT(followData != NULL); for (i = 0; i < ARRAY_COUNT(followData->moveHistory); i++) { - followData->moveHistory[i].pos.x = playerStatus->position.x; - followData->moveHistory[i].pos.y = playerStatus->position.y; - followData->moveHistory[i].pos.z = playerStatus->position.z; + followData->moveHistory[i].pos.x = playerStatus->pos.x; + followData->moveHistory[i].pos.y = playerStatus->pos.y; + followData->moveHistory[i].pos.z = playerStatus->pos.z; followData->moveHistory[i].isAirborne = FALSE; } followData->lastPointIdx = 0; @@ -58,8 +58,8 @@ void npc_follow_init(Npc* npc, s32 targetNpcID, FollowAnims* anims, f32 walkSpee followData->runSpeed = runSpeed; followData->idleRadius = idleRadius; followData->walkRadius = walkRadius; - npc->currentAnim = followData->anims->idle; - npc->jumpVelocity = 0.0f; + npc->curAnim = followData->anims->idle; + npc->jumpVel = 0.0f; npc->flags |= NPC_FLAG_GRAVITY; npc->flags &= ~NPC_FLAG_IGNORE_PLAYER_COLLISION; npc->collisionChannel = COLLISION_CHANNEL_10000; @@ -129,9 +129,9 @@ void npc_follow_npc(Npc* npc) { npc->moveSpeed = followData->runSpeed; } - npc->currentAnim = followData->anims->run; + npc->curAnim = followData->anims->run; if (!(npc->flags & NPC_FLAG_GROUNDED)) { - npc->currentAnim = followData->anims->fall; + npc->curAnim = followData->anims->fall; } while (TRUE) { @@ -157,7 +157,7 @@ void npc_follow_npc(Npc* npc) { if (followData->targetPointIdx == followData->lastPointIdx) { npc->moveSpeed = 0.0f; yaw = npc->yaw; - npc->currentAnim = followData->anims->idle; + npc->curAnim = followData->anims->idle; break; } @@ -165,7 +165,7 @@ void npc_follow_npc(Npc* npc) { if (dist <= followData->idleRadius) { npc->moveSpeed = 0.0f; yaw = npc->yaw; - npc->currentAnim = followData->anims->idle; + npc->curAnim = followData->anims->idle; followData->followState = NPC_FOLLOW_STATE_IDLE; break; } @@ -218,7 +218,7 @@ void npc_follow_npc(Npc* npc) { dist = currentY; } if (dist < followData->idleRadius) { - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; npc->flags |= NPC_FLAG_GRAVITY; npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z); followData->followState = NPC_FOLLOW_STATE_RUN; @@ -229,29 +229,29 @@ void npc_follow_npc(Npc* npc) { npc->duration = 10; } npc->moveSpeed = npc->planarFlyDist / npc->duration; - npc->jumpVelocity = (currentY + (npc->jumpScale * npc->duration * npc->duration * 0.5f)) / npc->duration; - npc->currentAnim = followData->anims->jump; + npc->jumpVel = (currentY + (npc->jumpScale * npc->duration * npc->duration * 0.5f)) / npc->duration; + npc->curAnim = followData->anims->jump; npc->flags &= ~NPC_FLAG_GRAVITY; followData->followState = NPC_FOLLOW_STATE_FALL; } break; case NPC_FOLLOW_STATE_FALL: - npc->jumpVelocity -= npc->jumpScale; - npc->pos.y += npc->jumpVelocity; - if (npc->jumpVelocity <= 0.0f) { - npc->currentAnim = followData->anims->fall; + npc->jumpVel -= npc->jumpScale; + npc->pos.y += npc->jumpVel; + if (npc->jumpVel <= 0.0f) { + npc->curAnim = followData->anims->fall; } npc_move_heading(npc, npc->moveSpeed, npc->yaw); - if (npc->jumpVelocity <= 0.0f) { + if (npc->jumpVel <= 0.0f) { currentX = npc->pos.x; - dist = fabsf(npc->jumpVelocity) + 8.0; + dist = fabsf(npc->jumpVel) + 8.0; currentY = npc->pos.y + dist; currentZ = npc->pos.z; if (npc_raycast_down_sides(npc->collisionChannel, ¤tX, ¤tY, ¤tZ, &dist) != 0 && - dist <= fabsf(npc->jumpVelocity) + 8.0) + dist <= fabsf(npc->jumpVel) + 8.0) { - npc->currentAnim = followData->anims->land; - npc->jumpVelocity = 0.0f; + npc->curAnim = followData->anims->land; + npc->jumpVel = 0.0f; npc->pos.y = currentY; npc->flags |= NPC_FLAG_GRAVITY; npc->yaw = atan2(currentX, currentZ, x, z); diff --git a/src/415D90.c b/src/415D90.c index e2e9abad23..76d92a0d8f 100644 --- a/src/415D90.c +++ b/src/415D90.c @@ -646,7 +646,7 @@ s32 btl_main_menu_update(void) { } break; case BTL_MENU_STATE_ACCEPT_INPUT: - if (battleStatus->currentButtonsPressed & BUTTON_A) { + if (battleStatus->curButtonsPressed & BUTTON_A) { if (BattleMenu_OptionEnabled[BattleMenu_CurPos + BattleMenu_HomePos] == TRUE) { sfx_play_sound(SOUND_MENU_NEXT); BattleMenuState = BTL_MENU_STATE_OPENED_SUBMENU; @@ -658,12 +658,12 @@ s32 btl_main_menu_update(void) { } else { BattleMenu_PrevPos = BattleMenu_CurPos; if (D_802AD004 == 0) { - if ((battleStatus->currentButtonsHeld & (BUTTON_STICK_LEFT | BUTTON_STICK_UP)) && + if ((battleStatus->curButtonsHeld & (BUTTON_STICK_LEFT | BUTTON_STICK_UP)) && BattleMenu_MinIdx < BattleMenu_CurPos) { BattleMenu_CurPos--; } - if ((battleStatus->currentButtonsHeld & (BUTTON_STICK_RIGHT | BUTTON_STICK_DOWN)) && + if ((battleStatus->curButtonsHeld & (BUTTON_STICK_RIGHT | BUTTON_STICK_DOWN)) && BattleMenu_CurPos < BattleMenu_MaxIdx) { BattleMenu_CurPos++; @@ -1213,18 +1213,18 @@ s32 btl_submenu_moves_update(void) { break; case BTL_SUBMENU_MOVES_STATE_UNK_1: D_802AD10A = battle_menu_moveCursorPos; - if (battleStatus->currentButtonsHeld & (BUTTON_STICK_UP | BUTTON_Z)) { + if (battleStatus->curButtonsHeld & (BUTTON_STICK_UP | BUTTON_Z)) { if (battle_menu_moveCursorPos > 0) { battle_menu_moveCursorPos--; - } else if (battleStatus->currentButtonsPressed & (BUTTON_STICK_UP | BUTTON_Z)) { + } else if (battleStatus->curButtonsPressed & (BUTTON_STICK_UP | BUTTON_Z)) { battle_menu_moveCursorPos--; } } - if (battleStatus->currentButtonsHeld & (BUTTON_STICK_DOWN | BUTTON_R)) { + if (battleStatus->curButtonsHeld & (BUTTON_STICK_DOWN | BUTTON_R)) { if (battle_menu_moveCursorPos < BattleMenu_Moves_OptionCount - 1) { battle_menu_moveCursorPos++; - } else if (battleStatus->currentButtonsPressed & (BUTTON_STICK_DOWN | BUTTON_R)) { + } else if (battleStatus->curButtonsPressed & (BUTTON_STICK_DOWN | BUTTON_R)) { battle_menu_moveCursorPos++; } } @@ -1260,7 +1260,7 @@ s32 btl_submenu_moves_update(void) { } D_802AD10D = battle_menu_moveScrollLine + 6; - if (battleStatus->currentButtonsPressed & BUTTON_A) { + if (battleStatus->curButtonsPressed & BUTTON_A) { if (BattleMenu_Moves_OptionEnabled[BattleMenu_Moves_OptionIndexMap[battle_menu_moveCursorPos]] == 1) { sfx_play_sound(SOUND_MENU_NEXT); battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_NEGATIVE_ONE; @@ -1276,7 +1276,7 @@ s32 btl_submenu_moves_update(void) { break; } - if (battleStatus->currentButtonsPressed & BUTTON_B) { + if (battleStatus->curButtonsPressed & BUTTON_B) { sfx_play_sound(SOUND_MENU_BACK); func_802A27E4(); battle_menu_moveState = BTL_SUBMENU_MOVES_STATE_UNK_NEGATIVE_TWO; @@ -1851,18 +1851,18 @@ s32 func_802A4A54(void) { case 1: if (D_802AD607 == 0) { D_802AD606 = D_802AD605; - if (battleStatus->currentButtonsHeld & BUTTON_STICK_UP) { + if (battleStatus->curButtonsHeld & BUTTON_STICK_UP) { if (D_802AD605 > 0) { D_802AD605--; - } else if (battleStatus->currentButtonsPressed & BUTTON_STICK_UP) { + } else if (battleStatus->curButtonsPressed & BUTTON_STICK_UP) { D_802AD605--; } } - if (battleStatus->currentButtonsHeld & BUTTON_STICK_DOWN) { + if (battleStatus->curButtonsHeld & BUTTON_STICK_DOWN) { if (D_802AD605 < D_802AD66C - 1) { D_802AD605++; - } else if (battleStatus->currentButtonsPressed & BUTTON_STICK_DOWN) { + } else if (battleStatus->curButtonsPressed & BUTTON_STICK_DOWN) { D_802AD605++; } } @@ -1890,7 +1890,7 @@ s32 func_802A4A54(void) { D_802AD609 = D_802AD66C; } - if (battleStatus->currentButtonsPressed & BUTTON_A) { + if (battleStatus->curButtonsPressed & BUTTON_A) { if (D_802AD690[D_802AD605] == 1) { sfx_play_sound(SOUND_MENU_NEXT); BattleSubmenuStratsState = -1; @@ -1902,7 +1902,7 @@ s32 func_802A4A54(void) { break; } - if (battleStatus->currentButtonsPressed & BUTTON_B) { + if (battleStatus->curButtonsPressed & BUTTON_B) { sfx_play_sound(SOUND_MENU_BACK); func_802A472C(); BattleSubmenuStratsState = -2; @@ -2233,7 +2233,7 @@ void btl_state_update_player_menu(void) { case BTL_SUBSTATE_PLAYER_MENU_INIT: battleStatus->moveCategory = BTL_MENU_TYPE_INVALID; battleStatus->selectedMoveID = 0; - battleStatus->currentAttackElement = 0; + battleStatus->curAttackElement = 0; if (!can_btl_state_update_switch_to_player()) { btl_set_state(BATTLE_STATE_END_PLAYER_TURN); return; @@ -2244,8 +2244,8 @@ void btl_state_update_player_menu(void) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CREATE_MAIN_MENU; } else { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_PERFORM_SWAP; - partnerActor->state.currentPos.x = partnerActor->homePos.x; - partnerActor->state.currentPos.z = partnerActor->homePos.z; + partnerActor->state.curPos.x = partnerActor->homePos.x; + partnerActor->state.curPos.z = partnerActor->homePos.z; partnerActor->state.goalPos.x = playerActor->homePos.x; partnerActor->state.goalPos.z = playerActor->homePos.z; partnerActor->state.moveTime = 4; @@ -2254,27 +2254,27 @@ void btl_state_update_player_menu(void) { break; case BTL_SUBSTATE_PLAYER_MENU_PERFORM_SWAP: if (partnerActor->state.moveTime != 0) { - partnerActor->currentPos.x += (partnerActor->state.goalPos.x - partnerActor->currentPos.x) / partnerActor->state.moveTime; - partnerActor->currentPos.z += (partnerActor->state.goalPos.z - partnerActor->currentPos.z) / partnerActor->state.moveTime; - playerActor->currentPos.x += (partnerActor->state.currentPos.x - playerActor->currentPos.x) / partnerActor->state.moveTime; - playerActor->currentPos.z += (partnerActor->state.currentPos.z - playerActor->currentPos.z) / partnerActor->state.moveTime; + partnerActor->curPos.x += (partnerActor->state.goalPos.x - partnerActor->curPos.x) / partnerActor->state.moveTime; + partnerActor->curPos.z += (partnerActor->state.goalPos.z - partnerActor->curPos.z) / partnerActor->state.moveTime; + playerActor->curPos.x += (partnerActor->state.curPos.x - playerActor->curPos.x) / partnerActor->state.moveTime; + playerActor->curPos.z += (partnerActor->state.curPos.z - playerActor->curPos.z) / partnerActor->state.moveTime; } - partnerActor->currentPos.z -= sin_rad(DEG_TO_RAD(partnerActor->state.angle)) * 16.0f; + partnerActor->curPos.z -= sin_rad(DEG_TO_RAD(partnerActor->state.angle)) * 16.0f; partnerActor->yaw = clamp_angle(-partnerActor->state.angle); - playerActor->currentPos.z += sin_rad(DEG_TO_RAD(partnerActor->state.angle)) * 16.0f; + playerActor->curPos.z += sin_rad(DEG_TO_RAD(partnerActor->state.angle)) * 16.0f; playerActor->yaw = clamp_angle(-partnerActor->state.angle); partnerActor->state.angle += 90.0f; if (partnerActor->state.moveTime != 0) { partnerActor->state.moveTime--; } else { - partnerActor->currentPos.x = partnerActor->state.goalPos.x; - partnerActor->currentPos.z = partnerActor->state.goalPos.z; - playerActor->currentPos.x = partnerActor->state.currentPos.x; - playerActor->currentPos.z = partnerActor->state.currentPos.z; - partnerActor->homePos.x = partnerActor->currentPos.x; - partnerActor->homePos.z = partnerActor->currentPos.z; - playerActor->homePos.x = playerActor->currentPos.x; - playerActor->homePos.z = playerActor->currentPos.z; + partnerActor->curPos.x = partnerActor->state.goalPos.x; + partnerActor->curPos.z = partnerActor->state.goalPos.z; + playerActor->curPos.x = partnerActor->state.curPos.x; + playerActor->curPos.z = partnerActor->state.curPos.z; + partnerActor->homePos.x = partnerActor->curPos.x; + partnerActor->homePos.z = partnerActor->curPos.z; + playerActor->homePos.x = playerActor->curPos.x; + playerActor->homePos.z = playerActor->curPos.z; gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CREATE_MAIN_MENU; battleStatus->flags1 &= ~BS_FLAGS1_PLAYER_IN_BACK; } @@ -2467,14 +2467,14 @@ void btl_state_update_player_menu(void) { D_802ACC60--; } else if (submenuResult != 0) { set_animation(ACTOR_PLAYER, 0, ANIM_Mario1_Walk); - battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] = battleStatus->currentSubmenu = battle_menu_submenuIDs[submenuResult - 1]; + battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] = battleStatus->curSubmenu = battle_menu_submenuIDs[submenuResult - 1]; for (i = 0; i < ARRAY_COUNT(battleStatus->submenuMoves); i++) { battleStatus->submenuMoves[i] = 0; battleStatus->submenuIcons[0] = 0; ///< @bug ? battleStatus->submenuStatus[i] = 0; } - switch (battleStatus->currentSubmenu) { + switch (battleStatus->curSubmenu) { case BTL_MENU_TYPE_ITEMS: battleStatus->submenuMoves[0] = D_802AB4F0[8]; battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK; @@ -2487,7 +2487,7 @@ void btl_state_update_player_menu(void) { battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; battleStatus->moveArgument = playerData->invItems[i]; - battleStatus->currentTargetListFlags = itemData->targetFlags; + battleStatus->curTargetListFlags = itemData->targetFlags; player_create_target_list(playerActor); } entryIdx = 1; @@ -2495,7 +2495,7 @@ void btl_state_update_player_menu(void) { if (playerData->equippedBadges[i] != 0) { s32 moveID = gItemTable[playerData->equippedBadges[i]].moveID; moveData = &gMoveTable[moveID]; - if (moveData->category == D_802AB4F0[battleStatus->currentSubmenu]) { + if (moveData->category == D_802AB4F0[battleStatus->curSubmenu]) { battleStatus->submenuMoves[entryIdx] = moveID; battleStatus->submenuIcons[entryIdx] = playerData->equippedBadges[i]; battleStatus->submenuStatus[entryIdx] = 1; @@ -2542,7 +2542,7 @@ void btl_state_update_player_menu(void) { battleStatus->submenuIcons[entryIdx] = 0; battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; battleStatus->moveArgument = MOVE_REFRESH + i; - battleStatus->currentTargetListFlags = moveData->flags; + battleStatus->curTargetListFlags = moveData->flags; player_create_target_list(playerActor); battleStatus->submenuStatus[entryIdx] = 1; if (playerActor->targetListLength == 0) { @@ -2564,7 +2564,7 @@ void btl_state_update_player_menu(void) { battleStatus->submenuIcons[entryIdx] = 0; battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; battleStatus->moveArgument = MOVE_REFRESH + i; - battleStatus->currentTargetListFlags = moveData->flags; + battleStatus->curTargetListFlags = moveData->flags; player_create_target_list(playerActor); battleStatus->submenuStatus[entryIdx] = starBeamLevel; if (playerActor->targetListLength == 0) { @@ -2587,7 +2587,7 @@ void btl_state_update_player_menu(void) { battleStatus->submenuIcons[entryIdx] = 0; battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; battleStatus->moveArgument = MOVE_REFRESH + i; - battleStatus->currentTargetListFlags = moveData->flags; + battleStatus->curTargetListFlags = moveData->flags; player_create_target_list(playerActor); battleStatus->submenuStatus[entryIdx] = 1; if (playerActor->targetListLength == 0) { @@ -2608,7 +2608,7 @@ void btl_state_update_player_menu(void) { } while (0); // TODO required to match } - currentSubmenu = battleStatus->currentSubmenu; + currentSubmenu = battleStatus->curSubmenu; if (currentSubmenu == BTL_MENU_TYPE_STAR_POWERS) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_1; btl_state_update_player_menu(); @@ -2648,13 +2648,13 @@ void btl_state_update_player_menu(void) { } initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_JUMP]; } - if (battleStatus->currentSubmenu == BTL_MENU_TYPE_SMASH) { + if (battleStatus->curSubmenu == BTL_MENU_TYPE_SMASH) { if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH] < 0) { battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH] = 0; } initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH]; } - if (battleStatus->currentSubmenu == BTL_MENU_TYPE_ITEMS) { + if (battleStatus->curSubmenu == BTL_MENU_TYPE_ITEMS) { if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_ITEMS] < 0) { battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_ITEMS] = 0; } @@ -2732,16 +2732,16 @@ void btl_state_update_player_menu(void) { } else { battleStatus->unk_49 = BattleMenu_Moves_OptionIndices[submenuResult - 1]; battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->unk_49]; - if (battleStatus->currentSubmenu == BTL_MENU_TYPE_JUMP) { + if (battleStatus->curSubmenu == BTL_MENU_TYPE_JUMP) { battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_JUMP] = battle_menu_moveOptionActive; } - if (battleStatus->currentSubmenu == BTL_MENU_TYPE_SMASH) { + if (battleStatus->curSubmenu == BTL_MENU_TYPE_SMASH) { battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH] = battle_menu_moveOptionActive; } - currentSubmenu2 = battleStatus->currentSubmenu; - if (battleStatus->currentSubmenu == BTL_MENU_TYPE_ITEMS) { + currentSubmenu2 = battleStatus->curSubmenu; + if (battleStatus->curSubmenu == BTL_MENU_TYPE_ITEMS) { battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_ITEMS] = battle_menu_moveOptionActive; - if (battleStatus->currentSubmenu == currentSubmenu2) { + if (battleStatus->curSubmenu == currentSubmenu2) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_1; btl_state_update_player_menu(); btl_state_update_player_menu(); @@ -2755,7 +2755,7 @@ void btl_state_update_player_menu(void) { break; case BTL_SUBSTATE_PLAYER_MENU_MOVE_CHOOSE_TARGET: submenuResult = btl_submenu_moves_update(); - if ((battleStatus->currentButtonsPressed & BUTTON_B) && submenuResult == 0) { + if ((battleStatus->curButtonsPressed & BUTTON_B) && submenuResult == 0) { func_802A2AB8(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_4; @@ -2767,8 +2767,8 @@ void btl_state_update_player_menu(void) { battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_MOVE_TARGET_CANCEL; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_MOVE_TARGET_CHOSEN; battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->unk_49]; - battleStatus->currentTargetListFlags = gMoveTable[battleStatus->submenuMoves[battleStatus->unk_49]].flags; - currentSubmenu = battleStatus->currentSubmenu; + battleStatus->curTargetListFlags = gMoveTable[battleStatus->submenuMoves[battleStatus->unk_49]].flags; + currentSubmenu = battleStatus->curSubmenu; switch (currentSubmenu) { case BTL_MENU_TYPE_JUMP: battleStatus->moveCategory = BTL_MENU_TYPE_JUMP; @@ -2813,7 +2813,7 @@ void btl_state_update_player_menu(void) { if (gBattleStatus.flags2 & BS_FLAGS2_4) { btl_show_variable_battle_message(BTL_MSG_CANT_SWITCH, 60, 0); } else { - btl_show_variable_battle_message(BTL_MSG_CANT_MOVE, 60, playerData->currentPartner); + btl_show_variable_battle_message(BTL_MSG_CANT_MOVE, 60, playerData->curPartner); } D_802AD607 = 1; gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_AWAIT_CANT_SWAP; @@ -2833,25 +2833,25 @@ void btl_state_update_player_menu(void) { break; case BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_11: submenuResult = btl_main_menu_update(); - if ((battleStatus->currentButtonsPressed & BUTTON_B) && submenuResult == 0) { + if ((battleStatus->curButtonsPressed & BUTTON_B) && submenuResult == 0) { func_802A1078(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_12; } else if (submenuResult != 0) { battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_13; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_14; - switch (battleStatus->currentSubmenu) { + switch (battleStatus->curSubmenu) { case BTL_MENU_TYPE_JUMP: battleStatus->moveCategory = BTL_MENU_TYPE_JUMP; battleStatus->moveArgument = playerData->bootsLevel; battleStatus->selectedMoveID = playerData->bootsLevel + MOVE_JUMP1; - battleStatus->currentTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; + battleStatus->curTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; btl_set_state(BATTLE_STATE_SELECT_TARGET); break; case BTL_MENU_TYPE_SMASH: battleStatus->moveCategory = BTL_MENU_TYPE_SMASH; battleStatus->moveArgument = playerData->hammerLevel; battleStatus->selectedMoveID = playerData->hammerLevel + MOVE_HAMMER1; - battleStatus->currentTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; + battleStatus->curTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; btl_set_state(BATTLE_STATE_SELECT_TARGET); break; default: @@ -2894,7 +2894,7 @@ void btl_state_update_player_menu(void) { } battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; battleStatus->moveArgument = playerData->invItems[i]; - battleStatus->currentTargetListFlags = itemData->targetFlags; + battleStatus->curTargetListFlags = itemData->targetFlags; player_create_target_list(playerActor); popup->ptrIcon[entryIdx] = hudScriptPair->enabled; popup->userIndex[entryIdx] = playerData->invItems[i]; @@ -2943,8 +2943,8 @@ void btl_state_update_player_menu(void) { battleStatus->unk_1AA = popup->userIndex[popup->result - 1]; battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; battleStatus->moveArgument = battleStatus->unk_1AA; - battleStatus->currentTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | TARGET_FLAG_8000; - battleStatus->currentAttackElement = 0; + battleStatus->curTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | TARGET_FLAG_8000; + battleStatus->curAttackElement = 0; battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = popup->result - 1; hide_popup_menu(); func_802A27D0(); @@ -2954,7 +2954,7 @@ void btl_state_update_player_menu(void) { } break; case BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_3: - if ((battleStatus->currentButtonsPressed & BUTTON_B) && popup->result == POPUP_RESULT_CHOOSING) { + if ((battleStatus->curButtonsPressed & BUTTON_B) && popup->result == POPUP_RESULT_CHOOSING) { func_800F16CC(); func_802A2C58(); func_802A1098(); @@ -2998,7 +2998,7 @@ void btl_state_update_player_menu(void) { } battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; battleStatus->moveArgument = playerData->invItems[i]; - battleStatus->currentTargetListFlags = itemData->targetFlags; + battleStatus->curTargetListFlags = itemData->targetFlags; player_create_target_list(playerActor); popup->ptrIcon[entryIdx] = hudScriptPair->enabled; @@ -3041,8 +3041,8 @@ void btl_state_update_player_menu(void) { battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; battleStatus->moveArgument = battleStatus->unk_1AA; battleStatus->selectedMoveID = MOVE_ITEMS; - battleStatus->currentTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | TARGET_FLAG_8000; - battleStatus->currentAttackElement = 0; + battleStatus->curTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | TARGET_FLAG_8000; + battleStatus->curAttackElement = 0; battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = popup->result - 1; hide_popup_menu(); func_802A1030(); @@ -3051,7 +3051,7 @@ void btl_state_update_player_menu(void) { } break; case BTL_SUBSTATE_PLAYER_MENU_ITEMS_3: - if ((battleStatus->currentButtonsPressed & BUTTON_B) && popup->result == POPUP_RESULT_CHOOSING) { + if ((battleStatus->curButtonsPressed & BUTTON_B) && popup->result == POPUP_RESULT_CHOOSING) { func_800F16CC(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_ITEMS_4; @@ -3143,7 +3143,7 @@ void btl_state_update_player_menu(void) { break; case BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_3: submenuResult = btl_submenu_moves_update(); - if ((battleStatus->currentButtonsPressed & BUTTON_B) && submenuResult == 0) { + if ((battleStatus->curButtonsPressed & BUTTON_B) && submenuResult == 0) { func_802A2AB8(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_4; @@ -3152,7 +3152,7 @@ void btl_state_update_player_menu(void) { battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_6; battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->unk_49]; - battleStatus->currentTargetListFlags = gMoveTable[battleStatus->submenuMoves[battleStatus->unk_49]].flags; + battleStatus->curTargetListFlags = gMoveTable[battleStatus->submenuMoves[battleStatus->unk_49]].flags; battleStatus->moveArgument = battleStatus->unk_49; if (playerData->starBeamLevel == 2 && battleStatus->moveArgument == 8) { battleStatus->moveArgument++; @@ -3198,7 +3198,7 @@ void btl_state_update_player_menu(void) { battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; battleStatus->moveArgument = playerData->invItems[i]; - battleStatus->currentTargetListFlags = itemData->targetFlags; + battleStatus->curTargetListFlags = itemData->targetFlags; player_create_target_list(playerActor); popup->ptrIcon[entryIdx] = hudScriptPair->enabled; popup->userIndex[entryIdx] = playerData->invItems[i]; @@ -3249,8 +3249,8 @@ void btl_state_update_player_menu(void) { battleStatus->unk_1AA = popup->userIndex[popup->result - 1]; battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; battleStatus->moveArgument = battleStatus->unk_1AA; - battleStatus->currentTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | TARGET_FLAG_8000; - battleStatus->currentAttackElement = 0; + battleStatus->curTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | TARGET_FLAG_8000; + battleStatus->curAttackElement = 0; battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = popup->result - 1; hide_popup_menu(); D_802ACC60 = 5; @@ -3282,7 +3282,7 @@ void btl_state_update_player_menu(void) { break; case BTL_SUBSTATE_PLAYER_MENU_BERSERKER_1: if (playerData->bootsLevel >= 0) { - battleStatus->currentTargetListFlags = gMoveTable[MOVE_UNUSED_JUMP5].flags; + battleStatus->curTargetListFlags = gMoveTable[MOVE_UNUSED_JUMP5].flags; player_create_target_list(playerActor); jumpTargetCount = playerActor->targetListLength; } else { @@ -3290,7 +3290,7 @@ void btl_state_update_player_menu(void) { } if (playerData->hammerLevel >= 0) { - battleStatus->currentTargetListFlags = gMoveTable[MOVE_UNUSED_HAMMER5].flags; + battleStatus->curTargetListFlags = gMoveTable[MOVE_UNUSED_HAMMER5].flags; player_create_target_list(playerActor); hammerTargetCount = playerActor->targetListLength; } else { @@ -3312,13 +3312,13 @@ void btl_state_update_player_menu(void) { if (rand_int(100) < jumpChance) { battleStatus->selectedMoveID = MOVE_UNUSED_JUMP5; battleStatus->moveCategory = BTL_MENU_TYPE_JUMP; - battleStatus->currentTargetListFlags = gMoveTable[MOVE_UNUSED_JUMP5].flags; + battleStatus->curTargetListFlags = gMoveTable[MOVE_UNUSED_JUMP5].flags; battleStatus->moveArgument = playerData->bootsLevel; player_create_target_list(playerActor); } else { battleStatus->selectedMoveID = MOVE_UNUSED_HAMMER5; battleStatus->moveCategory = BTL_MENU_TYPE_SMASH; - battleStatus->currentTargetListFlags = gMoveTable[MOVE_UNUSED_HAMMER5].flags; + battleStatus->curTargetListFlags = gMoveTable[MOVE_UNUSED_HAMMER5].flags; battleStatus->moveArgument = playerData->hammerLevel; player_create_target_list(playerActor); } @@ -3331,11 +3331,11 @@ void btl_state_update_player_menu(void) { if (battleStatus->changePartnerAllowed >= 0) { D_802AD678[0] = BTL_MENU_TYPE_CHANGE_PARTNER; D_802AD658[0] = BattleMenu_LeftJustMessages[BTL_MENU_TYPE_CHANGE_PARTNER]; - D_802AD640[0] = battle_menu_PartnerHudScripts[playerData->currentPartner]; + D_802AD640[0] = battle_menu_PartnerHudScripts[playerData->curPartner]; D_802AD690[0] = 1; D_802AD6C0[0] = MSG_Menus_Action_ChangePartner; if (battleStatus->changePartnerAllowed <= 0) { - D_802AD640[0] = battle_menu_DisabledPartnerHudScripts[playerData->currentPartner]; + D_802AD640[0] = battle_menu_DisabledPartnerHudScripts[playerData->curPartner]; D_802AD690[0] = 0; D_802AD6A8[0] = 0; } @@ -3383,9 +3383,9 @@ void btl_state_update_player_menu(void) { btl_state_update_player_menu(); btl_state_update_player_menu(); } else { - battleStatus->currentSubmenu = D_802AD678[submenuResult - 1]; + battleStatus->curSubmenu = D_802AD678[submenuResult - 1]; battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STRATEGY] = submenuResult - 1; - if (battleStatus->currentSubmenu == 5) { + if (battleStatus->curSubmenu == 5) { gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_1; btl_state_update_player_menu(); btl_state_update_player_menu(); @@ -3398,14 +3398,14 @@ void btl_state_update_player_menu(void) { break; case BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_3: submenuResult = func_802A4A54(); - if ((battleStatus->currentButtonsPressed & BUTTON_B) && submenuResult == 0) { + if ((battleStatus->curButtonsPressed & BUTTON_B) && submenuResult == 0) { func_802A48FC(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_4; } else if (btl_main_menu_update() != 0) { battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_5; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_6; - switch (battleStatus->currentSubmenu) { + switch (battleStatus->curSubmenu) { case 3: gBattleSubState = BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_6; btl_state_update_player_menu(); @@ -3469,7 +3469,7 @@ void btl_state_update_player_menu(void) { popup->nameMsg[entryIdx] = prop->nameMsg; popup->descMsg[entryIdx] = prop->battleDescMsg; popup->value[entryIdx] = playerData->partners[partnerId].level; - if (playerData->currentPartner == partnerId) { + if (playerData->curPartner == partnerId) { popup->enabled[entryIdx] = 0; popup->ptrIcon[entryIdx] = battle_menu_DisabledPartnerHudScripts[partnerId]; } @@ -3481,7 +3481,7 @@ void btl_state_update_player_menu(void) { } popup->popupType = POPUP_MENU_SWITCH_PARTNER; popup->numEntries = entryIdx; - popup->initialPos = MenuIndexFromPartnerID[playerData->currentPartner] - 1; + popup->initialPos = MenuIndexFromPartnerID[playerData->curPartner] - 1; popup->dipMode = 0; popup->titleNumber = 0; create_battle_popup_menu(popup); @@ -3503,7 +3503,7 @@ void btl_state_update_player_menu(void) { battleStatus->unk_1AC = popup->userIndex[popup->result - 1]; battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER; battleStatus->selectedMoveID = MOVE_UNUSED_37; - battleStatus->currentTargetListFlags = TARGET_FLAG_2; + battleStatus->curTargetListFlags = TARGET_FLAG_2; battleStatus->moveArgument = battleStatus->unk_1AC; battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_PARTNER] = popup->result - 1; hide_popup_menu(); @@ -3514,7 +3514,7 @@ void btl_state_update_player_menu(void) { } break; case BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_3: - if ((battleStatus->currentButtonsPressed & BUTTON_B) && popup->result == POPUP_RESULT_CHOOSING) { + if ((battleStatus->curButtonsPressed & BUTTON_B) && popup->result == POPUP_RESULT_CHOOSING) { func_800F16CC(); func_802A4A10(); func_802A1098(); @@ -3629,7 +3629,7 @@ void btl_state_update_partner_menu(void) { if (gBattleSubState == BTL_SUBSTATE_PARTNER_MENU_NONE) { battleStatus->moveCategory = BTL_MENU_TYPE_INVALID; battleStatus->selectedMoveID = MOVE_NONE; - battleStatus->currentAttackElement = 0; + battleStatus->curAttackElement = 0; if (!func_802A58D0()) { btl_set_state(BATTLE_STATE_9); } else { @@ -3641,8 +3641,8 @@ void btl_state_update_partner_menu(void) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_INIT_MENU; } else { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_12D; - partnerActor->state.currentPos.x = partnerActor->homePos.x; - partnerActor->state.currentPos.z = partnerActor->homePos.z; + partnerActor->state.curPos.x = partnerActor->homePos.x; + partnerActor->state.curPos.z = partnerActor->homePos.z; partnerActor->state.goalPos.x = playerActor->homePos.x; partnerActor->state.goalPos.z = playerActor->homePos.z; partnerActor->state.moveTime = 4; @@ -3652,28 +3652,28 @@ void btl_state_update_partner_menu(void) { } if (gBattleSubState == BTL_SUBSTATE_PARTNER_MENU_12D) { if (partnerActor->state.moveTime != 0) { - partnerActor->currentPos.x += (partnerActor->state.goalPos.x - partnerActor->currentPos.x) / partnerActor->state.moveTime; - partnerActor->currentPos.z += (partnerActor->state.goalPos.z - partnerActor->currentPos.z) / partnerActor->state.moveTime; - playerActor->currentPos.x += (partnerActor->state.currentPos.x - playerActor->currentPos.x) / partnerActor->state.moveTime; - playerActor->currentPos.z += (partnerActor->state.currentPos.z - playerActor->currentPos.z) / partnerActor->state.moveTime; + partnerActor->curPos.x += (partnerActor->state.goalPos.x - partnerActor->curPos.x) / partnerActor->state.moveTime; + partnerActor->curPos.z += (partnerActor->state.goalPos.z - partnerActor->curPos.z) / partnerActor->state.moveTime; + playerActor->curPos.x += (partnerActor->state.curPos.x - playerActor->curPos.x) / partnerActor->state.moveTime; + playerActor->curPos.z += (partnerActor->state.curPos.z - playerActor->curPos.z) / partnerActor->state.moveTime; } - partnerActor->currentPos.z += sin_rad(DEG_TO_RAD(partnerActor->state.angle)) * 16.0f; + partnerActor->curPos.z += sin_rad(DEG_TO_RAD(partnerActor->state.angle)) * 16.0f; partnerActor->yaw = clamp_angle(-partnerActor->state.angle); - playerActor->currentPos.z -= sin_rad(DEG_TO_RAD(partnerActor->state.angle)) * 16.0f; + playerActor->curPos.z -= sin_rad(DEG_TO_RAD(partnerActor->state.angle)) * 16.0f; playerActor->yaw = clamp_angle(-partnerActor->state.angle); partnerActor->state.angle += 90.0f; if (partnerActor->state.moveTime != 0) { partnerActor->state.moveTime--; } else { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_INIT_MENU; - partnerActor->currentPos.x = partnerActor->state.goalPos.x; - partnerActor->currentPos.z = partnerActor->state.goalPos.z; - playerActor->currentPos.x = partnerActor->state.currentPos.x; - playerActor->currentPos.z = partnerActor->state.currentPos.z; - partnerActor->homePos.x = partnerActor->currentPos.x; - partnerActor->homePos.z = partnerActor->currentPos.z; - playerActor->homePos.x = playerActor->currentPos.x; - playerActor->homePos.z = playerActor->currentPos.z; + partnerActor->curPos.x = partnerActor->state.goalPos.x; + partnerActor->curPos.z = partnerActor->state.goalPos.z; + playerActor->curPos.x = partnerActor->state.curPos.x; + playerActor->curPos.z = partnerActor->state.curPos.z; + partnerActor->homePos.x = partnerActor->curPos.x; + partnerActor->homePos.z = partnerActor->curPos.z; + playerActor->homePos.x = playerActor->curPos.x; + playerActor->homePos.z = playerActor->curPos.z; gBattleStatus.flags1 |= BS_FLAGS1_PLAYER_IN_BACK; } } @@ -3710,17 +3710,17 @@ void btl_state_update_partner_menu(void) { entryIdx++; // abilities menu category - BattleMenu_HudScripts[entryIdx] = battle_menu_PartnerMoveHudScripts[playerData->currentPartner][0]; + BattleMenu_HudScripts[entryIdx] = battle_menu_PartnerMoveHudScripts[playerData->curPartner][0]; battle_menu_submenuIDs[entryIdx] = BTL_MENU_TYPE_ABILITY; BattleMenu_OptionEnabled[entryIdx] = TRUE; BattleMenu_TitleMessages[entryIdx] = BattleMenu_CenteredMessages[BTL_MENU_TYPE_ABILITY]; if (battleStatus->menuStatus[3] <= 0) { - BattleMenu_HudScripts[entryIdx] = battle_menu_PartnerMoveHudScripts[playerData->currentPartner][1]; + BattleMenu_HudScripts[entryIdx] = battle_menu_PartnerMoveHudScripts[playerData->curPartner][1]; BattleMenu_OptionEnabled[entryIdx] = FALSE; battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_CANT_SELECT_NOW; } if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_ABILITIES)) { - BattleMenu_HudScripts[entryIdx] = battle_menu_PartnerMoveHudScripts[playerData->currentPartner][1]; + BattleMenu_HudScripts[entryIdx] = battle_menu_PartnerMoveHudScripts[playerData->curPartner][1]; BattleMenu_OptionEnabled[entryIdx] = FALSE; battle_menu_isMessageDisabled[entryIdx] = BTL_MSG_CANT_SELECT_NOW; } @@ -3762,7 +3762,7 @@ void btl_state_update_partner_menu(void) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_1; return; case BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_1: - set_animation(ACTOR_PARTNER, 0, BattleMenu_PartnerThinkAnims[playerData->currentPartner]); + set_animation(ACTOR_PARTNER, 0, BattleMenu_PartnerThinkAnims[playerData->curPartner]); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_2; case BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_2: entryIdx = btl_main_menu_update(); @@ -3785,7 +3785,7 @@ void btl_state_update_partner_menu(void) { if (D_802ACC60 != 0) { D_802ACC60--; } else if (entryIdx != 0) { - set_animation(ACTOR_PARTNER, 0, BattleMenu_PartnerIdleAnims[playerData->currentPartner]); + set_animation(ACTOR_PARTNER, 0, BattleMenu_PartnerIdleAnims[playerData->curPartner]); battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_MAIN] = battleStatus->unk_4A = battle_menu_submenuIDs[entryIdx - 1]; if (battleStatus->unk_4A == 7) { gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_1; @@ -3817,7 +3817,7 @@ void btl_state_update_partner_menu(void) { break; case BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_3: entryIdx = btl_main_menu_update(); - if ((battleStatus->currentButtonsPressed & BUTTON_B) && entryIdx == 0) { + if ((battleStatus->curButtonsPressed & BUTTON_B) && entryIdx == 0) { func_802A1078(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_4; return; @@ -3826,7 +3826,7 @@ void btl_state_update_partner_menu(void) { battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; battleStatus->selectedMoveID = MOVE_FOCUS; battleStatus->moveArgument = 0; - battleStatus->currentTargetListFlags = gMoveTable[MOVE_FOCUS].flags; + battleStatus->curTargetListFlags = gMoveTable[MOVE_FOCUS].flags; btl_set_state(BATTLE_STATE_SELECT_TARGET); return; } @@ -3878,9 +3878,9 @@ void btl_state_update_partner_menu(void) { battleStatus->submenuStatus[i] = 0; BattleMenu_Moves_OptionCantUseMessages[i] = BTL_MSG_CANT_SELECT_NOW; } - battle_menu_moveOptionIconScripts[i] = battle_menu_PartnerMoveHudScripts[playerData->currentPartner][2 * i + 2]; + battle_menu_moveOptionIconScripts[i] = battle_menu_PartnerMoveHudScripts[playerData->curPartner][2 * i + 2]; if (battleStatus->submenuStatus[i] == 0) { - battle_menu_moveOptionIconScripts[i] = battle_menu_PartnerMoveHudScripts[playerData->currentPartner][2 * i + 3]; + battle_menu_moveOptionIconScripts[i] = battle_menu_PartnerMoveHudScripts[playerData->curPartner][2 * i + 3]; } BattleMenu_Moves_OptionIndices[i] = battleStatus->submenuMoves[i]; BattleMenu_Moves_OptionEnabled[i] = battleStatus->submenuStatus[i]; @@ -3933,14 +3933,14 @@ void btl_state_update_partner_menu(void) { break; case BTL_SUBSTATE_PARTNER_MENU_ABILITIES_3: entryIdx = btl_submenu_moves_update(); - if ((battleStatus->currentButtonsPressed & BUTTON_B) && entryIdx == 0) { + if ((battleStatus->curButtonsPressed & BUTTON_B) && entryIdx == 0) { func_802A2AB8(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_ABILITIES_4; } else if (btl_main_menu_update() != 0) { battleStatus->moveCategory = BTL_MENU_TYPE_ABILITY; battleStatus->selectedMoveID = BattleMenu_Moves_OptionIndices[battleStatus->unk_4B]; - battleStatus->currentTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; + battleStatus->curTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags; battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_ABILITY] = battle_menu_moveOptionActive; battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_ABILITIES_5; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_ABILITIES_6; @@ -4016,8 +4016,8 @@ void btl_state_update_partner_menu(void) { battleStatus->unk_1AA = popupMenu->userIndex[popupMenu->result - 1]; battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS; battleStatus->moveArgument = battleStatus->unk_1AA; - battleStatus->currentTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | TARGET_FLAG_8000; - battleStatus->currentAttackElement = 0; + battleStatus->curTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | TARGET_FLAG_8000; + battleStatus->curAttackElement = 0; battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER_ITEM] = popupMenu->result - 1; hide_popup_menu(); func_802A1030(); @@ -4026,7 +4026,7 @@ void btl_state_update_partner_menu(void) { } break; case BTL_SUBSTATE_PARTNER_MENU_ITEMS_3: - if ((battleStatus->currentButtonsPressed & BUTTON_B) && popupMenu->result == POPUP_RESULT_CHOOSING) { + if ((battleStatus->curButtonsPressed & BUTTON_B) && popupMenu->result == POPUP_RESULT_CHOOSING) { func_800F16CC(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_ITEMS_4; @@ -4060,7 +4060,7 @@ void btl_state_update_partner_menu(void) { popupMenu->nameMsg[popupIndex] = popupProps->nameMsg; popupMenu->descMsg[popupIndex] = popupProps->battleDescMsg; popupMenu->value[popupIndex] = playerData->partners[partnerId].level; - if (playerData->currentPartner == partnerId) { + if (playerData->curPartner == partnerId) { popupMenu->enabled[popupIndex] = 0; popupMenu->ptrIcon[popupIndex] = battle_menu_DisabledPartnerHudScripts[partnerId]; } @@ -4072,7 +4072,7 @@ void btl_state_update_partner_menu(void) { } popupMenu->popupType = POPUP_MENU_SWITCH_PARTNER; popupMenu->numEntries = popupIndex; - popupMenu->initialPos = MenuIndexFromPartnerID[playerData->currentPartner] - 1; + popupMenu->initialPos = MenuIndexFromPartnerID[playerData->curPartner] - 1; popupMenu->dipMode = 0; popupMenu->titleNumber = 0; create_battle_popup_menu(popupMenu); @@ -4096,7 +4096,7 @@ void btl_state_update_partner_menu(void) { battleStatus->unk_1AC = popupMenu->userIndex[popupMenu->result - 1]; battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER; battleStatus->selectedMoveID = MOVE_UNUSED_37; - battleStatus->currentTargetListFlags = TARGET_FLAG_2; + battleStatus->curTargetListFlags = TARGET_FLAG_2; battleStatus->moveArgument = battleStatus->unk_1AC; battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER] = popupMenu->result - 1; hide_popup_menu(); @@ -4106,7 +4106,7 @@ void btl_state_update_partner_menu(void) { } break; case BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_3: - if ((battleStatus->currentButtonsPressed & BUTTON_B) && (popupMenu->result == POPUP_RESULT_CHOOSING)) { + if ((battleStatus->curButtonsPressed & BUTTON_B) && (popupMenu->result == POPUP_RESULT_CHOOSING)) { func_800F16CC(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_4; @@ -4187,7 +4187,7 @@ void btl_state_update_partner_menu(void) { break; case BTL_SUBSTATE_PARTNER_MENU_FOCUS_3: entryIdx = btl_submenu_moves_update(); - if ((battleStatus->currentButtonsPressed & BUTTON_B) && (entryIdx == 0)) { + if ((battleStatus->curButtonsPressed & BUTTON_B) && (entryIdx == 0)) { func_802A2AB8(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_FOCUS_4; @@ -4196,7 +4196,7 @@ void btl_state_update_partner_menu(void) { battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PARTNER_MENU_FOCUS_6; battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->unk_4B]; - battleStatus->currentTargetListFlags = gMoveTable[battleStatus->submenuMoves[battleStatus->unk_4B]].flags; + battleStatus->curTargetListFlags = gMoveTable[battleStatus->submenuMoves[battleStatus->unk_4B]].flags; battleStatus->moveArgument = battleStatus->unk_4B; battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STAR_POWER] = battle_menu_moveOptionActive; btl_set_state(BATTLE_STATE_SELECT_TARGET); @@ -4223,11 +4223,11 @@ void btl_state_update_partner_menu(void) { if (battleStatus->changePartnerAllowed >= 0) { D_802AD678[popupIndex] = BTL_MENU_TYPE_CHANGE_PARTNER; D_802AD658[popupIndex] = BattleMenu_LeftJustMessages[BTL_MENU_TYPE_CHANGE_PARTNER]; - D_802AD640[popupIndex] = battle_menu_PartnerHudScripts[playerData->currentPartner]; + D_802AD640[popupIndex] = battle_menu_PartnerHudScripts[playerData->curPartner]; D_802AD690[popupIndex] = 1; D_802AD6C0[popupIndex] = MSG_Menus_Action_ChangePartner; if (battleStatus->changePartnerAllowed <= 0) { - D_802AD640[popupIndex] = battle_menu_DisabledPartnerHudScripts[playerData->currentPartner]; + D_802AD640[popupIndex] = battle_menu_DisabledPartnerHudScripts[playerData->curPartner]; D_802AD690[popupIndex] = 0; D_802AD6A8[popupIndex] = 0; } @@ -4276,7 +4276,7 @@ void btl_state_update_partner_menu(void) { break; case BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_3: entryIdx = func_802A4A54(); - if ((battleStatus->currentButtonsPressed & BUTTON_B) && entryIdx == 0) { + if ((battleStatus->curButtonsPressed & BUTTON_B) && entryIdx == 0) { func_802A48FC(); func_802A1098(); gBattleSubState = BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_4; @@ -4334,7 +4334,7 @@ void btl_state_update_partner_menu(void) { popupMenu->nameMsg[popupIndex] = popupProps->nameMsg; popupMenu->descMsg[popupIndex] = popupProps->battleDescMsg; popupMenu->value[popupIndex] = playerData->partners[partnerId].level; - if (playerData->currentPartner == partnerId) { + if (playerData->curPartner == partnerId) { popupMenu->enabled[popupIndex] = 0; popupMenu->ptrIcon[popupIndex] = battle_menu_DisabledPartnerHudScripts[partnerId]; } @@ -4346,7 +4346,7 @@ void btl_state_update_partner_menu(void) { } popupMenu->popupType = POPUP_MENU_SWITCH_PARTNER; popupMenu->numEntries = popupIndex; - popupMenu->initialPos = MenuIndexFromPartnerID[playerData->currentPartner] - 1; + popupMenu->initialPos = MenuIndexFromPartnerID[playerData->curPartner] - 1; popupMenu->dipMode = 0; popupMenu->titleNumber = 0; create_battle_popup_menu(popupMenu); @@ -4368,7 +4368,7 @@ void btl_state_update_partner_menu(void) { battleStatus->unk_1AC = popupMenu->userIndex[popupMenu->result - 1]; battleStatus->moveCategory = BTL_MENU_TYPE_CHANGE_PARTNER; battleStatus->selectedMoveID = MOVE_UNUSED_37; - battleStatus->currentTargetListFlags = TARGET_FLAG_2; + battleStatus->curTargetListFlags = TARGET_FLAG_2; battleStatus->moveArgument = battleStatus->unk_1AC; battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER] = popupMenu->result - 1; hide_popup_menu(); @@ -4379,7 +4379,7 @@ void btl_state_update_partner_menu(void) { } break; case BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_3: - if ((battleStatus->currentButtonsPressed & BUTTON_B) && popupMenu->result == POPUP_RESULT_CHOOSING) { + if ((battleStatus->curButtonsPressed & BUTTON_B) && popupMenu->result == POPUP_RESULT_CHOOSING) { func_800F16CC(); func_802A4A10(); func_802A1098(); @@ -4502,8 +4502,8 @@ void btl_state_update_peach_menu(void) { gBattleSubState = BTL_SUBSTATE_PEACH_CREATE_MAIN_MENU; break; } - player->state.currentPos.x = player->homePos.x; - player->state.currentPos.z = player->homePos.z; + player->state.curPos.x = player->homePos.x; + player->state.curPos.z = player->homePos.z; gBattleSubState = BTL_SUBSTATE_PEACH_MENU_PERFORM_SWAP; player->state.goalPos.x = partner->homePos.x; player->state.goalPos.z = partner->homePos.z; @@ -4512,15 +4512,15 @@ void btl_state_update_peach_menu(void) { break; case BTL_SUBSTATE_PEACH_MENU_PERFORM_SWAP: if (player->state.moveTime != 0) { - player->currentPos.x += (player->state.goalPos.x - player->currentPos.x) / player->state.moveTime; - player->currentPos.z += (player->state.goalPos.z - player->currentPos.z) / player->state.moveTime; - partner->currentPos.x += (player->state.currentPos.x - partner->currentPos.x) / player->state.moveTime; - partner->currentPos.z += (player->state.currentPos.z - partner->currentPos.z) / player->state.moveTime; + player->curPos.x += (player->state.goalPos.x - player->curPos.x) / player->state.moveTime; + player->curPos.z += (player->state.goalPos.z - player->curPos.z) / player->state.moveTime; + partner->curPos.x += (player->state.curPos.x - partner->curPos.x) / player->state.moveTime; + partner->curPos.z += (player->state.curPos.z - partner->curPos.z) / player->state.moveTime; } - player->currentPos.z -= sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; + player->curPos.z -= sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; player->yaw = clamp_angle(-player->state.angle); - partner->currentPos.z += sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; + partner->curPos.z += sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; partner->yaw = clamp_angle(-player->state.angle); player->state.angle += 90.0f; @@ -4529,14 +4529,14 @@ void btl_state_update_peach_menu(void) { break; } - player->currentPos.x = player->state.goalPos.x; - player->currentPos.z = player->state.goalPos.z; - partner->currentPos.x = player->state.currentPos.x; - partner->currentPos.z = player->state.currentPos.z; - player->homePos.x = player->currentPos.x; - player->homePos.z = player->currentPos.z; - partner->homePos.x = partner->currentPos.x; - partner->homePos.z = partner->currentPos.z; + player->curPos.x = player->state.goalPos.x; + player->curPos.z = player->state.goalPos.z; + partner->curPos.x = player->state.curPos.x; + partner->curPos.z = player->state.curPos.z; + player->homePos.x = player->curPos.x; + player->homePos.z = player->curPos.z; + partner->homePos.x = partner->curPos.x; + partner->homePos.z = partner->curPos.z; gBattleStatus.flags1 &= ~BS_FLAGS1_PLAYER_IN_BACK; case BTL_SUBSTATE_PEACH_CREATE_MAIN_MENU: gBattleStatus.flags1 |= BS_FLAGS1_MENU_OPEN; @@ -4586,7 +4586,7 @@ void btl_state_update_peach_menu(void) { } if (selectedOption != 0) { set_animation(ACTOR_PLAYER, 0, ANIM_Peach1_Walk); - battleStatus->currentSubmenu = battle_menu_submenuIDs[selectedOption - 1]; + battleStatus->curSubmenu = battle_menu_submenuIDs[selectedOption - 1]; func_802A1030(); D_802ACC60 = 8; D_802ACC6C = 4; @@ -4597,7 +4597,7 @@ void btl_state_update_peach_menu(void) { if (btl_main_menu_update() != 0) { battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_PEACH_MENU_TARGET_CANCEL; battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_PEACH_MENU_TARGET_CHOSEN; - battleStatus->currentTargetListFlags = gMoveTable[MOVE_PEACH_FOCUS].flags; + battleStatus->curTargetListFlags = gMoveTable[MOVE_PEACH_FOCUS].flags; battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; battleStatus->selectedMoveID = MOVE_PEACH_FOCUS; battleStatus->moveArgument = STAR_POWER_INDEX(MOVE_PEACH_FOCUS); @@ -4709,8 +4709,8 @@ void btl_state_update_twink_menu(void) { btl_cam_use_preset(BTL_CAM_DEFAULT); btl_cam_move(10); if (!(gBattleStatus.flags1 & BS_FLAGS1_PLAYER_IN_BACK)) { - player->state.currentPos.x = player->homePos.x; - player->state.currentPos.z = player->homePos.z; + player->state.curPos.x = player->homePos.x; + player->state.curPos.z = player->homePos.z; player->state.goalPos.x = partner->homePos.x; player->state.goalPos.z = partner->homePos.z; gBattleSubState = BTL_SUBSTATE_TWINK_MENU_PERFORM_SWAP; @@ -4722,28 +4722,28 @@ void btl_state_update_twink_menu(void) { break; case BTL_SUBSTATE_TWINK_MENU_PERFORM_SWAP: if (player->state.moveTime != 0) { - player->currentPos.x += (player->state.goalPos.x - player->currentPos.x) / player->state.moveTime; - player->currentPos.z += (player->state.goalPos.z - player->currentPos.z) / player->state.moveTime; - partner->currentPos.x += (player->state.currentPos.x - partner->currentPos.x) / player->state.moveTime; - partner->currentPos.z += (player->state.currentPos.z - partner->currentPos.z) / player->state.moveTime; + player->curPos.x += (player->state.goalPos.x - player->curPos.x) / player->state.moveTime; + player->curPos.z += (player->state.goalPos.z - player->curPos.z) / player->state.moveTime; + partner->curPos.x += (player->state.curPos.x - partner->curPos.x) / player->state.moveTime; + partner->curPos.z += (player->state.curPos.z - partner->curPos.z) / player->state.moveTime; } - player->currentPos.z += sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; + player->curPos.z += sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; player->yaw = clamp_angle(-player->state.angle); - partner->currentPos.z -= sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; + partner->curPos.z -= sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f; partner->yaw = clamp_angle(-player->state.angle); player->state.angle += 90.0f; if (player->state.moveTime != 0) { player->state.moveTime--; break; } - player->currentPos.x = player->state.goalPos.x; - player->currentPos.z = player->state.goalPos.z; - partner->currentPos.x = player->state.currentPos.x; - partner->currentPos.z = player->state.currentPos.z; - player->homePos.x = player->currentPos.x; - player->homePos.z = player->currentPos.z; - partner->homePos.x = partner->currentPos.x; - partner->homePos.z = partner->currentPos.z; + player->curPos.x = player->state.goalPos.x; + player->curPos.z = player->state.goalPos.z; + partner->curPos.x = player->state.curPos.x; + partner->curPos.z = player->state.curPos.z; + player->homePos.x = player->curPos.x; + player->homePos.z = player->curPos.z; + partner->homePos.x = partner->curPos.x; + partner->homePos.z = partner->curPos.z; gBattleStatus.flags1 |= BS_FLAGS1_PLAYER_IN_BACK; case BTL_SUBSTATE_TWINK_MENU_CREATE_MAIN_MENU: gBattleStatus.flags1 |= BS_FLAGS1_MENU_OPEN; @@ -4793,7 +4793,7 @@ void btl_state_update_twink_menu(void) { } if (selection != 0) { set_animation(ACTOR_PARTNER, 0, ANIM_Twink_Angry); - battleStatus->currentSubmenu = battle_menu_submenuIDs[selection - 1]; + battleStatus->curSubmenu = battle_menu_submenuIDs[selection - 1]; func_802A1030(); D_802ACC60 = 8; D_802ACC6C = 4; @@ -4807,7 +4807,7 @@ void btl_state_update_twink_menu(void) { battleStatus->moveCategory = BTL_MENU_TYPE_STAR_POWERS; battleStatus->selectedMoveID = MOVE_TWINK_DASH; battleStatus->moveArgument = 0; - battleStatus->currentTargetListFlags = gMoveTable[MOVE_TWINK_DASH].flags; + battleStatus->curTargetListFlags = gMoveTable[MOVE_TWINK_DASH].flags; btl_set_state(BATTLE_STATE_SELECT_TARGET); } break; @@ -4896,7 +4896,7 @@ void btl_state_update_select_target(void) { } player_create_target_list(actor); targetListLength = actor->targetListLength; - if (battleStatus->currentTargetListFlags & TARGET_FLAG_ENEMY) { + if (battleStatus->curTargetListFlags & TARGET_FLAG_ENEMY) { targetIndexList = actor->targetIndexList; for (i = 0; i < targetListLength; i++) { target = &actor->targetData[targetIndexList[i]]; @@ -4907,7 +4907,7 @@ void btl_state_update_select_target(void) { } } - if (battleStatus->currentTargetListFlags & TARGET_FLAG_80000000) { + if (battleStatus->curTargetListFlags & TARGET_FLAG_80000000) { if (!(gBattleStatus.flags1 & BS_FLAGS1_PARTNER_ACTING)) { gBattleSubState = battleStatus->acceptTargetMenuSubstate; if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { @@ -4965,13 +4965,13 @@ void btl_state_update_select_target(void) { } } - if (battleStatus->currentButtonsPressed & BUTTON_B) { + if (battleStatus->curButtonsPressed & BUTTON_B) { sfx_play_sound(SOUND_MENU_BACK); gBattleSubState = BTL_SUBSTATE_SELECT_TARGET_CANCEL; break; } - if (battleStatus->currentButtonsPressed & BUTTON_A) { + if (battleStatus->curButtonsPressed & BUTTON_A) { sfx_play_sound(SOUND_MENU_NEXT); D_802ACC60 = 8; D_802ACC6C = 4; @@ -4980,18 +4980,18 @@ void btl_state_update_select_target(void) { } gBattleStatus.flags1 |= BS_FLAGS1_MENU_OPEN; - if (battleStatus->currentButtonsDown & (BUTTON_Z | BUTTON_R)) { + if (battleStatus->curButtonsDown & (BUTTON_Z | BUTTON_R)) { gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN; break; } - if (battleStatus->currentTargetListFlags & TARGET_FLAG_ENEMY) { + if (battleStatus->curTargetListFlags & TARGET_FLAG_ENEMY) { s32 oldSelectedTargetIndex = selectedTargetIndex; - if (battleStatus->currentButtonsHeld & BUTTON_STICK_LEFT) { + if (battleStatus->curButtonsHeld & BUTTON_STICK_LEFT) { selectedTargetIndex--; } - if (battleStatus->currentButtonsHeld & BUTTON_STICK_RIGHT) { + if (battleStatus->curButtonsHeld & BUTTON_STICK_RIGHT) { selectedTargetIndex++; } if (selectedTargetIndex < 0) { @@ -5115,7 +5115,7 @@ void btl_state_draw_select_target(void) { tmpPtr = &D_802ACC68; if (targetListLength != 0) { - if (battleStatus->currentTargetListFlags & TARGET_FLAG_ENEMY) { + if (battleStatus->curTargetListFlags & TARGET_FLAG_ENEMY) { target = &actor->targetData[targetIndexList[selectedTargetIndex]]; anotherActor = get_actor(target->actorID); id = D_802ACC70[0]; @@ -5169,14 +5169,14 @@ void btl_state_draw_select_target(void) { } } - currentPartner = playerData->currentPartner; + currentPartner = playerData->curPartner; screenX = 52; screenY = 64; if (gBattleStatus.flags2 & BS_FLAGS2_PEACH_BATTLE) { currentPartner = PARTNER_TWINK; } - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_ENEMY) || targetListLength == 1) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_ENEMY) || targetListLength == 1) { actorID = target->actorID; if (actorID == ACTOR_PLAYER) { msgWidth = get_msg_width(MSG_Menus_Battle_TargetMario, 0) + 10; @@ -5208,7 +5208,7 @@ void btl_state_draw_select_target(void) { screenX += 4; screenY += 2; - if ((battleStatus->currentTargetListFlags & TARGET_FLAG_ENEMY) || targetListLength == 1) { + if ((battleStatus->curTargetListFlags & TARGET_FLAG_ENEMY) || targetListLength == 1) { actorID = target->actorID; if (actorID == ACTOR_PLAYER) { draw_msg(MSG_Menus_Battle_TargetMario, screenX + D_802ACC68, screenY, 255, MSG_PAL_36, 0); diff --git a/src/77480.c b/src/77480.c index 1b05f3a69a..3bfdfbd6a6 100644 --- a/src/77480.c +++ b/src/77480.c @@ -182,7 +182,7 @@ s32 player_raycast_below_cam_relative(PlayerStatus* playerStatus, f32* outX, f32 yaw = 180.0f; } - return player_raycast_below(yaw - 90.0f + gCameras[gCurrentCameraID].currentYaw, playerStatus->colliderDiameter, + return player_raycast_below(yaw - 90.0f + gCameras[gCurrentCameraID].curYaw, playerStatus->colliderDiameter, outX, outY, outZ, outLength, hitRx, hitRz, hitDirX, hitDirZ); } @@ -607,31 +607,31 @@ void update_player(void) { update_partner_timers(); - if ((playerStatus->timeInAir > 100) || (playerStatus->position.y < -2000.0f)) { + if ((playerStatus->timeInAir > 100) || (playerStatus->pos.y < -2000.0f)) { if (!(playerStatus->animFlags & PA_FLAG_NO_OOB_RESPAWN)) { playerStatus->timeInAir = 0; - playerStatus->position.x = playerStatus->lastGoodPosition.x; - playerStatus->position.y = playerStatus->lastGoodPosition.y; - playerStatus->position.z = playerStatus->lastGoodPosition.z; + playerStatus->pos.x = playerStatus->lastGoodPos.x; + playerStatus->pos.y = playerStatus->lastGoodPos.y; + playerStatus->pos.z = playerStatus->lastGoodPos.z; if (playerStatus->animFlags & PA_FLAG_RIDING_PARTNER) { Npc* partner; playerStatus->animFlags |= PA_FLAG_DISMOUNTING_ALLOWED | PA_FLAG_INTERRUPT_USE_PARTNER; partner = get_npc_unsafe(NPC_PARTNER); - partner->pos.x = playerStatus->lastGoodPosition.x; - partner->pos.y = playerStatus->lastGoodPosition.y + playerStatus->colliderHeight; - partner->pos.z = playerStatus->lastGoodPosition.z; - partner->moveToPos.y = playerStatus->lastGoodPosition.y; + partner->pos.x = playerStatus->lastGoodPos.x; + partner->pos.y = playerStatus->lastGoodPos.y + playerStatus->colliderHeight; + partner->pos.z = playerStatus->lastGoodPos.z; + partner->moveToPos.y = playerStatus->lastGoodPos.y; } else { playerStatus->timeInAir = 10; } } } - collisionStatus->currentWall = NO_COLLIDER; + collisionStatus->curWall = NO_COLLIDER; collisionStatus->lastWallHammered = NO_COLLIDER; - collisionStatus->currentInspect = NO_COLLIDER; + collisionStatus->curInspect = NO_COLLIDER; collisionStatus->floorBelow = TRUE; update_player_input(); @@ -664,10 +664,10 @@ void update_player(void) { player_update_sprite(); gameStatus = gGameStatusPtr; - gameStatus->playerPos.x = playerStatus->position.x; - gameStatus->playerPos.y = playerStatus->position.y; - gameStatus->playerPos.z = playerStatus->position.z; - gameStatus->playerYaw = playerStatus->currentYaw; + gameStatus->playerPos.x = playerStatus->pos.x; + gameStatus->playerPos.y = playerStatus->pos.y; + gameStatus->playerPos.z = playerStatus->pos.z; + gameStatus->playerYaw = playerStatus->curYaw; check_input_open_menus(); if (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)) { @@ -680,9 +680,9 @@ void update_player(void) { check_for_pulse_stone(); check_for_ispy(); - playerStatus->pushVelocity.x = 0.0f; - playerStatus->pushVelocity.y = 0.0f; - playerStatus->pushVelocity.z = 0.0f; + playerStatus->pushVel.x = 0.0f; + playerStatus->pushVel.y = 0.0f; + playerStatus->pushVel.z = 0.0f; playerStatus->flags &= ~PS_FLAG_SLIDING; playerStatus->animFlags &= ~PA_FLAG_FORCE_USE_PARTNER; } @@ -699,7 +699,7 @@ void check_input_use_partner(void) { && !(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) && actionState <= ACTION_STATE_RUN ) { - if (playerData->currentPartner == PARTNER_GOOMBARIO) { + if (playerData->curPartner == PARTNER_GOOMBARIO) { WorldTattleInteractionID = playerStatus->interactingWithID; } partner_use_ability(); @@ -747,9 +747,9 @@ void phys_update_standard(void) { } if (!(playerStatus->flags & PS_FLAG_CAMERA_DOESNT_FOLLOW)) { - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; } } @@ -761,9 +761,9 @@ void phys_update_lava_reset(void) { if (!(gPlayerStatusPtr->flags & PS_FLAG_CAMERA_DOESNT_FOLLOW)) { Camera* camera = &gCameras[CAM_DEFAULT]; - camera->targetPos.x = gPlayerStatusPtr->position.x; - camera->targetPos.y = gPlayerStatusPtr->position.y; - camera->targetPos.z = gPlayerStatusPtr->position.z; + camera->targetPos.x = gPlayerStatusPtr->pos.x; + camera->targetPos.y = gPlayerStatusPtr->pos.y; + camera->targetPos.z = gPlayerStatusPtr->pos.z; } } @@ -777,8 +777,8 @@ void player_reset_data(void) { mem_clear(playerStatus, sizeof(PlayerStatus)); playerStatus->flags = PS_FLAG_HAS_REFLECTION; reset_player_status(); - playerStatus->shadowID = create_shadow_type(0, playerStatus->position.x, playerStatus->position.y, - playerStatus->position.z); + playerStatus->shadowID = create_shadow_type(0, playerStatus->pos.x, playerStatus->pos.y, + playerStatus->pos.z); func_800E6B68(); func_800E0B14(); clear_conversation_prompt(); @@ -925,7 +925,7 @@ void update_player_blink(void) { f32 get_xz_dist_to_player(f32 x, f32 z) { PlayerStatus* playerStatus = &gPlayerStatus; - return dist2D(x, z, playerStatus->position.x, playerStatus->position.z); + return dist2D(x, z, playerStatus->pos.x, playerStatus->pos.z); } void enable_player_shadow(void) { @@ -983,7 +983,7 @@ void func_800E01DC(void) { s32 game_scripts_disabled(void) { s32 ret = FALSE; - if (gGameStatusPtr->disableScripts && (gGameStatusPtr->currentButtons[0] & BUTTON_R)) { + if (gGameStatusPtr->disableScripts && (gGameStatusPtr->curButtons[0] & BUTTON_R)) { if (gPartnerStatus.partnerActionState == PARTNER_ACTION_NONE) { set_action_state(ACTION_STATE_IDLE); } @@ -1137,7 +1137,7 @@ s32 func_800E06D8(void) { if (playerStatus->timeInAir != 0 || playerStatus->inputDisabledCount != 0) { return FALSE; } - if (gCollisionStatus.currentWall == NO_COLLIDER) { + if (gCollisionStatus.curWall == NO_COLLIDER) { return FALSE; } if (playerStatus->flags & PS_FLAG_HAS_CONVERSATION_NPC @@ -1149,7 +1149,7 @@ s32 func_800E06D8(void) { return TRUE; } - currentWall = gCollisionStatus.currentWall; + currentWall = gCollisionStatus.curWall; if (!(currentWall & COLLISION_WITH_ENTITY_BIT)) { if (!should_collider_allow_interact(currentWall)) { return FALSE; @@ -1185,7 +1185,7 @@ void check_for_interactables(void) { } if (InteractNotificationCallback == NULL) { - s32 curInteraction = gCollisionStatus.currentWall; + s32 curInteraction = gCollisionStatus.curWall; if (playerStatus->inputDisabledCount != 0) { if (gPlayerStatus.interactingWithID != curInteraction) { @@ -1199,7 +1199,7 @@ void check_for_interactables(void) { } if (curInteraction == NO_COLLIDER) { - s32 floor = gCollisionStatus.currentFloor; + s32 floor = gCollisionStatus.curFloor; if ((floor >= 0) && (floor & COLLISION_WITH_ENTITY_BIT)) { phi_s2 = 1; @@ -1313,8 +1313,8 @@ void update_partner_timers(void) { void player_update_sprite(void) { PlayerStatus* playerStatus = &gPlayerStatus; - f32 cameraYaw = gCameras[gCurrentCameraID].currentYaw; - f32 camRelativeYaw = get_clamped_angle_diff(cameraYaw, playerStatus->currentYaw); + f32 cameraYaw = gCameras[gCurrentCameraID].curYaw; + f32 camRelativeYaw = get_clamped_angle_diff(cameraYaw, playerStatus->curYaw); s32 trueAnim; s32 sprIndex; f32 angle; @@ -1338,7 +1338,7 @@ void player_update_sprite(void) { PrevPlayerDirection = direction; playerStatus->flipYaw[gCurrentCameraID] = (direction != 0) ? 180.0f : -180.0f; - if (fabsf(get_clamped_angle_diff(cameraYaw, playerStatus->currentYaw)) >= 90.0f) { + if (fabsf(get_clamped_angle_diff(cameraYaw, playerStatus->curYaw)) >= 90.0f) { playerStatus->flipYaw[gCurrentCameraID] = -playerStatus->flipYaw[gCurrentCameraID]; } } @@ -1367,7 +1367,7 @@ void player_update_sprite(void) { PrevPlayerCamRelativeYaw = angle = clamp_angle(camRelativeYaw); angle = clamp_angle(playerStatus->flipYaw[gCurrentCameraID] + angle); - if (playerStatus->currentSpeed == 0.0f) { + if (playerStatus->curSpeed == 0.0f) { D_800F7B48 = 0.0f; } @@ -1382,12 +1382,12 @@ void player_update_sprite(void) { trueAnim = playerStatus->anim; if (!(playerStatus->flags & PS_FLAG_FACE_FORWARDS) && (sprIndex == SPR_Mario1 || sprIndex == SPR_MarioW1 || sprIndex == SPR_Peach1) - && fabsf(get_clamped_angle_diff(cameraYaw, playerStatus->currentYaw)) < 60.0f + && fabsf(get_clamped_angle_diff(cameraYaw, playerStatus->curYaw)) < 60.0f ) { trueAnim = get_player_back_anim(trueAnim); } playerStatus->trueAnimation = trueAnim; - playerStatus->currentYaw = playerStatus->targetYaw; + playerStatus->curYaw = playerStatus->targetYaw; } else { trueAnim = playerStatus->anim; if (!(playerStatus->flags & PS_FLAG_FACE_FORWARDS) @@ -1474,8 +1474,8 @@ void render_player_model(void) { if (playerStatus->flags & PS_FLAG_SPRITE_REDRAW) { playerStatus->flags &= ~PS_FLAG_SPRITE_REDRAW; - get_screen_coords(gCurrentCamID, playerStatus->position.x, playerStatus->position.y, - playerStatus->position.z, &x, &y, &z); + get_screen_coords(gCurrentCamID, playerStatus->pos.x, playerStatus->pos.y, + playerStatus->pos.z, &x, &y, &z); if (!(playerStatus->flags & PS_FLAG_SPINNING)) { if (playerStatus->alpha1 != playerStatus->alpha2) { if (playerStatus->alpha1 < 254) { @@ -1503,7 +1503,7 @@ void render_player_model(void) { if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) { rtPtr->appendGfxArg = playerStatus; - rtPtr->distance = -z; + rtPtr->dist = -z; rtPtr->renderMode = playerStatus->renderMode; @@ -1524,7 +1524,7 @@ void render_player_model(void) { void appendGfx_player(void* data) { PlayerStatus* playerStatus = &gPlayerStatus; Matrix4f sp20, sp60, spA0, spE0; - f32 temp_f0 = -gCameras[gCurrentCamID].currentYaw; + f32 temp_f0 = -gCameras[gCurrentCamID].curYaw; s32 spriteIdx; if (playerStatus->actionState == ACTION_STATE_SLIDING) { @@ -1533,7 +1533,7 @@ void appendGfx_player(void* data) { guMtxCatF(spE0, sp20, sp20); guRotateF(spA0, playerStatus->spriteFacingAngle, 0.0f, 1.0f, 0.0f); guMtxCatF(sp20, spA0, sp20); - guTranslateF(sp60, playerStatus->position.x, playerStatus->position.y - 1.0f, playerStatus->position.z); + guTranslateF(sp60, playerStatus->pos.x, playerStatus->pos.y - 1.0f, playerStatus->pos.z); guMtxCatF(sp20, sp60, sp20); spr_draw_player_sprite(PLAYER_SPRITE_MAIN, 0, 0, 0, sp20); } else { @@ -1550,7 +1550,7 @@ void appendGfx_player(void* data) { guMtxCatF(sp20, sp60, sp20); guScaleF(spE0, SPRITE_WORLD_SCALE_D, SPRITE_WORLD_SCALE_D, SPRITE_WORLD_SCALE_D); guMtxCatF(sp20, spE0, sp20); - guTranslateF(sp60, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z); + guTranslateF(sp60, playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z); guMtxCatF(sp20, sp60, sp20); if (playerStatus->animFlags & PA_FLAG_SHIVERING) { @@ -1599,7 +1599,7 @@ void appendGfx_player_spin(void* data) { s32 spriteIdx; for (i = 0; i < 2; i++) { - yaw = -gCameras[gCurrentCamID].currentYaw; + yaw = -gCameras[gCurrentCamID].curYaw; if (i == 0) { if (playerStatus->spriteFacingAngle > 90.0f && playerStatus->spriteFacingAngle <= 180.0f) { @@ -1625,20 +1625,20 @@ void appendGfx_player_spin(void* data) { guRotateF(rotation, yaw, 0.0f, -1.0f, 0.0f); guRotateF(mtx, clamp_angle(playerStatus->pitch), 0.0f, 0.0f, 1.0f); guMtxCatF(rotation, mtx, mtx); - px = playerStatus->position.x; - py = playerStatus->position.y; - pz = playerStatus->position.z; + px = playerStatus->pos.x; + py = playerStatus->pos.y; + pz = playerStatus->pos.z; } else { blurAngle = phys_get_spin_history(i, &x, &y, &z); if (y == 0x80000000) { - py = playerStatus->position.y; + py = playerStatus->pos.y; } else { py = y; } - px = playerStatus->position.x; - pz = playerStatus->position.z; + px = playerStatus->pos.x; + pz = playerStatus->pos.z; set_player_imgfx_comp(PLAYER_SPRITE_MAIN, -1, IMGFX_SET_ALPHA, 0, 0, 0, 64, 0); guRotateF(mtx, yaw, 0.0f, -1.0f, 0.0f); guRotateF(rotation, yaw, 0.0f, -1.0f, 0.0f); @@ -1686,24 +1686,24 @@ void update_player_shadow(void) { yawTemp = 180.0f; } - raycastYaw = (yawTemp - 90.0f) + gCameras[gCurrentCameraID].currentYaw; - shadow->position.x = playerX = playerStatus->position.x; - shadow->position.z = playerZ = playerStatus->position.z; + raycastYaw = (yawTemp - 90.0f) + gCameras[gCurrentCameraID].curYaw; + shadow->pos.x = playerX = playerStatus->pos.x; + shadow->pos.z = playerZ = playerStatus->pos.z; x = playerX; - y = playerStatus->position.y + (playerStatus->colliderHeight / 3.5f); + y = playerStatus->pos.y + (playerStatus->colliderHeight / 3.5f); z = playerZ; shadowScale = 1024.0f; gCollisionStatus.floorBelow = player_raycast_below(raycastYaw, playerStatus->colliderDiameter, &x, &y, &z, &shadowScale, &hitRx, &hitRz, &hitDirX, &hitDirZ); - shadow->rotation.x = hitRx; - shadow->rotation.z = hitRz; - shadow->rotation.y = clamp_angle(-camera->currentYaw); + shadow->rot.x = hitRx; + shadow->rot.z = hitRz; + shadow->rot.y = clamp_angle(-camera->curYaw); hitRx += 180.0f; hitRz += 180.0f; if (hitRx != 0.0f || hitRz != 0.0f) { - s32 dist = dist2D(x, z, playerStatus->position.x, playerStatus->position.z); - f32 tan = atan2(playerStatus->position.x, playerStatus->position.z, x, z); + s32 dist = dist2D(x, z, playerStatus->pos.x, playerStatus->pos.z); + f32 tan = atan2(playerStatus->pos.x, playerStatus->pos.z, x, z); s32 angleTemp = clamp_angle((-90.0f - tan) + get_player_normal_yaw()); if (gGameStatusPtr->playerGroundTraceNormal.y != 0.0f) { @@ -1712,7 +1712,7 @@ void update_player_shadow(void) { } } - shadow->position.y = y; + shadow->pos.y = y; shadow->alpha = (f64)playerStatus->alpha1 / 2; if (!(gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_IS_PEACH)) { diff --git a/src/7B440.c b/src/7B440.c index 70947792ed..96d3f71636 100644 --- a/src/7B440.c +++ b/src/7B440.c @@ -16,7 +16,7 @@ void update_player_input(void) { playerStatus->stickAxis[0] = gGameStatusPtr->stickX[0]; playerStatus->stickAxis[1] = gGameStatusPtr->stickY[0]; - playerStatus->currentButtons = gGameStatusPtr->currentButtons[0]; + playerStatus->curButtons = gGameStatusPtr->curButtons[0]; playerStatus->pressedButtons = gGameStatusPtr->pressedButtons[0]; playerStatus->heldButtons = gGameStatusPtr->heldButtons[0]; @@ -27,7 +27,7 @@ void update_player_input(void) { playerStatus->stickXBuffer[inputBufPos] = playerStatus->stickAxis[0]; playerStatus->stickYBuffer[inputBufPos] = playerStatus->stickAxis[1]; - playerStatus->currentButtonsBuffer[inputBufPos] = playerStatus->currentButtons; + playerStatus->curButtonsBuffer[inputBufPos] = playerStatus->curButtons; playerStatus->pressedButtonsBuffer[inputBufPos] = playerStatus->pressedButtons; playerStatus->heldButtonsBuffer[inputBufPos] = playerStatus->heldButtons; playerStatus->inputBufPos = inputBufPos; @@ -35,7 +35,7 @@ void update_player_input(void) { if (playerStatus->flags & (PS_FLAG_INPUT_DISABLED | PS_FLAG_NO_STATIC_COLLISION)) { playerStatus->stickAxis[0] = 0; playerStatus->stickAxis[1] = 0; - playerStatus->currentButtons = 0; + playerStatus->curButtons = 0; playerStatus->pressedButtons = 0; playerStatus->heldButtons = 0; } @@ -97,16 +97,16 @@ void reset_player_status(void) { set_action_state(ACTION_STATE_IDLE); - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; playerStatus->targetYaw = 0.0f; playerStatus->overlapPushAmount = 0.0f; playerStatus->overlapPushYaw = 0.0f; playerStatus->anim = 0; playerStatus->timeInAir = 0; - playerStatus->position.x = 0.0f; - playerStatus->position.y = 0.0f; - playerStatus->position.z = 0.0f; - playerStatus->currentYaw = 0.0f; + playerStatus->pos.x = 0.0f; + playerStatus->pos.y = 0.0f; + playerStatus->pos.z = 0.0f; + playerStatus->curYaw = 0.0f; playerStatus->flipYaw[CAM_DEFAULT] = 0.0f; playerStatus->flipYaw[CAM_BATTLE] = 0.0f; playerStatus->flipYaw[CAM_TATTLE] = 0.0f; @@ -116,16 +116,16 @@ void reset_player_status(void) { if (mapSettings->entryList != NULL) { if (gGameStatusPtr->entryID < mapSettings->entryCount) { - playerStatus->position.x = (*mapSettings->entryList)[gGameStatusPtr->entryID].x; - playerStatus->position.y = (*mapSettings->entryList)[gGameStatusPtr->entryID].y; - playerStatus->position.z = (*mapSettings->entryList)[gGameStatusPtr->entryID].z; - playerStatus->currentYaw = (*mapSettings->entryList)[gGameStatusPtr->entryID].yaw; + playerStatus->pos.x = (*mapSettings->entryList)[gGameStatusPtr->entryID].x; + playerStatus->pos.y = (*mapSettings->entryList)[gGameStatusPtr->entryID].y; + playerStatus->pos.z = (*mapSettings->entryList)[gGameStatusPtr->entryID].z; + playerStatus->curYaw = (*mapSettings->entryList)[gGameStatusPtr->entryID].yaw; } } - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; phys_reset_spin_history(); mem_clear(&gPlayerSpinState, sizeof(gPlayerSpinState)); @@ -134,7 +134,7 @@ void reset_player_status(void) { void get_packed_buttons(s32* arg0) { PlayerStatus* playerStatus = &gPlayerStatus; - *arg0 = (u16)playerStatus->currentButtons | (playerStatus->pressedButtons << 16); + *arg0 = (u16)playerStatus->curButtons | (playerStatus->pressedButtons << 16); } void player_input_to_move_vector(f32* angle, f32* magnitude) { @@ -153,7 +153,7 @@ void player_input_to_move_vector(f32* angle, f32* magnitude) { mag = magMax; } - ang = clamp_angle(atan2(0.0f, 0.0f, stickAxisX, stickAxisY) + gCameras[CAM_DEFAULT].currentYaw); + ang = clamp_angle(atan2(0.0f, 0.0f, stickAxisX, stickAxisY) + gCameras[CAM_DEFAULT].curYaw); if (mag == 0.0f) { ang = playerStatus->targetYaw; } @@ -175,7 +175,7 @@ void game_input_to_move_vector(f32* outAngle, f32* outMagnitude) { magnitude = maxRadius; } - angle = clamp_angle(atan2(0.0f, 0.0f, stickX, stickY) + gCameras[CAM_DEFAULT].currentYaw); + angle = clamp_angle(atan2(0.0f, 0.0f, stickX, stickY) + gCameras[CAM_DEFAULT].curYaw); if (magnitude == 0.0f) { angle = playerStatus->targetYaw; } @@ -186,8 +186,8 @@ void game_input_to_move_vector(f32* outAngle, f32* outMagnitude) { void func_800E24F8(void) { Shadow* shadow = get_shadow_by_index(gPlayerStatus.shadowID); - f32 x = shadow->rotation.x + 180.0; - f32 z = shadow->rotation.z + 180.0; + f32 x = shadow->rot.x + 180.0; + f32 z = shadow->rot.z + 180.0; Camera* camera = &gCameras[CAM_DEFAULT]; f32 temp; diff --git a/src/7E9D0.c b/src/7E9D0.c index 51c47143f8..69435daa6f 100644 --- a/src/7E9D0.c +++ b/src/7E9D0.c @@ -45,42 +45,42 @@ s32 phys_adjust_cam_on_landing(void) { break; case 1: if (D_8010C9B0 == 0) { - if (playerStatus->position.y <= 0.0f) { + if (playerStatus->pos.y <= 0.0f) { D_8010C9B0 = 1; } ret = 2; - } else if (playerStatus->position.y > 0.0f) { + } else if (playerStatus->pos.y > 0.0f) { ret = 0; } break; case 3: - if (playerStatus->position.y > 25.0f) { + if (playerStatus->pos.y > 25.0f) { ret = 0; } break; case 4: - if (playerStatus->position.y > 50.0f) { + if (playerStatus->pos.y > 50.0f) { ret = 0; } break; case 7: - if (playerStatus->position.y > -390.0f) { + if (playerStatus->pos.y > -390.0f) { ret = 0; - } else if (playerStatus->position.y < -495.0f) { + } else if (playerStatus->pos.y < -495.0f) { ret = 0; } break; case 8: - if (playerStatus->position.y > -90.0f) { + if (playerStatus->pos.y > -90.0f) { ret = 0; - } else if (playerStatus->position.y < -370.0f) { + } else if (playerStatus->pos.y < -370.0f) { ret = 0; } break; case 2: if (gGameStatusPtr->entryID == 0) { if (D_8010C9B0 == 0) { - if (!(playerStatus->position.y > 0.0f)) { + if (!(playerStatus->pos.y > 0.0f)) { D_8010C9B0 = 1; } else { ret = 2; @@ -88,7 +88,7 @@ s32 phys_adjust_cam_on_landing(void) { } } - if (playerStatus->position.y > 0.0f) { + if (playerStatus->pos.y > 0.0f) { ret = 0; } } else { @@ -98,7 +98,7 @@ s32 phys_adjust_cam_on_landing(void) { case 5: if (gGameStatusPtr->entryID == 0) { if (D_8010C9B0 == 0) { - if (!(playerStatus->position.y > -130.0f)) { + if (!(playerStatus->pos.y > -130.0f)) { D_8010C9B0 = 1; } else { ret = 2; @@ -107,7 +107,7 @@ s32 phys_adjust_cam_on_landing(void) { } - if (playerStatus->position.y > -130.0f) { + if (playerStatus->pos.y > -130.0f) { ret = 0; } } else { @@ -116,7 +116,7 @@ s32 phys_adjust_cam_on_landing(void) { break; case 10: if (D_8010C9B0 == 0) { - if (!(playerStatus->position.y > -520.0f)) { + if (!(playerStatus->pos.y > -520.0f)) { D_8010C9B0 = 1; } else { ret = 2; @@ -124,14 +124,14 @@ s32 phys_adjust_cam_on_landing(void) { } } - if (playerStatus->position.y > -520.0f) { + if (playerStatus->pos.y > -520.0f) { ret = 0; } break; case 11: if (gGameStatusPtr->entryID == 0) { if (D_8010C9B0 == 0) { - if (!(playerStatus->position.y > -520.0f)) { + if (!(playerStatus->pos.y > -520.0f)) { D_8010C9B0 = 1; } else { ret = 2; @@ -140,7 +140,7 @@ s32 phys_adjust_cam_on_landing(void) { } - if (playerStatus->position.y > -520.0f) { + if (playerStatus->pos.y > -520.0f) { ret = 0; } } @@ -154,7 +154,7 @@ s32 phys_adjust_cam_on_landing(void) { } if (ret == 1) { - s32 surfaceType = get_collider_flags(gCollisionStatus.currentFloor) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; + s32 surfaceType = get_collider_flags(gCollisionStatus.curFloor) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; if (surfaceType == SURFACE_TYPE_LAVA) { gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_IGNORE_PLAYER_Y; @@ -363,7 +363,7 @@ void set_action_state(s32 actionState) { } // Whilst Sushie, Lakilester, or Parakarry's ability is active, hazards have no effect. - partner = playerData->currentPartner; + partner = playerData->curPartner; if (partner == PARTNER_SUSHIE || partner == PARTNER_LAKILESTER || partner == PARTNER_PARAKARRY) { if (gPartnerStatus.partnerActionState != PARTNER_ACTION_NONE) { @@ -457,7 +457,7 @@ s32 check_input_hammer(void) { return FALSE; } - if (gPartnerStatus.partnerActionState == PARTNER_ACTION_USE && playerData->currentPartner == PARTNER_WATT) { + if (gPartnerStatus.partnerActionState == PARTNER_ACTION_USE && playerData->curPartner == PARTNER_WATT) { return FALSE; } @@ -481,7 +481,7 @@ s32 check_input_jump(void) { } // @bug? collider flags not properly masked with COLLIDER_FLAG_SURFACE_TYPE - surfaceType = get_collider_flags((u16)gCollisionStatus.currentFloor); + surfaceType = get_collider_flags((u16)gCollisionStatus.curFloor); if ((surfaceType == SURFACE_TYPE_SLIDE) && phys_should_player_be_sliding()) { return FALSE; } @@ -493,8 +493,8 @@ s32 check_input_jump(void) { return FALSE; } - if ((collisionStatus->currentInspect != -1) && (collisionStatus->currentInspect & COLLISION_WITH_ENTITY_BIT)) { - Entity* entity = get_entity_by_index(collisionStatus->currentInspect); + if ((collisionStatus->curInspect != -1) && (collisionStatus->curInspect & COLLISION_WITH_ENTITY_BIT)) { + Entity* entity = get_entity_by_index(collisionStatus->curInspect); if (entity->flags & ENTITY_FLAG_SHOWS_INSPECT_PROMPT) { if ((entity->boundScriptBytecode == 0) || (entity->flags & ENTITY_FLAG_4000)) { @@ -521,7 +521,7 @@ void check_input_spin(void) { if (!((playerStatus->flags & (PS_FLAG_NO_STATIC_COLLISION | PS_FLAG_CUTSCENE_MOVEMENT)) || (playerStatus->animFlags & PA_FLAG_USING_WATT) || - (playerStatus->currentButtons & BUTTON_C_DOWN) || + (playerStatus->curButtons & BUTTON_C_DOWN) || is_ability_active(ABILITY_SLOW_GO))) { s32 actionState = playerStatus->actionState; @@ -553,7 +553,7 @@ void peach_set_disguise_anim(AnimID anim) { s32 listIndex = PeachDisguiseNpcIndex; if (listIndex >= 0) { - get_npc_by_index(listIndex)->currentAnim = anim; + get_npc_by_index(listIndex)->curAnim = anim; } } @@ -610,9 +610,9 @@ void peach_sync_disguise_npc(void) { npc->yaw = playerStatus->targetYaw; } - npc->pos.x = playerStatus->position.x; - npc->pos.y = playerStatus->position.y; - npc->pos.z = playerStatus->position.z; + npc->pos.x = playerStatus->pos.x; + npc->pos.y = playerStatus->pos.y; + npc->pos.z = playerStatus->pos.z; } } @@ -650,9 +650,9 @@ Npc* peach_make_disguise_npc(s32 peachDisguise) { set_npc_yaw(npc, yaw); - npc->pos.x = playerStatus->position.x; - npc->pos.y = playerStatus->position.y; - npc->pos.z = playerStatus->position.z; + npc->pos.x = playerStatus->pos.x; + npc->pos.y = playerStatus->pos.y; + npc->pos.z = playerStatus->pos.z; return npc; } @@ -666,16 +666,16 @@ s32 peach_disguise_check_overlaps(void) { s32 i; if (playerStatus->spriteFacingAngle >= 90.0f && playerStatus->spriteFacingAngle < 270.0f) { - yaw = camera->currentYaw - 270.0f; + yaw = camera->curYaw - 270.0f; } else { - yaw = camera->currentYaw - 90.0f; + yaw = camera->curYaw - 90.0f; } sin_cos_rad(DEG_TO_RAD(clamp_angle(yaw)), &dx, &dy); for (radius = 2, i = 2; i > 0; radius += 18, i--) { - f32 x = playerStatus->position.x + (dx * radius); - f32 y = playerStatus->position.y + 4.0f; - f32 z = playerStatus->position.z - (dy * radius); + f32 x = playerStatus->pos.x + (dx * radius); + f32 y = playerStatus->pos.y + 4.0f; + f32 z = playerStatus->pos.z - (dy * radius); hitID = player_test_lateral_overlap(3, playerStatus, &x, &y, &z, 4.0f, yaw); if (hitID >= 0) { break; diff --git a/src/7bb60_len_41b0.c b/src/7bb60_len_41b0.c index a92b1c4a91..1186ddb095 100644 --- a/src/7bb60_len_41b0.c +++ b/src/7bb60_len_41b0.c @@ -15,7 +15,7 @@ s32 phys_check_interactable_collision(void); void phys_save_ground_pos(void); void record_jump_apex(void) { - gPlayerStatus.jumpApexHeight = gPlayerStatus.position.y; + gPlayerStatus.jumpApexHeight = gPlayerStatus.pos.y; } s32 can_trigger_loading_zone(void) { @@ -33,7 +33,7 @@ s32 can_trigger_loading_zone(void) { } if (actionState == ACTION_STATE_RIDE) { - if (playerData->currentPartner == PARTNER_LAKILESTER || playerData->currentPartner == PARTNER_BOW) { + if (playerData->curPartner == PARTNER_LAKILESTER || playerData->curPartner == PARTNER_BOW) { if (partnerStatus->partnerActionState != PARTNER_ACTION_NONE) { return TRUE; } else { @@ -57,7 +57,7 @@ void move_player(s32 duration, f32 heading, f32 speed) { gPlayerStatus.flags |= PS_FLAG_CUTSCENE_MOVEMENT; gPlayerStatus.heading = heading; gPlayerStatus.moveFrames = duration; - gPlayerStatus.currentSpeed = speed; + gPlayerStatus.curSpeed = speed; if (!(gPlayerStatus.animFlags & PA_FLAG_RIDING_PARTNER)) { set_action_state(speed > gPlayerStatus.walkSpeed ? ACTION_STATE_RUN : ACTION_STATE_WALK); @@ -76,26 +76,26 @@ s32 collision_main_above(void) { f32 phi_f2; new_var = sp2C = playerStatus->colliderHeight * 0.5f; - x = playerStatus->position.x; - y = playerStatus->position.y + new_var; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y + new_var; + z = playerStatus->pos.z; player_input_to_move_vector(&moveAngle, &moveMagnitude); if (moveMagnitude != 0.0f) { phi_f2 = playerStatus->targetYaw; } else { - phi_f2 = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw; + phi_f2 = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw; } moveAngle = phi_f2; hitResult = player_raycast_up_corners(playerStatus, &x, &y, &z, &sp2C, moveAngle); - collisionStatus->currentCeiling = hitResult; + collisionStatus->curCeiling = hitResult; if (hitResult >= 0) { if (playerStatus->actionState != ACTION_STATE_FALLING && playerStatus->actionState != ACTION_STATE_STEP_DOWN - && collisionStatus->currentFloor <= NO_COLLIDER + && collisionStatus->curFloor <= NO_COLLIDER ) { if (sp2C <= fabsf(new_var + playerStatus->gravityIntegrator[0])) { do { @@ -104,7 +104,7 @@ s32 collision_main_above(void) { } } while (0); - playerStatus->position.y = y - ((playerStatus->colliderHeight / 5.0f) * 3.0f); + playerStatus->pos.y = y - ((playerStatus->colliderHeight / 5.0f) * 3.0f); if (playerStatus->actionState != ACTION_STATE_TORNADO_JUMP && playerStatus->actionState != ACTION_STATE_SPIN_JUMP ) { @@ -132,8 +132,8 @@ void handle_switch_hit(void) { } if (playerStatus->actionSubstate == LANDING_ON_SWITCH_SUBSTATE_0) { - if (dist2D(JumpedOnSwitchX, JumpedOnSwitchZ, playerStatus->position.x, playerStatus->position.z) <= 22.0f) { - add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, 5.0f, playerStatus->targetYaw); + if (dist2D(JumpedOnSwitchX, JumpedOnSwitchZ, playerStatus->pos.x, playerStatus->pos.z) <= 22.0f) { + add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, 5.0f, playerStatus->targetYaw); } integrate_gravity(); if (playerStatus->gravityIntegrator[0] <= 0.0f) { @@ -145,14 +145,14 @@ void handle_switch_hit(void) { if (playerStatus->gravityIntegrator[0] > playerStatus->maxJumpSpeed) { playerStatus->gravityIntegrator[0] = playerStatus->maxJumpSpeed; } - playerStatus->position.y += playerStatus->gravityIntegrator[0]; + playerStatus->pos.y += playerStatus->gravityIntegrator[0]; } else if (playerStatus->actionSubstate == LANDING_ON_SWITCH_SUBSTATE_2) { - if (dist2D(JumpedOnSwitchX, JumpedOnSwitchZ, playerStatus->position.x, playerStatus->position.z) <= 22.0f) { - add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, 5.0f, playerStatus->targetYaw); + if (dist2D(JumpedOnSwitchX, JumpedOnSwitchZ, playerStatus->pos.x, playerStatus->pos.z) <= 22.0f) { + add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, 5.0f, playerStatus->targetYaw); } groundPosY = player_check_collision_below(player_fall_distance(), &colliderID); player_handle_floor_collider_type(colliderID); - playerStatus->position.y = groundPosY; + playerStatus->pos.y = groundPosY; if (colliderID >= 0) { if (!(playerStatus->animFlags & PA_FLAG_USING_WATT)) { anim = ANIM_Mario1_Land; @@ -170,8 +170,8 @@ void func_800E2BB0(void) { PlayerStatus* playerStatus = &gPlayerStatus; s32 cond = FALSE; - if (playerStatus->position.y < playerStatus->gravityIntegrator[3] + playerStatus->gravityIntegrator[2]) { - f32 phi_f6 = (playerStatus->gravityIntegrator[3] - playerStatus->position.y) / 777.0f; + if (playerStatus->pos.y < playerStatus->gravityIntegrator[3] + playerStatus->gravityIntegrator[2]) { + f32 phi_f6 = (playerStatus->gravityIntegrator[3] - playerStatus->pos.y) / 777.0f; if (phi_f6 < -0.47) { phi_f6 = -0.47f; @@ -180,7 +180,7 @@ void func_800E2BB0(void) { phi_f6 = 0.001f; } playerStatus->gravityIntegrator[0] += phi_f6; - playerStatus->position.y += playerStatus->gravityIntegrator[0]; + playerStatus->pos.y += playerStatus->gravityIntegrator[0]; if (playerStatus->gravityIntegrator[0] <= 0.0f) { cond = TRUE; } @@ -189,7 +189,7 @@ void func_800E2BB0(void) { if (playerStatus->gravityIntegrator[0] <= 0.0f) { cond = TRUE; } - playerStatus->position.y += playerStatus->gravityIntegrator[0]; + playerStatus->pos.y += playerStatus->gravityIntegrator[0]; } if (cond) { @@ -212,7 +212,7 @@ void phys_update_jump(void) { return; case ACTION_STATE_BOUNCE: integrate_gravity(); - playerStatus->position.y += playerStatus->gravityIntegrator[0]; + playerStatus->pos.y += playerStatus->gravityIntegrator[0]; if (playerStatus->gravityIntegrator[0] <= 0.0f) { record_jump_apex(); if (is_starting_conversation()) { @@ -229,7 +229,7 @@ void phys_update_jump(void) { return; case ACTION_STATE_HOP: playerStatus->gravityIntegrator[0] -= 4.5; - playerStatus->position.y += playerStatus->gravityIntegrator[0]; + playerStatus->pos.y += playerStatus->gravityIntegrator[0]; if (playerStatus->gravityIntegrator[0] <= 0.0f) { record_jump_apex(); gravity_use_fall_parms(); @@ -241,7 +241,7 @@ void phys_update_jump(void) { case ACTION_STATE_HIT_LAVA: return; default: - if (!(playerStatus->currentButtons & BUTTON_A)) { + if (!(playerStatus->curButtons & BUTTON_A)) { record_jump_apex(); set_action_state(ACTION_STATE_HOP); integrate_gravity(); @@ -266,7 +266,7 @@ void phys_update_jump(void) { if (playerStatus->gravityIntegrator[0] > playerStatus->maxJumpSpeed) { playerStatus->gravityIntegrator[0] = playerStatus->maxJumpSpeed; } - playerStatus->position.y += playerStatus->gravityIntegrator[0]; + playerStatus->pos.y += playerStatus->gravityIntegrator[0]; } void phys_init_integrator_for_current_state(void) { @@ -330,7 +330,7 @@ void phys_update_falling(void) { && gPlayerStatus.actionState != ACTION_STATE_BOUNCE ) { s32 colliderID; - gPlayerStatus.position.y = player_check_collision_below(player_fall_distance(), &colliderID); + gPlayerStatus.pos.y = player_check_collision_below(player_fall_distance(), &colliderID); player_handle_floor_collider_type(colliderID); } } @@ -387,21 +387,21 @@ void phys_player_land(void) { playerStatus->timeInAir = 0; playerStatus->peakJumpTime = 0; playerStatus->flags &= ~PS_FLAG_SCRIPTED_FALL; - playerStatus->landPos.x = playerStatus->position.x; - playerStatus->landPos.z = playerStatus->position.z; + playerStatus->landPos.x = playerStatus->pos.x; + playerStatus->landPos.z = playerStatus->pos.z; playerStatus->flags &= ~PS_FLAG_AIRBORNE; sfx_play_sound_at_player(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0); - if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) { + if (!(collisionStatus->curFloor & COLLISION_WITH_ENTITY_BIT)) { phys_adjust_cam_on_landing(); } collisionStatus->lastTouchedFloor = -1; - if (collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT) { - s32 entityType = get_entity_type(collisionStatus->currentFloor); + if (collisionStatus->curFloor & COLLISION_WITH_ENTITY_BIT) { + s32 entityType = get_entity_type(collisionStatus->curFloor); if (entityType <= ACTION_STATE_FALLING) { if (entityType >= ACTION_STATE_LANDING_ON_SWITCH) { - Entity* entity = get_entity_by_index(collisionStatus->currentFloor); + Entity* entity = get_entity_by_index(collisionStatus->curFloor); entity->collisionFlags |= ENTITY_COLLISION_PLAYER_TOUCH_FLOOR; if (playerStatus->actionState != ACTION_STATE_TORNADO_JUMP @@ -474,20 +474,20 @@ f32 player_check_collision_below(f32 offset, s32* colliderID) { CollisionStatus* collisionStatus = &gCollisionStatus; f32 temp_f4 = playerStatus->colliderHeight * 0.5f; f32 outLength = fabsf(offset) + temp_f4; - f32 x = playerStatus->position.x; - f32 y = playerStatus->position.y + temp_f4; - f32 z = playerStatus->position.z; + f32 x = playerStatus->pos.x; + f32 y = playerStatus->pos.y + temp_f4; + f32 z = playerStatus->pos.z; f32 sp38, sp3C, sp40, sp44; s32 hit = *colliderID = player_raycast_below_cam_relative(&gPlayerStatus, &x, &y, &z, &outLength, &sp38, &sp3C, &sp40, &sp44); if (hit < 0) { - if (offset >= 0.0f && collisionStatus->currentCeiling >= 0) { - return playerStatus->position.y; + if (offset >= 0.0f && collisionStatus->curCeiling >= 0) { + return playerStatus->pos.y; } - y = playerStatus->position.y + offset; + y = playerStatus->pos.y + offset; } else { - collisionStatus->currentFloor = hit; + collisionStatus->curFloor = hit; collisionStatus->lastTouchedFloor = -1; } return y; @@ -512,91 +512,91 @@ void collision_main_lateral(void) { gCollisionStatus.pushingAgainstWall = NO_COLLIDER; if (playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT) { - speed = playerStatus->currentSpeed; + speed = playerStatus->curSpeed; if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) { speed *= 0.5f; } - add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, speed, playerStatus->heading); + add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, speed, playerStatus->heading); return; } switch (playerStatus->actionState) { case ACTION_STATE_STEP_UP: collision_check_player_intersecting_world(0, 0, - playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw); + playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw); break; case ACTION_STATE_RIDE: if (get_current_partner_id() == PARTNER_BOW) { - playerStatus->position.x += playerStatus->pushVelocity.x; - playerStatus->position.y += playerStatus->pushVelocity.y; - playerStatus->position.z += playerStatus->pushVelocity.z; + playerStatus->pos.x += playerStatus->pushVel.x; + playerStatus->pos.y += playerStatus->pushVel.y; + playerStatus->pos.z += playerStatus->pushVel.z; - if (playerStatus->pushVelocity.x != 0.0f || - playerStatus->pushVelocity.y != 0.0f || - playerStatus->pushVelocity.z != 0.0f) + if (playerStatus->pushVel.x != 0.0f || + playerStatus->pushVel.y != 0.0f || + playerStatus->pushVel.z != 0.0f) { - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; if (playerStatus->alpha1 != 128) { collision_check_player_intersecting_world(0, 0, - atan2(0.0f, 0.0f, playerStatus->pushVelocity.x, playerStatus->pushVelocity.z)); + atan2(0.0f, 0.0f, playerStatus->pushVel.x, playerStatus->pushVel.z)); } } } break; case ACTION_STATE_SPIN_POUND: case ACTION_STATE_TORNADO_POUND: - playerStatus->position.x += playerStatus->pushVelocity.x; - playerStatus->position.y += playerStatus->pushVelocity.y; - playerStatus->position.z += playerStatus->pushVelocity.z; - if (playerStatus->pushVelocity.x != 0.0f || - playerStatus->pushVelocity.y != 0.0f || - playerStatus->pushVelocity.z != 0.0f) + playerStatus->pos.x += playerStatus->pushVel.x; + playerStatus->pos.y += playerStatus->pushVel.y; + playerStatus->pos.z += playerStatus->pushVel.z; + if (playerStatus->pushVel.x != 0.0f || + playerStatus->pushVel.y != 0.0f || + playerStatus->pushVel.z != 0.0f) { - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; } - if (playerStatus->pushVelocity.x != 0.0f || - playerStatus->pushVelocity.y != 0.0f || - playerStatus->pushVelocity.z != 0.0f) + if (playerStatus->pushVel.x != 0.0f || + playerStatus->pushVel.y != 0.0f || + playerStatus->pushVel.z != 0.0f) { collision_check_player_intersecting_world(0, 0, - playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw); + playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw); } break; case ACTION_STATE_HAMMER: - playerStatus->position.x += playerStatus->pushVelocity.x; - playerStatus->position.y += playerStatus->pushVelocity.y; - playerStatus->position.z += playerStatus->pushVelocity.z; - if (playerStatus->pushVelocity.x != 0.0f || - playerStatus->pushVelocity.y != 0.0f || - playerStatus->pushVelocity.z != 0.0f) + playerStatus->pos.x += playerStatus->pushVel.x; + playerStatus->pos.y += playerStatus->pushVel.y; + playerStatus->pos.z += playerStatus->pushVel.z; + if (playerStatus->pushVel.x != 0.0f || + playerStatus->pushVel.y != 0.0f || + playerStatus->pushVel.z != 0.0f) { - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; } - playerX = playerStatus->position.x; - playerY = playerStatus->position.y; - playerZ = playerStatus->position.z; - if (playerStatus->currentSpeed != 0.0f) { + playerX = playerStatus->pos.x; + playerY = playerStatus->pos.y; + playerZ = playerStatus->pos.z; + if (playerStatus->curSpeed != 0.0f) { yaw = playerStatus->targetYaw; } else { - yaw = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw; + yaw = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw; } - collisionStatus->currentWall = + collisionStatus->curWall = player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ, playerStatus->colliderDiameter * 0.5f, yaw); - if (playerStatus->pushVelocity.x != 0.0f || - playerStatus->pushVelocity.y != 0.0f || - playerStatus->pushVelocity.z != 0.0f) + if (playerStatus->pushVel.x != 0.0f || + playerStatus->pushVel.y != 0.0f || + playerStatus->pushVel.z != 0.0f) { collision_check_player_intersecting_world(0, 0, - playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw); + playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw); } break; default: @@ -637,7 +637,7 @@ void collision_main_lateral(void) { } sin_cos_rad(DEG_TO_RAD(playerStatus->targetYaw), &sinTheta, &cosTheta); - speed = playerStatus->currentSpeed; + speed = playerStatus->curSpeed; if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) { speed *= 0.5f; } @@ -652,47 +652,47 @@ void collision_main_lateral(void) { } } - playerStatus->position.x += playerStatus->pushVelocity.x; - playerStatus->position.z += playerStatus->pushVelocity.z; + playerStatus->pos.x += playerStatus->pushVel.x; + playerStatus->pos.z += playerStatus->pushVel.z; if (playerStatus->timeInAir == 0) { - playerStatus->position.y += playerStatus->pushVelocity.y; + playerStatus->pos.y += playerStatus->pushVel.y; } if ( - playerStatus->pushVelocity.x != 0.0f || - playerStatus->pushVelocity.y != 0.0f || - playerStatus->pushVelocity.z != 0.0f) + playerStatus->pushVel.x != 0.0f || + playerStatus->pushVel.y != 0.0f || + playerStatus->pushVel.z != 0.0f) { - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; } - playerX = playerStatus->position.x; - playerY = playerStatus->position.y; - playerZ = playerStatus->position.z; + playerX = playerStatus->pos.x; + playerY = playerStatus->pos.y; + playerZ = playerStatus->pos.z; result = player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ, playerStatus->colliderDiameter * 0.5f, playerStatus->targetYaw); if (speed == 0.0f && result < 0) { - yaw2 = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw; + yaw2 = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw; sin_cos_rad(DEG_TO_RAD(yaw2 + 180.0f), &sinTheta, &cosTheta); - playerX = playerStatus->position.x + (sinTheta * playerStatus->colliderDiameter * 0.5f); - playerY = playerStatus->position.y; - playerZ = playerStatus->position.z - (cosTheta * playerStatus->colliderDiameter * 0.5f); + playerX = playerStatus->pos.x + (sinTheta * playerStatus->colliderDiameter * 0.5f); + playerY = playerStatus->pos.y; + playerZ = playerStatus->pos.z - (cosTheta * playerStatus->colliderDiameter * 0.5f); result = player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ, playerStatus->colliderDiameter, yaw2); } - collisionStatus->currentWall = result; + collisionStatus->curWall = result; if (!(playerStatus->flags & PS_FLAG_MOVEMENT_LOCKED) && playerStatus->actionState != ACTION_STATE_HAMMER) { if (speed == 0.0f) { collision_check_player_intersecting_world(0, 0, - playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw); + playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw); break; } - playerX = playerStatus->position.x; - playerZ = playerStatus->position.z; - playerY = playerStatus->position.y; + playerX = playerStatus->pos.x; + playerZ = playerStatus->pos.z; + playerY = playerStatus->pos.y; yaw2 = yaw; if (speed > 4.0f) { @@ -719,22 +719,22 @@ void collision_main_lateral(void) { if (test1 < 0) { if (test2 < 0) { - playerStatus->position.x = playerX; - playerStatus->position.z = playerZ; + playerStatus->pos.x = playerX; + playerStatus->pos.z = playerZ; } else { - playerStatus->position.x = test1X; - playerStatus->position.z = test1Z; + playerStatus->pos.x = test1X; + playerStatus->pos.z = test1Z; } } else if (test2 < 0) { - playerStatus->position.x = test2X; - playerStatus->position.z = test2Y; + playerStatus->pos.x = test2X; + playerStatus->pos.z = test2Y; } if (playerStatus->enableCollisionOverlapsCheck == 0) { if (playerStatus->animFlags & PA_FLAG_SPINNING) { yaw2 = playerStatus->targetYaw; } else { - yaw2 = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw; + yaw2 = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw; } if (collision_check_player_intersecting_world(0, 0, yaw2) < 0) { collision_check_player_intersecting_world(1, playerStatus->colliderHeight * 0.75f, yaw2); @@ -762,9 +762,9 @@ s32 collision_check_player_intersecting_world(s32 mode, s32 arg1, f32 yaw) { s32 i; for (i = 0; i < 4; i++) { - f32 x = gPlayerStatusPtr->position.x; - f32 y = gPlayerStatusPtr->position.y + arg1; - f32 z = gPlayerStatusPtr->position.z; + f32 x = gPlayerStatusPtr->pos.x; + f32 y = gPlayerStatusPtr->pos.y + arg1; + f32 z = gPlayerStatusPtr->pos.z; s32 hitID, hitID2; hitID = player_test_lateral_overlap(mode, gPlayerStatusPtr, &x, &y, &z, 0.0f, angle); @@ -783,8 +783,8 @@ s32 collision_check_player_intersecting_world(s32 mode, s32 arg1, f32 yaw) { } gPlayerStatusPtr = gPlayerStatusPtr; - gPlayerStatusPtr->position.x = x; - gPlayerStatusPtr->position.z = z; + gPlayerStatusPtr->pos.x = x; + gPlayerStatusPtr->pos.z = z; angle += 90.0f; } @@ -819,16 +819,16 @@ void collision_check_player_overlaps(void) { f32 overlapPush = playerStatus->overlapPushAmount; if (overlapPush != 0.0f) { - f32 x = playerStatus->position.x; - f32 y = playerStatus->position.y; - f32 z = playerStatus->position.z; + f32 x = playerStatus->pos.x; + f32 y = playerStatus->pos.y; + f32 z = playerStatus->pos.z; player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, overlapPush, playerStatus->overlapPushYaw); overlapPush -= playerStatus->runSpeed / 10.0f; - playerStatus->position.x = x; - playerStatus->position.y = y; - playerStatus->position.z = z; + playerStatus->pos.x = x; + playerStatus->pos.y = y; + playerStatus->pos.z = z; if (overlapPush < 0.0f) { overlapPush = 0.0f; @@ -844,7 +844,7 @@ s32 phys_should_player_be_sliding(void) { s32 ret = FALSE; if (gGameStatusPtr->areaID == AREA_IWA) { - f32 temp_f0 = shadow->rotation.z + 180.0; + f32 temp_f0 = shadow->rot.z + 180.0; if (temp_f0 != 0.0f) { ret = TRUE; @@ -855,7 +855,7 @@ s32 phys_should_player_be_sliding(void) { } break; case 1: - if (playerStatus->position.x >= -300.0f && playerStatus->position.x <= -140.0f) { + if (playerStatus->pos.x >= -300.0f && playerStatus->pos.x <= -140.0f) { ret = FALSE; } break; @@ -867,8 +867,8 @@ s32 phys_should_player_be_sliding(void) { s32 phys_is_on_sloped_ground(void) { Shadow* playerShadow = get_shadow_by_index(gPlayerStatus.shadowID); - f32 rotZ = playerShadow->rotation.z + 180.0; - f32 rotX = playerShadow->rotation.x + 180.0; + f32 rotZ = playerShadow->rot.z + 180.0; + f32 rotX = playerShadow->rot.x + 180.0; s32 ret = TRUE; if (fabsf(rotZ) < 20.0f && fabsf(rotX) < 20.0f) { @@ -883,9 +883,9 @@ void phys_main_collision_below(void) { PartnerStatus* partnerStatus = &gPartnerStatus; CollisionStatus* collisionStatus = &gCollisionStatus; f32 collHeightHalf = playerStatus->colliderHeight * 0.5f; - f32 playerX = playerStatus->position.x; - f32 playerY = playerStatus->position.y + collHeightHalf; - f32 playerZ = playerStatus->position.z; + f32 playerX = playerStatus->pos.x; + f32 playerY = playerStatus->pos.y + collHeightHalf; + f32 playerZ = playerStatus->pos.z; f32 outLength = playerStatus->colliderHeight; f32 temp_f24 = (2.0f * playerStatus->colliderHeight) / 7.0f; f32 hitRx, hitRz; @@ -901,7 +901,7 @@ void phys_main_collision_below(void) { colliderID = NO_COLLIDER; } if (playerStatus->timeInAir == 0) { - collisionStatus->currentFloor = colliderID; + collisionStatus->curFloor = colliderID; } if (colliderID >= 0) { playerStatus->groundAnglesXZ.x = hitDirX; @@ -953,21 +953,21 @@ void phys_main_collision_below(void) { break; default: cond = FALSE; - if (collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT) { - cond = get_entity_type(collisionStatus->currentFloor) == ENTITY_TYPE_HIDDEN_PANEL; + if (collisionStatus->curFloor & COLLISION_WITH_ENTITY_BIT) { + cond = get_entity_type(collisionStatus->curFloor) == ENTITY_TYPE_HIDDEN_PANEL; } if (playerStatus->actionState != ACTION_STATE_STEP_UP && !cond) { if (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)) { - if (playerY - playerStatus->position.y < 6.0f) { - playerStatus->position.y = playerY; + if (playerY - playerStatus->pos.y < 6.0f) { + playerStatus->pos.y = playerY; } else { set_action_state(ACTION_STATE_STEP_UP); D_8010C928 = playerY; D_8010C984 = playerStatus->targetYaw; } } else { - playerStatus->position.y = playerY; + playerStatus->pos.y = playerY; } phys_save_ground_pos(); } @@ -989,13 +989,13 @@ void phys_main_collision_below(void) { void func_800E4AD8(s32 mode) { Camera* currentCamera = &gCameras[gCurrentCameraID]; - collision_check_player_intersecting_world(mode, 0, gPlayerStatus.spriteFacingAngle - 90.0f + currentCamera->currentYaw); + collision_check_player_intersecting_world(mode, 0, gPlayerStatus.spriteFacingAngle - 90.0f + currentCamera->curYaw); } void func_800E4B40(s32 mode, f32* arg1, f32* arg2, f32* arg3) { Camera* currentCamera = &gCameras[gCurrentCameraID]; - func_800E4404(mode, 0, gPlayerStatus.spriteFacingAngle - 90.0f + currentCamera->currentYaw, arg1, arg2, arg3); + func_800E4404(mode, 0, gPlayerStatus.spriteFacingAngle - 90.0f + currentCamera->curYaw, arg1, arg2, arg3); } void collision_lava_reset_check_additional_overlaps(void) { @@ -1009,79 +1009,79 @@ void collision_lava_reset_check_additional_overlaps(void) { } temp_f0 = clamp_angle(playerStatus->targetYaw - 30.0); - y = playerStatus->position.y + (playerStatus->colliderHeight * 0.75f); - x = playerStatus->position.x; - z = playerStatus->position.z; + y = playerStatus->pos.y + (playerStatus->colliderHeight * 0.75f); + x = playerStatus->pos.x; + z = playerStatus->pos.z; player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, 0.0f, temp_f0); - playerStatus->position.x = x; - playerStatus->position.z = z; + playerStatus->pos.x = x; + playerStatus->pos.z = z; temp_f0 = clamp_angle(playerStatus->targetYaw + 30.0); - y = playerStatus->position.y + (playerStatus->colliderHeight * 0.75f); - x = playerStatus->position.x; - z = playerStatus->position.z; + y = playerStatus->pos.y + (playerStatus->colliderHeight * 0.75f); + x = playerStatus->pos.x; + z = playerStatus->pos.z; player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, 0.0f, temp_f0); - playerStatus->position.x = x; - playerStatus->position.z = z; + playerStatus->pos.x = x; + playerStatus->pos.z = z; temp_f0 = clamp_angle(playerStatus->targetYaw - 30.0); - x = playerStatus->position.x; - y = playerStatus->position.y; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y; + z = playerStatus->pos.z; player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, 0.0f, temp_f0); - playerStatus->position.x = x; - playerStatus->position.z = z; + playerStatus->pos.x = x; + playerStatus->pos.z = z; temp_f0 = clamp_angle(playerStatus->targetYaw + 30.0); - x = playerStatus->position.x; - y = playerStatus->position.y; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y; + z = playerStatus->pos.z; player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, 0.0f, temp_f0); - playerStatus->position.x = x; - playerStatus->position.z = z; + playerStatus->pos.x = x; + playerStatus->pos.z = z; temp_f0 = clamp_angle(playerStatus->targetYaw + 90.0); - x = playerStatus->position.x; - y = playerStatus->position.y; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y; + z = playerStatus->pos.z; player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, 0.0f, temp_f0); - playerStatus->position.x = x; - playerStatus->position.z = z; + playerStatus->pos.x = x; + playerStatus->pos.z = z; temp_f0 = clamp_angle(playerStatus->targetYaw - 90.0); - x = playerStatus->position.x; - y = playerStatus->position.y; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y; + z = playerStatus->pos.z; player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, 0.0f, temp_f0); - playerStatus->position.x = x; - playerStatus->position.z = z; + playerStatus->pos.x = x; + playerStatus->pos.z = z; temp_f0 = clamp_angle(playerStatus->targetYaw + 180.0); - x = playerStatus->position.x; - y = playerStatus->position.y; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y; + z = playerStatus->pos.z; player_test_lateral_overlap(0, &gPlayerStatus, &x, &y, &z, 0.0f, temp_f0); - playerStatus->position.x = x; - playerStatus->position.z = z; + playerStatus->pos.x = x; + playerStatus->pos.z = z; } void collision_lateral_peach(void) { PlayerStatus* playerStatus = &gPlayerStatus; s32 climbableStep = FALSE; f32 yaw = playerStatus->targetYaw; - f32 x = playerStatus->position.x; - f32 y = playerStatus->position.y; - f32 z = playerStatus->position.z; + f32 x = playerStatus->pos.x; + f32 y = playerStatus->pos.y; + f32 z = playerStatus->pos.z; s32 wall = player_test_move_without_slipping(&gPlayerStatus, &x, &y, &z, 0, yaw, &climbableStep); - playerStatus->position.x = x; - playerStatus->position.z = z; + playerStatus->pos.x = x; + playerStatus->pos.z = z; // If there was a climbable step in this direction, but no wall, we can climb up it if (climbableStep && wall < 0 && playerStatus->actionState != ACTION_STATE_STEP_UP_PEACH - && playerStatus->currentSpeed != 0.0f + && playerStatus->curSpeed != 0.0f ) { set_action_state(ACTION_STATE_STEP_UP_PEACH); } @@ -1110,12 +1110,12 @@ void check_input_midair_jump(void) { } s8 get_current_partner_id(void) { - return gPlayerData.currentPartner; + return gPlayerData.curPartner; } void try_player_footstep_sounds(s32 interval) { if (gGameStatusPtr->frameCounter % interval == 0) { - s32 surfaceType = get_collider_flags(gCollisionStatus.currentFloor) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; + s32 surfaceType = get_collider_flags(gCollisionStatus.curFloor) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; s32 soundID, altSoundID; if (surfaceType == SURFACE_TYPE_FLOWERS || surfaceType == SURFACE_TYPE_HEDGES) { @@ -1136,7 +1136,7 @@ void try_player_footstep_sounds(s32 interval) { } void phys_update_interact_collider(void) { - gCollisionStatus.currentInspect = phys_check_interactable_collision(); + gCollisionStatus.curInspect = phys_check_interactable_collision(); } s32 phys_check_interactable_collision(void) { @@ -1150,16 +1150,16 @@ s32 phys_check_interactable_collision(void) { if (playerStatus->pressedButtons & BUTTON_A) { yaw = playerStatus->targetYaw; - x = playerStatus->position.x; - y = playerStatus->position.y; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y; + z = playerStatus->pos.z; ret = player_test_move_with_slipping(playerStatus, &x, &y, &z, playerStatus->colliderDiameter * 0.5f, yaw); - if (ret < 0 && playerStatus->currentSpeed == 0.0f) { - yaw = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw; - x = playerStatus->position.x; - y = playerStatus->position.y; - z = playerStatus->position.z; + if (ret < 0 && playerStatus->curSpeed == 0.0f) { + yaw = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw; + x = playerStatus->pos.x; + y = playerStatus->pos.y; + z = playerStatus->pos.z; ret = player_test_move_with_slipping(playerStatus, &x, &y, &z, playerStatus->colliderDiameter * 0.5f, yaw); } } @@ -1189,7 +1189,7 @@ s32 phys_can_player_interact(void) { } f32 func_800E5348(void) { - f32 deltaYaw = get_clamped_angle_diff(gCameras[gCurrentCameraID].currentYaw, gPlayerStatus.currentYaw); + f32 deltaYaw = get_clamped_angle_diff(gCameras[gCurrentCameraID].curYaw, gPlayerStatus.curYaw); if (deltaYaw < -5.0f && deltaYaw > -175.0f) { deltaYaw = 0.0f; @@ -1198,7 +1198,7 @@ f32 func_800E5348(void) { } else { deltaYaw = PrevPlayerCamRelativeYaw; } - return clamp_angle(deltaYaw - 90.0f + gCameras[gCurrentCameraID].currentYaw); + return clamp_angle(deltaYaw - 90.0f + gCameras[gCurrentCameraID].curYaw); } f32 player_get_camera_facing_angle(void) { @@ -1208,7 +1208,7 @@ f32 player_get_camera_facing_angle(void) { angle = 180.0f; } - angle = angle + gCameras[CAM_DEFAULT].currentYaw + 90.0f; + angle = angle + gCameras[CAM_DEFAULT].curYaw + 90.0f; return clamp_angle(angle); } @@ -1216,7 +1216,7 @@ f32 player_get_camera_facing_angle(void) { void phys_save_ground_pos(void) { PlayerStatus* playerStatus = &gPlayerStatus; - playerStatus->lastGoodPosition.x = playerStatus->position.x; - playerStatus->lastGoodPosition.y = playerStatus->position.y; - playerStatus->lastGoodPosition.z = playerStatus->position.z; + playerStatus->lastGoodPos.x = playerStatus->pos.x; + playerStatus->lastGoodPos.y = playerStatus->pos.y; + playerStatus->lastGoodPos.z = playerStatus->pos.z; } diff --git a/src/7fd10_len_b40.c b/src/7fd10_len_b40.c index 3397ce97ad..7321a1a683 100644 --- a/src/7fd10_len_b40.c +++ b/src/7fd10_len_b40.c @@ -140,7 +140,7 @@ s32 setup_partner_popup(PopupMenu* menu) { menu->nameMsg[optionCount] = properties->nameMsg; menu->descMsg[optionCount] = properties->worldDescMsg; menu->value[optionCount] = playerData->partners[partnerID].level; - if (playerData->currentPartner == partnerID) { + if (playerData->curPartner == partnerID) { menu->enabled[optionCount] = FALSE; menu->ptrIcon[optionCount] = wDisabledPartnerHudScripts[partnerID]; } @@ -209,10 +209,10 @@ void check_input_open_menus(void) { partnerStatus->actingPartner == PARTNER_LAKILESTER || partnerStatus->actingPartner == PARTNER_BOW)) { - currentButtons = partnerStatus->currentButtons; + currentButtons = partnerStatus->curButtons; pressedButtons = partnerStatus->pressedButtons; } else { - currentButtons = playerStatus->currentButtons; + currentButtons = playerStatus->curButtons; pressedButtons = playerStatus->pressedButtons; } partnerActionState = &partnerStatus->partnerActionState; @@ -251,7 +251,7 @@ block_17: } popup->numEntries = numEntries; popup->popupType = POPUP_MENU_SWITCH_PARTNER; - popup->initialPos = MenuIndexFromPartnerID[playerData->currentPartner] - 1; + popup->initialPos = MenuIndexFromPartnerID[playerData->curPartner] - 1; break; } return; @@ -388,14 +388,14 @@ void check_input_status_bar(void) { } if (!is_status_bar_visible()) { - if (!(playerStatus->currentButtons & (Z_TRIG | R_TRIG)) && (pressedButtons & BUTTON_C_UP) && func_800E9860()) { + if (!(playerStatus->curButtons & (Z_TRIG | R_TRIG)) && (pressedButtons & BUTTON_C_UP) && func_800E9860()) { open_status_bar_long(); if (!is_picking_up_item()) { sfx_play_sound(SOUND_3); } } - } else if (!(playerStatus->currentButtons & (Z_TRIG | R_TRIG)) && (pressedButtons & BUTTON_C_UP) && func_800E9860()) { + } else if (!(playerStatus->curButtons & (Z_TRIG | R_TRIG)) && (pressedButtons & BUTTON_C_UP) && func_800E9860()) { close_status_bar(); if (!is_picking_up_item()) { diff --git a/src/80850_len_3060.c b/src/80850_len_3060.c index 2bc7eb748f..bf44f7c6c4 100644 --- a/src/80850_len_3060.c +++ b/src/80850_len_3060.c @@ -60,7 +60,7 @@ void clear_player_data(void) { playerData->maxStarPower = 0; playerData->specialBarsFilled = 0; playerData->starBeamLevel = 0; - playerData->currentPartner = 0; + playerData->curPartner = 0; for (i = 0; i < ARRAY_COUNT(playerData->partners); i++) { playerData->partners[i].enabled = FALSE; diff --git a/src/8800.c b/src/8800.c index f28e751b0c..0da40064f3 100644 --- a/src/8800.c +++ b/src/8800.c @@ -191,7 +191,7 @@ void render_frame(s32 isSecondPass) { camera->unkMatrix = &gDisplayContext->matrixStack[gMatrixListPos]; matrixListPos = gMatrixListPos++; - guRotate(&gDisplayContext->matrixStack[matrixListPos], -camera->trueRotation.x, 0.0f, 1.0f, 0.0f); + guRotate(&gDisplayContext->matrixStack[matrixListPos], -camera->trueRot.x, 0.0f, 1.0f, 0.0f); camera->vpAlt.vp.vtrans[0] = camera->vp.vp.vtrans[0] + gGameStatusPtr->unk_82; camera->vpAlt.vp.vtrans[1] = camera->vp.vp.vtrans[1] + gGameStatusPtr->unk_83; @@ -366,12 +366,12 @@ Camera* initialize_next_camera(CameraInitData* initData) { camera->lookAt_obj.x = 0; camera->lookAt_obj.y = 0; camera->lookAt_obj.z = -100.0f; - camera->currentYaw = 0; - camera->currentBoomLength = 0; - camera->currentYOffset = 0; - camera->trueRotation.x = 0.0f; - camera->trueRotation.y = 0.0f; - camera->trueRotation.z = 0.0f; + camera->curYaw = 0; + camera->curBoomLength = 0; + camera->curYOffset = 0; + camera->trueRot.x = 0.0f; + camera->trueRot.y = 0.0f; + camera->trueRot.z = 0.0f; camera->updateMode = initData->updateMode; camera->needsInit = TRUE; camera->nearClip = initData->nearClip; diff --git a/src/891b0_len_fb0.c b/src/891b0_len_fb0.c index fabee788df..e69cc7f4eb 100644 --- a/src/891b0_len_fb0.c +++ b/src/891b0_len_fb0.c @@ -41,7 +41,7 @@ void handle_floor_behavior(void) { colliderType = D_80109480; } - D_80109480 = get_collider_flags((u16)gCollisionStatus.currentFloor) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; + D_80109480 = get_collider_flags((u16)gCollisionStatus.curFloor) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; if (playerStatus->actionState != ACTION_STATE_JUMP) { colliderType = D_80109480; @@ -90,9 +90,9 @@ void surface_standard_behavior(void) { (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) && D_8010CFF4 >= 10) { - x = playerStatus->position.x; - y = playerStatus->position.y + 0.0f; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y + 0.0f; + z = playerStatus->pos.z; if (!cond) { fx_landing_dust(0, x, y, z, D_80109484); } else { @@ -102,33 +102,33 @@ void surface_standard_behavior(void) { } else if ( (playerStatus->actionState == ACTION_STATE_SPIN_POUND || playerStatus->actionState == ACTION_STATE_TORNADO_POUND) && (playerStatus->flags & PS_FLAG_SPECIAL_LAND)) { - x = playerStatus->position.x; - y = playerStatus->position.y + 0.0f; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y + 0.0f; + z = playerStatus->pos.z; if (!cond) { fx_landing_dust(0, x, y, z, D_80109484); } else { fx_misc_particles(3, x, y, z, playerStatus->colliderDiameter, 10.0f, 1.0f, 5, 40); } - } else if (playerStatus->actionState == ACTION_STATE_SPIN && playerStatus->currentSpeed != 0.0f) { + } else if (playerStatus->actionState == ACTION_STATE_SPIN && playerStatus->curSpeed != 0.0f) { if (D_80109488++ >= 4) { D_80109488 = 2; if (cond) { sin_cos_rad(DEG_TO_RAD(clamp_angle(playerStatus->targetYaw)), &sinTheta, &cosTheta); fx_misc_particles( 3, - playerStatus->position.x + (playerStatus->colliderDiameter * sinTheta), - playerStatus->position.y + 1.5f, - playerStatus->position.z + (playerStatus->colliderDiameter * cosTheta), + playerStatus->pos.x + (playerStatus->colliderDiameter * sinTheta), + playerStatus->pos.y + 1.5f, + playerStatus->pos.z + (playerStatus->colliderDiameter * cosTheta), 13.0f, 10.0f, 1.0f, 5, 30 ); } else { - sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->currentYaw)), &sinTheta, &cosTheta); + sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->curYaw)), &sinTheta, &cosTheta); fx_walking_dust( 0, - playerStatus->position.x + (playerStatus->colliderDiameter * sinTheta * 0.2f), - playerStatus->position.y + 1.5f, - playerStatus->position.z + (playerStatus->colliderDiameter * cosTheta * 0.2f), + playerStatus->pos.x + (playerStatus->colliderDiameter * sinTheta * 0.2f), + playerStatus->pos.y + 1.5f, + playerStatus->pos.z + (playerStatus->colliderDiameter * cosTheta * 0.2f), sinTheta, cosTheta ); } @@ -144,21 +144,21 @@ void surface_standard_behavior(void) { if (D_80109488++ >= 4) { D_80109488 = 0; if (!cond) { - sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->currentYaw)), &sinTheta, &cosTheta); + sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->curYaw)), &sinTheta, &cosTheta); fx_walking_dust( 0, - playerStatus->position.x + (playerStatus->colliderDiameter * sinTheta * 0.2f), - playerStatus->position.y + 1.5f, - playerStatus->position.z + (playerStatus->colliderDiameter * cosTheta * 0.2f), + playerStatus->pos.x + (playerStatus->colliderDiameter * sinTheta * 0.2f), + playerStatus->pos.y + 1.5f, + playerStatus->pos.z + (playerStatus->colliderDiameter * cosTheta * 0.2f), sinTheta, cosTheta ); } else { sin_cos_rad(DEG_TO_RAD(clamp_angle(playerStatus->targetYaw)), &sinTheta, &cosTheta); fx_misc_particles( 3, - playerStatus->position.x + (playerStatus->currentSpeed * sinTheta), - playerStatus->position.y + 1.5f, - playerStatus->position.z + (playerStatus->currentSpeed * cosTheta), + playerStatus->pos.x + (playerStatus->curSpeed * sinTheta), + playerStatus->pos.y + 1.5f, + playerStatus->pos.z + (playerStatus->curSpeed * cosTheta), 13.0f, 10.0f, 1.0f, 5, 30 ); } @@ -172,10 +172,10 @@ void surface_flowers_behavior(void) { f32 t1; if (playerStatus->actionState == ACTION_STATE_JUMP && playerStatus->timeInAir == 1 && D_80109492 == 5) { - z = playerStatus->position.z; // TODO weird use of temps required to match - x = playerStatus->position.y + 14.0f; + z = playerStatus->pos.z; // TODO weird use of temps required to match + x = playerStatus->pos.y + 14.0f; y = D_8010948C; - fx_flower_splash(playerStatus->position.x, x, z, y); + fx_flower_splash(playerStatus->pos.x, x, z, y); D_8010948C = clamp_angle(D_8010948C + 35.0f); D_80109492 = 0; return; @@ -197,15 +197,15 @@ void surface_flowers_behavior(void) { if (D_80109490++ > 0) { f32 colliderDiameter; D_80109490 = 0; - sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->currentYaw)), &sin, &cos); + sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->curYaw)), &sin, &cos); colliderDiameter = playerStatus->colliderDiameter; - x = playerStatus->position.x + (colliderDiameter * sin * -0.4f); - z = playerStatus->position.z + (colliderDiameter * cos * -0.4f); - y = playerStatus->position.y + 15.5f; + x = playerStatus->pos.x + (colliderDiameter * sin * -0.4f); + z = playerStatus->pos.z + (colliderDiameter * cos * -0.4f); + y = playerStatus->pos.y + 15.5f; - fx_flower_trail(0, x, y, z, -playerStatus->currentYaw + rand_int(10) - 5.0f, D_80109494); + fx_flower_trail(0, x, y, z, -playerStatus->curYaw + rand_int(10) - 5.0f, D_80109494); D_80109494 = !D_80109494; } } @@ -225,9 +225,9 @@ void surface_cloud_behavior(void) { D_8010CFF4 >= 10) { fx_cloud_puff( - playerStatus->position.x, - (playerStatus->position.y + 14.0f) - 5.0f, - playerStatus->position.z, D_80109498 + playerStatus->pos.x, + (playerStatus->pos.y + 14.0f) - 5.0f, + playerStatus->pos.z, D_80109498 ); D_80109498 = clamp_angle(D_80109498 + 35.0f); @@ -236,12 +236,12 @@ void surface_cloud_behavior(void) { zTemp = rand_int(10) - 5; yTemp = -2.0f - ((SQ(xTemp) + SQ(zTemp)) / 5.0f); D_8010949C = 0; - sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->currentYaw + (i * 90))), &sinTheta, &cosTheta); + sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->curYaw + (i * 90))), &sinTheta, &cosTheta); fx_cloud_trail( 0, - playerStatus->position.x + (playerStatus->colliderDiameter * sinTheta * -0.3f) + xTemp, - playerStatus->position.y + 15.5f + yTemp, - playerStatus->position.z + (playerStatus->colliderDiameter * cosTheta * -0.3f) + zTemp + playerStatus->pos.x + (playerStatus->colliderDiameter * sinTheta * -0.3f) + xTemp, + playerStatus->pos.y + 15.5f + yTemp, + playerStatus->pos.z + (playerStatus->colliderDiameter * cosTheta * -0.3f) + zTemp ); } } else { @@ -255,12 +255,12 @@ void surface_cloud_behavior(void) { zTemp2 = rand_int(10) - 5; yTemp2 = -2.0f - ((SQ(xTemp2) + SQ(zTemp2)) / 5.0f); D_8010949C = 0; - sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->currentYaw)), &sinTheta, &cosTheta); + sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->curYaw)), &sinTheta, &cosTheta); fx_cloud_trail( 1, - playerStatus->position.x + (playerStatus->colliderDiameter * sinTheta * -0.3f) + xTemp2, - playerStatus->position.y + 15.5f + yTemp2, - playerStatus->position.z + (playerStatus->colliderDiameter * cosTheta * -0.3f) + zTemp2 + playerStatus->pos.x + (playerStatus->colliderDiameter * sinTheta * -0.3f) + xTemp2, + playerStatus->pos.y + 15.5f + yTemp2, + playerStatus->pos.z + (playerStatus->colliderDiameter * cosTheta * -0.3f) + zTemp2 ); } } @@ -281,12 +281,12 @@ void surface_snow_behavior(void) { if (D_801094A4++ >= 4) { D_801094A4 = 0; - sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->currentYaw)), &sin, &cos); + sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->curYaw)), &sin, &cos); fx_footprint( - playerStatus->position.x + (playerStatus->colliderDiameter * sin * 0.2f), - playerStatus->position.y + 1.5f, - playerStatus->position.z + (playerStatus->colliderDiameter * cos * 0.2f), - -playerStatus->currentYaw, + playerStatus->pos.x + (playerStatus->colliderDiameter * sin * 0.2f), + playerStatus->pos.y + 1.5f, + playerStatus->pos.z + (playerStatus->colliderDiameter * cos * 0.2f), + -playerStatus->curYaw, D_801094A8 ); D_801094A8 = !D_801094A8; @@ -309,12 +309,12 @@ void surface_hedges_behavior(void) { if (D_801094AC++ >= 4) { D_801094AC = 0; - sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->currentYaw)), &sin, &cos); + sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->curYaw)), &sin, &cos); fx_falling_leaves( 0, - playerStatus->position.x + (playerStatus->colliderDiameter * sin * 0.2f), + playerStatus->pos.x + (playerStatus->colliderDiameter * sin * 0.2f), 40.0f, - playerStatus->position.z + (playerStatus->colliderDiameter * cos * 0.2f) + playerStatus->pos.z + (playerStatus->colliderDiameter * cos * 0.2f) ); } } @@ -335,12 +335,12 @@ void surface_water_behavior(void) { if (D_801094AE++ >= 4) { D_801094AE = 0; - sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->currentYaw)), &sin, &cos); + sin_cos_rad(DEG_TO_RAD(clamp_angle(-playerStatus->curYaw)), &sin, &cos); fx_rising_bubble( 0, - playerStatus->position.x + (playerStatus->colliderDiameter * sin * 0.2f), - playerStatus->position.y + 0.0f, - playerStatus->position.z + (playerStatus->colliderDiameter * cos * 0.2f), + playerStatus->pos.x + (playerStatus->colliderDiameter * sin * 0.2f), + playerStatus->pos.y + 0.0f, + playerStatus->pos.z + (playerStatus->colliderDiameter * cos * 0.2f), 0.0f ); } diff --git a/src/8a860_len_3f30.c b/src/8a860_len_3f30.c index 802c900ae8..f838e5580d 100644 --- a/src/8a860_len_3f30.c +++ b/src/8a860_len_3f30.c @@ -973,7 +973,7 @@ s32 popup_menu_update(void) { case POPUP_STATE_CANCEL_DIP_AWAIT_CHOICE: if (D_8010D6A4 == 1) { set_window_update(WINDOW_ID_21, WINDOW_UPDATE_HIDE); - switch (D_8010D6A0->currentOption) { + switch (D_8010D6A0->curOption) { case 0: gPopupState = POPUP_STATE_CANCEL_DIP_ACCEPT; break; diff --git a/src/9d10_len_1080.c b/src/9d10_len_1080.c index 5b0047f011..5f2a66c350 100644 --- a/src/9d10_len_1080.c +++ b/src/9d10_len_1080.c @@ -35,23 +35,23 @@ void update_camera_mode_4(Camera* camera) { } camera->lookAt_obj_target.z = f4; camera->unk_70 = 0.0f; - camera->currentBoomYaw = 0.0f; - camera->trueRotation.x = camera->unk_70; - camera->currentBoomLength = camera->lookAt_dist * D_8009A5EC; - camera->currentYOffset = camera->auxBoomPitch * D_8009A5EC; + camera->curBoomYaw = 0.0f; + camera->trueRot.x = camera->unk_70; + camera->curBoomLength = camera->lookAt_dist * D_8009A5EC; + camera->curYOffset = camera->auxBoomPitch * D_8009A5EC; if (camera->needsInit) { camera->needsInit = FALSE; camera->unk_98 = 0.0f; camera->unk_9C = 0.0f; camera->lookAt_obj.x = camera->lookAt_obj_target.x; - camera->lookAt_obj.y = camera->lookAt_obj_target.y + camera->currentYOffset; + camera->lookAt_obj.y = camera->lookAt_obj_target.y + camera->curYOffset; camera->lookAt_obj.z = camera->lookAt_obj_target.z; - boomYaw = DEG_TO_RAD(camera->currentBoomYaw); + boomYaw = DEG_TO_RAD(camera->curBoomYaw); sinBoom = sin_rad(boomYaw); cosBoom = cos_rad(boomYaw); deltaX = 0.0f; deltaY = 0.0f; - deltaZ = camera->currentBoomLength; + deltaZ = camera->curBoomLength; deltaX2 = deltaX; deltaY2 = deltaY; boomYaw = deltaX = -deltaY2; @@ -71,14 +71,14 @@ void update_camera_mode_4(Camera* camera) { camera->lookAt_eye.z = camera->lookAt_obj.z + deltaZ2; } camera->lookAt_obj.x = camera->lookAt_obj_target.x; - camera->lookAt_obj.y = camera->lookAt_obj_target.y + camera->currentYOffset; + camera->lookAt_obj.y = camera->lookAt_obj_target.y + camera->curYOffset; camera->lookAt_obj.z = camera->lookAt_obj_target.z; - boomYaw = DEG_TO_RAD(camera->currentBoomYaw); + boomYaw = DEG_TO_RAD(camera->curBoomYaw); sinBoom = sin_rad(boomYaw); cosBoom = cos_rad(boomYaw); deltaX = 0.0f; deltaY = 0.0f; - deltaZ = camera->currentBoomLength; + deltaZ = camera->curBoomLength; deltaX2 = deltaX; deltaY2 = deltaY; boomYaw = deltaX = -deltaY2; @@ -96,12 +96,12 @@ void update_camera_mode_4(Camera* camera) { camera->lookAt_eye.x = camera->lookAt_obj.x + deltaX2; camera->lookAt_eye.y = camera->lookAt_obj.y + deltaY2; camera->lookAt_eye.z = camera->lookAt_obj.z + deltaZ2; - camera->currentYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z); + camera->curYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z); deltaX = camera->lookAt_obj.x - camera->lookAt_eye.x; deltaY = camera->lookAt_obj.y - camera->lookAt_eye.y; deltaZ = camera->lookAt_obj.z - camera->lookAt_eye.z; - camera->currentBlendedYawNegated = -atan2(0.0f, 0.0f, deltaX, deltaZ); - camera->currentPitch = atan2(0.0f, 0.0f, deltaY, -sqrtf(SQ(deltaX) + SQ(deltaZ))); + camera->curBlendedYawNegated = -atan2(0.0f, 0.0f, deltaX, deltaZ); + camera->curPitch = atan2(0.0f, 0.0f, deltaY, -sqrtf(SQ(deltaX) + SQ(deltaZ))); } void update_camera_mode_2(Camera *camera) { @@ -120,26 +120,26 @@ void update_camera_mode_2(Camera *camera) { f32 tmp; camera->unk_70 = camera->auxBoomLength; - camera->currentBoomLength = camera->lookAt_dist * D_8009A5EC; - camera->currentYOffset = camera->auxBoomPitch * D_8009A5EC; - camera->currentBoomYaw = camera->auxPitch; - camera->trueRotation.x = camera->unk_70; + camera->curBoomLength = camera->lookAt_dist * D_8009A5EC; + camera->curYOffset = camera->auxBoomPitch * D_8009A5EC; + camera->curBoomYaw = camera->auxPitch; + camera->trueRot.x = camera->unk_70; if (camera->needsInit) { camera->needsInit = FALSE; camera->unk_98 = 0.0f; camera->unk_9C = 0.0f; camera->lookAt_obj.x = camera->lookAt_obj_target.x; - camera->lookAt_obj.y = camera->lookAt_obj_target.y + camera->currentYOffset; + camera->lookAt_obj.y = camera->lookAt_obj_target.y + camera->curYOffset; camera->lookAt_obj.z = camera->lookAt_obj_target.z; - boomYaw = DEG_TO_RAD(camera->currentBoomYaw); + boomYaw = DEG_TO_RAD(camera->curBoomYaw); sinBoom = sin_rad(boomYaw); cosBoom = cos_rad(boomYaw); deltaX = 0.0f; deltaY = 0.0f; - deltaZ = camera->currentBoomLength; + deltaZ = camera->curBoomLength; deltaX3 = deltaX; deltaY3 = -deltaY; @@ -168,7 +168,7 @@ void update_camera_mode_2(Camera *camera) { } deltaX2 = camera->lookAt_obj_target.x - camera->lookAt_obj.x; - deltaY2 = (camera->lookAt_obj_target.y + camera->currentYOffset) - camera->lookAt_obj.y; + deltaY2 = (camera->lookAt_obj_target.y + camera->curYOffset) - camera->lookAt_obj.y; deltaZ2 = camera->lookAt_obj_target.z - camera->lookAt_obj.z; if (fabsf(deltaX2) > 16.0f) { @@ -197,13 +197,13 @@ void update_camera_mode_2(Camera *camera) { camera->lookAt_obj.y += deltaY2 * 0.5f; camera->lookAt_obj.z += deltaZ2 * 0.5f; - boomYaw = DEG_TO_RAD(camera->currentBoomYaw); + boomYaw = DEG_TO_RAD(camera->curBoomYaw); sinBoom = sin_rad(boomYaw); cosBoom = cos_rad(boomYaw); deltaX = 0.0f; deltaY = 0.0f; - deltaZ = camera->currentBoomLength; + deltaZ = camera->curBoomLength; deltaX3 = deltaX; deltaY3 = -deltaY; @@ -257,14 +257,14 @@ void update_camera_mode_2(Camera *camera) { camera->lookAt_eye.y += deltaY2; camera->lookAt_eye.z += deltaZ2; - camera->currentYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z); + camera->curYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z); deltaX = camera->lookAt_obj.x - camera->lookAt_eye.x; deltaY = camera->lookAt_obj.y - camera->lookAt_eye.y; deltaZ = camera->lookAt_obj.z - camera->lookAt_eye.z; - camera->currentBlendedYawNegated = -atan2(0.0f, 0.0f, deltaX, deltaZ); - camera->currentPitch = atan2(0.0f, 0.0f, deltaY, -sqrtf(SQ(deltaX) + SQ(deltaZ))); + camera->curBlendedYawNegated = -atan2(0.0f, 0.0f, deltaX, deltaZ); + camera->curPitch = atan2(0.0f, 0.0f, deltaY, -sqrtf(SQ(deltaX) + SQ(deltaZ))); } void update_camera_mode_1(Camera* camera) { @@ -287,24 +287,24 @@ void update_camera_mode_1(Camera* camera) { deltaX2 = camera->targetPos.x; deltaZ = camera->targetPos.z; - camera->currentBoomYaw = camera->auxPitch; - camera->currentBoomLength = camera->lookAt_dist * 100 / D_8009A5EC; - camera->currentYOffset = camera->auxBoomPitch * 20 / D_8009A5EC; + camera->curBoomYaw = camera->auxPitch; + camera->curBoomLength = camera->lookAt_dist * 100 / D_8009A5EC; + camera->curYOffset = camera->auxBoomPitch * 20 / D_8009A5EC; f20 = atan2(deltaX, deltaZ2, deltaX2, deltaZ); if ((dist2D(deltaX, deltaZ2, deltaX2, deltaZ) < camera->auxBoomLength * 100 / D_8009A5EC)) { - f20 = camera->trueRotation.x; - camera->trueRotation.x = f20; + f20 = camera->trueRot.x; + camera->trueRot.x = f20; } else { - camera->trueRotation.x = f20; + camera->trueRot.x = f20; } - camera->trueRotation.y = f20; + camera->trueRot.y = f20; camera->lookAt_obj.x = camera->lookAt_obj_target.x; - camera->lookAt_obj.y = camera->lookAt_obj_target.y + camera->currentYOffset; + camera->lookAt_obj.y = camera->lookAt_obj_target.y + camera->curYOffset; camera->lookAt_obj.z = camera->lookAt_obj_target.z; - boomYaw = DEG_TO_RAD(camera->currentBoomYaw); + boomYaw = DEG_TO_RAD(camera->curBoomYaw); sinBoom = sin_rad(boomYaw); deltaX = 0.0f; @@ -312,7 +312,7 @@ void update_camera_mode_1(Camera* camera) { new_var2 = -deltaY; cosBoom = cos_rad(boomYaw); boomYaw = new_var2; - deltaZ = camera->currentBoomLength; + deltaZ = camera->curBoomLength; deltaX2 = deltaX; deltaY2 = new_var2; @@ -341,11 +341,11 @@ void update_camera_mode_1(Camera* camera) { y3 = tmp1; z3 = camera->lookAt_obj_target.z; - camera->currentBoomYaw = camera->auxPitch; - camera->currentBoomLength = camera->lookAt_dist * 100 / D_8009A5EC; - camera->currentYOffset = camera->auxBoomPitch * 20 / D_8009A5EC; + camera->curBoomYaw = camera->auxPitch; + camera->curBoomLength = camera->lookAt_dist * 100 / D_8009A5EC; + camera->curYOffset = camera->auxBoomPitch * 20 / D_8009A5EC; - y3 += camera->currentYOffset; + y3 += camera->curYOffset; x3 -= camera->lookAt_obj.x; y3 -= camera->lookAt_obj.y; @@ -365,20 +365,20 @@ void update_camera_mode_1(Camera* camera) { f20 = atan2(deltaX, deltaZ2, deltaX2, deltaZ); if ((dist2D(deltaX, deltaZ2, deltaX2, deltaZ) < camera->auxBoomLength * 100 / D_8009A5EC)) { - f20 = camera->trueRotation.x; + f20 = camera->trueRot.x; } else { - camera->trueRotation.x = f20; + camera->trueRot.x = f20; } - camera->trueRotation.y -= get_clamped_angle_diff(f20, camera->trueRotation.y) / 10.0f; - f20 = camera->trueRotation.y; + camera->trueRot.y -= get_clamped_angle_diff(f20, camera->trueRot.y) / 10.0f; + f20 = camera->trueRot.y; - boomYaw = DEG_TO_RAD(camera->currentBoomYaw); + boomYaw = DEG_TO_RAD(camera->curBoomYaw); sinBoom = sin_rad(boomYaw); cosBoom = cos_rad(boomYaw); deltaX = 0.0f; deltaY = 0.0f; - deltaZ = camera->currentBoomLength; + deltaZ = camera->curBoomLength; deltaX2 = deltaX; deltaY2 = -deltaY; @@ -402,14 +402,14 @@ void update_camera_mode_1(Camera* camera) { camera->lookAt_eye.y = camera->lookAt_obj.y + deltaY2; camera->lookAt_eye.z = camera->lookAt_obj.z + deltaZ; - camera->currentYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z); + camera->curYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z); deltaX = camera->lookAt_obj.x - camera->lookAt_eye.x; deltaY = camera->lookAt_obj.y - camera->lookAt_eye.y; deltaZ2 = camera->lookAt_obj.z - camera->lookAt_eye.z; - camera->currentBlendedYawNegated = -atan2(0.0f, 0.0f, deltaX, deltaZ2); - camera->currentPitch = atan2(0.0f, 0.0f, deltaY, -sqrtf((deltaX * deltaX) + (deltaZ2 * deltaZ2))); + camera->curBlendedYawNegated = -atan2(0.0f, 0.0f, deltaX, deltaZ2); + camera->curPitch = atan2(0.0f, 0.0f, deltaY, -sqrtf((deltaX * deltaX) + (deltaZ2 * deltaZ2))); } void update_camera_mode_0(Camera* camera) { @@ -427,11 +427,11 @@ void update_camera_mode_0(Camera* camera) { camera->lookAt_eye.z = camera->lookAt_obj.z - (1000.0f / D_8009A5EC); } - camera->currentYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z); + camera->curYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z); dx = camera->lookAt_obj.x - camera->lookAt_eye.x; dy = camera->lookAt_obj.y - camera->lookAt_eye.y; dz = camera->lookAt_obj.z - camera->lookAt_eye.z; - camera->currentBlendedYawNegated = -atan2(0.0f, 0.0f, dx, dz); + camera->curBlendedYawNegated = -atan2(0.0f, 0.0f, dx, dz); dx = -sqrtf(SQ(dx) + SQ(dz)); - camera->currentPitch = atan2(0.0f, 0.0f, dy, dx); + camera->curPitch = atan2(0.0f, 0.0f, dy, dx); } diff --git a/src/B0E0.c b/src/B0E0.c index 10c2dbbdd6..abee907d62 100644 --- a/src/B0E0.c +++ b/src/B0E0.c @@ -36,25 +36,25 @@ void update_camera_mode_unused(Camera* camera) { } if (!(playerStatus->flags & (PS_FLAG_FALLING | PS_FLAG_JUMPING))) { - camera->lookAt_obj_target.y = playerStatus->position.y + 60.0f; + camera->lookAt_obj_target.y = playerStatus->pos.y + 60.0f; } - camera->lookAt_obj_target.x = playerStatus->position.x; - camera->lookAt_obj_target.z = playerStatus->position.z + 400.0f; + camera->lookAt_obj_target.x = playerStatus->pos.x; + camera->lookAt_obj_target.z = playerStatus->pos.z + 400.0f; if (camera->auxPitch == 0) { camera->lookAt_obj.x = camera->lookAt_obj_target.x; camera->lookAt_obj.y = camera->lookAt_obj_target.y; camera->lookAt_obj.z = camera->lookAt_obj_target.z; - camera->trueRotation.x = camera->auxBoomYaw; - camera->currentBoomYaw = camera->auxBoomPitch; - camera->currentBoomLength = camera->auxBoomLength; + camera->trueRot.x = camera->auxBoomYaw; + camera->curBoomYaw = camera->auxBoomPitch; + camera->curBoomLength = camera->auxBoomLength; camera->vfov = (10000 / camera->lookAt_dist) / 4; - boomYaw = DEG_TO_RAD(camera->currentBoomYaw); + boomYaw = DEG_TO_RAD(camera->curBoomYaw); sinBoom = sin_rad(boomYaw); cosBoom = cos_rad(boomYaw); deltaX = 0.0f; deltaY = 0.0f; - deltaZ = camera->currentBoomLength; + deltaZ = camera->curBoomLength; deltaX2 = deltaX; deltaY2 = deltaY; boomYaw = deltaX = -deltaY2; @@ -62,7 +62,7 @@ void update_camera_mode_unused(Camera* camera) { deltaX = deltaX2; deltaY = cosBoom * deltaY2 + deltaZ2 * sinBoom; deltaZ = sinBoom * boomYaw + deltaZ2 * cosBoom; - boomYaw = DEG_TO_RAD(camera->trueRotation.x); + boomYaw = DEG_TO_RAD(camera->trueRot.x); sinBoom = sin_rad(boomYaw); cosBoom = cos_rad(boomYaw); deltaZ2 = cosBoom * deltaX - deltaZ * sinBoom; @@ -73,12 +73,12 @@ void update_camera_mode_unused(Camera* camera) { camera->lookAt_eye.y = camera->lookAt_obj.y + deltaY2; camera->lookAt_eye.z = camera->lookAt_obj.z + deltaZ2; } - camera->currentYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z); + camera->curYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z); deltaX = camera->lookAt_obj.x - camera->lookAt_eye.x; deltaY = camera->lookAt_obj.y - camera->lookAt_eye.y; deltaZ = camera->lookAt_obj.z - camera->lookAt_eye.z; - camera->currentBlendedYawNegated = -atan2(0.0f, 0.0f, deltaX, deltaZ); - camera->currentPitch = atan2(0.0f, 0.0f, deltaY, -sqrtf(SQ(deltaX) + SQ(deltaZ))); + camera->curBlendedYawNegated = -atan2(0.0f, 0.0f, deltaX, deltaZ); + camera->curPitch = atan2(0.0f, 0.0f, deltaY, -sqrtf(SQ(deltaX) + SQ(deltaZ))); } //TODO CODE SPLIT? @@ -87,26 +87,26 @@ void update_camera_mode_5(Camera* camera) { PlayerStatus* playerStatus = &gPlayerStatus; f32 lookXDelta, lookYDelta, lookZDelta; - camera->currentBoomYaw = 18.0f; - camera->currentBoomLength = 690.0f; - camera->currentYOffset = 47.0f; + camera->curBoomYaw = 18.0f; + camera->curBoomLength = 690.0f; + camera->curYOffset = 47.0f; if (camera->needsInit) { camera->unk_550 = 0.0f; camera->unk_70 = 0.0f; - camera->trueRotation.x = 0.0f; + camera->trueRot.x = 0.0f; camera->needsInit = FALSE; camera->unk_554 = 0; camera->lookAt_obj.x = camera->targetPos.x; - camera->lookAt_obj.y = camera->targetPos.y + camera->currentYOffset; + camera->lookAt_obj.y = camera->targetPos.y + camera->curYOffset; camera->lookAt_obj.z = camera->targetPos.z; cam_interp_lookat_pos(camera, 0.0f, 0.0f, FALSE); } else { - f32 maxInterpSpeed = (playerStatus->currentSpeed * 1.5f) + 1.0f; - f32 interpRate = (playerStatus->currentSpeed * 0.05f) + 0.05f; + f32 maxInterpSpeed = (playerStatus->curSpeed * 1.5f) + 1.0f; + f32 interpRate = (playerStatus->curSpeed * 0.05f) + 0.05f; camera->lookAt_obj_target.x = camera->targetPos.x + camera->unk_550; - camera->lookAt_obj_target.y = camera->targetPos.y + camera->currentYOffset; + camera->lookAt_obj_target.y = camera->targetPos.y + camera->curYOffset; camera->lookAt_obj_target.z = camera->targetPos.z; func_8003034C(camera); if (!(camera->moveFlags & CAMERA_MOVE_IGNORE_PLAYER_Y)) { @@ -118,12 +118,12 @@ void update_camera_mode_5(Camera* camera) { } } - camera->currentYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z); + camera->curYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z); lookXDelta = camera->lookAt_obj.x - camera->lookAt_eye.x; lookYDelta = camera->lookAt_obj.y - camera->lookAt_eye.y; lookZDelta = camera->lookAt_obj.z - camera->lookAt_eye.z; - camera->currentBlendedYawNegated = -atan2(0.0f, 0.0f, lookXDelta, lookZDelta); - camera->currentPitch = atan2(0.0f, 0.0f, lookYDelta, -sqrtf(SQ(lookXDelta) + SQ(lookZDelta))); + camera->curBlendedYawNegated = -atan2(0.0f, 0.0f, lookXDelta, lookZDelta); + camera->curPitch = atan2(0.0f, 0.0f, lookYDelta, -sqrtf(SQ(lookXDelta) + SQ(lookZDelta))); } void cam_interp_lookat_pos(Camera* camera, f32 interpAmtXZ, f32 maxDeltaXZ, s16 lockPosY) { @@ -141,22 +141,22 @@ void cam_interp_lookat_pos(Camera* camera, f32 interpAmtXZ, f32 maxDeltaXZ, s16 camera->lookAt_obj.x = camera->lookAt_eye.x = camera->lookAt_obj.x + xDelta; - theta = DEG_TO_RAD(camera->currentBoomYaw); - cosTheta = cos_rad(DEG_TO_RAD(camera->currentBoomYaw)); + theta = DEG_TO_RAD(camera->curBoomYaw); + cosTheta = cos_rad(DEG_TO_RAD(camera->curBoomYaw)); camera->lookAt_obj.z += (camera->lookAt_obj_target.z - camera->lookAt_obj.z) * interpAmtXZ; - camera->lookAt_eye.z = camera->lookAt_obj.z + (camera->currentBoomLength * cosTheta); + camera->lookAt_eye.z = camera->lookAt_obj.z + (camera->curBoomLength * cosTheta); if (!lockPosY) { sinTheta = sin_rad(theta); camera->lookAt_obj.y += (camera->lookAt_obj_target.y - camera->lookAt_obj.y) * 0.125f; - camera->lookAt_eye.y = camera->lookAt_obj.y + (camera->currentBoomLength * sinTheta); + camera->lookAt_eye.y = camera->lookAt_obj.y + (camera->curBoomLength * sinTheta); } } void func_8003034C(Camera* camera) { PlayerStatus* playerStatus = &gPlayerStatus; - if (fabsf(get_clamped_angle_diff(playerStatus->currentYaw, 90.0f)) < 45.0f) { + if (fabsf(get_clamped_angle_diff(playerStatus->curYaw, 90.0f)) < 45.0f) { if (camera->unk_556 == 0) { if (camera->unk_554 <= 0) { camera->unk_550 = 35.0f; @@ -167,7 +167,7 @@ void func_8003034C(Camera* camera) { camera->unk_554 = 15; camera->unk_556 = 0; } - } else if (fabsf(get_clamped_angle_diff(playerStatus->currentYaw, 270.0f)) < 45.0f) { + } else if (fabsf(get_clamped_angle_diff(playerStatus->curYaw, 270.0f)) < 45.0f) { if (camera->unk_556 == 1) { if (camera->unk_554 <= 0) { camera->unk_550 = -35.0f; @@ -789,7 +789,7 @@ void update_camera_zone_interp(Camera* camera) { changingZone = FALSE; if (camera->isChangingMap) { - camera->currentController = NULL; + camera->curController = NULL; camera->prevController = NULL; camera->linearInterp = 0.0f; camera->unk_494 = 0.0f; @@ -854,7 +854,7 @@ void update_camera_zone_interp(Camera* camera) { cond2 = FALSE; cs2 = cs; - currentController = camera->currentController; + currentController = camera->curController; if (cs != NULL && currentController != NULL && cs->type == currentController->type @@ -909,13 +909,13 @@ void update_camera_zone_interp(Camera* camera) { if (camera->panActive || (!cond2 && cs2 != currentController)) { if (camera->interpAlpha == 1.0f) { - camera->prevController = camera->currentController; + camera->prevController = camera->curController; } else { camera->prevController = (CameraControlSettings*) CAMERA_SETTINGS_PTR_MINUS_1; } changingZone = TRUE; camera->prevConfiguration = gCurrentCamConfiguration; - camera->currentController = cs; + camera->curController = cs; camera->interpAlpha = 0.0f; camera->linearInterp = 0.0f; camera->panActive = FALSE; @@ -953,7 +953,7 @@ void update_camera_zone_interp(Camera* camera) { } update_camera_from_controller(camera, &camera->prevConfiguration, &camera->prevController, - &camera->goalConfiguration, &camera->currentController, posX, posY, posZ, tX, tY, tZ, + &camera->goalConfiguration, &camera->curController, posX, posY, posZ, tX, tY, tZ, camera->isChangingMap, &camera->interpAlpha, changingZone); if (camera->isChangingMap) { @@ -1098,13 +1098,13 @@ void update_camera_zone_interp(Camera* camera) { temp_f4_4 = (dist * cosAngle) - (temp_f8_2 * sinAngle); camera->lookAt_obj.x = camera->lookAt_eye.x + (temp_f26 * temp_f4_4); camera->lookAt_obj.z = camera->lookAt_eye.z + (temp_f24_2 * temp_f4_4); - camera->currentYaw = gCurrentCamConfiguration.boomYaw + D_800A08E0; - camera->trueRotation.x = camera->currentYaw; - camera->currentBoomLength = gCurrentCamConfiguration.boomLength; - camera->currentBlendedYawNegated = -gCurrentCamConfiguration.boomYaw; - camera->currentPitch = -gCurrentCamConfiguration.boomPitch - gCurrentCamConfiguration.viewPitch; + camera->curYaw = gCurrentCamConfiguration.boomYaw + D_800A08E0; + camera->trueRot.x = camera->curYaw; + camera->curBoomLength = gCurrentCamConfiguration.boomLength; + camera->curBlendedYawNegated = -gCurrentCamConfiguration.boomYaw; + camera->curPitch = -gCurrentCamConfiguration.boomPitch - gCurrentCamConfiguration.viewPitch; camera->lookAt_obj_target.x = camera->lookAt_obj.x; camera->lookAt_obj_target.y = camera->lookAt_obj.y; camera->lookAt_obj_target.z = camera->lookAt_obj.z; - camera->currentYOffset = 0.0f; + camera->curYOffset = 0.0f; } diff --git a/src/B4580.c b/src/B4580.c index fdfaad65b9..fa30682ae4 100644 --- a/src/B4580.c +++ b/src/B4580.c @@ -373,9 +373,9 @@ AnimatorNode* add_anim_node(ModelAnimator* animator, s32 parentNodeID, AnimatorN ret->pos.x = 0.0f; ret->pos.y = 0.0f; ret->pos.z = 0.0f; - ret->rotation.x = nodeBP->rotation.x; - ret->rotation.y = nodeBP->rotation.y; - ret->rotation.z = nodeBP->rotation.z; + ret->rot.x = nodeBP->rot.x; + ret->rot.y = nodeBP->rot.y; + ret->rot.z = nodeBP->rot.z; ret->scale.x = 1.0f; ret->scale.y = 1.0f; ret->scale.z = 1.0f; @@ -595,9 +595,9 @@ s32 step_model_animator(ModelAnimator* animator) { node = get_animator_child_with_id(animator->rootNode, nodeId); ASSERT(node != NULL); - node->rotation.x = x; - node->rotation.y = y; - node->rotation.z = z; + node->rot.x = x; + node->rot.y = y; + node->rot.z = z; return 1; case AS_ADD_ROTATION: nodeId = animator->staticNodeIDs[*args++ - 1]; @@ -608,9 +608,9 @@ s32 step_model_animator(ModelAnimator* animator) { node = get_animator_child_with_id(animator->rootNode, nodeId); ASSERT(node != NULL); - node->rotation.x += x; - node->rotation.y += y; - node->rotation.z += z; + node->rot.x += x; + node->rot.y += y; + node->rot.z += z; return 1; case AS_SET_POS: nodeId = animator->staticNodeIDs[*args++ - 1]; @@ -668,7 +668,7 @@ void animator_node_update_model_transform(ModelAnimator* animator, f32 (*flipMtx Matrix4f sp10; s32 i; - guRotateRPYF(gAnimRotMtx, clamp_angle(node->rotation.x), clamp_angle(node->rotation.y), clamp_angle(node->rotation.z)); + guRotateRPYF(gAnimRotMtx, clamp_angle(node->rot.x), clamp_angle(node->rot.y), clamp_angle(node->rot.z)); guScaleF(gAnimScaleMtx, node->scale.x, node->scale.y, node->scale.z); guTranslateF(gAnimTranslateMtx, node->basePos.x + node->pos.x, node->basePos.y + node->pos.y, node->basePos.z + node->pos.z); guMtxCatF(gAnimScaleMtx, gAnimRotMtx, gAnimRotScaleMtx); @@ -712,7 +712,7 @@ void render_animated_model(s32 animatorID, Mtx* rootTransform) { animator->baseAddr = NULL; rtPtr->appendGfxArg = animator; rtPtr->appendGfx = (void (*)(void*))appendGfx_animator; - rtPtr->distance = 0; + rtPtr->dist = 0; rtPtr->renderMode = animator->renderMode; queue_render_task(rtPtr); } @@ -736,7 +736,7 @@ void render_animated_model_with_vertices(s32 animatorID, Mtx* rootTransform, s32 animator->baseAddr = baseAddr; rtPtr->appendGfxArg = animator; rtPtr->appendGfx = (void (*)(void*))appendGfx_animator; - rtPtr->distance = 0; + rtPtr->dist = 0; rtPtr->renderMode = animator->renderMode; queue_render_task(rtPtr); } @@ -1060,9 +1060,9 @@ void load_model_animator_node(StaticAnimatorNode* node, ModelAnimator* animator, bpPtr->basePos.x = 0.0f; bpPtr->basePos.y = 0.0f; bpPtr->basePos.z = 0.0f; - bpPtr->rotation.x = ((f32) node->rot.x * 180.0) / 32767.0; - bpPtr->rotation.y = ((f32) node->rot.y * 180.0) / 32767.0; - bpPtr->rotation.z = ((f32) node->rot.z * 180.0) / 32767.0; + bpPtr->rot.x = ((f32) node->rot.x * 180.0) / 32767.0; + bpPtr->rot.y = ((f32) node->rot.y * 180.0) / 32767.0; + bpPtr->rot.z = ((f32) node->rot.z * 180.0) / 32767.0; newNode = add_anim_node(animator, parentNodeID, bpPtr); @@ -1150,9 +1150,9 @@ void reload_mesh_animator_node(StaticAnimatorNode* node, ModelAnimator* animator bpPtr->basePos.x = 0.0f; bpPtr->basePos.y = 0.0f; bpPtr->basePos.z = 0.0f; - bpPtr->rotation.x = ((f32) node->rot.x * 180.0) / 32767.0; - bpPtr->rotation.y = ((f32) node->rot.y * 180.0) / 32767.0; - bpPtr->rotation.z = ((f32) node->rot.z * 180.0) / 32767.0; + bpPtr->rot.x = ((f32) node->rot.x * 180.0) / 32767.0; + bpPtr->rot.y = ((f32) node->rot.y * 180.0) / 32767.0; + bpPtr->rot.z = ((f32) node->rot.z * 180.0) / 32767.0; newNode = add_anim_node(animator, parentNodeID, bpPtr); newNode->vertexStartOffset = node->vertexStartOffset; @@ -1249,9 +1249,9 @@ s32 step_mesh_animator(ModelAnimator* animator) { if (nodeId != 0xFF) { node = get_animator_child_with_id(animator->rootNode, nodeId); if (node != NULL) { - node->rotation.x = x; - node->rotation.y = y; - node->rotation.z = z; + node->rot.x = x; + node->rot.y = y; + node->rot.z = z; return 1; } else { animator->animReadPos = oldPos; @@ -1269,9 +1269,9 @@ s32 step_mesh_animator(ModelAnimator* animator) { if (nodeId != 0xFF) { node = get_animator_child_with_id(animator->rootNode, nodeId); if (node != NULL) { - node->rotation.x += x; - node->rotation.y += y; - node->rotation.z += z; + node->rot.x += x; + node->rot.y += y; + node->rot.z += z; return 1; } else { animator->animReadPos = oldPos; diff --git a/src/C50A0.c b/src/C50A0.c index 727fc51245..537e71e09a 100644 --- a/src/C50A0.c +++ b/src/C50A0.c @@ -664,10 +664,10 @@ void draw_coin_sparkles(ItemEntity* item) { x = D_80155D8C; y = D_80155D8E; z = D_80155D90; - angle = clamp_angle(180.0f - gCameras[gCurrentCamID].currentYaw); + angle = clamp_angle(180.0f - gCameras[gCurrentCamID].curYaw); guTranslateF(sp18, x, y, z); - guTranslateF(sp58, item->position.x, item->position.y + 12.0f, item->position.z); + guTranslateF(sp58, item->pos.x, item->pos.y + 12.0f, item->pos.z); guRotateF(sp98, angle, 0.0f, 1.0f, 0.0f); guMtxCatF(sp18, sp98, sp98); guMtxCatF(sp98, sp58, spD8); @@ -922,9 +922,9 @@ s32 make_item_entity(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pic item->spawnType = itemSpawnMode; item->state = ITEM_PHYSICS_STATE_INIT; - item->position.x = x; - item->position.y = y; - item->position.z = z; + item->pos.x = x; + item->pos.y = y; + item->pos.z = z; itemID &= 0xFFFF; @@ -1119,24 +1119,24 @@ s32 make_item_entity(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pic case ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS: case ITEM_SPAWN_MODE_FIXED_SPAWN_ALWAYS: case ITEM_SPAWN_MODE_ITEM_BLOCK_SPAWN_ALWAYS: - item->shadowIndex = create_shadow_type(0, item->position.x, item->position.y, item->position.z); + item->shadowIndex = create_shadow_type(0, item->pos.x, item->pos.y, item->pos.z); shadow = get_shadow_by_index(item->shadowIndex); if (item->spawnType == ITEM_SPAWN_MODE_ITEM_BLOCK_SPAWN_ALWAYS) { shadow->flags |= ENTITY_FLAG_HIDDEN; } - x = item->position.x; - y = item->position.y + 12.0f; - z = item->position.z; + x = item->pos.x; + y = item->pos.y + 12.0f; + z = item->pos.z; hitDepth = 1000.0f; npc_raycast_down_sides(COLLISION_CHANNEL_20000, &x, &y, &z, &hitDepth); - shadow->position.x = x; - shadow->position.y = y; - shadow->position.z = z; - shadow->rotation.x = gGameStatusPtr->playerGroundTraceAngles.x; - shadow->rotation.y = 0.0f; - shadow->rotation.z = gGameStatusPtr->playerGroundTraceAngles.z; + shadow->pos.x = x; + shadow->pos.y = y; + shadow->pos.z = z; + shadow->rot.x = gGameStatusPtr->playerGroundTraceAngles.x; + shadow->rot.y = 0.0f; + shadow->rot.z = gGameStatusPtr->playerGroundTraceAngles.z; set_standard_shadow_scale(shadow, hitDepth * 0.5f); break; } @@ -1200,9 +1200,9 @@ s32 make_item_entity_at_player(s32 itemID, s32 category, s32 pickupMsgFlags) { item->spawnType = ITEM_SPAWN_AT_PLAYER; item->state = ITEM_PICKUP_STATE_INIT; item->boundVar = 0; - item->position.x = playerStatus->position.x; - item->position.y = playerStatus->position.y; - item->position.z = playerStatus->position.z; + item->pos.x = playerStatus->pos.x; + item->pos.y = playerStatus->pos.y; + item->pos.z = playerStatus->pos.z; item->shadowIndex = -1; item->nextUpdate = 1; @@ -1224,22 +1224,22 @@ s32 make_item_entity_at_player(s32 itemID, s32 category, s32 pickupMsgFlags) { } ItemEntityAlternatingSpawn = 1 - ItemEntityAlternatingSpawn; - item->shadowIndex = create_shadow_type(0, item->position.x, item->position.y, item->position.z); + item->shadowIndex = create_shadow_type(0, item->pos.x, item->pos.y, item->pos.z); shadow = get_shadow_by_index(item->shadowIndex); shadow->flags |= ENTITY_FLAG_HIDDEN; - posX = item->position.x; - posY = item->position.y + 12.0f; - posZ = item->position.z; + posX = item->pos.x; + posY = item->pos.y + 12.0f; + posZ = item->pos.z; depth = 1000.0f; npc_raycast_down_sides(COLLISION_CHANNEL_20000, &posX, &posY, &posZ, &depth); - shadow->position.x = posX; - shadow->position.y = posY; - shadow->position.z = posZ; + shadow->pos.x = posX; + shadow->pos.y = posY; + shadow->pos.z = posZ; - shadow->rotation.x = gGameStatusPtr->playerGroundTraceAngles.x; - shadow->rotation.y = 0.0f; - shadow->rotation.z = gGameStatusPtr->playerGroundTraceAngles.z; + shadow->rot.x = gGameStatusPtr->playerGroundTraceAngles.x; + shadow->rot.y = 0.0f; + shadow->rot.z = gGameStatusPtr->playerGroundTraceAngles.z; set_standard_shadow_scale(shadow, depth * 0.5f); item_entity_load(item); @@ -1350,32 +1350,32 @@ void update_item_entities(void) { case ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS: case ITEM_SPAWN_MODE_FIXED_SPAWN_ALWAYS: case ITEM_SPAWN_AT_PLAYER: - xs = item->position.x; - ys = item->position.y; - zs = item->position.z; + xs = item->pos.x; + ys = item->pos.y; + zs = item->pos.z; if (xs != item->lastPos.x || ys != item->lastPos.y || zs != item->lastPos.z) { Shadow* shadow = get_shadow_by_index(item->shadowIndex); - x = item->position.x; - y = item->position.y + 12.0f; - z = item->position.z; + x = item->pos.x; + y = item->pos.y + 12.0f; + z = item->pos.z; hitDepth = 1000.0f; npc_raycast_down_sides(COLLISION_CHANNEL_20000, &x, &y, &z, &hitDepth); - shadow->position.x = x; - shadow->position.y = y; - shadow->position.z = z; - shadow->rotation.x = gGameStatusPtr->playerGroundTraceAngles.x; - shadow->rotation.y = 0.0f; - shadow->rotation.z = gGameStatusPtr->playerGroundTraceAngles.z; + shadow->pos.x = x; + shadow->pos.y = y; + shadow->pos.z = z; + shadow->rot.x = gGameStatusPtr->playerGroundTraceAngles.x; + shadow->rot.y = 0.0f; + shadow->rot.z = gGameStatusPtr->playerGroundTraceAngles.z; set_standard_shadow_scale(shadow, hitDepth * 0.5f); } break; } - item->lastPos.x = item->position.x; - item->lastPos.y = item->position.y; - item->lastPos.z = item->position.z; + item->lastPos.x = item->pos.x; + item->lastPos.y = item->pos.y; + item->lastPos.z = item->pos.z; } } do {} while (0); // required to match @@ -1414,8 +1414,8 @@ void appendGfx_item_entity(void* data) { item->scale = 1.0f; } - rot = clamp_angle(180.0f - gCameras[gCurrentCamID].currentYaw); - guTranslateF(mtxTranslate, item->position.x, item->position.y + yOffset, item->position.z); + rot = clamp_angle(180.0f - gCameras[gCurrentCamID].curYaw); + guTranslateF(mtxTranslate, item->pos.x, item->pos.y + yOffset, item->pos.z); guRotateF(mtxRotY, rot, 0.0f, 1.0f, 0.0f); if (item->flags & ITEM_ENTITY_RESIZABLE) { guScaleF(mtxScale, item->scale, item->scale, item->scale); @@ -1554,7 +1554,7 @@ void draw_item_entities(void) { rtPtr->appendGfxArg = item; rtPtr->appendGfx = appendGfx_item_entity; - rtPtr->distance = 0; + rtPtr->dist = 0; retTask = queue_render_task(rtPtr); retTask->renderMode |= RENDER_TASK_FLAG_REFLECT_FLOOR; @@ -1624,8 +1624,8 @@ void render_item_entities(void) { item->scale = 1.0f; } - rotX = clamp_angle(180.0f - gCameras[gCurrentCamID].currentYaw); - guTranslateF(sp58, item->position.x, -item->position.y - offsetY, item->position.z); + rotX = clamp_angle(180.0f - gCameras[gCurrentCamID].curYaw); + guTranslateF(sp58, item->pos.x, -item->pos.y - offsetY, item->pos.z); guRotateF(sp98, rotX, 0.0f, 1.0f, 0.0f); if (item->flags & ITEM_ENTITY_RESIZABLE) { guScaleF(spD8, item->scale, item->scale, item->scale); @@ -1879,28 +1879,28 @@ b32 test_item_player_collision(ItemEntity* item) { cond = FALSE; colliderHeightHalf = playerStatus->colliderHeight / 2; - playerX = playerStatus->position.x; - playerY = playerStatus->position.y; - playerZ = playerStatus->position.z; + playerX = playerStatus->pos.x; + playerY = playerStatus->pos.y; + playerZ = playerStatus->pos.z; colliderDiameterQuart = playerStatus->colliderDiameter / 4; spriteFacingAngle = playerStatus->spriteFacingAngle; if (spriteFacingAngle < 180.0f) { - spriteFacingAngle = clamp_angle(camera->currentYaw - 90.0f); + spriteFacingAngle = clamp_angle(camera->curYaw - 90.0f); } else { - spriteFacingAngle = clamp_angle(camera->currentYaw + 90.0f); + spriteFacingAngle = clamp_angle(camera->curYaw + 90.0f); } tmpX = playerX; playerY2 = playerY; tmpZ = playerZ; - if (get_clamped_angle_diff(camera->currentYaw, spriteFacingAngle) < 0.0f) { - angle = clamp_angle(camera->currentYaw - 90.0f); + if (get_clamped_angle_diff(camera->curYaw, spriteFacingAngle) < 0.0f) { + angle = clamp_angle(camera->curYaw - 90.0f); if (playerStatus->trueAnimation & 0x01000000) { angle = clamp_angle(angle + 30.0f); } } else { - angle = clamp_angle(camera->currentYaw + 90.0f); + angle = clamp_angle(camera->curYaw + 90.0f); if (playerStatus->trueAnimation & 0x01000000) { angle = clamp_angle(angle - 30.0f); } @@ -1908,9 +1908,9 @@ b32 test_item_player_collision(ItemEntity* item) { add_vec2D_polar(&tmpX, &tmpZ, 24.0f, angle); - itemX = item->position.x; - itemY = item->position.y; - itemZ = item->position.z; + itemX = item->pos.x; + itemY = item->pos.y; + itemZ = item->pos.z; do { do { @@ -1997,9 +1997,9 @@ s32 test_item_entity_position(f32 x, f32 y, f32 z, f32 dist) { continue; } - dx = item->position.x - x; - dz = item->position.y - y; - dy = item->position.z - z; + dx = item->pos.x - x; + dz = item->pos.y - y; + dy = item->pos.z - z; if (sqrtf(SQ(dx) + SQ(dz) + SQ(dy)) < dist) { return i; } @@ -2041,9 +2041,9 @@ b32 is_picking_up_item(void) { void set_item_entity_position(s32 itemEntityIndex, f32 x, f32 y, f32 z) { ItemEntity* item = gCurrentItemEntities[itemEntityIndex]; - item->position.x = x; - item->position.y = y; - item->position.z = z; + item->pos.x = x; + item->pos.y = y; + item->pos.z = z; } void set_current_item_entity_render_group(s32 group) { @@ -2087,71 +2087,71 @@ void update_item_entity_collectable(ItemEntity* item) { ASSERT(physData != NULL); if (item->flags & ITEM_ENTITY_FLAG_TOSS_HIGHER) { - physData->verticalVelocity = 16.0f; + physData->verticalVel = 16.0f; physData->gravity = 2.0f; } else if (!(item->flags & ITEM_ENTITY_FLAG_TOSS_LOWER)) { - physData->verticalVelocity = 12.0f; + physData->verticalVel = 12.0f; physData->gravity = 2.0f; } else { - physData->verticalVelocity = 14.0f; + physData->verticalVel = 14.0f; physData->gravity = 2.0f; } physData->collisionRadius = 24.0f; - physData->constVelocity = 24.0f; + physData->constVel = 24.0f; if (item->spawnAngle < 0) { if (IS_ITEM(item->itemID)) { if (rand_int(10000) < 5000) { - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw + 105.0f + rand_int(30) - 15.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw + 105.0f + rand_int(30) - 15.0f); } else { - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw - 105.0f + rand_int(30) - 15.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw - 105.0f + rand_int(30) - 15.0f); } - physData->verticalVelocity += 4.0f; + physData->verticalVel += 4.0f; } else { switch (item->itemID) { case ITEM_HEART: - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw + 90.0f + rand_int(120) - 60.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw + 90.0f + rand_int(120) - 60.0f); break; case ITEM_FLOWER_POINT: - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw - 90.0f + rand_int(120) + 60.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw - 90.0f + rand_int(120) + 60.0f); break; case ITEM_COIN: if (rand_int(10000) < 5000) { - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw + 90.0f + rand_int(120) - 60.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw + 90.0f + rand_int(120) - 60.0f); } else { - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw - 90.0f + rand_int(120) - 60.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw - 90.0f + rand_int(120) - 60.0f); } break; case ITEM_KOOPA_FORTRESS_KEY: if (rand_int(10000) >= 5000) { - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw - 90.0f + rand_int(120) - 60.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw - 90.0f + rand_int(120) - 60.0f); } else { - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw + 90.0f + rand_int(120) - 60.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw + 90.0f + rand_int(120) - 60.0f); } break; case ITEM_STAR_POINT: if (item->spawnType != ITEM_SPAWN_MODE_TOSS_FADE1) { - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw - 90.0f + rand_int(120) - 60.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw - 90.0f + rand_int(120) - 60.0f); break; } if (rand_int(10000) < 5000) { - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw + 90.0f + rand_int(60) - 30.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw + 90.0f + rand_int(60) - 30.0f); } else { - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw - 90.0f + rand_int(60) - 30.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw - 90.0f + rand_int(60) - 30.0f); } break; case ITEM_HEART_POINT: - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw + 90.0f + rand_int(120) - 60.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw + 90.0f + rand_int(120) - 60.0f); break; case ITEM_STAR_PIECE: if (rand_int(10000) < 5000) { - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw + 90.0f + rand_int(60) - 30.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw + 90.0f + rand_int(60) - 30.0f); } else { - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw - 90.0f + rand_int(60) - 30.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw - 90.0f + rand_int(60) - 30.0f); } break; case ITEM_HEART_PIECE: - physData->moveAngle = clamp_angle(gCameras[camID].currentYaw + 90.0f + rand_int(120) - 60.0f); + physData->moveAngle = clamp_angle(gCameras[camID].curYaw + 90.0f + rand_int(120) - 60.0f); break; default: physData->moveAngle = 0.0f; @@ -2165,16 +2165,16 @@ void update_item_entity_collectable(ItemEntity* item) { theta = DEG_TO_RAD(physData->moveAngle); sinAngle = sin_rad(theta); cosAngle = cos_rad(theta); - physData->velx = temp * sinAngle; - physData->velz = -temp * cosAngle; + physData->velX = temp * sinAngle; + physData->velZ = -temp * cosAngle; } else { temp = rand_int(2000); temp = (temp / 1000.0f) + 2.0; theta = DEG_TO_RAD(physData->moveAngle); sinAngle = sin_rad(theta); cosAngle = cos_rad(theta); - physData->velx = temp * sinAngle; - physData->velz = -temp * cosAngle; + physData->velX = temp * sinAngle; + physData->velZ = -temp * cosAngle; } } else { physData->moveAngle = clamp_angle(item->spawnAngle); @@ -2186,8 +2186,8 @@ void update_item_entity_collectable(ItemEntity* item) { theta = DEG_TO_RAD(physData->moveAngle); sinAngle = sin_rad(theta); cosAngle = cos_rad(theta); - physData->velx = temp * sinAngle; - physData->velz = -temp * cosAngle; + physData->velX = temp * sinAngle; + physData->velZ = -temp * cosAngle; } if (item->spawnType != ITEM_SPAWN_MODE_TOSS_FADE1) { @@ -2200,28 +2200,28 @@ void update_item_entity_collectable(ItemEntity* item) { physData->timeLeft = 20; } physData->useSimplePhysics = FALSE; - physData->verticalVelocity = 15.0f; + physData->verticalVel = 15.0f; physData->gravity = 1.6f; } if (item->spawnType == ITEM_SPAWN_MODE_ITEM_BLOCK_SPAWN_ALWAYS) { physData->timeLeft = 60; physData->useSimplePhysics = FALSE; - physData->velx = 0.0f; - physData->velz = 0.0f; + physData->velX = 0.0f; + physData->velZ = 0.0f; } if (item->spawnType == ITEM_SPAWN_MODE_FALL_SPAWN_ALWAYS) { - physData->verticalVelocity = 0.0f; - physData->velx = 0.0f; - physData->velz = 0.0f; + physData->verticalVel = 0.0f; + physData->velX = 0.0f; + physData->velZ = 0.0f; physData->useSimplePhysics = TRUE; } if (item->spawnType == ITEM_SPAWN_MODE_FIXED_SPAWN_ALWAYS) { - physData->verticalVelocity = 0.0f; - physData->velx = 0.0f; - physData->velz = 0.0f; + physData->verticalVel = 0.0f; + physData->velX = 0.0f; + physData->velZ = 0.0f; physData->useSimplePhysics = TRUE; } @@ -2259,19 +2259,19 @@ void update_item_entity_collectable(ItemEntity* item) { // apply gravity if (!(item->flags & ITEM_ENTITY_FLAG_NO_GRAVITY)) { if (!(item->flags & ITEM_ENTITY_FLAG_CANT_COLLECT)) { - physData->verticalVelocity -= physData->gravity; - if (physData->verticalVelocity < -16.0) { - physData->verticalVelocity = -16.0f; + physData->verticalVel -= physData->gravity; + if (physData->verticalVel < -16.0) { + physData->verticalVel = -16.0f; } - item->position.y += physData->verticalVelocity; - item->position.x += physData->velx; - item->position.z += physData->velz; + item->pos.y += physData->verticalVel; + item->pos.x += physData->velX; + item->pos.z += physData->velZ; } } // handle auto-collection from multi-coin bricks if (item->spawnType == ITEM_SPAWN_MODE_ITEM_BLOCK_SPAWN_ALWAYS - && physData->verticalVelocity <= 0.0f + && physData->verticalVel <= 0.0f ) { item->state = ITEM_PHYSICS_STATE_TOUCH; break; @@ -2281,13 +2281,13 @@ void update_item_entity_collectable(ItemEntity* item) { if (!(item->flags & (ITEM_ENTITY_FLAG_DONE_FALLING | ITEM_ENTITY_FLAG_NO_MOTION)) && item->spawnType != ITEM_SPAWN_MODE_ITEM_BLOCK_SPAWN_ALWAYS && item->spawnType != ITEM_SPAWN_MODE_TOSS_FADE1 - && physData->verticalVelocity > 0.0f + && physData->verticalVel > 0.0f ) { - temp = physData->constVelocity; - outX = item->position.x; - outY = item->position.y; - outZ = item->position.z; - outDepth = temp + physData->verticalVelocity; + temp = physData->constVel; + outX = item->pos.x; + outY = item->pos.y; + outZ = item->pos.z; + outDepth = temp + physData->verticalVel; if (!physData->useSimplePhysics) { hit = npc_raycast_up(COLLISION_CHANNEL_20000, &outX, &outY, &outZ, &outDepth); @@ -2296,8 +2296,8 @@ void update_item_entity_collectable(ItemEntity* item) { } if (hit && outDepth < temp) { - item->position.y = outY - temp; - physData->verticalVelocity = 0.0f; + item->pos.y = outY - temp; + physData->verticalVel = 0.0f; } } @@ -2305,53 +2305,53 @@ void update_item_entity_collectable(ItemEntity* item) { if (!(item->flags & (ITEM_ENTITY_FLAG_DONE_FALLING | ITEM_ENTITY_FLAG_NO_MOTION)) && item->spawnType != ITEM_SPAWN_MODE_ITEM_BLOCK_SPAWN_ALWAYS && item->spawnType != ITEM_SPAWN_MODE_TOSS_FADE1 - && (physData->velx != 0.0f || physData->velz != 0.0f) + && (physData->velX != 0.0f || physData->velZ != 0.0f) ) { - outX = item->position.x; - outY = item->position.y; - outZ = item->position.z; + outX = item->pos.x; + outY = item->pos.y; + outZ = item->pos.z; if (!physData->useSimplePhysics) { - hit = npc_test_move_complex_with_slipping(COLLISION_CHANNEL_20000, &outX, &outY, &outZ, 0.0f, physData->moveAngle, physData->constVelocity, physData->collisionRadius); + hit = npc_test_move_complex_with_slipping(COLLISION_CHANNEL_20000, &outX, &outY, &outZ, 0.0f, physData->moveAngle, physData->constVel, physData->collisionRadius); } else { - hit = npc_test_move_simple_with_slipping(COLLISION_CHANNEL_20000, &outX, &outY, &outZ, 0.0f, physData->moveAngle, physData->constVelocity, physData->collisionRadius); + hit = npc_test_move_simple_with_slipping(COLLISION_CHANNEL_20000, &outX, &outY, &outZ, 0.0f, physData->moveAngle, physData->constVel, physData->collisionRadius); } if (hit) { // if a wall is hit, bounce back - item->position.x = outX; - item->position.y = outY; - item->position.z = outZ; + item->pos.x = outX; + item->pos.y = outY; + item->pos.z = outZ; physData->moveAngle = clamp_angle(physData->moveAngle + 180.0f); theta = DEG_TO_RAD(physData->moveAngle); sinAngle = sin_rad(theta); cosAngle = cos_rad(theta); - physData->velx = sinAngle * 2.0; - physData->velz = cosAngle * -2.0; + physData->velX = sinAngle * 2.0; + physData->velZ = cosAngle * -2.0; } } // if the item has downward velocity, try moving it down if (!(item->flags & ITEM_ENTITY_FLAG_NO_MOTION) && item->spawnType != ITEM_SPAWN_MODE_ITEM_BLOCK_SPAWN_ALWAYS - && physData->verticalVelocity <= 0.0 + && physData->verticalVel <= 0.0 ) { physData->useSimplePhysics = TRUE; if (item->spawnType != ITEM_SPAWN_MODE_TOSS_FADE1) { - outX = item->position.x; - outY = (item->position.y - physData->verticalVelocity) + 12.0f; - outZ = item->position.z; - outDepth = -physData->verticalVelocity + 12.0f; + outX = item->pos.x; + outY = (item->pos.y - physData->verticalVel) + 12.0f; + outZ = item->pos.z; + outDepth = -physData->verticalVel + 12.0f; if (!physData->useSimplePhysics) { hit = npc_raycast_down_sides(COLLISION_CHANNEL_20000, &outX, &outY, &outZ, &outDepth); } else { hit = npc_raycast_down_around(COLLISION_CHANNEL_20000, &outX, &outY, &outZ, &outDepth, 180.0f, 20.0f); } } else { - outX = item->position.x; - outY = (item->position.y - physData->verticalVelocity) + 12.0f; - outZ = item->position.z; - outDepth = -physData->verticalVelocity + 12.0f; + outX = item->pos.x; + outY = (item->pos.y - physData->verticalVel) + 12.0f; + outZ = item->pos.z; + outDepth = -physData->verticalVel + 12.0f; if (outY < outDepth + 0.0f) { outY = 0.0f; hit = TRUE; @@ -2362,43 +2362,43 @@ void update_item_entity_collectable(ItemEntity* item) { // handle bounce if (hit) { - item->position.y = outY; - physData->verticalVelocity = -physData->verticalVelocity / 1.25; - if (physData->verticalVelocity < 3.0) { - physData->verticalVelocity = 0.0f; - physData->velx = 0.0f; - physData->velz = 0.0f; + item->pos.y = outY; + physData->verticalVel = -physData->verticalVel / 1.25; + if (physData->verticalVel < 3.0) { + physData->verticalVel = 0.0f; + physData->velX = 0.0f; + physData->velZ = 0.0f; item->flags |= ITEM_ENTITY_FLAG_DONE_FALLING; } else { if (IS_BADGE(item->itemID)) { - sfx_play_sound_at_position(SOUND_21B, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_21B, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); } else if (IS_ITEM(item->itemID)) { - sfx_play_sound_at_position(SOUND_21A, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_21A, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); } else { switch (item->itemID) { case ITEM_HEART: - sfx_play_sound_at_position(SOUND_214, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_214, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); break; case ITEM_COIN: - sfx_play_sound_at_position(SOUND_212, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_212, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); break; case ITEM_KOOPA_FORTRESS_KEY: - sfx_play_sound_at_position(SOUND_212, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_212, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); break; case ITEM_HEART_PIECE: - sfx_play_sound_at_position(SOUND_214, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_214, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); break; case ITEM_STAR_POINT: - sfx_play_sound_at_position(SOUND_212, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_212, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); break; case ITEM_HEART_POINT: - sfx_play_sound_at_position(SOUND_214, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_214, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); break; case ITEM_STAR_PIECE: - sfx_play_sound_at_position(SOUND_219, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_219, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); break; case ITEM_FLOWER_POINT: - sfx_play_sound_at_position(SOUND_218, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_218, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); break; } } @@ -2406,7 +2406,7 @@ void update_item_entity_collectable(ItemEntity* item) { } } - if (item->position.y < -2000.0f) { + if (item->pos.y < -2000.0f) { item->state = ITEM_PHYSICS_STATE_DEAD; } break; @@ -2421,7 +2421,7 @@ void update_item_entity_collectable(ItemEntity* item) { set_global_flag(item->boundVar); } - fx_small_gold_sparkle(0, item->position.x, item->position.y + 16.0f, item->position.z, 1.0f, 0); + fx_small_gold_sparkle(0, item->pos.x, item->pos.y + 16.0f, item->pos.z, 1.0f, 0); if (IS_ITEM(item->itemID)) { item->state = ITEM_PHYSICS_STATE_PICKUP; @@ -2438,34 +2438,34 @@ void update_item_entity_collectable(ItemEntity* item) { switch (item->itemID) { case ITEM_HEART: if (playerData->curHP < playerData->curMaxHP) { - fx_recover(0, playerStatus->position.x, playerStatus->position.y + playerStatus->colliderHeight, playerStatus->position.z, 1); - sfx_play_sound_at_position(SOUND_2056, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + fx_recover(0, playerStatus->pos.x, playerStatus->pos.y + playerStatus->colliderHeight, playerStatus->pos.z, 1); + sfx_play_sound_at_position(SOUND_2056, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); } playerData->curHP++; if (playerData->curHP > playerData->curMaxHP) { playerData->curHP = playerData->curMaxHP; } - sfx_play_sound_at_position(SOUND_213, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); - fx_sparkles(4, playerStatus->position.x, playerStatus->position.y + playerStatus->colliderHeight, playerStatus->position.z, 30.0f); + sfx_play_sound_at_position(SOUND_213, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); + fx_sparkles(4, playerStatus->pos.x, playerStatus->pos.y + playerStatus->colliderHeight, playerStatus->pos.z, 30.0f); break; case ITEM_FLOWER_POINT: if (playerData->curFP < playerData->curMaxFP) { - fx_recover(1, playerStatus->position.x, playerStatus->position.y + playerStatus->colliderHeight, playerStatus->position.z, 1); - sfx_play_sound_at_position(SOUND_2056, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + fx_recover(1, playerStatus->pos.x, playerStatus->pos.y + playerStatus->colliderHeight, playerStatus->pos.z, 1); + sfx_play_sound_at_position(SOUND_2056, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); } playerData->curFP++; if (playerData->curFP > playerData->curMaxFP) { playerData->curFP = playerData->curMaxFP; } - sfx_play_sound_at_position(SOUND_217, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); - fx_sparkles(4, playerStatus->position.x, playerStatus->position.y + playerStatus->colliderHeight, playerStatus->position.z, 30.0f); + sfx_play_sound_at_position(SOUND_217, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); + fx_sparkles(4, playerStatus->pos.x, playerStatus->pos.y + playerStatus->colliderHeight, playerStatus->pos.z, 30.0f); break; case ITEM_COIN: playerData->coins++; if (playerData->coins > 999) { playerData->coins = 999; } - sfx_play_sound_at_position(SOUND_211, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_211, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); playerData->totalCoinsEarned++; if (playerData->totalCoinsEarned > 99999) { playerData->totalCoinsEarned = 99999; @@ -2473,19 +2473,19 @@ void update_item_entity_collectable(ItemEntity* item) { break; case ITEM_KOOPA_FORTRESS_KEY: playerData->fortressKeyCount = playerData->fortressKeyCount + 1; - sfx_play_sound_at_position(SOUND_211, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_211, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); break; case ITEM_STAR_POINT: playerData->starPoints++; if (playerData->starPoints > 100) { playerData->starPoints = 100; } - sfx_play_sound_at_position(SOUND_211, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_211, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); break; case ITEM_HEART_POINT: playerData->curHP = playerData->curMaxHP; playerData->curFP = playerData->curMaxFP; - sfx_play_sound_at_position(SOUND_213, SOUND_SPACE_MODE_0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_213, SOUND_SPACE_MODE_0, item->pos.x, item->pos.y, item->pos.z); break; } D_801565A8 = FALSE; @@ -2606,7 +2606,7 @@ void update_item_entity_pickup(ItemEntity* item) { } else if (gItemTable[item->itemID].typeFlags & ITEM_TYPE_FLAG_KEY) { sfx_play_sound(SOUND_D2); } else if (item->itemID == ITEM_COIN) { - sfx_play_sound_at_position(SOUND_211, 0, item->position.x, item->position.y, item->position.z); + sfx_play_sound_at_position(SOUND_211, 0, item->pos.x, item->pos.y, item->pos.z); } else { sfx_play_sound(SOUND_D1); } @@ -2706,18 +2706,18 @@ block_47: // TODO required to match || (item->flags & ITEM_ENTITY_FLAG_4000000) || (item->pickupMsgFlags & ITEM_PICKUP_FLAG_NO_ANIMS) ) { - item->position.x = playerStatus->position.x; - item->position.y = playerStatus->position.y + playerStatus->colliderHeight; - item->position.z = playerStatus->position.z; + item->pos.x = playerStatus->pos.x; + item->pos.y = playerStatus->pos.y + playerStatus->colliderHeight; + item->pos.z = playerStatus->pos.z; suggest_player_anim_always_forward(ANIM_MarioW1_Lift); } if (gItemTable[item->itemID].typeFlags & ITEM_TYPE_FLAG_GEAR) { fx_got_item_outline( 1, - item->position.x, - item->position.y + 8.0f, - item->position.z, + item->pos.x, + item->pos.y + 8.0f, + item->pos.z, 1.0f, &ItemPickupGotOutline ); @@ -2896,9 +2896,9 @@ block_47: // TODO required to match get_item_entity( make_item_entity_delayed( D_801568EC, - playerStatus->position.x, - playerStatus->position.y + playerStatus->colliderHeight, - playerStatus->position.z, 3, 0, 0 + playerStatus->pos.x, + playerStatus->pos.y + playerStatus->colliderHeight, + playerStatus->pos.z, 3, 0, 0 ) )->renderGroup = -1; diff --git a/src/actor_api.c b/src/actor_api.c index f97ef4caff..a586577866 100644 --- a/src/actor_api.c +++ b/src/actor_api.c @@ -9,7 +9,7 @@ s32 count_targets(Actor* actor, s32 targetHomeIndex, s32 targetSelectionFlags) { BattleStatus* battleStatus = &gBattleStatus; battleStatus->targetHomeIndex = targetHomeIndex; - battleStatus->currentTargetListFlags = targetSelectionFlags; + battleStatus->curTargetListFlags = targetSelectionFlags; player_create_target_list(actor); return actor->targetListLength; } @@ -49,9 +49,9 @@ void set_goal_pos_to_part(ActorState* state, s32 actorID, s32 partID) { switch (actorClass) { case ACTOR_CLASS_PLAYER: part = get_actor_part(actor, 0); - state->goalPos.x = actor->currentPos.x + part->partOffset.x * actor->scalingFactor; - state->goalPos.y = actor->currentPos.y + part->partOffset.y * actor->scalingFactor; - state->goalPos.z = actor->currentPos.z + 10.0f; + state->goalPos.x = actor->curPos.x + part->partOffset.x * actor->scalingFactor; + state->goalPos.y = actor->curPos.y + part->partOffset.y * actor->scalingFactor; + state->goalPos.z = actor->curPos.z + 10.0f; if (actor->stoneStatus == STATUS_KEY_STONE) { state->goalPos.y -= actor->scalingFactor * 5.0f; } @@ -60,21 +60,21 @@ void set_goal_pos_to_part(ActorState* state, s32 actorID, s32 partID) { case ACTOR_CLASS_ENEMY: part = get_actor_part(actor, partID); if (!(part->flags & ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION)) { - state->goalPos.x = actor->currentPos.x + (part->partOffset.x + part->targetOffset.x) * actor->scalingFactor; + state->goalPos.x = actor->curPos.x + (part->partOffset.x + part->targetOffset.x) * actor->scalingFactor; if (!(actor->flags & ACTOR_PART_FLAG_800)) { - state->goalPos.y = actor->currentPos.y + (part->partOffset.y + part->targetOffset.y) * actor->scalingFactor; + state->goalPos.y = actor->curPos.y + (part->partOffset.y + part->targetOffset.y) * actor->scalingFactor; } else { - state->goalPos.y = actor->currentPos.y + (-part->partOffset.y - part->targetOffset.y) * actor->scalingFactor; + state->goalPos.y = actor->curPos.y + (-part->partOffset.y - part->targetOffset.y) * actor->scalingFactor; } - state->goalPos.z = actor->currentPos.z + part->partOffset.z + 10.0f; + state->goalPos.z = actor->curPos.z + part->partOffset.z + 10.0f; } else { - state->goalPos.x = part->absolutePosition.x + part->targetOffset.x; + state->goalPos.x = part->absolutePos.x + part->targetOffset.x; if (!(actor->flags & ACTOR_PART_FLAG_800)) { - state->goalPos.y = part->absolutePosition.y + part->targetOffset.y * actor->scalingFactor; + state->goalPos.y = part->absolutePos.y + part->targetOffset.y * actor->scalingFactor; } else { - state->goalPos.y = part->absolutePosition.y - part->targetOffset.y * actor->scalingFactor; + state->goalPos.y = part->absolutePos.y - part->targetOffset.y * actor->scalingFactor; } - state->goalPos.z = part->absolutePosition.z + 10.0f; + state->goalPos.z = part->absolutePos.z + 10.0f; } break; } @@ -88,29 +88,29 @@ void set_part_goal_to_actor_part(ActorPartMovement* movement, s32 actorID, s32 p switch (actorClass) { case ACTOR_CLASS_PLAYER: part = get_actor_part(actor, 0); - part->movement->goalPos.x = actor->currentPos.x + part->partOffset.x * actor->scalingFactor; - part->movement->goalPos.y = actor->currentPos.y + part->partOffset.y * actor->scalingFactor; - part->movement->goalPos.z = actor->currentPos.z; + part->movement->goalPos.x = actor->curPos.x + part->partOffset.x * actor->scalingFactor; + part->movement->goalPos.y = actor->curPos.y + part->partOffset.y * actor->scalingFactor; + part->movement->goalPos.z = actor->curPos.z; break; case ACTOR_CLASS_PARTNER: case ACTOR_CLASS_ENEMY: part = get_actor_part(actor, partID); if (!(part->flags & ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION)) { - part->movement->goalPos.x = actor->currentPos.x + (part->partOffset.x + part->targetOffset.x) * actor->scalingFactor; + part->movement->goalPos.x = actor->curPos.x + (part->partOffset.x + part->targetOffset.x) * actor->scalingFactor; if (!(actor->flags & ACTOR_PART_FLAG_800)) { - part->movement->goalPos.y = actor->currentPos.y + (part->partOffset.y + part->targetOffset.y) * actor->scalingFactor; + part->movement->goalPos.y = actor->curPos.y + (part->partOffset.y + part->targetOffset.y) * actor->scalingFactor; } else { - part->movement->goalPos.y = actor->currentPos.y + (-part->partOffset.y - part->targetOffset.y) * actor->scalingFactor; + part->movement->goalPos.y = actor->curPos.y + (-part->partOffset.y - part->targetOffset.y) * actor->scalingFactor; } - part->movement->goalPos.z = actor->currentPos.z + part->partOffset.z; + part->movement->goalPos.z = actor->curPos.z + part->partOffset.z; } else { - part->movement->goalPos.x = part->absolutePosition.x + part->targetOffset.x; + part->movement->goalPos.x = part->absolutePos.x + part->targetOffset.x; if (!(actor->flags & ACTOR_PART_FLAG_800)) { - part->movement->goalPos.y = part->absolutePosition.y + part->targetOffset.y * actor->scalingFactor; + part->movement->goalPos.y = part->absolutePos.y + part->targetOffset.y * actor->scalingFactor; } else { - part->movement->goalPos.y = part->absolutePosition.y - part->targetOffset.y * actor->scalingFactor; + part->movement->goalPos.y = part->absolutePos.y - part->targetOffset.y * actor->scalingFactor; } - part->movement->goalPos.z = part->absolutePosition.z; + part->movement->goalPos.z = part->absolutePos.z; } break; } @@ -119,9 +119,9 @@ void set_part_goal_to_actor_part(ActorPartMovement* movement, s32 actorID, s32 p void set_actor_current_position(s32 actorID, f32 x, f32 y, f32 z) { Actor* actor = get_actor(actorID); - actor->currentPos.x = x; - actor->currentPos.y = y; - actor->currentPos.z = z; + actor->curPos.x = x; + actor->curPos.y = y; + actor->curPos.z = z; } void set_part_absolute_position(s32 actorID, s32 partID, f32 x, f32 y, f32 z) { @@ -130,16 +130,16 @@ void set_part_absolute_position(s32 actorID, s32 partID, f32 x, f32 y, f32 z) { switch (actorID & ACTOR_CLASS_MASK) { case ACTOR_CLASS_PLAYER: - actor->currentPos.x = x; - actor->currentPos.y = y; - actor->currentPos.z = z; + actor->curPos.x = x; + actor->curPos.y = y; + actor->curPos.z = z; break; case ACTOR_CLASS_PARTNER: case ACTOR_CLASS_ENEMY: actorPart = get_actor_part(actor, partID); - actorPart->absolutePosition.x = x; - actorPart->absolutePosition.y = y; - actorPart->absolutePosition.z = z; + actorPart->absolutePos.x = x; + actorPart->absolutePos.y = y; + actorPart->absolutePos.z = z; break; } } @@ -186,19 +186,19 @@ ApiStatus GetBattlePhase(Evt* script, s32 isInitialCall) { } ApiStatus GetLastElement(Evt* script, s32 isInitialCall) { - evt_set_variable(script, *script->ptrReadPos, gBattleStatus.currentAttackElement); + evt_set_variable(script, *script->ptrReadPos, gBattleStatus.curAttackElement); return ApiStatus_DONE2; } ApiStatus GetDamageSource(Evt* script, s32 isInitialCall) { - evt_set_variable(script, *script->ptrReadPos, gBattleStatus.currentDamageSource); + evt_set_variable(script, *script->ptrReadPos, gBattleStatus.curDamageSource); return ApiStatus_DONE2; } ApiStatus SetDamageSource(Evt* script, s32 isInitialCall) { s32 damageSource = *script->ptrReadPos; - gBattleStatus.currentDamageSource = damageSource; + gBattleStatus.curDamageSource = damageSource; return ApiStatus_DONE2; } @@ -263,7 +263,7 @@ ApiStatus GetIndexFromPos(Evt* script, s32 isInitialCall) { } actor = get_actor(actorID); - evt_set_variable(script, a1, get_nearest_home_index(actor->currentPos.x, actor->currentPos.y, actor->currentPos.z)); + evt_set_variable(script, a1, get_nearest_home_index(actor->curPos.x, actor->curPos.y, actor->curPos.z)); return ApiStatus_DONE2; } @@ -296,8 +296,8 @@ ApiStatus CountPlayerTargets(Evt* script, s32 isInitialCall) { } actor = get_actor(actorID); - evt_set_variable(script, outVar, count_targets(actor, get_nearest_home_index(actor->currentPos.x, actor->currentPos.y, - actor->currentPos.z), targetSelectionFlags)); + evt_set_variable(script, outVar, count_targets(actor, get_nearest_home_index(actor->curPos.x, actor->curPos.y, + actor->curPos.z), targetSelectionFlags)); return ApiStatus_DONE2; } @@ -318,11 +318,11 @@ ApiStatus ForceHomePos(Evt* script, s32 isInitialCall) { actor = get_actor(actorID); actor->homePos.x = x; - actor->currentPos.x = x; + actor->curPos.x = x; actor->homePos.y = y; - actor->currentPos.y = y; + actor->curPos.y = y; actor->homePos.z = z; - actor->currentPos.z = z; + actor->curPos.z = z; return ApiStatus_DONE2; } @@ -603,9 +603,9 @@ ApiStatus GetActorPos(Evt* script, s32 isInitialCall) { outY = *args++; outZ = *args++; - x = actor->currentPos.x; - y = actor->currentPos.y; - z = actor->currentPos.z; + x = actor->curPos.x; + y = actor->curPos.y; + z = actor->curPos.z; evt_set_variable(script, outX, x); evt_set_variable(script, outY, y); @@ -638,9 +638,9 @@ ApiStatus GetPartOffset(Evt* script, s32 isInitialCall) { y = actorPart->partOffset.y; z = actorPart->partOffset.z; } else { - x = actorPart->absolutePosition.x; - y = actorPart->absolutePosition.y; - z = actorPart->absolutePosition.z; + x = actorPart->absolutePos.x; + y = actorPart->absolutePos.y; + z = actorPart->absolutePos.z; } evt_set_variable(script, outX, x); @@ -669,9 +669,9 @@ ApiStatus GetPartPos(Evt* script, s32 isInitialCall) { outY = *args++; outZ = *args++; - x = actorPart->currentPos.x; - y = actorPart->currentPos.y; - z = actorPart->currentPos.z; + x = actorPart->curPos.x; + y = actorPart->curPos.y; + z = actorPart->curPos.z; evt_set_variable(script, outX, x); evt_set_variable(script, outY, y); @@ -723,9 +723,9 @@ ApiStatus SetActorPos(Evt* script, s32 isInitialCall) { z = evt_get_variable(script, *args++); actor = get_actor(actorID); - actor->currentPos.x = x; - actor->currentPos.y = y; - actor->currentPos.z = z; + actor->curPos.x = x; + actor->curPos.y = y; + actor->curPos.z = z; return ApiStatus_DONE2; } @@ -751,9 +751,9 @@ ApiStatus SetPartPos(Evt* script, s32 isInitialCall) { switch (actorID & ACTOR_CLASS_MASK) { case ACTOR_CLASS_PLAYER: - actor->currentPos.x = x; - actor->currentPos.y = y; - actor->currentPos.z = z; + actor->curPos.x = x; + actor->curPos.y = y; + actor->curPos.z = z; break; case ACTOR_CLASS_PARTNER: case ACTOR_CLASS_ENEMY: @@ -764,9 +764,9 @@ ApiStatus SetPartPos(Evt* script, s32 isInitialCall) { actorPart->partOffset.y = y; actorPart->partOffset.z = z; } else { - actorPart->absolutePosition.x = x; - actorPart->absolutePosition.y = y; - actorPart->absolutePosition.z = z; + actorPart->absolutePos.x = x; + actorPart->absolutePos.y = y; + actorPart->absolutePos.z = z; } break; } @@ -841,7 +841,7 @@ ApiStatus GetAnimation(Evt* script, s32 isInitialCall) { actorPart = get_actor_part(get_actor(actorID), partID); if (actorPart != NULL) { - evt_set_variable(script, outVar, actorPart->currentAnimation); + evt_set_variable(script, outVar, actorPart->curAnimation); } return ApiStatus_DONE2; } @@ -1059,9 +1059,9 @@ ApiStatus AddActorPos(Evt* script, s32 isInitialCall) { z = evt_get_float_variable(script, *args++); actor = get_actor(actorID); - actor->currentPos.x += x; - actor->currentPos.y += y; - actor->currentPos.z += z; + actor->curPos.x += x; + actor->curPos.y += y; + actor->curPos.z += z; return ApiStatus_DONE2; } @@ -1334,15 +1334,15 @@ ApiStatus SetActorRotation(Evt* script, s32 isInitialCall) { actor = get_actor(actorID); if (x != EVT_IGNORE_ARG) { - actor->rotation.x = x; + actor->rot.x = x; } if (y != EVT_IGNORE_ARG) { - actor->rotation.y = y; + actor->rot.y = y; } if (z != EVT_IGNORE_ARG) { - actor->rotation.z = z; + actor->rot.z = z; } return ApiStatus_DONE2; @@ -1364,9 +1364,9 @@ ApiStatus SetActorRotationOffset(Evt* script, s32 isInitialCall) { actor = get_actor(actorID); - actor->rotationPivotOffset.x = x; - actor->rotationPivotOffset.y = y; - actor->rotationPivotOffset.z = z; + actor->rotPivotOffset.x = x; + actor->rotPivotOffset.y = y; + actor->rotPivotOffset.z = z; return ApiStatus_DONE2; } @@ -1387,9 +1387,9 @@ ApiStatus GetActorRotation(Evt* script, s32 isInitialCall) { actor = get_actor(actorID); - evt_set_variable(script, x, actor->rotation.x); - evt_set_variable(script, y, actor->rotation.y); - evt_set_variable(script, z, actor->rotation.z); + evt_set_variable(script, x, actor->rot.x); + evt_set_variable(script, y, actor->rot.y); + evt_set_variable(script, z, actor->rot.z); return ApiStatus_DONE2; } @@ -1411,9 +1411,9 @@ ApiStatus SetPartRotation(Evt* script, s32 isInitialCall) { actorPart = get_actor_part(get_actor(actorID), partID); - actorPart->rotation.x = x; - actorPart->rotation.y = y; - actorPart->rotation.z = z; + actorPart->rot.x = x; + actorPart->rot.y = y; + actorPart->rot.z = z; return ApiStatus_DONE2; } @@ -1435,9 +1435,9 @@ ApiStatus SetPartRotationOffset(Evt* script, s32 isInitialCall) { actorPart = get_actor_part(get_actor(actorID), partID); - actorPart->rotationPivotOffset.x = x; - actorPart->rotationPivotOffset.y = y; - actorPart->rotationPivotOffset.z = z; + actorPart->rotPivotOffset.x = x; + actorPart->rotPivotOffset.y = y; + actorPart->rotPivotOffset.z = z; return ApiStatus_DONE2; } @@ -1459,9 +1459,9 @@ ApiStatus GetPartRotation(Evt* script, s32 isInitialCall) { actorPart = get_actor_part(get_actor(actorID), partID); - evt_set_float_variable(script, x, actorPart->rotation.x); - evt_set_float_variable(script, y, actorPart->rotation.y); - evt_set_float_variable(script, z, actorPart->rotation.z); + evt_set_float_variable(script, x, actorPart->rot.x); + evt_set_float_variable(script, y, actorPart->rot.y); + evt_set_float_variable(script, z, actorPart->rot.z); return ApiStatus_DONE2; } @@ -1941,7 +1941,7 @@ ApiStatus HPBarToHome(Evt* script, s32 isInitialCall) { actor->healthBarPos.y = actor->homePos.y - actor->size.y - actor->actorBlueprint->healthBarOffset.y; } - actor->healthFraction = (actor->currentHP * 25) / actor->maxHP; + actor->healthFraction = (actor->curHP * 25) / actor->maxHP; return ApiStatus_DONE2; } @@ -1956,15 +1956,15 @@ ApiStatus HPBarToCurrent(Evt* script, s32 isInitialCall) { } actor = get_actor(actorID); - actor->healthBarPos.x = actor->currentPos.x + actor->actorBlueprint->healthBarOffset.x; - actor->healthBarPos.y = actor->currentPos.y + actor->actorBlueprint->healthBarOffset.y; - actor->healthBarPos.z = actor->currentPos.z; + actor->healthBarPos.x = actor->curPos.x + actor->actorBlueprint->healthBarOffset.x; + actor->healthBarPos.y = actor->curPos.y + actor->actorBlueprint->healthBarOffset.y; + actor->healthBarPos.z = actor->curPos.z; if (actor->flags & ACTOR_FLAG_UPSIDE_DOWN) { - actor->healthBarPos.y = actor->currentPos.y - actor->size.y - actor->actorBlueprint->healthBarOffset.y; + actor->healthBarPos.y = actor->curPos.y - actor->size.y - actor->actorBlueprint->healthBarOffset.y; } - actor->healthFraction = (actor->currentHP * 25) / actor->maxHP; + actor->healthFraction = (actor->curHP * 25) / actor->maxHP; return ApiStatus_DONE2; } @@ -2205,9 +2205,9 @@ ApiStatus SetBattleInputButtons(Evt* script, s32 isInitialCall) { s32 currentButtonsPressed = *args++; s32 currentButtonsHeld = *args; - battleStatus->currentButtonsDown = currentButtonsDown; - battleStatus->currentButtonsPressed = currentButtonsPressed; - battleStatus->currentButtonsHeld = currentButtonsHeld; + battleStatus->curButtonsDown = currentButtonsDown; + battleStatus->curButtonsPressed = currentButtonsPressed; + battleStatus->curButtonsHeld = currentButtonsHeld; return ApiStatus_DONE2; } @@ -2216,7 +2216,7 @@ ApiStatus CheckButtonPress(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; Bytecode buttons = *args++; Bytecode out = *args; - s32 buttonsPressed = gBattleStatus.currentButtonsPressed; + s32 buttonsPressed = gBattleStatus.curButtonsPressed; evt_set_variable(script, out, (buttonsPressed & buttons) != 0); return ApiStatus_DONE2; @@ -2226,7 +2226,7 @@ ApiStatus CheckButtonHeld(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; Bytecode buttons = *args++; Bytecode out = *args; - s32 buttonsHeld = gBattleStatus.currentButtonsHeld; + s32 buttonsHeld = gBattleStatus.curButtonsHeld; evt_set_variable(script, out, (buttonsHeld & buttons) != 0); return ApiStatus_DONE2; @@ -2236,7 +2236,7 @@ ApiStatus CheckButtonDown(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; Bytecode buttons = *args++; Bytecode out = *args; - s32 buttonsDown = gBattleStatus.currentButtonsDown; + s32 buttonsDown = gBattleStatus.curButtonsDown; evt_set_variable(script, out, (buttonsDown & buttons) != 0); return ApiStatus_DONE2; @@ -2308,7 +2308,7 @@ ApiStatus PlayerCreateTargetList(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; Actor* actor = get_actor(script->owner1.actorID); - gBattleStatus.currentTargetListFlags = *args; + gBattleStatus.curTargetListFlags = *args; player_create_target_list(actor); return ApiStatus_DONE2; @@ -2318,7 +2318,7 @@ ApiStatus EnemyCreateTargetList(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; Actor* actor = get_actor(script->owner1.actorID); - gBattleStatus.currentTargetListFlags = *args; + gBattleStatus.curTargetListFlags = *args; enemy_create_target_list(actor); return ApiStatus_DONE2; @@ -2423,9 +2423,9 @@ s32 func_8026E558(Evt* script, s32 isInitialCall) { } actor = get_actor(i); - x = actor->currentPos.x; - y = actor->currentPos.y; - z = actor->currentPos.z; + x = actor->curPos.x; + y = actor->curPos.y; + z = actor->curPos.z; outVal = -1; @@ -2518,8 +2518,8 @@ ApiStatus func_8026E914(Evt* script, s32 isInitialCall) { s32 temp_v0 = *args++; s32 temp_s1 = *args++; - evt_set_variable(script, temp_v0, gBattleStatus.currentTargetID2); - evt_set_variable(script, temp_s1, gBattleStatus.currentTargetPart2); + evt_set_variable(script, temp_v0, gBattleStatus.curTargetID2); + evt_set_variable(script, temp_s1, gBattleStatus.curTargetPart2); return ApiStatus_DONE2; } @@ -2537,8 +2537,8 @@ ApiStatus func_8026E9A0(Evt* script, s32 isInitialCall) { actorID = evt_get_variable(script, *args++); partID = evt_get_variable(script, *args++); - gBattleStatus.currentTargetPart2 = partID; - gBattleStatus.currentTargetID2 = actorID; + gBattleStatus.curTargetPart2 = partID; + gBattleStatus.curTargetID2 = actorID; return ApiStatus_DONE2; } @@ -2555,7 +2555,7 @@ ApiStatus GetDistanceToGoal(Evt* script, s32 isInitialCall) { } actor = get_actor(actorID); - dist = dist2D(actor->currentPos.x, actor->currentPos.z, actor->state.goalPos.x, actor->state.goalPos.z); + dist = dist2D(actor->curPos.x, actor->curPos.z, actor->state.goalPos.x, actor->state.goalPos.z); evt_set_variable(script, outVar, dist); return ApiStatus_DONE2; } @@ -3213,26 +3213,26 @@ ApiStatus BoostAttack(Evt* script, s32 isInitialCall) { attackBoost = script->functionTemp[2]; flags = actor->flags; - x1 = actor->currentPos.x + actor->headOffset.x; + x1 = actor->curPos.x + actor->headOffset.x; if (flags & ACTOR_FLAG_UPSIDE_DOWN) { - y1 = actor->currentPos.y + actor->headOffset.y - actor->size.y / 2; + y1 = actor->curPos.y + actor->headOffset.y - actor->size.y / 2; } else if (!(flags & ACTOR_FLAG_8000)) { - y1 = actor->currentPos.y + actor->headOffset.y + actor->size.y / 2; + y1 = actor->curPos.y + actor->headOffset.y + actor->size.y / 2; } else { - y1 = actor->currentPos.y + actor->headOffset.y + actor->size.y; + y1 = actor->curPos.y + actor->headOffset.y + actor->size.y; } - z1 = actor->currentPos.z + actor->headOffset.z + 10.0f; + z1 = actor->curPos.z + actor->headOffset.z + 10.0f; flags2 = actor->flags; - x2 = actor->currentPos.x + actor->headOffset.x + actor->size.x / 2; + x2 = actor->curPos.x + actor->headOffset.x + actor->size.x / 2; if (flags2 & ACTOR_FLAG_UPSIDE_DOWN) { - y2 = actor->currentPos.y + actor->headOffset.y - actor->size.y; + y2 = actor->curPos.y + actor->headOffset.y - actor->size.y; } else if (!(flags2 & ACTOR_FLAG_8000)) { - y2 = actor->currentPos.y + actor->headOffset.y + actor->size.y; + y2 = actor->curPos.y + actor->headOffset.y + actor->size.y; } else { - y2 = actor->currentPos.y + actor->headOffset.y + actor->size.y * 2; + y2 = actor->curPos.y + actor->headOffset.y + actor->size.y * 2; } - z2 = actor->currentPos.z + actor->headOffset.z + 10.0f; + z2 = actor->curPos.z + actor->headOffset.z + 10.0f; switch (script->functionTemp[0]) { case 1: @@ -3337,26 +3337,26 @@ ApiStatus BoostDefense(Evt* script, s32 isInitialCall) { defenseBoost = script->functionTemp[2]; flags = actor->flags; - x1 = actor->currentPos.x + actor->headOffset.x; + x1 = actor->curPos.x + actor->headOffset.x; if (flags & ACTOR_FLAG_UPSIDE_DOWN) { - y1 = actor->currentPos.y + actor->headOffset.y - actor->size.y / 2; + y1 = actor->curPos.y + actor->headOffset.y - actor->size.y / 2; } else if (!(flags & ACTOR_FLAG_8000)) { - y1 = actor->currentPos.y + actor->headOffset.y + actor->size.y / 2; + y1 = actor->curPos.y + actor->headOffset.y + actor->size.y / 2; } else { - y1 = actor->currentPos.y + actor->headOffset.y + actor->size.y; + y1 = actor->curPos.y + actor->headOffset.y + actor->size.y; } - z1 = actor->currentPos.z + actor->headOffset.z + 10.0f; + z1 = actor->curPos.z + actor->headOffset.z + 10.0f; flags2 = actor->flags; - x2 = actor->currentPos.x + actor->headOffset.x + actor->size.x / 2; + x2 = actor->curPos.x + actor->headOffset.x + actor->size.x / 2; if (flags2 & ACTOR_FLAG_UPSIDE_DOWN) { - y2 = actor->currentPos.y + actor->headOffset.y - actor->size.y; + y2 = actor->curPos.y + actor->headOffset.y - actor->size.y; } else if (!(flags2 & ACTOR_FLAG_8000)) { - y2 = actor->currentPos.y + actor->headOffset.y + actor->size.y; + y2 = actor->curPos.y + actor->headOffset.y + actor->size.y; } else { - y2 = actor->currentPos.y + actor->headOffset.y + actor->size.y * 2; + y2 = actor->curPos.y + actor->headOffset.y + actor->size.y * 2; } - z2 = actor->currentPos.z + actor->headOffset.z + 10.0f; + z2 = actor->curPos.z + actor->headOffset.z + 10.0f; switch (script->functionTemp[0]) { case 1: @@ -3459,15 +3459,15 @@ ApiStatus VanishActor(Evt* script, s32 isInitialCall) { vanished = script->functionTemp[2]; flags = actor->flags; - x = actor->currentPos.x + actor->headOffset.x; + x = actor->curPos.x + actor->headOffset.x; if (flags & ACTOR_FLAG_UPSIDE_DOWN) { - y = actor->currentPos.y + actor->headOffset.y - actor->size.y / 2; + y = actor->curPos.y + actor->headOffset.y - actor->size.y / 2; } else if (!(flags & ACTOR_FLAG_8000)) { - y = actor->currentPos.y + actor->headOffset.y + actor->size.y / 2; + y = actor->curPos.y + actor->headOffset.y + actor->size.y / 2; } else { - y = actor->currentPos.y + actor->headOffset.y + actor->size.y; + y = actor->curPos.y + actor->headOffset.y + actor->size.y; } - z = actor->currentPos.z + actor->headOffset.z + 10.0f; + z = actor->curPos.z + actor->headOffset.z + 10.0f; switch (script->functionTemp[0]) { case 1: @@ -3565,15 +3565,15 @@ ApiStatus ElectrifyActor(Evt* script, s32 isInitialCall) { electrified = script->functionTemp[2]; flags = actor->flags; - x = actor->currentPos.x + actor->headOffset.x; + x = actor->curPos.x + actor->headOffset.x; if (flags & ACTOR_FLAG_UPSIDE_DOWN) { - y = actor->currentPos.y + actor->headOffset.y - actor->size.y / 2; + y = actor->curPos.y + actor->headOffset.y - actor->size.y / 2; } else if (!(flags & ACTOR_FLAG_8000)) { - y = actor->currentPos.y + actor->headOffset.y + actor->size.y / 2; + y = actor->curPos.y + actor->headOffset.y + actor->size.y / 2; } else { - y = actor->currentPos.y + actor->headOffset.y + actor->size.y; + y = actor->curPos.y + actor->headOffset.y + actor->size.y; } - z = actor->currentPos.z + actor->headOffset.z + 10.0f; + z = actor->curPos.z + actor->headOffset.z + 10.0f; switch (script->functionTemp[0]) { case 1: @@ -3671,26 +3671,26 @@ ApiStatus HealActor(Evt* script, s32 isInitialCall) { hpBoost = script->functionTemp[2]; flags = actor->flags; - x1 = actor->currentPos.x + actor->headOffset.x; + x1 = actor->curPos.x + actor->headOffset.x; if (flags & ACTOR_FLAG_UPSIDE_DOWN) { - y1 = actor->currentPos.y + actor->headOffset.y - actor->size.y / 2; + y1 = actor->curPos.y + actor->headOffset.y - actor->size.y / 2; } else if (!(flags & ACTOR_FLAG_8000)) { - y1 = actor->currentPos.y + actor->headOffset.y + actor->size.y / 2; + y1 = actor->curPos.y + actor->headOffset.y + actor->size.y / 2; } else { - y1 = actor->currentPos.y + actor->headOffset.y + actor->size.y; + y1 = actor->curPos.y + actor->headOffset.y + actor->size.y; } - z1 = actor->currentPos.z + actor->headOffset.z + 10.0f; + z1 = actor->curPos.z + actor->headOffset.z + 10.0f; flags2 = actor->flags; - x2 = actor->currentPos.x + actor->headOffset.x + actor->size.x / 2; + x2 = actor->curPos.x + actor->headOffset.x + actor->size.x / 2; if (flags2 & ACTOR_FLAG_UPSIDE_DOWN) { - y2 = actor->currentPos.y + actor->headOffset.y - actor->size.y; + y2 = actor->curPos.y + actor->headOffset.y - actor->size.y; } else if (!(flags2 & ACTOR_FLAG_8000)) { - y2 = actor->currentPos.y + actor->headOffset.y + actor->size.y; + y2 = actor->curPos.y + actor->headOffset.y + actor->size.y; } else { - y2 = actor->currentPos.y + actor->headOffset.y + actor->size.y * 2; + y2 = actor->curPos.y + actor->headOffset.y + actor->size.y * 2; } - z2 = actor->currentPos.z + actor->headOffset.z + 10.0f; + z2 = actor->curPos.z + actor->headOffset.z + 10.0f; switch (script->functionTemp[0]) { case 1: @@ -3709,9 +3709,9 @@ ApiStatus HealActor(Evt* script, s32 isInitialCall) { if (script->functionTemp[3] == 0) { btl_cam_use_preset(BTL_CAM_DEFAULT); btl_cam_move(15); - actor->currentHP += hpBoost; - if (actor->maxHP < actor->currentHP) { - actor->currentHP = actor->maxHP; + actor->curHP += hpBoost; + if (actor->maxHP < actor->curHP) { + actor->curHP = actor->maxHP; } show_recovery_shimmer(x1, y1, z1, hpBoost); script->functionTemp[3] = 15; diff --git a/src/ad90_len_2880.c b/src/ad90_len_2880.c index 391f9e1341..fbb59d9376 100644 --- a/src/ad90_len_2880.c +++ b/src/ad90_len_2880.c @@ -33,25 +33,25 @@ void update_camera_mode_6(Camera* camera) { camera->lookAt_obj.x = camera->lookAt_obj_target.x + camera->targetPos.x; camera->lookAt_obj.y = camera->lookAt_obj_target.y + camera->targetPos.y + camera->auxBoomZOffset / 256.0; camera->lookAt_obj.z = camera->lookAt_obj_target.z + camera->targetPos.z; - camera->trueRotation.x = camera->auxBoomYaw; - camera->currentBoomYaw = camera->auxBoomPitch; - camera->currentBoomLength = camera->auxBoomLength; + camera->trueRot.x = camera->auxBoomYaw; + camera->curBoomYaw = camera->auxBoomPitch; + camera->curBoomLength = camera->auxBoomLength; camera->vfov = (10000 / camera->lookAt_dist) / 4; - boomYaw = DEG_TO_RAD(camera->currentBoomYaw); + boomYaw = DEG_TO_RAD(camera->curBoomYaw); sinBoom = sin_rad(boomYaw); cosBoom = cos_rad(boomYaw); deltaX = 0.0f; deltaY = 0.0f; - deltaZ = camera->currentBoomLength; + deltaZ = camera->curBoomLength; deltaX2 = 0.0f; deltaY2 = 0.0f; boomYaw = deltaX = -deltaY2; - deltaZ2 = camera->currentBoomLength; + deltaZ2 = camera->curBoomLength; new_var = boomYaw; deltaX = deltaX2; deltaY = cosBoom * deltaY2 + deltaZ2 * sinBoom; deltaZ = sinBoom * new_var + deltaZ2 * cosBoom; - boomYaw = DEG_TO_RAD(camera->trueRotation.x); + boomYaw = DEG_TO_RAD(camera->trueRot.x); sinBoom = sin_rad(boomYaw); cosBoom = cos_rad(boomYaw); deltaZ2 = cosBoom * deltaX - deltaZ * sinBoom; @@ -62,13 +62,13 @@ void update_camera_mode_6(Camera* camera) { camera->lookAt_eye.y = camera->lookAt_obj.y + deltaY2; camera->lookAt_eye.z = camera->lookAt_obj.z + deltaZ2; } - camera->currentYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z); + camera->curYaw = atan2(camera->lookAt_eye.x, camera->lookAt_eye.z, camera->lookAt_obj.x, camera->lookAt_obj.z); deltaX = camera->lookAt_obj.x - camera->lookAt_eye.x; deltaY = camera->lookAt_obj.y - camera->lookAt_eye.y; deltaZ = camera->lookAt_obj.z - camera->lookAt_eye.z; - camera->currentBlendedYawNegated = -atan2(0.0f, 0.0f, deltaX, deltaZ); + camera->curBlendedYawNegated = -atan2(0.0f, 0.0f, deltaX, deltaZ); planarDist = sqrtf(SQ(deltaX) + SQ(deltaZ)); - camera->currentPitch = atan2(0.0f, 0.0f, deltaY, -planarDist); + camera->curPitch = atan2(0.0f, 0.0f, deltaY, -planarDist); gBattleStatus.camLookatObjPos.x = camera->lookAt_obj.x; gBattleStatus.camLookatObjPos.y = camera->lookAt_obj.y; gBattleStatus.camLookatObjPos.z = camera->lookAt_obj.z; diff --git a/src/audio.h b/src/audio.h index 24d1976128..d32b02f514 100644 --- a/src/audio.h +++ b/src/audio.h @@ -364,7 +364,7 @@ typedef union VolumeField { // envelope related? typedef struct Fade { - /* 0x0 */ VolumeField currentVolume; + /* 0x0 */ VolumeField curVolume; /* 0x4 */ s32 fadeStep; /* 0x8 */ s16 targetVolume; /* 0xA */ s16 fadeTime; @@ -439,7 +439,7 @@ typedef struct AuFxBus { /* 0x02 */ char unk_02[0x2]; /* 0x04 */ AuFX* fxL; /* 0x08 */ AuFX* fxR; - /* 0x0C */ u8 currentEffectType; + /* 0x0C */ u8 curEffectType; /* 0x0D */ char unk_0D[0x3]; /* 0x10 */ struct AuPVoice* head; /* 0x14 */ struct AuPVoice* tail; @@ -620,7 +620,7 @@ typedef struct SoundPlayer { /* 0x92 */ s16 coarseTune; /* 0x94 */ s8 fineTune; /* 0x95 */ char unk_05; - /* 0x96 */ u16 currentSoundID; + /* 0x96 */ u16 curSoundID; /* 0x98 */ u8 priority; /* 0x99 */ u8 exclusiveID; /* 0x9A */ u8 sfxParamsFlags; @@ -658,7 +658,7 @@ typedef struct SoundManagerCustomCmdList { typedef struct SoundManager { /* 0x000 */ struct AuGlobals* globals; - /* 0x004 */ struct AuVoice* currentVoice; + /* 0x004 */ struct AuVoice* curVoice; /* 0x008 */ u8* sefData; /* 0x00C */ s32* normalSounds[8]; /* 0x02C */ s32* extraSounds; @@ -681,7 +681,7 @@ typedef struct SoundManager { /* 0x0BC */ u8 priority; /* 0x0BD */ u8 sfxPlayerSelector; /* 0x0BE */ u8 busId; - /* 0x0BF */ u8 currentVoiceIndex; + /* 0x0BF */ u8 curVoiceIndex; /* 0x0C0 */ u8 state; /* 0x0C1 */ char unk_C1[0x1]; /* 0x0C2 */ SoundSFXEntry soundQueue[16]; @@ -701,13 +701,13 @@ typedef struct SoundInstance { /* 0x0C */ u8 volume; /* 0x0D */ u8 pan; /* 0x0E */ s16 pitchShift; - /* 0x10 */ Vec3f position; + /* 0x10 */ Vec3f pos; } SoundInstance; // size = 0x1C typedef struct AlternatingSoundSet { /* 0x00 */ s32* sounds; /* 0x04 */ s16 soundCount; - /* 0x06 */ s16 currentIndex; + /* 0x06 */ s16 curIndex; } AlternatingSoundSet; // size = 0x08 typedef struct AuVoice { diff --git a/src/audio/28910_len_5090.c b/src/audio/28910_len_5090.c index fc5b0070ce..b56c8ca37b 100644 --- a/src/audio/28910_len_5090.c +++ b/src/audio/28910_len_5090.c @@ -295,7 +295,7 @@ AuResult func_8004DB4C(SongUpdateEvent* s) { if (player->unk_220 == 0) { player->fadeInfo.targetVolume = volume; player->fadeInfo.fadeTime = (duration * 1000) / AU_5750; - player->fadeInfo.fadeStep = ((volume << 0x10) - player->fadeInfo.currentVolume.s32) / player->fadeInfo.fadeTime; + player->fadeInfo.fadeStep = ((volume << 0x10) - player->fadeInfo.curVolume.s32) / player->fadeInfo.fadeTime; player->fadeInfo.variation = s->variation; if (s->unk14 == 1) { player->fadeSongName = songName; @@ -616,9 +616,9 @@ void au_bgm_update_fade(BGMPlayer* player) { player->fadeInfo.fadeTime--; if (player->fadeInfo.fadeTime != 0) { - player->fadeInfo.currentVolume.s32 += player->fadeInfo.fadeStep; + player->fadeInfo.curVolume.s32 += player->fadeInfo.fadeStep; } else { - player->fadeInfo.currentVolume.s32 = player->fadeInfo.targetVolume << 16; + player->fadeInfo.curVolume.s32 = player->fadeInfo.targetVolume << 16; if (player->fadeInfo.onCompleteCallback != NULL) { player->fadeInfo.onCompleteCallback(); @@ -626,7 +626,7 @@ void au_bgm_update_fade(BGMPlayer* player) { if (player->fadeSongName != 0) { func_8004DC80(player->fadeSongName); - } else if (player->fadeInfo.currentVolume.s32 == 0) { + } else if (player->fadeInfo.curVolume.s32 == 0) { au_bgm_stop_player(player); } } @@ -634,7 +634,7 @@ void au_bgm_update_fade(BGMPlayer* player) { } void func_8004E444(BGMPlayer* arg0) { - u16 mult = (arg0->fadeInfo.currentVolume.u16 * arg0->fadeInfo.volScale.u16) >> 15; + u16 mult = (arg0->fadeInfo.curVolume.u16 * arg0->fadeInfo.volScale.u16) >> 15; s32 i; for (i = 0; i < ARRAY_COUNT(arg0->effectIndices); i++) { @@ -1788,7 +1788,7 @@ void au_BGMCmd_FF(BGMPlayer* player, BGMPlayerTrack* track) { for (i = 0; i < ARRAY_COUNT(player->soundManager->bgmSounds); i++) { if ((player->soundManager->bgmSounds[i].unk_0) == 0) { player->soundManager->bgmSounds[i].unk_0 = arg1; - player->soundManager->bgmSounds[i].volume = ((player->fadeInfo.currentVolume.u16 * player->fadeInfo.volScale.u16) + 0x7FFF) >> 0x17; + player->soundManager->bgmSounds[i].volume = ((player->fadeInfo.curVolume.u16 * player->fadeInfo.volScale.u16) + 0x7FFF) >> 0x17; break; } } diff --git a/src/audio/2e230_len_2190.c b/src/audio/2e230_len_2190.c index 48bf51b5e8..73c051f5c8 100644 --- a/src/audio/2e230_len_2190.c +++ b/src/audio/2e230_len_2190.c @@ -212,7 +212,7 @@ void au_update_clients_2(void) { if (sfxManager->fadeInfo.fadeTime != 0) { au_fade_update(&sfxManager->fadeInfo); - au_fade_set_volume(sfxManager->busId, sfxManager->fadeInfo.currentVolume.u16, sfxManager->busVolume); + au_fade_set_volume(sfxManager->busId, sfxManager->fadeInfo.curVolume.u16, sfxManager->busVolume); } sfxManager->nextUpdateCounter -= sfxManager->nextUpdateStep; @@ -398,12 +398,12 @@ f32 au_compute_pitch_ratio(s32 pitch) { } void au_fade_init(Fade* fade, s32 time, s32 startValue, s32 endValue) { - fade->currentVolume.s32 = startValue * 0x10000; + fade->curVolume.s32 = startValue * 0x10000; fade->targetVolume = endValue; if (time != 0) { fade->fadeTime = (time * 1000) / AU_5750; - fade->fadeStep = (endValue * 0x10000 - fade->currentVolume.s32) / fade->fadeTime; + fade->fadeStep = (endValue * 0x10000 - fade->curVolume.s32) / fade->fadeTime; } else { fade->fadeTime = 1; fade->fadeStep = 0; @@ -422,9 +422,9 @@ void au_fade_update(Fade* fade) { fade->fadeTime--; if ((fade->fadeTime << 0x10) != 0) { - fade->currentVolume.s32 += fade->fadeStep; + fade->curVolume.s32 += fade->fadeStep; } else { - fade->currentVolume.s32 = fade->targetVolume << 0x10; + fade->curVolume.s32 = fade->targetVolume << 0x10; if (fade->onCompleteCallback != NULL) { fade->onCompleteCallback(); fade->fadeStep = 0; @@ -441,7 +441,7 @@ void func_80053AC8(Fade* fade) { if (fade->fadeTime == 0) { fade->fadeTime = 1; fade->fadeStep = 0; - fade->targetVolume = fade->currentVolume.u16; + fade->targetVolume = fade->curVolume.u16; } } diff --git a/src/audio/31650.c b/src/audio/31650.c index 660eb91850..6dfaadc2ec 100644 --- a/src/audio/31650.c +++ b/src/audio/31650.c @@ -88,11 +88,11 @@ void au_driver_init(AuSynDriver* driver, ALConfig* config) { fxBus->head = NULL; fxBus->tail = NULL; fxBus->gain = 0x7FFF; - fxBus->currentEffectType = AU_FX_NONE; + fxBus->curEffectType = AU_FX_NONE; fxBus->fxL = alHeapAlloc(heap, 1, sizeof(*fxBus->fxL)); fxBus->fxR = alHeapAlloc(heap, 1, sizeof(*fxBus->fxR)); - func_80058E84(fxBus->fxL, fxBus->currentEffectType, heap); - func_80058E84(fxBus->fxR, fxBus->currentEffectType, heap); + func_80058E84(fxBus->fxL, fxBus->curEffectType, heap); + func_80058E84(fxBus->fxR, fxBus->curEffectType, heap); } gSynDriverPtr->savedMainOut = alHeapAlloc(heap, 2 * AUDIO_SAMPLES, 2); @@ -174,7 +174,7 @@ Acmd* alAudioFrame(Acmd* cmdList, s32* cmdLen, s16* outBuf, s32 outLen) { } while (next != NULL); fxBus->tail = NULL; } - if (fxBus->currentEffectType != AU_FX_NONE) { + if (fxBus->curEffectType != AU_FX_NONE) { cmdListPos = au_pull_fx(fxBus->fxL, cmdListPos, N_AL_AUX_L_OUT, 0); cmdListPos = au_pull_fx(fxBus->fxR, cmdListPos, N_AL_AUX_R_OUT, 0); } @@ -279,7 +279,7 @@ u16 au_bus_get_volume(u8 index, u16 arg1) { void au_bus_set_effect(u8 index, u8 effectType) { AuFxBus* fxBus = &gSynDriverPtr->fxBus[index]; - fxBus->currentEffectType = effectType; + fxBus->curEffectType = effectType; func_8005904C(fxBus->fxL, effectType); func_8005904C(fxBus->fxR, effectType); } diff --git a/src/audio/sfx.c b/src/audio/sfx.c index c341f1fe72..97f23a97bc 100644 --- a/src/audio/sfx.c +++ b/src/audio/sfx.c @@ -339,7 +339,7 @@ void sfx_update_env_sound_params(void) { for (i = 0; i < MAX_SOUND_INSTANCES; i++, sound++) { if (sound->flags & SOUND_INSTANCE_FLAG_ACTIVE) { if (sound->flags & SOUND_INSTANCE_FLAG_POSITION_CHANGED) { - sfx_get_spatialized_sound_params(sound->position.x, sound->position.y, sound->position.z, &volume, &pan, sound->sourceFlags); + sfx_get_spatialized_sound_params(sound->pos.x, sound->pos.y, sound->pos.z, &volume, &pan, sound->sourceFlags); sound->volume = volume; sound->pan = pan; } @@ -418,9 +418,9 @@ void sfx_register_looping_sound_at_position(s32 soundID, s32 flags, f32 x, f32 y } sound->sourceFlags = flags; - sound->position.x = x; - sound->position.y = y; - sound->position.z = z; + sound->pos.x = x; + sound->pos.y = y; + sound->pos.z = z; sound->soundID = soundID; sound->flags |= SOUND_INSTANCE_FLAG_ACTIVE | SOUND_INSTANCE_FLAG_POSITION_CHANGED; @@ -435,9 +435,9 @@ s32 sfx_adjust_env_sound_pos(s32 soundID, s32 sourceFlags, f32 x, f32 y, f32 z) } sound->sourceFlags = sourceFlags; - sound->position.x = x; - sound->position.y = y; - sound->position.z = z; + sound->pos.x = x; + sound->pos.y = y; + sound->pos.z = z; sound->soundID = soundID; sound->flags |= SOUND_INSTANCE_FLAG_ACTIVE | SOUND_INSTANCE_FLAG_POSITION_CHANGED; return TRUE; @@ -478,10 +478,10 @@ void sfx_play_sound_with_params(s32 soundID, u8 volume, u8 pan, s16 pitchShift) case SOUND_TYPE_ALTERNATING: // 0xBxxxxxxx alternatingSet = &AlternatingSounds[soundIndex]; - if (alternatingSet->currentIndex >= alternatingSet->soundCount) { - alternatingSet->currentIndex = 0; + if (alternatingSet->curIndex >= alternatingSet->soundCount) { + alternatingSet->curIndex = 0; } - soundID = alternatingSet->sounds[alternatingSet->currentIndex++]; + soundID = alternatingSet->sounds[alternatingSet->curIndex++]; break; } } @@ -520,7 +520,7 @@ void sfx_play_sound(s32 soundID) { void sfx_play_sound_at_player(s32 soundID, s32 flags) { PlayerStatus* playerStatus = &gPlayerStatus; - sfx_play_sound_at_position(soundID, flags, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z); + sfx_play_sound_at_position(soundID, flags, playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z); } void sfx_play_sound_at_npc(s32 soundID, s32 flags, s32 npcID) { diff --git a/src/audio/sfx_player.c b/src/audio/sfx_player.c index da3f5fa05e..9a6fb2855e 100644 --- a/src/audio/sfx_player.c +++ b/src/audio/sfx_player.c @@ -480,7 +480,7 @@ void au_sfx_init(SoundManager* manager, u8 priority, u8 busId, AuGlobals* global au_sfx_set_state(manager, SND_MANAGER_STATE_ENABLED); au_sfx_clear_queue(manager); au_fade_init(&manager->fadeInfo, 0, 0x7FFF, 0x7FFF); - au_fade_set_volume(manager->busId, manager->fadeInfo.currentVolume.u16, manager->busVolume); + au_fade_set_volume(manager->busId, manager->fadeInfo.curVolume.u16, manager->busVolume); manager->lastCustomEffectIdx = 0xFF; manager->customReverbParams[0] = CUSTOM_SMALL_ROOM_PARAMS; @@ -589,7 +589,7 @@ void au_sfx_update_main(SoundManager* manager) { u16 sound2 = unkData->sound2; if (sound2 != 0) { for (j = 0; j < ARRAY_COUNT(manager->players); j++) { - if (manager->players[j].currentSoundID == sound2) { + if (manager->players[j].curSoundID == sound2) { newEntry.soundID = unkData->sound1; newEntry.upperSoundID = 0; newEntry.pitchShift = 0; @@ -718,7 +718,7 @@ void au_sfx_load_sound(SoundManager* manager, SoundSFXEntry* entry, SoundManager // check if any player is playing this sound for (playerIndex = 7; playerIndex >= 0; playerIndex--) { player = &manager->players[playerIndex]; - if (player->currentSoundID == soundIDLower) { + if (player->curSoundID == soundIDLower) { cond = TRUE; break; } @@ -755,7 +755,7 @@ void au_sfx_load_sound(SoundManager* manager, SoundSFXEntry* entry, SoundManager // check if any player is playing this sound for (playerIndex = 7; playerIndex >= 0; playerIndex--) { player = &manager->players[playerIndex]; - if (player->currentSoundID == soundIDLower) { + if (player->curSoundID == soundIDLower) { cond = TRUE; break; } @@ -796,7 +796,7 @@ void au_sfx_load_sound(SoundManager* manager, SoundSFXEntry* entry, SoundManager if (entry->upperSoundID != 0) { for (playerIndex = 0; playerIndex < 8; playerIndex++) { player = &manager->players[playerIndex]; - if (player->currentSoundID == entry->upperSoundID) { + if (player->curSoundID == entry->upperSoundID) { cond = TRUE; break; } @@ -819,7 +819,7 @@ void au_sfx_load_sound(SoundManager* manager, SoundSFXEntry* entry, SoundManager // check if any player is playing this sound for (playerIndex = soundInfo & 0x7; playerIndex >= 0; playerIndex--) { player = &manager->players[playerIndex]; - if (player->currentSoundID == soundIDLower) { + if (player->curSoundID == soundIDLower) { cond = TRUE; break; } @@ -955,7 +955,7 @@ static void au_sfx_play_sound(SoundManager* manager, SoundPlayer* player, s8* re player->loopIterCount = 0; player->delay = 1; player->playLength = 0; - player->currentSoundID = sfxEntry->soundID & SOUND_ID_LOWER; + player->curSoundID = sfxEntry->soundID & SOUND_ID_LOWER; player->priority = priority; player->exclusiveID = exclusiveID; player->envelopCustomPressProfile = NULL; @@ -1004,7 +1004,7 @@ static void au_sfx_set_triggers(SoundManager* manager, u32 soundID) { for (i = 0; i < ARRAY_COUNT(manager->players); i++) { SoundPlayer* player = &manager->players[i]; - if (player->currentSoundID == (soundID & SOUND_ID_LOWER)) { + if (player->curSoundID == (soundID & SOUND_ID_LOWER)) { player->triggers = triggers; } } @@ -1015,7 +1015,7 @@ static void au_sfx_stop_by_id(SoundManager* manager, u32 soundID) { for (i = 0; i < ARRAY_COUNT(manager->players); i++) { SoundPlayer* player = &manager->players[i]; - if (player->currentSoundID == (soundID & SOUND_ID_LOWER)) { + if (player->curSoundID == (soundID & SOUND_ID_LOWER)) { player->sefDataReadPos = BlankSEFData; player->alternativeDataPos = NULL; player->sfxParamsFlags = SFX_PARAM_MODE_SEQUENCE; @@ -1050,7 +1050,7 @@ static void au_sfx_set_modifiers(SoundManager* manager, SoundSFXEntry* sfxEntry) for (i = 0; i < ARRAY_COUNT(manager->players); i++) { SoundPlayer* player = &manager->players[i]; - if (player->currentSoundID == soundID) { + if (player->curSoundID == soundID) { au_sfx_set_player_modifiers(player, sfxEntry); } } @@ -1092,9 +1092,9 @@ s16 au_sfx_manager_update(SoundManager* manager) { player = &manager->players[i - manager->sfxPlayerSelector]; if (player->sefDataReadPos != NULL) { voice = &manager->globals->voices[i]; - manager->currentVoice = voice; + manager->curVoice = voice; if (voice->priority <= manager->priority) { - manager->currentVoiceIndex = i; + manager->curVoiceIndex = i; switch (player->sfxParamsFlags & SFX_PARAM_FLAG_MODE) { case SFX_PARAM_MODE_ADVANCED: au_sfx_update_basic(manager, player, voice, i); @@ -1107,7 +1107,7 @@ s16 au_sfx_manager_update(SoundManager* manager) { } } else { player->sefDataReadPos = NULL; - player->currentSoundID = 0; + player->curSoundID = 0; player->priority = 0; } } @@ -1126,7 +1126,7 @@ static void au_sfx_update_basic(SoundManager* manager, SoundPlayer* player, AuVo case SND_PLAYER_STATE_CONTINUE: if (voice->priority != manager->priority) { player->sefDataReadPos = NULL; - player->currentSoundID = 0; + player->curSoundID = 0; player->priority = 0; } else { if (!(player->sfxParamsFlags & SFX_PARAM_FLAG_PITCH)) { @@ -1198,7 +1198,7 @@ static void au_sfx_update_basic(SoundManager* manager, SoundPlayer* player, AuVo break; default: player->sefDataReadPos = NULL; - player->currentSoundID = 0; + player->curSoundID = 0; player->priority = 0; break; } @@ -1253,7 +1253,7 @@ static void au_sfx_update_sequence(SoundManager* manager, SoundPlayer* player, A au_reset_voice(voice, voiceIdx); } player->sefDataReadPos = NULL; - player->currentSoundID = 0; + player->curSoundID = 0; player->priority = 0; player->exclusiveID = 0; return; @@ -1513,7 +1513,7 @@ static void au_SEFCmd_06_FineTune(SoundManager* manager, SoundPlayer* player) { } static void au_SEFCmd_07_WaitForEnd(SoundManager* manager, SoundPlayer* player) { - if (manager->currentVoice->priority == manager->priority) { + if (manager->curVoice->priority == manager->priority) { player->delay = 2; player->sefDataReadPos--; } @@ -1614,9 +1614,9 @@ static void au_SEFCmd_0E_SetAlternativeSound(SoundManager* manager, SoundPlayer* } static void au_SEFCmd_0F_Stop(SoundManager* manager, SoundPlayer* player) { - AuVoice* voice = manager->currentVoice; + AuVoice* voice = manager->curVoice; if (voice->priority == manager->priority) { - au_reset_voice(voice, manager->currentVoiceIndex); + au_reset_voice(voice, manager->curVoiceIndex); } } diff --git a/src/background.c b/src/background.c index 417315ee2e..385df379ab 100644 --- a/src/background.c +++ b/src/background.c @@ -175,7 +175,7 @@ void appendGfx_background_texture(void) { } } - theta = clamp_angle(-cam->trueRotation.x); + theta = clamp_angle(-cam->trueRot.x); sinTheta = sin_deg(theta); cosTheta = cos_deg(theta); f5 = cosTheta * cam->lookAt_obj.x - sinTheta * cam->lookAt_obj.z + cam->leadAmount; diff --git a/src/battle/action_cmd/07.c b/src/battle/action_cmd/07.c index a31bcb3a83..fe80c8ccfa 100644 --- a/src/battle/action_cmd/07.c +++ b/src/battle/action_cmd/07.c @@ -139,7 +139,7 @@ void N(update)(void) { case 11: btl_set_popup_duration(99); - if (battleStatus->currentButtonsPressed & BUTTON_A) { + if (battleStatus->curButtonsPressed & BUTTON_A) { s32 fillAmt = battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 6; if (actionCommandStatus->unk_5D == 0) { diff --git a/src/battle/action_cmd/0A.c b/src/battle/action_cmd/0A.c index b90b1ad4b8..f8c296fb8c 100644 --- a/src/battle/action_cmd/0A.c +++ b/src/battle/action_cmd/0A.c @@ -106,7 +106,7 @@ void N(update)(void) { case 11: btl_set_popup_duration(99); - if (battleStatus->currentButtonsPressed & BUTTON_A) { + if (battleStatus->curButtonsPressed & BUTTON_A) { actionCommandStatus->barFillLevel += battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 15; } diff --git a/src/battle/action_cmd/air_lift.c b/src/battle/action_cmd/air_lift.c index 532461665c..914e6edefa 100644 --- a/src/battle/action_cmd/air_lift.c +++ b/src/battle/action_cmd/air_lift.c @@ -157,7 +157,7 @@ void N(update)(void) { } } - if (battleStatus->actionCommandMode != ACTION_COMMAND_MODE_NOT_LEARNED && (battleStatus->currentButtonsPressed & BUTTON_A)) { + if (battleStatus->actionCommandMode != ACTION_COMMAND_MODE_NOT_LEARNED && (battleStatus->curButtonsPressed & BUTTON_A)) { if (actionCommandStatus->unk_5A != 0) { s32 a = battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty]; s32 b = actionCommandStatus->unk_5A * 820; diff --git a/src/battle/action_cmd/air_raid.c b/src/battle/action_cmd/air_raid.c index fff5c36f40..1dc158781c 100644 --- a/src/battle/action_cmd/air_raid.c +++ b/src/battle/action_cmd/air_raid.c @@ -129,18 +129,18 @@ void N(update)(void) { } if (!actionCommandStatus->isBarFilled) { - if (battleStatus->currentButtonsDown & BUTTON_STICK_LEFT) { + if (battleStatus->curButtonsDown & BUTTON_STICK_LEFT) { actionCommandStatus->unk_5C = 1; } - if (!(battleStatus->currentButtonsDown & BUTTON_STICK_LEFT)) { + if (!(battleStatus->curButtonsDown & BUTTON_STICK_LEFT)) { if (actionCommandStatus->unk_5C != 0) { actionCommandStatus->barFillLevel += (battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 850) / 100; actionCommandStatus->unk_5C = 0; } } - if (battleStatus->currentButtonsPressed & BUTTON_STICK_RIGHT) { + if (battleStatus->curButtonsPressed & BUTTON_STICK_RIGHT) { actionCommandStatus->barFillLevel -= (battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 850) / 100; } } diff --git a/src/battle/action_cmd/body_slam.c b/src/battle/action_cmd/body_slam.c index da57bdfe81..9aeb3e2e4c 100644 --- a/src/battle/action_cmd/body_slam.c +++ b/src/battle/action_cmd/body_slam.c @@ -120,7 +120,7 @@ void N(update)(void) { case 11: btl_set_popup_duration(99); - if (battleStatus->currentButtonsDown & BUTTON_A) { + if (battleStatus->curButtonsDown & BUTTON_A) { actionCommandStatus->barFillLevel += 154; actionCommandStatus->thresholdLevel += 154; } else { diff --git a/src/battle/action_cmd/bomb.c b/src/battle/action_cmd/bomb.c index 5602720899..d9b9454eaf 100644 --- a/src/battle/action_cmd/bomb.c +++ b/src/battle/action_cmd/bomb.c @@ -120,7 +120,7 @@ void N(update)(void) { } } - if (battleStatus->currentButtonsPressed & BUTTON_A) { + if (battleStatus->curButtonsPressed & BUTTON_A) { switch (actionCommandStatus->targetWeakness) { case 0: { s32 fillOffset = battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 235 * 4; diff --git a/src/battle/action_cmd/dizzy_shell.c b/src/battle/action_cmd/dizzy_shell.c index 97c83159b8..ba69d789b8 100644 --- a/src/battle/action_cmd/dizzy_shell.c +++ b/src/battle/action_cmd/dizzy_shell.c @@ -120,7 +120,7 @@ void N(update)(void) { } } - if (battleStatus->currentButtonsPressed & BUTTON_A) { + if (battleStatus->curButtonsPressed & BUTTON_A) { s32 a = battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty]; s32 b = actionCommandStatus->targetWeakness * 850; s32 temp_v1_2 = (a * b) / 10000; diff --git a/src/battle/action_cmd/fire_shell.c b/src/battle/action_cmd/fire_shell.c index 768ded9a5e..a2bc4054de 100644 --- a/src/battle/action_cmd/fire_shell.c +++ b/src/battle/action_cmd/fire_shell.c @@ -118,16 +118,16 @@ void N(update)(void) { actionCommandStatus->barFillLevel = 0; } if (!actionCommandStatus->isBarFilled) { - if (battleStatus->currentButtonsDown & BUTTON_STICK_LEFT) { + if (battleStatus->curButtonsDown & BUTTON_STICK_LEFT) { actionCommandStatus->unk_5C = 1; } - if (!(battleStatus->currentButtonsDown & BUTTON_STICK_LEFT) && (actionCommandStatus->unk_5C != 0)) { + if (!(battleStatus->curButtonsDown & BUTTON_STICK_LEFT) && (actionCommandStatus->unk_5C != 0)) { actionCommandStatus->barFillLevel += (battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 950) / 100; actionCommandStatus->unk_5C = 0; } - if (battleStatus->currentButtonsPressed & BUTTON_STICK_RIGHT) { + if (battleStatus->curButtonsPressed & BUTTON_STICK_RIGHT) { actionCommandStatus->barFillLevel -= (battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 950) / 100; } } diff --git a/src/battle/action_cmd/flee.c b/src/battle/action_cmd/flee.c index 4fdee1b087..d9a804c965 100644 --- a/src/battle/action_cmd/flee.c +++ b/src/battle/action_cmd/flee.c @@ -142,7 +142,7 @@ void N(update)(void) { actionCommandStatus->state = 11; actionCommandStatus->frameCounter = actionCommandStatus->duration; case 11: - if (battleStatus->actionCommandMode != ACTION_COMMAND_MODE_NOT_LEARNED && (battleStatus->currentButtonsPressed & BUTTON_A)) { + if (battleStatus->actionCommandMode != ACTION_COMMAND_MODE_NOT_LEARNED && (battleStatus->curButtonsPressed & BUTTON_A)) { actionCommandStatus->barFillLevel += (battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 180 / 100); } if (actionCommandStatus->barFillLevel >= 10000) { diff --git a/src/battle/action_cmd/hammer.c b/src/battle/action_cmd/hammer.c index cb0378cf8f..a486b5c8ff 100644 --- a/src/battle/action_cmd/hammer.c +++ b/src/battle/action_cmd/hammer.c @@ -196,7 +196,7 @@ void N(update)(void) { } actionCommandStatus->frameCounter = 0; - if (!(battleStatus->currentButtonsDown & BUTTON_STICK_LEFT) && battleStatus->actionCommandMode < ACTION_COMMAND_MODE_TUTORIAL) { + if (!(battleStatus->curButtonsDown & BUTTON_STICK_LEFT) && battleStatus->actionCommandMode < ACTION_COMMAND_MODE_TUTORIAL) { actionCommandStatus->hammerMissedStart = TRUE; } actionCommandStatus->state = 11; @@ -254,7 +254,7 @@ void N(update)(void) { phi_s0 = 0; } - if (!(battleStatus->currentButtonsDown & BUTTON_STICK_LEFT) && + if (!(battleStatus->curButtonsDown & BUTTON_STICK_LEFT) && phi_s0 == 0 && actionCommandStatus->autoSucceed == 0 && battleStatus->actionCommandMode < ACTION_COMMAND_MODE_TUTORIAL) diff --git a/src/battle/action_cmd/jump.c b/src/battle/action_cmd/jump.c index 823d30f218..74da979759 100644 --- a/src/battle/action_cmd/jump.c +++ b/src/battle/action_cmd/jump.c @@ -123,7 +123,7 @@ void N(update)(void) { if (((actionCommandStatus->prepareTime - temp_s0_3) - 2) <= 0) { hud_element_set_script(actionCommandStatus->hudElements[0], &HES_AButtonDown); } - if ((battleStatus->currentButtonsPressed & BUTTON_A) && (actionCommandStatus->autoSucceed == 0)) { + if ((battleStatus->curButtonsPressed & BUTTON_A) && (actionCommandStatus->autoSucceed == 0)) { actionCommandStatus->wrongButtonPressed = TRUE; battleStatus->unk_86 = -1; } @@ -153,7 +153,7 @@ void N(update)(void) { } if (battleStatus->actionSuccess < 0) { - if (((battleStatus->currentButtonsPressed & BUTTON_A)&& + if (((battleStatus->curButtonsPressed & BUTTON_A)&& !actionCommandStatus->wrongButtonPressed) || (actionCommandStatus->autoSucceed != 0)) { battleStatus->actionSuccess = 1; diff --git a/src/battle/action_cmd/power_shock.c b/src/battle/action_cmd/power_shock.c index 4182a11735..799da1d7f8 100644 --- a/src/battle/action_cmd/power_shock.c +++ b/src/battle/action_cmd/power_shock.c @@ -181,7 +181,7 @@ void N(update)(void) { } } - if (battleStatus->currentButtonsPressed & BUTTON_A) { + if (battleStatus->curButtonsPressed & BUTTON_A) { phi_a1 = actionCommandStatus->targetWeakness; if (phi_a1 != 0) { s32 a = battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty]; diff --git a/src/battle/action_cmd/smack.c b/src/battle/action_cmd/smack.c index 123658b4f3..0e42b48057 100644 --- a/src/battle/action_cmd/smack.c +++ b/src/battle/action_cmd/smack.c @@ -151,11 +151,11 @@ void N(update)(void) { } if (!actionCommandStatus->isBarFilled) { - if (battleStatus->currentButtonsDown & BUTTON_STICK_LEFT) { + if (battleStatus->curButtonsDown & BUTTON_STICK_LEFT) { actionCommandStatus->unk_5C = TRUE; } - if (!(battleStatus->currentButtonsDown & BUTTON_STICK_LEFT) && actionCommandStatus->unk_5C) { + if (!(battleStatus->curButtonsDown & BUTTON_STICK_LEFT) && actionCommandStatus->unk_5C) { if (actionCommandStatus->targetWeakness == 0) { actionCommandStatus->barFillLevel += battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 13; } else { @@ -165,7 +165,7 @@ void N(update)(void) { actionCommandStatus->unk_5C = 0; } - if (battleStatus->currentButtonsPressed & BUTTON_STICK_RIGHT) { + if (battleStatus->curButtonsPressed & BUTTON_STICK_RIGHT) { actionCommandStatus->barFillLevel -= battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 11; } } diff --git a/src/battle/action_cmd/spiny_surge.c b/src/battle/action_cmd/spiny_surge.c index 0f2123587d..722871c3f1 100644 --- a/src/battle/action_cmd/spiny_surge.c +++ b/src/battle/action_cmd/spiny_surge.c @@ -156,10 +156,10 @@ void N(update)(void) { } if (!actionCommandStatus->isBarFilled) { - if (battleStatus->currentButtonsPressed & BUTTON_STICK_LEFT) { + if (battleStatus->curButtonsPressed & BUTTON_STICK_LEFT) { actionCommandStatus->barFillLevel += (battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 1250) / 100; } - if (battleStatus->currentButtonsPressed & BUTTON_STICK_RIGHT) { + if (battleStatus->curButtonsPressed & BUTTON_STICK_RIGHT) { actionCommandStatus->barFillLevel -= (battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 1250) / 100; } } @@ -185,13 +185,13 @@ void N(update)(void) { } if (!(D_802A98C0 & BUTTON_STICK_LEFT) && - !(battleStatus->currentButtonsDown & BUTTON_STICK_RIGHT) && + !(battleStatus->curButtonsDown & BUTTON_STICK_RIGHT) && actionCommandStatus->unk_5C == 1) { actionCommandStatus->unk_5C = 2; } battleStatus->actionSuccess = actionCommandStatus->barFillLevel / 100; - D_802A98C0 = battleStatus->currentButtonsDown; + D_802A98C0 = battleStatus->curButtonsDown; battleStatus->actionResult = actionCommandStatus->unk_5C; sfx_adjust_env_sound_params(SOUND_80000041, 0, 0, battleStatus->actionSuccess * 12); diff --git a/src/battle/action_cmd/spook.c b/src/battle/action_cmd/spook.c index 30c703e3d8..a05a75b81a 100644 --- a/src/battle/action_cmd/spook.c +++ b/src/battle/action_cmd/spook.c @@ -124,11 +124,11 @@ void N(update)(void) { if (!actionCommandStatus->isBarFilled) { if (actionCommandStatus->targetWeakness != 0) { - if (battleStatus->currentButtonsDown & BUTTON_STICK_LEFT) { + if (battleStatus->curButtonsDown & BUTTON_STICK_LEFT) { actionCommandStatus->unk_5C = TRUE; } - if (!(battleStatus->currentButtonsDown & BUTTON_STICK_LEFT) && actionCommandStatus->unk_5C) { + if (!(battleStatus->curButtonsDown & BUTTON_STICK_LEFT) && actionCommandStatus->unk_5C) { s32 a = battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty]; s32 b = actionCommandStatus->targetWeakness * 850; @@ -136,18 +136,18 @@ void N(update)(void) { actionCommandStatus->unk_5C = 0; } - if (battleStatus->currentButtonsPressed & BUTTON_STICK_RIGHT) { + if (battleStatus->curButtonsPressed & BUTTON_STICK_RIGHT) { s32 a = battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty]; s32 b = actionCommandStatus->targetWeakness * 850; actionCommandStatus->barFillLevel -= (a * b) / 10000; } } else { - if (battleStatus->currentButtonsDown & BUTTON_STICK_LEFT) { + if (battleStatus->curButtonsDown & BUTTON_STICK_LEFT) { actionCommandStatus->unk_5C = TRUE; } - if (!(battleStatus->currentButtonsDown & BUTTON_STICK_LEFT) && actionCommandStatus->unk_5C) { + if (!(battleStatus->curButtonsDown & BUTTON_STICK_LEFT) && actionCommandStatus->unk_5C) { actionCommandStatus->barFillLevel += 100; if (actionCommandStatus->barFillLevel >= 500) { actionCommandStatus->barFillLevel = 500; @@ -155,7 +155,7 @@ void N(update)(void) { actionCommandStatus->unk_5C = 0; } - if (battleStatus->currentButtonsPressed & BUTTON_STICK_RIGHT) { + if (battleStatus->curButtonsPressed & BUTTON_STICK_RIGHT) { actionCommandStatus->barFillLevel -= 100; } } diff --git a/src/battle/action_cmd/squirt.c b/src/battle/action_cmd/squirt.c index c5b0a6e605..f831f2d832 100644 --- a/src/battle/action_cmd/squirt.c +++ b/src/battle/action_cmd/squirt.c @@ -131,7 +131,7 @@ void N(update)(void) { cutoff = actionCommandStatus->mashMeterCutoffs[actionCommandStatus->mashMeterIntervals]; temp = actionCommandStatus->barFillLevel / cutoff; if (actionCommandStatus->unk_5C == 0) { - if (!(battleStatus->currentButtonsDown & BUTTON_A)) { + if (!(battleStatus->curButtonsDown & BUTTON_A)) { actionCommandStatus->barFillLevel -= D_802A9760_42A480[temp / 20]; if (actionCommandStatus->barFillLevel < 0) { actionCommandStatus->barFillLevel = 0; diff --git a/src/battle/action_cmd/stop_leech.c b/src/battle/action_cmd/stop_leech.c index abf09f3b68..be1402bd46 100644 --- a/src/battle/action_cmd/stop_leech.c +++ b/src/battle/action_cmd/stop_leech.c @@ -110,7 +110,7 @@ void N(update)(void) { case 11: btl_set_popup_duration(99); if (!actionCommandStatus->berserkerEnabled) { - if (battleStatus->currentButtonsPressed & BUTTON_A) { + if (battleStatus->curButtonsPressed & BUTTON_A) { actionCommandStatus->barFillLevel += battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty]; } } else { diff --git a/src/battle/action_cmd/whirlwind.c b/src/battle/action_cmd/whirlwind.c index 7f4e70c95d..0433dc676c 100644 --- a/src/battle/action_cmd/whirlwind.c +++ b/src/battle/action_cmd/whirlwind.c @@ -222,7 +222,7 @@ void N(update)(void) { } if (!actionCommandStatus->berserkerEnabled) { - if (battleStatus->currentButtonsPressed & BUTTON_A) { + if (battleStatus->curButtonsPressed & BUTTON_A) { s32 amt; if (actionCommandStatus->targetWeakness == 0) { diff --git a/src/battle/area/dig/script/dig_01.c b/src/battle/area/dig/script/dig_01.c index 226a08e0ce..dfde3ff4d6 100644 --- a/src/battle/area/dig/script/dig_01.c +++ b/src/battle/area/dig/script/dig_01.c @@ -12,7 +12,7 @@ API_CALLABLE(N(SetupDemoPlayerMove)) { battleStatus->moveCategory = BTL_MENU_TYPE_SMASH; battleStatus->selectedMoveID = MOVE_HAMMER1; battleStatus->moveArgument = gCurrentEncounter.hitTier; - battleStatus->currentTargetListFlags = gMoveTable[MOVE_HAMMER1].flags; + battleStatus->curTargetListFlags = gMoveTable[MOVE_HAMMER1].flags; player_create_target_list(player); player->selectedTargetIndex = 0; diff --git a/src/battle/area/dig/script/dig_02.c b/src/battle/area/dig/script/dig_02.c index 778a07cb78..b863571843 100644 --- a/src/battle/area/dig/script/dig_02.c +++ b/src/battle/area/dig/script/dig_02.c @@ -10,7 +10,7 @@ API_CALLABLE(N(SetupDemoPlayerMove)) { battleStatus->moveCategory = BTL_MENU_TYPE_JUMP; battleStatus->selectedMoveID = MOVE_POWER_BOUNCE; battleStatus->moveArgument = gCurrentEncounter.hitTier; - battleStatus->currentTargetListFlags = gMoveTable[MOVE_POWER_BOUNCE].flags; + battleStatus->curTargetListFlags = gMoveTable[MOVE_POWER_BOUNCE].flags; player_create_target_list(player); player->selectedTargetIndex = 1; diff --git a/src/battle/area/dig/script/dig_03.c b/src/battle/area/dig/script/dig_03.c index 647a48a7f7..1a31999647 100644 --- a/src/battle/area/dig/script/dig_03.c +++ b/src/battle/area/dig/script/dig_03.c @@ -10,7 +10,7 @@ API_CALLABLE(N(SetupDemoPlayerMove)) { battleStatus->moveCategory = BTL_MENU_TYPE_ABILITY; battleStatus->moveArgument = 0; battleStatus->selectedMoveID = MOVE_SHELL_SHOT; - battleStatus->currentTargetListFlags = gMoveTable[MOVE_SHELL_SHOT].flags; + battleStatus->curTargetListFlags = gMoveTable[MOVE_SHELL_SHOT].flags; player_create_target_list(partner); partner->selectedTargetIndex = 0; diff --git a/src/battle/area/dig/script/dig_04.c b/src/battle/area/dig/script/dig_04.c index 3a67d2e79d..f2d4af2aa5 100644 --- a/src/battle/area/dig/script/dig_04.c +++ b/src/battle/area/dig/script/dig_04.c @@ -13,9 +13,9 @@ API_CALLABLE(N(SetupDemoPlayerMove)) { battleStatus->moveArgument = ITEM_THUNDER_RAGE; selectedItemID = battleStatus->moveArgument; battleStatus->selectedMoveID = 0; - battleStatus->currentAttackElement = 0; + battleStatus->curAttackElement = 0; playerData->invItems[0] = selectedItemID; - battleStatus->currentTargetListFlags = gItemTable[playerData->invItems[0]].targetFlags | TARGET_FLAG_8000; + battleStatus->curTargetListFlags = gItemTable[playerData->invItems[0]].targetFlags | TARGET_FLAG_8000; player_create_target_list(player); player->selectedTargetIndex = 0; diff --git a/src/battle/area/hos/actor/goombario_tutor.c b/src/battle/area/hos/actor/goombario_tutor.c index 1789274b5b..aa110975de 100644 --- a/src/battle/area/hos/actor/goombario_tutor.c +++ b/src/battle/area/hos/actor/goombario_tutor.c @@ -281,7 +281,7 @@ EvtScript N(takeTurn_80219444) = { API_CALLABLE(func_80218000_47F0B0) { PlayerData* playerData = &gPlayerData; - playerData->currentPartner = PARTNER_GOOMBARIO; + playerData->curPartner = PARTNER_GOOMBARIO; return ApiStatus_DONE2; } diff --git a/src/battle/area/kkj/actor/kammy_koopa.c b/src/battle/area/kkj/actor/kammy_koopa.c index 6f9e3bbdc5..3f80b5ae3c 100644 --- a/src/battle/area/kkj/actor/kammy_koopa.c +++ b/src/battle/area/kkj/actor/kammy_koopa.c @@ -190,7 +190,7 @@ API_CALLABLE(N(BlockAppear)) { entity->scale.x = (60 - script->functionTemp[1]) / 60.0f; entity->scale.y = (60 - script->functionTemp[1]) / 60.0f; entity->scale.z = (60 - script->functionTemp[1]) / 60.0f; - entity->rotation.y = (1.0f - cos_rad(entity->scale.y * PI)) * 1080.0f * 0.5f; + entity->rot.y = (1.0f - cos_rad(entity->scale.y * PI)) * 1080.0f * 0.5f; script->functionTemp[1]--; if (script->functionTemp[1] == -1) { diff --git a/src/battle/area/kzn2/actor/lava_piranha.c b/src/battle/area/kzn2/actor/lava_piranha.c index 200bd51c24..b929a05d4c 100644 --- a/src/battle/area/kzn2/actor/lava_piranha.c +++ b/src/battle/area/kzn2/actor/lava_piranha.c @@ -521,7 +521,7 @@ void N(worker_render_piranha_vines)(void) { renderTask.appendGfx = &func_8021835C_59EA3C; renderTask.appendGfxArg = 0; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_SURFACE_OPA; queue_render_task(&renderTask); diff --git a/src/battle/area/mac/actor/lee.c b/src/battle/area/mac/actor/lee.c index eae8c6ebdf..39b36db452 100644 --- a/src/battle/area/mac/actor/lee.c +++ b/src/battle/area/mac/actor/lee.c @@ -2892,8 +2892,8 @@ API_CALLABLE(func_80219188_465618) { wattEffectData->angle = 0; wattEffectData->unk_0C = TRUE; wattEffectData->unk_10 = 0; - wattEffectData->effect1 = fx_static_status(0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z, (actor->debuff != STATUS_KEY_SHRINK) ? 1.0f : 0.4f, 5, 0); - wattEffectData->effect2 = fx_static_status(1, actor->currentPos.x, NPC_DISPOSE_POS_Y, actor->currentPos.z, (actor->debuff != STATUS_KEY_SHRINK) ? 1.0f : 0.4f, 5, 0); + wattEffectData->effect1 = fx_static_status(0, actor->curPos.x, actor->curPos.y, actor->curPos.z, (actor->debuff != STATUS_KEY_SHRINK) ? 1.0f : 0.4f, 5, 0); + wattEffectData->effect2 = fx_static_status(1, actor->curPos.x, NPC_DISPOSE_POS_Y, actor->curPos.z, (actor->debuff != STATUS_KEY_SHRINK) ? 1.0f : 0.4f, 5, 0); wattEffectData->flags = TRUE; wattEffectData->debuff = actor->debuff; } @@ -2906,9 +2906,9 @@ API_CALLABLE(func_80219188_465618) { } actor->verticalRenderOffset = sin_rad(DEG_TO_RAD(wattEffectData->angle)) * 3.0f; - x = actor->currentPos.x + actor->headOffset.x; - y = actor->currentPos.y + actor->headOffset.y + actor->verticalRenderOffset + (actor->debuff != STATUS_KEY_SHRINK ? 12.0 : 4.800000000000001); // 4.8 doesn't match - z = actor->currentPos.z + actor->headOffset.z; + x = actor->curPos.x + actor->headOffset.x; + y = actor->curPos.y + actor->headOffset.y + actor->verticalRenderOffset + (actor->debuff != STATUS_KEY_SHRINK ? 12.0 : 4.800000000000001); // 4.8 doesn't match + z = actor->curPos.z + actor->headOffset.z; if (wattEffectData->unk_0C) { switch (wattEffectData->unk_10) { case 0: @@ -4119,8 +4119,8 @@ Formation N(formation_lakilester) = { API_CALLABLE(func_802197B8_465C48) { Bytecode* args = script->ptrReadPos; - evt_set_variable(script, *args++, gPlayerData.currentPartner); - evt_set_variable(script, *args++, gPlayerData.partners[gPlayerData.currentPartner].level); + evt_set_variable(script, *args++, gPlayerData.curPartner); + evt_set_variable(script, *args++, gPlayerData.partners[gPlayerData.curPartner].level); return ApiStatus_DONE2; } diff --git a/src/battle/area/omo3/actor/big_lantern_ghost.c b/src/battle/area/omo3/actor/big_lantern_ghost.c index 3e8aef13f9..c146b5360f 100644 --- a/src/battle/area/omo3/actor/big_lantern_ghost.c +++ b/src/battle/area/omo3/actor/big_lantern_ghost.c @@ -191,16 +191,16 @@ API_CALLABLE(N(update_effect)) { effectData = effect->data.bulbGlow; } - posX = actor->currentPos.x; - posY = actor->currentPos.y; - posZ = actor->currentPos.z; + posX = actor->curPos.x; + posY = actor->curPos.y; + posZ = actor->curPos.z; - rotX = actor->rotation.x; - rotY = actor->rotation.y + actor->yaw; - rotZ = actor->rotation.z; + rotX = actor->rot.x; + rotY = actor->rot.y + actor->yaw; + rotZ = actor->rot.z; actorPart = get_actor_part(actor, 1); - if (actorPart->currentAnimation == ANIM_BigLanternGhost_Anim0C) { + if (actorPart->curAnimation == ANIM_BigLanternGhost_Anim0C) { spr_get_comp_position(actor->partsTable->spriteInstanceID, 0, &partX, &partY, &partZ); } else { spr_get_comp_position(actor->partsTable->spriteInstanceID, 1, &partX, &partY, &partZ); diff --git a/src/battle/area/pra2/actor/crystal_bit.c b/src/battle/area/pra2/actor/crystal_bit.c index 2f1881026b..025551ed99 100644 --- a/src/battle/area/pra2/actor/crystal_bit.c +++ b/src/battle/area/pra2/actor/crystal_bit.c @@ -229,13 +229,13 @@ API_CALLABLE(UpdateCrystalBitEffect) { effect->data.miscParticles->scaleX = actorPart->scale.x * 24.0f; effect->data.miscParticles->scaleY = actorPart->scale.y * 24.0f; if (actorPart->flags & ACTOR_PART_FLAG_INVISIBLE) { - effect->data.miscParticles->pos.x = actor->currentPos.x; + effect->data.miscParticles->pos.x = actor->curPos.x; effect->data.miscParticles->pos.y = NPC_DISPOSE_POS_Y; - effect->data.miscParticles->pos.z = actor->currentPos.z; + effect->data.miscParticles->pos.z = actor->curPos.z; } else { - effect->data.miscParticles->pos.x = actor->currentPos.x; - effect->data.miscParticles->pos.y = actor->currentPos.y; - effect->data.miscParticles->pos.z = actor->currentPos.z; + effect->data.miscParticles->pos.x = actor->curPos.x; + effect->data.miscParticles->pos.y = actor->curPos.y; + effect->data.miscParticles->pos.z = actor->curPos.z; } return ApiStatus_BLOCK; diff --git a/src/battle/area/trd_part_2/actor/common_koopa_bros.inc.c b/src/battle/area/trd_part_2/actor/common_koopa_bros.inc.c index 6ce1733696..e2f530b95b 100644 --- a/src/battle/area/trd_part_2/actor/common_koopa_bros.inc.c +++ b/src/battle/area/trd_part_2/actor/common_koopa_bros.inc.c @@ -156,9 +156,9 @@ API_CALLABLE(N(SpawnSpinEffect)) { s32 posZ = evt_get_variable(script, *args++); s32 duration = evt_get_variable(script, *args++); - N(DummyPlayerStatus).position.x = posX; - N(DummyPlayerStatus).position.y = posY - 10.0f; - N(DummyPlayerStatus).position.z = posZ; + N(DummyPlayerStatus).pos.x = posX; + N(DummyPlayerStatus).pos.y = posY - 10.0f; + N(DummyPlayerStatus).pos.z = posZ; fx_effect_46(6, &N(DummyPlayerStatus), 1.0f, duration); return ApiStatus_DONE2; diff --git a/src/battle/battle.c b/src/battle/battle.c index 35f0cb4459..a5d12a755e 100644 --- a/src/battle/battle.c +++ b/src/battle/battle.c @@ -188,7 +188,7 @@ void setup_demo_player(void) { playerData->partners[i].level = 2; } - playerData->currentPartner = PARTNER_GOOMBARIO; + playerData->curPartner = PARTNER_GOOMBARIO; for (i = 0; i < ARRAY_COUNT(playerData->badges); i++) { playerData->badges[i] = 0; @@ -257,25 +257,25 @@ void load_demo_battle(u32 index) { case 1: setup_demo_player(); mode = 0; - playerData->currentPartner = PARTNER_BOW; + playerData->curPartner = PARTNER_BOW; battleID = BTL_DIG_FORMATION_01; break; case 2: setup_demo_player(); mode = 0; - playerData->currentPartner = PARTNER_PARAKARRY; + playerData->curPartner = PARTNER_PARAKARRY; gGameStatusPtr->demoFlags |= 2; battleID = BTL_DIG_FORMATION_02; break; case 3: setup_demo_player(); mode = 0; - playerData->currentPartner = PARTNER_WATT; + playerData->curPartner = PARTNER_WATT; battleID = BTL_DIG_FORMATION_03; break; case 4: setup_demo_player(); - playerData->currentPartner = PARTNER_KOOPER; + playerData->curPartner = PARTNER_KOOPER; gGameStatusPtr->demoFlags |= 4; mode = 0; battleID = BTL_DIG_FORMATION_04; diff --git a/src/battle/common/actor/duplighost.inc.c b/src/battle/common/actor/duplighost.inc.c index d90ec37cbc..5efb933c9a 100644 --- a/src/battle/common/actor/duplighost.inc.c +++ b/src/battle/common/actor/duplighost.inc.c @@ -566,8 +566,8 @@ Formation N(formation_lakilester) = { API_CALLABLE(N(GetPartnerAndLevel)) { Bytecode* args = script->ptrReadPos; - evt_set_variable(script, *args++, gPlayerData.currentPartner); - evt_set_variable(script, *args++, gPlayerData.partners[gPlayerData.currentPartner].level); + evt_set_variable(script, *args++, gPlayerData.curPartner); + evt_set_variable(script, *args++, gPlayerData.partners[gPlayerData.curPartner].level); return ApiStatus_DONE2; } diff --git a/src/battle/common/actor/duplighost/ghost_kooper.inc.c b/src/battle/common/actor/duplighost/ghost_kooper.inc.c index 74cd029df2..c86e5cd931 100644 --- a/src/battle/common/actor/duplighost/ghost_kooper.inc.c +++ b/src/battle/common/actor/duplighost/ghost_kooper.inc.c @@ -126,22 +126,22 @@ API_CALLABLE(N(kooper_UnkActorPosFunc)) { ActorState* actorState = &actor->state; if (isInitialCall) { - actor->state.currentPos.x = actor->currentPos.x; - actor->state.currentPos.y = actor->currentPos.y; - actor->state.currentPos.z = actor->currentPos.z; + actor->state.curPos.x = actor->curPos.x; + actor->state.curPos.y = actor->curPos.y; + actor->state.curPos.z = actor->curPos.z; } - add_xz_vec3f(&actorState->currentPos, actor->state.speed, actor->state.angle); + add_xz_vec3f(&actorState->curPos, actor->state.speed, actor->state.angle); if (actor->state.speed < 4.0f) { - play_movement_dust_effects(0, actor->state.currentPos.x, actor->state.currentPos.y, actor->state.currentPos.z, actor->state.angle); + play_movement_dust_effects(0, actor->state.curPos.x, actor->state.curPos.y, actor->state.curPos.z, actor->state.angle); } else { - play_movement_dust_effects(1, actor->state.currentPos.x, actor->state.currentPos.y, actor->state.currentPos.z, actor->state.angle); + play_movement_dust_effects(1, actor->state.curPos.x, actor->state.curPos.y, actor->state.curPos.z, actor->state.angle); } actorState->speed /= 1.5; - actor->currentPos.x = actorState->currentPos.x; - actor->currentPos.y = actorState->currentPos.y; - actor->currentPos.z = actorState->currentPos.z; + actor->curPos.x = actorState->curPos.x; + actor->curPos.y = actorState->curPos.y; + actor->curPos.z = actorState->curPos.z; if (actorState->speed < 1.0) { return ApiStatus_DONE2; diff --git a/src/battle/common/actor/duplighost/ghost_watt.inc.c b/src/battle/common/actor/duplighost/ghost_watt.inc.c index e67f6f4bf9..19785c7e32 100644 --- a/src/battle/common/actor/duplighost/ghost_watt.inc.c +++ b/src/battle/common/actor/duplighost/ghost_watt.inc.c @@ -25,8 +25,8 @@ API_CALLABLE(N(UnkWattEffectFunc1)) { wattEffectData->angle = 0; wattEffectData->unk_0C = TRUE; wattEffectData->unk_10 = 0; - wattEffectData->effect1 = fx_static_status(0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z, (actor->debuff != STATUS_KEY_SHRINK) ? 1.0f : 0.4f, 5, 0); - wattEffectData->effect2 = fx_static_status(1, actor->currentPos.x, -1000.0f, actor->currentPos.z, (actor->debuff != STATUS_KEY_SHRINK) ? 1.0f : 0.4f, 5, 0); + wattEffectData->effect1 = fx_static_status(0, actor->curPos.x, actor->curPos.y, actor->curPos.z, (actor->debuff != STATUS_KEY_SHRINK) ? 1.0f : 0.4f, 5, 0); + wattEffectData->effect2 = fx_static_status(1, actor->curPos.x, -1000.0f, actor->curPos.z, (actor->debuff != STATUS_KEY_SHRINK) ? 1.0f : 0.4f, 5, 0); wattEffectData->flags = TRUE; wattEffectData->debuff = actor->debuff; } @@ -39,9 +39,9 @@ API_CALLABLE(N(UnkWattEffectFunc1)) { } actor->verticalRenderOffset = sin_rad(DEG_TO_RAD(wattEffectData->angle)) * 3.0f; - x = actor->currentPos.x + actor->headOffset.x; - y = actor->currentPos.y + actor->headOffset.y + actor->verticalRenderOffset + (actor->debuff != STATUS_KEY_SHRINK ? 12.0 : 4.800000000000001); // 4.8 doesn't match - z = actor->currentPos.z + actor->headOffset.z; + x = actor->curPos.x + actor->headOffset.x; + y = actor->curPos.y + actor->headOffset.y + actor->verticalRenderOffset + (actor->debuff != STATUS_KEY_SHRINK ? 12.0 : 4.800000000000001); // 4.8 doesn't match + z = actor->curPos.z + actor->headOffset.z; if (wattEffectData->unk_0C) { switch (wattEffectData->unk_10) { case 0: diff --git a/src/battle/common/actor/groove_guy.inc.c b/src/battle/common/actor/groove_guy.inc.c index 5e2c7748cb..d8810d93cd 100644 --- a/src/battle/common/actor/groove_guy.inc.c +++ b/src/battle/common/actor/groove_guy.inc.c @@ -612,9 +612,9 @@ s32 func_8021878C_512D5C(Evt* script, s32 isInitialCall) { temp_f20 = evt_get_float_variable(script, *args++); temp_v0 = evt_get_variable(script, *args++); - D_802310D0.position.x = x; - D_802310D0.position.y = y; - D_802310D0.position.z = z; + D_802310D0.pos.x = x; + D_802310D0.pos.y = y; + D_802310D0.pos.z = z; fx_effect_46(6, &D_802310D0, temp_f20, temp_v0); return ApiStatus_DONE2; diff --git a/src/battle/common/move/ItemRefund.inc.c b/src/battle/common/move/ItemRefund.inc.c index 3d67700b27..c4a7e2ada3 100644 --- a/src/battle/common/move/ItemRefund.inc.c +++ b/src/battle/common/move/ItemRefund.inc.c @@ -9,7 +9,7 @@ API_CALLABLE(N(GiveRefund)) { Actor* player = gBattleStatus.playerActor; s32 sellValue = gItemTable[battleStatus->moveArgument].sellValue; f32 posX; - f32 posY = player->currentPos.y + player->size.y; + f32 posY = player->curPos.y + player->size.y; f32 posZ; f32 angle = 0.0f; s32 delayTime = 0; @@ -25,8 +25,8 @@ API_CALLABLE(N(GiveRefund)) { sellValue = (sellValue * 75 + 99) / 100; for (i = 0; i < sellValue; i++) { - posX = player->currentPos.x; - posZ = player->currentPos.z; + posX = player->curPos.x; + posZ = player->curPos.z; make_item_entity(ITEM_COIN, posX, posY, posZ, ITEM_SPAWN_MODE_TOSS_FADE1, 1 + 3 * i, angle, 0); add_coins(1); @@ -36,9 +36,9 @@ API_CALLABLE(N(GiveRefund)) { delayTime = (i * 3) + 30; - posX = player->currentPos.x; - posY = player->currentPos.y; - posZ = player->currentPos.z; + posX = player->curPos.x; + posY = player->curPos.y; + posZ = player->curPos.z; get_screen_coords(gCurrentCameraID, posX, posY, posZ, &iconX, &iconY, &iconZ); diff --git a/src/battle/common/move/StarBeamSupport.inc.c b/src/battle/common/move/StarBeamSupport.inc.c index baa9c44376..0a3baa6a4c 100644 --- a/src/battle/common/move/StarBeamSupport.inc.c +++ b/src/battle/common/move/StarBeamSupport.inc.c @@ -323,15 +323,15 @@ API_CALLABLE(N(ProcessPeachStarBeam)) { return ApiStatus_DONE2; } get_actor_part(target, player->targetPartIndex); - targetPosX = target->currentPos.x + target->headOffset.x; + targetPosX = target->curPos.x + target->headOffset.x; if (target->flags & ACTOR_FLAG_UPSIDE_DOWN) { - targetPosY = target->currentPos.y + target->headOffset.y - target->size.y; + targetPosY = target->curPos.y + target->headOffset.y - target->size.y; } else if (!(target->flags & ACTOR_FLAG_8000)) { - targetPosY = target->currentPos.y + target->headOffset.y + target->size.y; + targetPosY = target->curPos.y + target->headOffset.y + target->size.y; } else { - targetPosY = target->currentPos.y + target->headOffset.y + target->size.y * 2; + targetPosY = target->curPos.y + target->headOffset.y + target->size.y * 2; } - targetPosZ = target->currentPos.z + target->headOffset.z; + targetPosZ = target->curPos.z + target->headOffset.z; } else { targetPosX = 64.0f; targetPosY = 80.0f; @@ -387,13 +387,13 @@ API_CALLABLE(N(ProcessPeachStarBeam)) { switch (script->functionTemp[0]) { case PEACH_STAR_BEAM_CREATE_EFFECT: - currentPosX = player->currentPos.x; - currentPosY = player->currentPos.y + player->size.y + 30.0f; - currentPosZ = player->currentPos.z; + currentPosX = player->curPos.x; + currentPosY = player->curPos.y + player->size.y + 30.0f; + currentPosZ = player->curPos.z; - playerState->currentPos.x = currentPosX; - playerState->currentPos.y = currentPosY + 150.0f; - playerState->currentPos.z = currentPosZ; + playerState->curPos.x = currentPosX; + playerState->curPos.y = currentPosY + 150.0f; + playerState->curPos.z = currentPosZ; playerState->goalPos.x = currentPosX; playerState->goalPos.y = currentPosY; @@ -404,12 +404,12 @@ API_CALLABLE(N(ProcessPeachStarBeam)) { } else { N(effect) = fx_peach_star_beam(1, currentPosX, currentPosY, currentPosZ, 1.0f, 0); } - playerState->distance = 48.0f; + playerState->dist = 48.0f; N(effect)->data.peachStarBeam->unk_3C = 0; - N(effect)->data.peachStarBeam->circleRadius = playerState->distance; + N(effect)->data.peachStarBeam->circleRadius = playerState->dist; N(effect)->data.peachStarBeam->beamAlpha = 0; N(effect)->data.peachStarBeam->twinkYOffset = 30.0f; - N(effect)->data.peachStarBeam->rotationSpeed = 5.0f; + N(effect)->data.peachStarBeam->rotSpeed = 5.0f; for (i = 0; i < ARRAY_COUNT(N(miscParticlesTimeLeft)); i++) { N(miscParticlesTimeLeft)[i] = rand_int(20); } @@ -423,12 +423,12 @@ API_CALLABLE(N(ProcessPeachStarBeam)) { script->functionTemp[0] = PEACH_STAR_BEAM_SPIRITS_APPEAR; break; case PEACH_STAR_BEAM_SPIRITS_APPEAR: - playerState->currentPos.y += (playerState->goalPos.y - playerState->currentPos.y) / 10.0f; - N(effect)->data.peachStarBeam->circleCenter.x = playerState->currentPos.x; - N(effect)->data.peachStarBeam->circleCenter.y = playerState->currentPos.y; - N(effect)->data.peachStarBeam->circleCenter.z = playerState->currentPos.z; + playerState->curPos.y += (playerState->goalPos.y - playerState->curPos.y) / 10.0f; + N(effect)->data.peachStarBeam->circleCenter.x = playerState->curPos.x; + N(effect)->data.peachStarBeam->circleCenter.y = playerState->curPos.y; + N(effect)->data.peachStarBeam->circleCenter.z = playerState->curPos.z; N(effect)->data.peachStarBeam->unk_3C = 0; - N(effect)->data.peachStarBeam->circleRadius = playerState->distance; + N(effect)->data.peachStarBeam->circleRadius = playerState->dist; N(effect)->data.peachStarBeam->beamAlpha = 0; if (script->functionTemp[1] == 0) { script->functionTemp[1] = 20; @@ -448,8 +448,8 @@ API_CALLABLE(N(ProcessPeachStarBeam)) { } break; case PEACH_STAR_BEAM_SHRINK_CIRCLE: - playerState->distance += (24.0f - playerState->distance) * 0.125f; - N(effect)->data.peachStarBeam->circleRadius = playerState->distance; + playerState->dist += (24.0f - playerState->dist) * 0.125f; + N(effect)->data.peachStarBeam->circleRadius = playerState->dist; if (script->functionTemp[1] == 0) { playerState->goalPos.x = targetPosX; playerState->goalPos.y = targetPosY; @@ -470,45 +470,45 @@ API_CALLABLE(N(ProcessPeachStarBeam)) { break; case PEACH_STAR_BEAM_FLY_TO_TARGET: cond = FALSE; - playerState->distance += (48.0f - playerState->distance) * 0.25f; - N(effect)->data.peachStarBeam->circleRadius = playerState->distance; + playerState->dist += (48.0f - playerState->dist) * 0.25f; + N(effect)->data.peachStarBeam->circleRadius = playerState->dist; for (i = 0; i < 2; i++) { if (i != 0) { spirit = &effectData->spirits[i]; if (N(spiritsFlyDelay)[i] < 0) { - currentPosX = playerState->currentPos.x; - currentPosY = playerState->currentPos.y; - currentPosZ = playerState->currentPos.z; + currentPosX = playerState->curPos.x; + currentPosY = playerState->curPos.y; + currentPosZ = playerState->curPos.z; goalPosX = playerState->goalPos.x; goalPosY = playerState->goalPos.y; goalPosZ = playerState->goalPos.z; - playerState->currentPos.x += goalPosX - currentPosX; - playerState->currentPos.y += goalPosY - currentPosY; - playerState->currentPos.z += goalPosZ - currentPosZ; + playerState->curPos.x += goalPosX - currentPosX; + playerState->curPos.y += goalPosY - currentPosY; + playerState->curPos.z += goalPosZ - currentPosZ; } else { cond = TRUE; if (N(spiritsFlyDelay)[i] != 0) { N(spiritsFlyDelay)[i]--; } else { - currentPosX = playerState->currentPos.x; - currentPosY = playerState->currentPos.y; - currentPosZ = playerState->currentPos.z; + currentPosX = playerState->curPos.x; + currentPosY = playerState->curPos.y; + currentPosZ = playerState->curPos.z; goalPosX = playerState->goalPos.x; goalPosY = playerState->goalPos.y; goalPosZ = playerState->goalPos.z; dist = dist2D(currentPosX, currentPosZ, goalPosX, goalPosZ); - playerState->currentPos.x += (goalPosX - currentPosX) / N(spiritsMoveTime)[i]; - playerState->currentPos.y += (goalPosY - currentPosY) / N(spiritsMoveTime)[i]; - playerState->currentPos.z += (goalPosZ - currentPosZ) / N(spiritsMoveTime)[i]; + playerState->curPos.x += (goalPosX - currentPosX) / N(spiritsMoveTime)[i]; + playerState->curPos.y += (goalPosY - currentPosY) / N(spiritsMoveTime)[i]; + playerState->curPos.z += (goalPosZ - currentPosZ) / N(spiritsMoveTime)[i]; if (N(spiritsMoveTime)[i] == 1) { N(spiritsFlyDelay)[i] = -1; - playerState->currentPos.x = goalPosX; - playerState->currentPos.y = goalPosY; - playerState->currentPos.z = goalPosZ; + playerState->curPos.x = goalPosX; + playerState->curPos.y = goalPosY; + playerState->curPos.z = goalPosZ; } else { - playerState->currentPos.y += dist / 60.0f; + playerState->curPos.y += dist / 60.0f; } N(spiritsMoveTime)[i]--; } @@ -516,22 +516,22 @@ API_CALLABLE(N(ProcessPeachStarBeam)) { } } - N(effect)->data.peachStarBeam->circleCenter.x = playerState->currentPos.x; - N(effect)->data.peachStarBeam->circleCenter.y = playerState->currentPos.y; - N(effect)->data.peachStarBeam->circleCenter.z = playerState->currentPos.z; - N(effect)->data.peachStarBeam->pos.x = playerState->currentPos.x; + N(effect)->data.peachStarBeam->circleCenter.x = playerState->curPos.x; + N(effect)->data.peachStarBeam->circleCenter.y = playerState->curPos.y; + N(effect)->data.peachStarBeam->circleCenter.z = playerState->curPos.z; + N(effect)->data.peachStarBeam->pos.x = playerState->curPos.x; N(effect)->data.peachStarBeam->pos.y = 0.0f; - N(effect)->data.peachStarBeam->pos.z = playerState->currentPos.z; + N(effect)->data.peachStarBeam->pos.z = playerState->curPos.z; if (!cond) { - playerState->currentPos.x = playerState->goalPos.x; - playerState->currentPos.y = playerState->goalPos.y; - playerState->currentPos.z = playerState->goalPos.z; - N(effect)->data.peachStarBeam->circleCenter.x = playerState->currentPos.x; - N(effect)->data.peachStarBeam->circleCenter.y = playerState->currentPos.y; - N(effect)->data.peachStarBeam->circleCenter.z = playerState->currentPos.z; - N(effect)->data.peachStarBeam->pos.x = playerState->currentPos.x; + playerState->curPos.x = playerState->goalPos.x; + playerState->curPos.y = playerState->goalPos.y; + playerState->curPos.z = playerState->goalPos.z; + N(effect)->data.peachStarBeam->circleCenter.x = playerState->curPos.x; + N(effect)->data.peachStarBeam->circleCenter.y = playerState->curPos.y; + N(effect)->data.peachStarBeam->circleCenter.z = playerState->curPos.z; + N(effect)->data.peachStarBeam->pos.x = playerState->curPos.x; N(effect)->data.peachStarBeam->pos.y = 0.0f; - N(effect)->data.peachStarBeam->pos.z = playerState->currentPos.z; + N(effect)->data.peachStarBeam->pos.z = playerState->curPos.z; effectData = N(effect)->data.peachStarBeam; for (i = 0; i < ARRAY_COUNT(effectData->spirits); i++) { if (script->functionTemp[2] != 0 || i != 0) { @@ -562,9 +562,9 @@ API_CALLABLE(N(ProcessPeachStarBeam)) { } newScript = start_script(&N(802A33A8), EVT_PRIORITY_A, 0); - newScript->varTable[0] = playerState->currentPos.x; - newScript->varTable[1] = playerState->currentPos.y * 0.5f; - newScript->varTable[2] = playerState->currentPos.z; + newScript->varTable[0] = playerState->curPos.x; + newScript->varTable[1] = playerState->curPos.y * 0.5f; + newScript->varTable[2] = playerState->curPos.z; newScript->varTable[10] = script->functionTemp[2]; do {} while (0); // required to match diff --git a/src/battle/common/stage/lib/DripVolumes.inc.c b/src/battle/common/stage/lib/DripVolumes.inc.c index e4dd3737e7..2bf1a74c72 100644 --- a/src/battle/common/stage/lib/DripVolumes.inc.c +++ b/src/battle/common/stage/lib/DripVolumes.inc.c @@ -18,9 +18,9 @@ API_CALLABLE(N(CheckDripCollisionWithActors)) { actor = battleStatus->playerActor; if (actor != NULL) { - xDiff = actor->currentPos.x - model->center.x; - yDiff = actor->currentPos.y + actor->size.y - 1.5f - model->center.y; - zDiff = actor->currentPos.z - model->center.z; + xDiff = actor->curPos.x - model->center.x; + yDiff = actor->curPos.y + actor->size.y - 1.5f - model->center.y; + zDiff = actor->curPos.z - model->center.z; temp = sqrtf(SQ(xDiff) + SQ(zDiff)); if (yDiff > 0.0f && yDiff < actor->size.y && temp < actor->size.x * 0.5f) { @@ -31,9 +31,9 @@ API_CALLABLE(N(CheckDripCollisionWithActors)) { actor = battleStatus->partnerActor; if (actor != NULL) { - xDiff = actor->currentPos.x - model->center.x; - yDiff = actor->currentPos.y + actor->size.y - 1.5f - model->center.y; - zDiff = actor->currentPos.z - model->center.z; + xDiff = actor->curPos.x - model->center.x; + yDiff = actor->curPos.y + actor->size.y - 1.5f - model->center.y; + zDiff = actor->curPos.z - model->center.z; temp = sqrtf(SQ(xDiff) + SQ(zDiff)); if (yDiff > 0.0f && yDiff < actor->size.y && temp < actor->size.x * 0.5f) { @@ -48,9 +48,9 @@ API_CALLABLE(N(CheckDripCollisionWithActors)) { actor = battleStatus->enemyActors[i]; if (actor != NULL && !(actor->flags & ACTOR_FLAG_DISABLED)) { - xDiff = actor->currentPos.x - model->center.x; - yDiff = actor->currentPos.y + actor->size.y - 1.5f - model->center.y; - zDiff = actor->currentPos.z - model->center.z; + xDiff = actor->curPos.x - model->center.x; + yDiff = actor->curPos.y + actor->size.y - 1.5f - model->center.y; + zDiff = actor->curPos.z - model->center.z; temp = sqrtf(SQ(xDiff) + SQ(zDiff)); if (yDiff > 0.0f && yDiff < actor->size.y && temp < actor->size.x * 0.5f) { @@ -61,9 +61,9 @@ API_CALLABLE(N(CheckDripCollisionWithActors)) { for (part = actor->partsTable; part != NULL; part = part->nextPart) { if (!(part->flags & ACTOR_PART_FLAG_INVISIBLE)) { if (part->flags & ACTOR_PART_FLAG_USE_ABSOLUTE_POSITION) { - xDiff = part->currentPos.x - model->center.x; - yDiff = part->currentPos.y + part->size.y - 1.5f - model->center.y; - zDiff = part->currentPos.z - model->center.z; + xDiff = part->curPos.x - model->center.x; + yDiff = part->curPos.y + part->size.y - 1.5f - model->center.y; + zDiff = part->curPos.z - model->center.z; temp = sqrtf(SQ(xDiff) + SQ(zDiff)); if (yDiff > 0.0f && yDiff < part->size.y && temp < part->size.x * 0.5f) { diff --git a/src/battle/move/hammer/spin_smash.c b/src/battle/move/hammer/spin_smash.c index 0eff0756d1..bed85034d5 100644 --- a/src/battle/move/hammer/spin_smash.c +++ b/src/battle/move/hammer/spin_smash.c @@ -7,9 +7,9 @@ API_CALLABLE(func_802A1000_737890) { BattleStatus* battleStatus = &gBattleStatus; Actor* playerActor = battleStatus->playerActor; - f32 xPos = playerActor->currentPos.x + 20.0f; - f32 yPos = playerActor->currentPos.y + 15.0f; - f32 zPos = playerActor->currentPos.z + 5.0f; + f32 xPos = playerActor->curPos.x + 20.0f; + f32 yPos = playerActor->curPos.y + 15.0f; + f32 zPos = playerActor->curPos.z + 5.0f; fx_stars_spread(0, xPos, yPos, zPos, 6, 20); @@ -19,9 +19,9 @@ API_CALLABLE(func_802A1000_737890) { API_CALLABLE(func_802A1074_737904) { BattleStatus* battleStatus = &gBattleStatus; Actor* playerActor = battleStatus->playerActor; - f32 xPos = playerActor->currentPos.x + 20.0f; - f32 yPos = playerActor->currentPos.y + 15.0f; - f32 zPos = playerActor->currentPos.z + 5.0f; + f32 xPos = playerActor->curPos.x + 20.0f; + f32 yPos = playerActor->curPos.y + 15.0f; + f32 zPos = playerActor->curPos.z + 5.0f; fx_steam_burst(0, xPos, yPos, zPos, 1.0f, 20); diff --git a/src/battle/move/item/food.c b/src/battle/move/item/food.c index 365f47887f..c5e2d94da9 100644 --- a/src/battle/move/item/food.c +++ b/src/battle/move/item/food.c @@ -17,9 +17,9 @@ API_CALLABLE(N(func_802A123C_73330C)) { s32 c = evt_get_variable(script, *args++); ItemEntity* item = get_item_entity(script->varTable[14]); - item->position.x = a; - item->position.y = b; - item->position.z = c; + item->pos.x = a; + item->pos.y = b; + item->pos.z = c; return ApiStatus_DONE2; } diff --git a/src/battle/move/item/life_shroom.c b/src/battle/move/item/life_shroom.c index 6a1fe52b38..560476c08a 100644 --- a/src/battle/move/item/life_shroom.c +++ b/src/battle/move/item/life_shroom.c @@ -17,9 +17,9 @@ API_CALLABLE(N(func_802A123C_72E76C)) { s32 c = evt_get_variable(script, *args++); ItemEntity* item = get_item_entity(script->varTable[14]); - item->position.x = a; - item->position.y = b; - item->position.z = c; + item->pos.x = a; + item->pos.y = b; + item->pos.z = c; return ApiStatus_DONE2; } diff --git a/src/battle/move/item/mushroom.c b/src/battle/move/item/mushroom.c index b96ea4604b..8472f4f472 100644 --- a/src/battle/move/item/mushroom.c +++ b/src/battle/move/item/mushroom.c @@ -17,9 +17,9 @@ API_CALLABLE(N(func_802A123C_715A8C)) { s32 c = evt_get_variable(script, *args++); ItemEntity* item = get_item_entity(script->varTable[14]); - item->position.x = a; - item->position.y = b; - item->position.z = c; + item->pos.x = a; + item->pos.y = b; + item->pos.z = c; return ApiStatus_DONE2; } diff --git a/src/battle/move/item/pow_block.c b/src/battle/move/item/pow_block.c index 284a7c5511..8cede60fe7 100644 --- a/src/battle/move/item/pow_block.c +++ b/src/battle/move/item/pow_block.c @@ -17,10 +17,10 @@ API_CALLABLE(N(func_802A123C_718A8C)) { if (player->scalingFactor == 1.0) { s32 var = script->varTable[10]; get_entity_by_index(var); - collisionStatus->currentCeiling = var | COLLISION_WITH_ENTITY_BIT; + collisionStatus->curCeiling = var | COLLISION_WITH_ENTITY_BIT; playerStatus->flags |= PS_FLAG_JUMPING; update_entities(); - collisionStatus->currentCeiling = -1; + collisionStatus->curCeiling = -1; playerStatus->flags &= ~PS_FLAG_JUMPING; return ApiStatus_DONE2; } @@ -45,7 +45,7 @@ API_CALLABLE(N(func_802A1318_718B68)) { entity->scale.y = player->scalingFactor; entity->scale.z = player->scalingFactor; if (player->scalingFactor != 1.0) { - entity->position.y -= 10.0f; + entity->pos.y -= 10.0f; } return ApiStatus_DONE2; diff --git a/src/battle/move/item/stone_cap.c b/src/battle/move/item/stone_cap.c index 37986c4dc8..b65b5f6b2f 100644 --- a/src/battle/move/item/stone_cap.c +++ b/src/battle/move/item/stone_cap.c @@ -26,9 +26,9 @@ API_CALLABLE(N(func_802A123C_7217DC)) { case 1: for (i = 0; i < 10; i++) { - f32 x = player->currentPos.x + ((rand_int(20) - 10) * player->scalingFactor); - f32 y = player->currentPos.y + ((rand_int(20) + 10) * player->scalingFactor); - f32 z = player->currentPos.z + 5.0f; + f32 x = player->curPos.x + ((rand_int(20) - 10) * player->scalingFactor); + f32 y = player->curPos.y + ((rand_int(20) + 10) * player->scalingFactor); + f32 z = player->curPos.z + 5.0f; fx_floating_cloud_puff(0, x, y, z, 1.0f, 25); } diff --git a/src/battle/move/item/super_soda.c b/src/battle/move/item/super_soda.c index 00979dc279..024931bc75 100644 --- a/src/battle/move/item/super_soda.c +++ b/src/battle/move/item/super_soda.c @@ -17,9 +17,9 @@ API_CALLABLE(N(func_802A123C_724F1C)) { s32 c = evt_get_variable(script, *args++); ItemEntity* item = get_item_entity(script->varTable[14]); - item->position.x = a; - item->position.y = b; - item->position.z = c; + item->pos.x = a; + item->pos.y = b; + item->pos.z = c; return ApiStatus_DONE2; } diff --git a/src/battle/move/item/thunder_bolt.c b/src/battle/move/item/thunder_bolt.c index 46b394c6fd..d4d605d8eb 100644 --- a/src/battle/move/item/thunder_bolt.c +++ b/src/battle/move/item/thunder_bolt.c @@ -17,9 +17,9 @@ API_CALLABLE(N(func_802A123C_722D7C)) { if (actor != NULL) { sfx_play_sound(SOUND_366); - posX = actor->currentPos.x; - posY = actor->currentPos.y + (actor->size.y / 10); - posZ = actor->currentPos.z; + posX = actor->curPos.x; + posY = actor->curPos.y + (actor->size.y / 10); + posZ = actor->curPos.z; scaleX = (actor->size.x + (actor->size.x >> 2)) * actor->scalingFactor; scaleY = (actor->size.y - 2) * actor->scalingFactor; diff --git a/src/battle/move/item/thunder_rage.c b/src/battle/move/item/thunder_rage.c index 4d978543b6..1ab24f9433 100644 --- a/src/battle/move/item/thunder_rage.c +++ b/src/battle/move/item/thunder_rage.c @@ -34,9 +34,9 @@ API_CALLABLE(N(func_802A1354_71B4F4)) { if (actor != NULL) { sfx_play_sound(SOUND_366); - posX = actor->currentPos.x; - posY = actor->currentPos.y + (actor->size.y / 10); - posZ = actor->currentPos.z; + posX = actor->curPos.x; + posY = actor->curPos.y + (actor->size.y / 10); + posZ = actor->curPos.z; scaleX = (actor->size.x + (actor->size.x >> 2)) * actor->scalingFactor; scaleY = (actor->size.y - 2) * actor->scalingFactor; diff --git a/src/battle/move/star_power/chill_out.c b/src/battle/move/star_power/chill_out.c index c67d80b4f4..36ef18c654 100644 --- a/src/battle/move/star_power/chill_out.c +++ b/src/battle/move/star_power/chill_out.c @@ -87,15 +87,15 @@ API_CALLABLE(func_802A16F4_7907C4) { dispatch_damage_event_actor_0(target, 0, 10); - x = target->currentPos.x + target->headOffset.x + (target->size.x / 2); + x = target->curPos.x + target->headOffset.x + (target->size.x / 2); if (target->flags & ACTOR_FLAG_UPSIDE_DOWN) { - y = target->currentPos.y + target->headOffset.y - target->size.y; + y = target->curPos.y + target->headOffset.y - target->size.y; } else if (!(target->flags & ACTOR_FLAG_8000)) { - y = target->currentPos.y + target->headOffset.y + target->size.y; + y = target->curPos.y + target->headOffset.y + target->size.y; } else { - y = target->currentPos.y + target->headOffset.y + target->size.y * 2; + y = target->curPos.y + target->headOffset.y + target->size.y * 2; } - z = target->currentPos.z + target->headOffset.z + 5.0f; + z = target->curPos.z + target->headOffset.z + 5.0f; fx_stat_change(5, x, y, z, 1.0f, 60); sfx_play_sound(SOUND_2106); diff --git a/src/battle/move/star_power/refresh.c b/src/battle/move/star_power/refresh.c index e4d0ea1ec3..401e493229 100644 --- a/src/battle/move/star_power/refresh.c +++ b/src/battle/move/star_power/refresh.c @@ -24,7 +24,7 @@ API_CALLABLE(func_802A1518_78BB18) { npc->planarFlyDist = 0; npc->yaw = 0; npc->duration = 0; - npc->jumpVelocity = -1.5f; + npc->jumpVel = -1.5f; npc->jumpScale = 0.02f; npc->moveSpeed = 1.0f; npc->moveToPos.x = npc->pos.x; @@ -33,7 +33,7 @@ API_CALLABLE(func_802A1518_78BB18) { script->functionTemp[0] = 1; break; case 1: - if (npc->jumpVelocity < 0.0f) { + if (npc->jumpVel < 0.0f) { npc->planarFlyDist += 3.0; if (npc->planarFlyDist > 40.0f) { npc->planarFlyDist = 40.0f; @@ -46,8 +46,8 @@ API_CALLABLE(func_802A1518_78BB18) { } npc->moveSpeed += 0.75; - npc->jumpVelocity += npc->jumpScale; - npc->pos.y += npc->jumpVelocity; + npc->jumpVel += npc->jumpScale; + npc->pos.y += npc->jumpVel; if (npc->moveSpeed > 33.0f) { npc->moveSpeed = 33.0f; } diff --git a/src/battle/partner/bombette.c b/src/battle/partner/bombette.c index 6a8eca326f..651ec31002 100644 --- a/src/battle/partner/bombette.c +++ b/src/battle/partner/bombette.c @@ -83,26 +83,26 @@ API_CALLABLE(N(SlowDown)) { ActorState* partnerActorMovement = &partnerActor->state; if (isInitialCall) { - partnerActor->state.currentPos.x = partnerActor->currentPos.x; - partnerActor->state.currentPos.y = partnerActor->currentPos.y; - partnerActor->state.currentPos.z = partnerActor->currentPos.z; + partnerActor->state.curPos.x = partnerActor->curPos.x; + partnerActor->state.curPos.y = partnerActor->curPos.y; + partnerActor->state.curPos.z = partnerActor->curPos.z; } - add_xz_vec3f(&partnerActorMovement->currentPos, partnerActor->state.speed, partnerActor->state.angle); + add_xz_vec3f(&partnerActorMovement->curPos, partnerActor->state.speed, partnerActor->state.angle); if (partnerActor->state.speed < 4.0f) { - play_movement_dust_effects(0, partnerActor->state.currentPos.x, partnerActor->state.currentPos.y, - partnerActor->state.currentPos.z, partnerActor->state.angle); + play_movement_dust_effects(0, partnerActor->state.curPos.x, partnerActor->state.curPos.y, + partnerActor->state.curPos.z, partnerActor->state.angle); } else { - play_movement_dust_effects(1, partnerActor->state.currentPos.x, partnerActor->state.currentPos.y, - partnerActor->state.currentPos.z, partnerActor->state.angle); + play_movement_dust_effects(1, partnerActor->state.curPos.x, partnerActor->state.curPos.y, + partnerActor->state.curPos.z, partnerActor->state.angle); } partnerActorMovement->speed /= 1.5; - partnerActor->currentPos.x = partnerActorMovement->currentPos.x; - partnerActor->currentPos.y = partnerActorMovement->currentPos.y; - partnerActor->currentPos.z = partnerActorMovement->currentPos.z; + partnerActor->curPos.x = partnerActorMovement->curPos.x; + partnerActor->curPos.y = partnerActorMovement->curPos.y; + partnerActor->curPos.z = partnerActorMovement->curPos.z; if (partnerActorMovement->speed < 1.0) { return ApiStatus_DONE2; diff --git a/src/battle/partner/goombario.c b/src/battle/partner/goombario.c index 6cecb50520..153eb0d0bf 100644 --- a/src/battle/partner/goombario.c +++ b/src/battle/partner/goombario.c @@ -37,9 +37,9 @@ enum N(ActorPartIDs) { API_CALLABLE(N(GetReturnMoveTime)) { BattleStatus* battleStatus = &gBattleStatus; Actor* partner = battleStatus->partnerActor; - f32 posX = partner->currentPos.x; - f32 posY = partner->currentPos.y; - f32 posZ = partner->currentPos.z; + f32 posX = partner->curPos.x; + f32 posY = partner->curPos.y; + f32 posZ = partner->curPos.z; f32 goalX = partner->state.goalPos.x; f32 goalY = partner->state.goalPos.y; f32 goalZ = partner->state.goalPos.z; @@ -103,38 +103,38 @@ API_CALLABLE(N(JumpOnTarget)) { } if (script->functionTemp[0] == 0) { - state->currentPos.x = actor->currentPos.x; - state->currentPos.y = actor->currentPos.y; + state->curPos.x = actor->curPos.x; + state->curPos.y = actor->curPos.y; stateGoalX = state->goalPos.x; stateGoalZ = state->goalPos.z; - stateCurrentX = state->currentPos.x; - stateCurrentZ = actor->currentPos.z; - state->currentPos.z = stateCurrentZ; + stateCurrentX = state->curPos.x; + stateCurrentZ = actor->curPos.z; + state->curPos.z = stateCurrentZ; state->angle = atan2(stateCurrentX, stateCurrentZ, stateGoalX, stateGoalZ); - state->distance = dist2D(stateCurrentX, stateCurrentZ, stateGoalX, stateGoalZ); + state->dist = dist2D(stateCurrentX, stateCurrentZ, stateGoalX, stateGoalZ); if (state->moveTime == 0) { - state->moveTime = state->distance / state->speed; - temp = state->distance - (state->moveTime * state->speed); + state->moveTime = state->dist / state->speed; + temp = state->dist - (state->moveTime * state->speed); } else { - state->speed = state->distance / state->moveTime; - temp = state->distance - (state->moveTime * state->speed); + state->speed = state->dist / state->moveTime; + temp = state->dist - (state->moveTime * state->speed); } if (state->moveTime == 0) { return ApiStatus_DONE2; } - state->unk_30.x = (state->goalPos.x - state->currentPos.x) / state->moveTime; - state->unk_30.y = (state->goalPos.y - state->currentPos.y) / state->moveTime; - state->unk_30.z = (state->goalPos.z - state->currentPos.z) / state->moveTime; + state->unk_30.x = (state->goalPos.x - state->curPos.x) / state->moveTime; + state->unk_30.y = (state->goalPos.y - state->curPos.y) / state->moveTime; + state->unk_30.z = (state->goalPos.z - state->curPos.z) / state->moveTime; state->acceleration = PI_S / state->moveTime; - state->velocity = 0.0f; + state->vel = 0.0f; state->speed += temp / state->moveTime; if (state->moveArcAmplitude < 3) { state->unk_24 = 90.0f; state->unk_28 = 360 / state->moveTime; - temp = state->distance; + temp = state->dist; temp -= 20.0; temp /= 6.0; temp += 47.0; @@ -144,13 +144,13 @@ API_CALLABLE(N(JumpOnTarget)) { } state->unk_18.x = 0.0f; state->unk_18.y = 0.0f; - vel3 = state->velocity; + vel3 = state->vel; acc3 = state->acceleration; - state->velocity = vel3 + ((sin_rad(DEG_TO_RAD(state->unk_24)) * 0.53 * acc3) + acc3); + state->vel = vel3 + ((sin_rad(DEG_TO_RAD(state->unk_24)) * 0.53 * acc3) + acc3); } else { state->unk_24 = 90.0f; state->unk_28 = 360 / state->moveTime; - temp = state->distance; + temp = state->dist; temp -= 20.0; temp /= 6.0; temp += 47.0; @@ -160,9 +160,9 @@ API_CALLABLE(N(JumpOnTarget)) { } state->unk_18.x = 0.0f; state->unk_18.y = 0.0f; - vel4 = state->velocity; + vel4 = state->vel; acc4 = state->acceleration; - state->velocity = vel4 + ((sin_rad(DEG_TO_RAD(state->unk_24)) * 0.8 * acc4) + acc4); + state->vel = vel4 + ((sin_rad(DEG_TO_RAD(state->unk_24)) * 0.8 * acc4) + acc4); } set_animation(ACTOR_PARTNER, 1, state->animJumpRise); script->functionTemp[0] = 1; @@ -170,41 +170,41 @@ API_CALLABLE(N(JumpOnTarget)) { switch (script->functionTemp[0]) { case 1: - if (state->velocity > PI_S / 2) { + if (state->vel > PI_S / 2) { set_animation(ACTOR_PARTNER, 1, state->animJumpFall); } - oldActorX = actor->currentPos.x; - oldActorY = actor->currentPos.y; - state->currentPos.x += state->unk_30.x; - state->currentPos.y = state->currentPos.y + state->unk_30.y; - state->currentPos.z = state->currentPos.z + state->unk_30.z; - state->unk_18.x = actor->currentPos.y; - actor->currentPos.x = state->currentPos.x; - actor->currentPos.y = state->currentPos.y + (state->bounceDivisor * sin_rad(state->velocity)); - actor->currentPos.z = state->currentPos.z; - if (state->goalPos.y > actor->currentPos.y && state->moveTime < 3) { - actor->currentPos.y = state->goalPos.y; + oldActorX = actor->curPos.x; + oldActorY = actor->curPos.y; + state->curPos.x += state->unk_30.x; + state->curPos.y = state->curPos.y + state->unk_30.y; + state->curPos.z = state->curPos.z + state->unk_30.z; + state->unk_18.x = actor->curPos.y; + actor->curPos.x = state->curPos.x; + actor->curPos.y = state->curPos.y + (state->bounceDivisor * sin_rad(state->vel)); + actor->curPos.z = state->curPos.z; + if (state->goalPos.y > actor->curPos.y && state->moveTime < 3) { + actor->curPos.y = state->goalPos.y; } - actor->rotation.z = -atan2(oldActorX, -oldActorY, actor->currentPos.x, -actor->currentPos.y); - state->unk_18.y = actor->currentPos.y; + actor->rot.z = -atan2(oldActorX, -oldActorY, actor->curPos.x, -actor->curPos.y); + state->unk_18.y = actor->curPos.y; if (state->moveArcAmplitude < 3) { - vel1 = state->velocity; + vel1 = state->vel; acc1 = state->acceleration; - state->velocity = vel1 + ((sin_rad(DEG_TO_RAD(state->unk_24)) * 0.53 * acc1) + acc1); + state->vel = vel1 + ((sin_rad(DEG_TO_RAD(state->unk_24)) * 0.53 * acc1) + acc1); } else { - vel2 = state->velocity; + vel2 = state->vel; acc2 = state->acceleration; - state->velocity = vel2 + ((sin_rad(DEG_TO_RAD(state->unk_24)) * 0.8 * acc2) + acc2); + state->vel = vel2 + ((sin_rad(DEG_TO_RAD(state->unk_24)) * 0.8 * acc2) + acc2); } state->unk_24 += state->unk_28; state->unk_24 = clamp_angle(state->unk_24); state->moveTime--; if (state->moveTime == 0) { - actor->currentPos.y = state->goalPos.y; + actor->curPos.y = state->goalPos.y; state->acceleration = 1.8f; - state->velocity = -(state->unk_18.x - state->unk_18.y); + state->vel = -(state->unk_18.x - state->unk_18.y); set_animation(ACTOR_PARTNER, 1, state->animJumpLand); return ApiStatus_DONE1; } @@ -216,23 +216,23 @@ API_CALLABLE(N(JumpOnTarget)) { state->moveTime = 1; state->acceleration = 1.8f; state->unk_24 = 90.0f; - state->velocity = -(state->unk_18.x - state->unk_18.y); + state->vel = -(state->unk_18.x - state->unk_18.y); state->bounceDivisor = fabsf(state->unk_18.x - state->unk_18.y) / 16.5; state->unk_28 = 360 / state->moveTime; - state->currentPos.x = actor->currentPos.x; - state->currentPos.y = actor->currentPos.y; - state->currentPos.z = actor->currentPos.z; + state->curPos.x = actor->curPos.x; + state->curPos.y = actor->curPos.y; + state->curPos.z = actor->curPos.z; script->functionTemp[0] = 3; // fallthrough case 3: - currentPosX64 = state->currentPos.x; // required to match - state->currentPos.x = currentPosX64 + state->bounceDivisor * sin_rad(DEG_TO_RAD(state->unk_24)) / 33.0; - state->currentPos.y -= state->bounceDivisor * sin_rad(DEG_TO_RAD(state->unk_24)); + currentPosX64 = state->curPos.x; // required to match + state->curPos.x = currentPosX64 + state->bounceDivisor * sin_rad(DEG_TO_RAD(state->unk_24)) / 33.0; + state->curPos.y -= state->bounceDivisor * sin_rad(DEG_TO_RAD(state->unk_24)); state->unk_24 += state->unk_28; state->unk_24 = clamp_angle(state->unk_24); - actor->currentPos.x = state->currentPos.x; - actor->currentPos.y = state->currentPos.y; - actor->currentPos.z = state->currentPos.z; + actor->curPos.x = state->curPos.x; + actor->curPos.y = state->curPos.y; + actor->curPos.z = state->curPos.z; if (gBattleStatus.flags1 & BS_FLAGS1_2000) { return ApiStatus_DONE2; @@ -251,38 +251,38 @@ API_CALLABLE(N(JumpOnTarget)) { API_CALLABLE(N(OnMissHeadbonk)) { BattleStatus* battleStatus = &gBattleStatus; Actor* partner = gBattleStatus.partnerActor; - Vec3f* pos = &partner->state.currentPos; + Vec3f* pos = &partner->state.curPos; if (isInitialCall) { script->functionTemp[0] = 0; } if (script->functionTemp[0] == 0) { - partner->state.currentPos.x = partner->currentPos.x; - partner->state.currentPos.y = partner->currentPos.y; - partner->state.currentPos.z = partner->currentPos.z; + partner->state.curPos.x = partner->curPos.x; + partner->state.curPos.y = partner->curPos.y; + partner->state.curPos.z = partner->curPos.z; script->functionTemp[0] = 1; } - if (partner->state.velocity > 0.0f) { + if (partner->state.vel > 0.0f) { set_animation(ACTOR_PARTNER, 0, partner->state.animJumpRise); } - if (partner->state.velocity < 0.0f) { + if (partner->state.vel < 0.0f) { set_animation(ACTOR_PARTNER, 0, partner->state.animJumpFall); } - partner->state.currentPos.y = (partner->state.currentPos.y + partner->state.velocity); - partner->state.velocity = (partner->state.velocity - partner->state.acceleration); + partner->state.curPos.y = (partner->state.curPos.y + partner->state.vel); + partner->state.vel = (partner->state.vel - partner->state.acceleration); add_xz_vec3f(pos, partner->state.speed, partner->state.angle); - partner->currentPos.x = partner->state.currentPos.x; - partner->currentPos.y = partner->state.currentPos.y; - partner->currentPos.z = partner->state.currentPos.z; + partner->curPos.x = partner->state.curPos.x; + partner->curPos.y = partner->state.curPos.y; + partner->curPos.z = partner->state.curPos.z; - if (partner->currentPos.y < 10.0f) { - partner->currentPos.y = 10.0f; + if (partner->curPos.y < 10.0f) { + partner->curPos.y = 10.0f; - play_movement_dust_effects(2, partner->currentPos.x, partner->currentPos.y, partner->currentPos.z, + play_movement_dust_effects(2, partner->curPos.x, partner->curPos.y, partner->curPos.z, partner->yaw); sfx_play_sound(SOUND_SOFT_LAND); diff --git a/src/battle/partner/kooper.c b/src/battle/partner/kooper.c index 796b03c634..0fd9c7fd85 100644 --- a/src/battle/partner/kooper.c +++ b/src/battle/partner/kooper.c @@ -36,26 +36,26 @@ API_CALLABLE(N(SlowDown)) { ActorState* partnerActorMovement = &partnerActor->state; if (isInitialCall) { - partnerActor->state.currentPos.x = partnerActor->currentPos.x; - partnerActor->state.currentPos.y = partnerActor->currentPos.y; - partnerActor->state.currentPos.z = partnerActor->currentPos.z; + partnerActor->state.curPos.x = partnerActor->curPos.x; + partnerActor->state.curPos.y = partnerActor->curPos.y; + partnerActor->state.curPos.z = partnerActor->curPos.z; } - add_xz_vec3f(&partnerActorMovement->currentPos, partnerActor->state.speed, partnerActor->state.angle); + add_xz_vec3f(&partnerActorMovement->curPos, partnerActor->state.speed, partnerActor->state.angle); if (partnerActor->state.speed < 4.0f) { - play_movement_dust_effects(0, partnerActor->state.currentPos.x, partnerActor->state.currentPos.y, - partnerActor->state.currentPos.z, partnerActor->state.angle); + play_movement_dust_effects(0, partnerActor->state.curPos.x, partnerActor->state.curPos.y, + partnerActor->state.curPos.z, partnerActor->state.angle); } else { - play_movement_dust_effects(1, partnerActor->state.currentPos.x, partnerActor->state.currentPos.y, - partnerActor->state.currentPos.z, partnerActor->state.angle); + play_movement_dust_effects(1, partnerActor->state.curPos.x, partnerActor->state.curPos.y, + partnerActor->state.curPos.z, partnerActor->state.angle); } partnerActorMovement->speed = partnerActorMovement->speed / 1.5; - partnerActor->currentPos.x = partnerActorMovement->currentPos.x; - partnerActor->currentPos.y = partnerActorMovement->currentPos.y; - partnerActor->currentPos.z = partnerActorMovement->currentPos.z; + partnerActor->curPos.x = partnerActorMovement->curPos.x; + partnerActor->curPos.y = partnerActorMovement->curPos.y; + partnerActor->curPos.z = partnerActorMovement->curPos.z; if (partnerActorMovement->speed < 1.0) { return ApiStatus_DONE2; @@ -80,7 +80,7 @@ API_CALLABLE(N(SetTargetsYaw)) { if (script->functionTemp[0] == 0) { for (i = 0; i < actor->targetListLength; i++) { - x = actor->currentPos.x; + x = actor->curPos.x; target = &actor->targetData[actor->targetIndexList[i]]; targetX = target->posA.x; targetActor = get_actor(target->actorID); diff --git a/src/battle/partner/lakilester.c b/src/battle/partner/lakilester.c index 3ce8a7e3d8..41aba0d1ae 100644 --- a/src/battle/partner/lakilester.c +++ b/src/battle/partner/lakilester.c @@ -424,20 +424,20 @@ API_CALLABLE(N(SpinyFlipActionCommand)) { hudAim[i] = idAim = hud_element_create(N(aimHudScripts)[i]); hud_element_set_render_depth(idAim, 10); } - partnerState->currentPos.x = partner->currentPos.x + 33.0f; - partnerState->currentPos.y = partner->currentPos.y + 34.0f; - partnerState->currentPos.z = partner->currentPos.z + 15.0f; - partnerState->unk_18.x = partner->currentPos.x + 33.0f; - partnerState->unk_18.y = partner->currentPos.y + 34.0f; - partnerState->unk_18.z = partner->currentPos.z + 15.0f; + partnerState->curPos.x = partner->curPos.x + 33.0f; + partnerState->curPos.y = partner->curPos.y + 34.0f; + partnerState->curPos.z = partner->curPos.z + 15.0f; + partnerState->unk_18.x = partner->curPos.x + 33.0f; + partnerState->unk_18.y = partner->curPos.y + 34.0f; + partnerState->unk_18.z = partner->curPos.z + 15.0f; set_goal_pos_to_part(partnerState, partner->targetActorID, partner->targetPartIndex); target = get_actor(partner->targetActorID); part = get_actor_part(target, partner->targetPartIndex); partnerState->goalPos.x += part->projectileTargetOffset.x; partnerState->goalPos.y += part->projectileTargetOffset.y; partnerState->goalPos.z = partnerState->goalPos.z; // required to match - partnerState->distance = dist2D(partnerState->currentPos.x, - partnerState->currentPos.y, + partnerState->dist = dist2D(partnerState->curPos.x, + partnerState->curPos.y, partnerState->goalPos.x, partnerState->goalPos.y); partnerState->speed = 0.0f; @@ -514,22 +514,22 @@ API_CALLABLE(N(SpinyFlipActionCommand)) { sinTheta = sin_rad(theta); cosTheta = cos_rad(theta); speed = partnerState->speed; - partnerState->currentPos.x += speed * sinTheta; - partnerState->currentPos.y += speed * cosTheta; + partnerState->curPos.x += speed * sinTheta; + partnerState->curPos.y += speed * cosTheta; } - if (partnerState->currentPos.x < -30.0f) { - partnerState->currentPos.x = -30.0f; + if (partnerState->curPos.x < -30.0f) { + partnerState->curPos.x = -30.0f; } - if (partnerState->currentPos.x > 170.0f) { - partnerState->currentPos.x = 170.0f; + if (partnerState->curPos.x > 170.0f) { + partnerState->curPos.x = 170.0f; } - if (partnerState->currentPos.y > 130.0f) { - partnerState->currentPos.y = 130.0f; + if (partnerState->curPos.y > 130.0f) { + partnerState->curPos.y = 130.0f; } - if (partnerState->currentPos.y < 0.0f) { - partnerState->currentPos.y = 0.0f; + if (partnerState->curPos.y < 0.0f) { + partnerState->curPos.y = 0.0f; } - if (battleStatus->currentButtonsPressed & BUTTON_A) { + if (battleStatus->curButtonsPressed & BUTTON_A) { sAimingTimer = 0; } if (sAimingTimer == 60) { @@ -544,11 +544,11 @@ API_CALLABLE(N(SpinyFlipActionCommand)) { } script->varTable[14] = 0; script->varTable[15] = 0; - script->varTable[7] = partnerState->currentPos.x; - script->varTable[8] = partnerState->currentPos.y; - script->varTable[9] = partnerState->currentPos.z; - partnerState->distance = dist2D(partnerState->currentPos.x, partnerState->currentPos.y, partnerState->goalPos.x, partnerState->goalPos.y) / partnerState->unk_24; - if (partnerState->distance <= 12.0) { + script->varTable[7] = partnerState->curPos.x; + script->varTable[8] = partnerState->curPos.y; + script->varTable[9] = partnerState->curPos.z; + partnerState->dist = dist2D(partnerState->curPos.x, partnerState->curPos.y, partnerState->goalPos.x, partnerState->goalPos.y) / partnerState->unk_24; + if (partnerState->dist <= 12.0) { script->varTable[15] = 1; } hud_element_free(hudAimTarget); @@ -572,7 +572,7 @@ API_CALLABLE(N(SpinyFlipActionCommand)) { sTargetMarkRotation -= 10; sTargetMarkRotation = clamp_angle(sTargetMarkRotation); get_screen_coords(gCurrentCameraID, - partnerState->currentPos.x, partnerState->currentPos.y, partnerState->currentPos.z, + partnerState->curPos.x, partnerState->curPos.y, partnerState->curPos.z, &screenX, &screenY, &screenZ); hud_element_set_render_pos(hudAimReticle, screenX, screenY); @@ -590,11 +590,11 @@ API_CALLABLE(N(SpinyFlipActionCommand)) { switch (script->functionTemp[0]) { case 1: case 2: - playerState->currentPos.x = partnerState->currentPos.x; - playerState->currentPos.y = partnerState->currentPos.y; - playerState->currentPos.z = partnerState->currentPos.z; + playerState->curPos.x = partnerState->curPos.x; + playerState->curPos.y = partnerState->curPos.y; + playerState->curPos.z = partnerState->curPos.z; for (i = 0; i < ARRAY_COUNT(N(aimHudScripts)); i++) { - get_screen_coords(gCurrentCameraID, playerState->currentPos.x, playerState->currentPos.y, playerState->currentPos.z, &screenX, &screenY, &screenZ); + get_screen_coords(gCurrentCameraID, playerState->curPos.x, playerState->curPos.y, playerState->curPos.z, &screenX, &screenY, &screenZ); id = hudAim[i]; hud_element_set_render_pos(id, screenX, screenY); } @@ -608,9 +608,9 @@ API_CALLABLE(N(SpinyFlipActionCommand)) { API_CALLABLE(N(ThrowSpinyFX)) { BattleStatus* battleStatus = &gBattleStatus; Actor* partnerActor = battleStatus->partnerActor; - f32 xPos = partnerActor->currentPos.x + 5; - f32 yPos = partnerActor->currentPos.y + partnerActor->size.y + 20; - f32 zPos = partnerActor->currentPos.z; + f32 xPos = partnerActor->curPos.x + 5; + f32 yPos = partnerActor->curPos.y + partnerActor->size.y + 20; + f32 zPos = partnerActor->curPos.z; f32 var = rand_int(140) + 10; f32 var2 = rand_int(80) + 10; @@ -690,7 +690,7 @@ API_CALLABLE(N(CloudNineFX)) { switch (script->functionTemp[0]) { case 0: sCounter = 0.1f; - fx_ending_decals(0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z, 0.1f, &battleStatus->cloudNineEffect); + fx_ending_decals(0, actor->curPos.x, actor->curPos.y, actor->curPos.z, 0.1f, &battleStatus->cloudNineEffect); script->functionTemp[0] = 1; break; case 1: @@ -742,7 +742,7 @@ API_CALLABLE(N(InitHurricane)) { target = &partner->targetData[targetIdx]; actor = get_actor(target->actorID); part = get_actor_part(actor, target->partID); - hpMissingPercent = 100 - ((actor->currentHP * 100) / actor->maxHP); + hpMissingPercent = 100 - ((actor->curHP * 100) / actor->maxHP); hurricaneChance = actor->actorBlueprint->hurricaneChance; if (hurricaneChance > 0) { hurricaneChance += hurricaneChance * hpMissingPercent / 100; @@ -1455,15 +1455,15 @@ API_CALLABLE(N(ProcessHurricane)) { } sHuffPuffBreathEffect->data.huffPuffBreath->scale = sBreathSizeIncrease / 50.0 + 1.0; - x = partner->currentPos.x; - y = partner->currentPos.y; + x = partner->curPos.x; + y = partner->curPos.y; rand_int(1000); tempF1 = 5.0f; switch (sHuffPuffBreathState) { case STATE_INHALE: - x = partner->currentPos.x; - y = partner->currentPos.y + 15.0f; - z = partner->currentPos.z + tempF1; + x = partner->curPos.x; + y = partner->curPos.y + 15.0f; + z = partner->curPos.z + tempF1; add_vec2D_polar(&x, &y, 12.0f, 90.0f); sHuffPuffBreathEffect->data.huffPuffBreath->pos.x = x; sHuffPuffBreathEffect->data.huffPuffBreath->pos.y = y; @@ -1476,7 +1476,7 @@ API_CALLABLE(N(ProcessHurricane)) { sHuffPuffBreathEffect->data.huffPuffBreath->pos.z = NPC_DISPOSE_POS_Z; if (script->functionTemp[2] != 0) { - sfx_play_sound_at_position(SOUND_201E, SOUND_SPACE_MODE_0, partner->currentPos.x, partner->currentPos.y, partner->currentPos.z); + sfx_play_sound_at_position(SOUND_201E, SOUND_SPACE_MODE_0, partner->curPos.x, partner->curPos.y, partner->curPos.z); } script->functionTemp[2] = 0; @@ -1489,9 +1489,9 @@ API_CALLABLE(N(ProcessHurricane)) { sHuffPuffBreathEffect->data.huffPuffBreath->pos.z = NPC_DISPOSE_POS_Z; break; case STATE_EXHALE: - x = partner->currentPos.x; - y = partner->currentPos.y + 15.0f; - z = partner->currentPos.z + tempF1; + x = partner->curPos.x; + y = partner->curPos.y + 15.0f; + z = partner->curPos.z + tempF1; add_vec2D_polar(&x, &y, 12.0f, 90.0f); sHuffPuffBreathEffect->data.huffPuffBreath->pos.x = x; sHuffPuffBreathEffect->data.huffPuffBreath->pos.y = y; @@ -1499,7 +1499,7 @@ API_CALLABLE(N(ProcessHurricane)) { sHuffPuffBreathEffect->data.huffPuffBreath->speedX = 2.0f; if (script->functionTemp[2] == 0) { - sfx_play_sound_at_position(SOUND_201F, SOUND_SPACE_MODE_0, partner->currentPos.x, partner->currentPos.y, partner->currentPos.z); + sfx_play_sound_at_position(SOUND_201F, SOUND_SPACE_MODE_0, partner->curPos.x, partner->curPos.y, partner->curPos.z); } script->functionTemp[2] = 1; @@ -1653,33 +1653,33 @@ API_CALLABLE(N(BlowTargetAway)) { switch (script->functionTemp[0]) { case 0: target->state.moveTime = 0; - target->state.currentPos.x = target->currentPos.x; - target->state.currentPos.y = target->currentPos.y; - target->state.currentPos.z = target->currentPos.z; + target->state.curPos.x = target->curPos.x; + target->state.curPos.y = target->curPos.y; + target->state.curPos.z = target->curPos.z; target->state.speed = 5.5f; sNumEnemiesBeingBlown += 1; - battleStatus->currentAttackElement = 0; + battleStatus->curAttackElement = 0; dispatch_event_actor(target, EVENT_BLOW_AWAY); script->functionTemp[0] = 1; break; case 1: - target->state.currentPos.x += target->state.speed; - temp_f20 = target->state.currentPos.y; - target->state.currentPos.y = + target->state.curPos.x += target->state.speed; + temp_f20 = target->state.curPos.y; + target->state.curPos.y = temp_f20 + ((sin_rad(2.0f * sin_rad(DEG_TO_RAD(target->state.moveTime)) * PI_S) * 1.4) + 0.5); target->state.moveTime += 6; target->state.moveTime = clamp_angle(target->state.moveTime); target->yaw += 33.0f; target->yaw = clamp_angle(target->yaw); - if (target->state.currentPos.x > 240.0f) { + if (target->state.curPos.x > 240.0f) { sNumEnemiesBeingBlown -= 1; return ApiStatus_DONE2; } break; } - target->currentPos.x = state->currentPos.x; - target->currentPos.y = state->currentPos.y; - target->currentPos.z = state->currentPos.z; + target->curPos.x = state->curPos.x; + target->curPos.y = state->curPos.y; + target->curPos.z = state->curPos.z; return ApiStatus_BLOCK; } diff --git a/src/battle/partner/parakarry.c b/src/battle/partner/parakarry.c index 7c70470650..bcfa03b41e 100644 --- a/src/battle/partner/parakarry.c +++ b/src/battle/partner/parakarry.c @@ -148,22 +148,22 @@ API_CALLABLE(N(ShellShotActionCommand)) { state->goalPos.z = state->goalPos.z; state->unk_24 = (targetActorPart->size.y + targetActorPart->size.x) / 2 / 24.0; hud_element_set_scale(hudTarget, state->unk_24 * targetActor->scalingFactor); - state->currentPos.x = parakarry->currentPos.x + 8.0f; - state->currentPos.y = parakarry->currentPos.y + 16.0f; - state->currentPos.z = parakarry->currentPos.z; - state->angle = atan2(state->currentPos.x, state->currentPos.y, state->goalPos.x, state->goalPos.y); + state->curPos.x = parakarry->curPos.x + 8.0f; + state->curPos.y = parakarry->curPos.y + 16.0f; + state->curPos.z = parakarry->curPos.z; + state->angle = atan2(state->curPos.x, state->curPos.y, state->goalPos.x, state->goalPos.y); state->bounceDivisor = state->angle; - state->distance = 116.0f; + state->dist = 116.0f; state->unk_18.x = state->angle; i = 0; for (i = 0; i < 30; i++) { state->unk_18.x -= 1.0f; aimAngle = clamp_angle(state->unk_18.x); - x = state->currentPos.x; - y = state->currentPos.y; - z = state->currentPos.z; - clampedAngleDiff = state->distance; + x = state->curPos.x; + y = state->curPos.y; + z = state->curPos.z; + clampedAngleDiff = state->dist; add_vec2D_polar(&x, &y, clampedAngleDiff, aimAngle); get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ); if (screenY > 180) { @@ -177,10 +177,10 @@ API_CALLABLE(N(ShellShotActionCommand)) { for (i = 0; i < 30; i++) { state->unk_18.y += 1.0f; aimAngle = clamp_angle(state->unk_18.y); - x = state->currentPos.x; - y = state->currentPos.y; - z = state->currentPos.z; - add_vec2D_polar(&x, &y, state->distance, aimAngle); + x = state->curPos.x; + y = state->curPos.y; + z = state->curPos.z; + add_vec2D_polar(&x, &y, state->dist, aimAngle); get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ); if (screenY < 30) { break; @@ -192,9 +192,9 @@ API_CALLABLE(N(ShellShotActionCommand)) { hudTargetRotation = 0; shellShotTimer = 90; #if VERSION_PAL - state->velocity = 4.0f; + state->vel = 4.0f; #else - state->velocity = 3.0f; + state->vel = 3.0f; #endif battleStatus->unk_86 = 0; action_command_init_status(); @@ -202,7 +202,7 @@ API_CALLABLE(N(ShellShotActionCommand)) { script->functionTemp[0] = 1; break; case 1: - if (gActionCommandStatus.autoSucceed || battleStatus->currentButtonsDown & BUTTON_STICK_LEFT) { + if (gActionCommandStatus.autoSucceed || battleStatus->curButtonsDown & BUTTON_STICK_LEFT) { shellShotTimer = 0; } @@ -225,7 +225,7 @@ API_CALLABLE(N(ShellShotActionCommand)) { break; case 2: if (!(gActionCommandStatus.autoSucceed)) { - if (!(battleStatus->currentButtonsDown & BUTTON_STICK_LEFT)) { + if (!(battleStatus->curButtonsDown & BUTTON_STICK_LEFT)) { script->functionTemp[0] = 3; break; } @@ -243,16 +243,16 @@ API_CALLABLE(N(ShellShotActionCommand)) { } } - state->angle += state->velocity; + state->angle += state->vel; if (state->angle <= state->unk_18.x) { state->angle = state->unk_18.x; - state->velocity = 0.0f - state->velocity; + state->vel = 0.0f - state->vel; } if (state->angle >= state->unk_18.y) { state->angle = state->unk_18.y; - state->velocity = 0.0f - state->velocity; + state->vel = 0.0f - state->vel; } break; case 3: @@ -260,7 +260,7 @@ API_CALLABLE(N(ShellShotActionCommand)) { clampedAngleDiff = get_clamped_angle_diff(state->angle, state->bounceDivisor); aimAngle = fabsf(clampedAngleDiff) / state->unk_24 * targetActor->scalingFactor; - if (state->velocity >= 0.0f) { + if (state->vel >= 0.0f) { if (clampedAngleDiff < 0.0f) { battleStatus->unk_86 = 0; } else { @@ -326,18 +326,18 @@ API_CALLABLE(N(ShellShotActionCommand)) { if (script->functionTemp[0] >= 2) { if (script->functionTemp[0] < 3) { aimAngle = clamp_angle(state->angle); - aimX = state->currentPos.x; - aimY = state->currentPos.y; - aimZ = state->currentPos.z; - add_vec2D_polar(&aimX, &aimY, state->distance, aimAngle); - z = state->currentPos.z; - x = state->currentPos.x; - y = state->currentPos.y; + aimX = state->curPos.x; + aimY = state->curPos.y; + aimZ = state->curPos.z; + add_vec2D_polar(&aimX, &aimY, state->dist, aimAngle); + z = state->curPos.z; + x = state->curPos.x; + y = state->curPos.y; for (i = 0; i < ARRAY_COUNT(hudShimmers); i++) { - x += (aimX - state->currentPos.x) / 6.0f; - y += (aimY - state->currentPos.y) / 6.0f; - z += (aimZ - state->currentPos.z) / 6.0f; + x += (aimX - state->curPos.x) / 6.0f; + y += (aimY - state->curPos.y) / 6.0f; + z += (aimZ - state->curPos.z) / 6.0f; get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ); hud_element_set_render_pos(hudMarkers[i], screenX, screenY); hudID = hudShimmers[i]; @@ -378,7 +378,7 @@ API_CALLABLE(N(AirLiftChance)) { Actor* targetActor = get_actor(partnerActor->targetActorID); ActorPart* targetActorPart = get_actor_part(targetActor, partnerActor->targetPartIndex); s32 airLiftChance = targetActor->actorBlueprint->airLiftChance; - s32 hpPercentLost = 100 - targetActor->currentHP * 100 / targetActor->maxHP; + s32 hpPercentLost = 100 - targetActor->curHP * 100 / targetActor->maxHP; if (targetActor->transparentStatus == STATUS_KEY_TRANSPARENT) { airLiftChance = 0; @@ -428,39 +428,39 @@ API_CALLABLE(N(CarryAway)) { switch (script->functionTemp[0]) { case 0: - parakarry->state.goalPos.x = targetActor->currentPos.x - parakarry->currentPos.x; - parakarry->state.goalPos.y = targetActor->currentPos.y - parakarry->currentPos.y; - parakarry->state.goalPos.z = targetActor->currentPos.z - parakarry->currentPos.z; + parakarry->state.goalPos.x = targetActor->curPos.x - parakarry->curPos.x; + parakarry->state.goalPos.y = targetActor->curPos.y - parakarry->curPos.y; + parakarry->state.goalPos.z = targetActor->curPos.z - parakarry->curPos.z; parakarry->state.speed = 2.0f; parakarry->state.moveTime = 0; script->functionTemp[0] = 1; break; case 1: - parakarry->state.currentPos.x += parakarry->state.speed; + parakarry->state.curPos.x += parakarry->state.speed; *animationRatePtr = 1.0f; - y = parakarry->state.currentPos.y; - parakarry->state.currentPos.y = y + (sin_rad(2.0f * sin_rad(DEG_TO_RAD(parakarry->state.moveTime)) * PI_S) * 1.4 + 0.5); + y = parakarry->state.curPos.y; + parakarry->state.curPos.y = y + (sin_rad(2.0f * sin_rad(DEG_TO_RAD(parakarry->state.moveTime)) * PI_S) * 1.4 + 0.5); parakarry->state.moveTime += 6; parakarry->state.moveTime = clamp_angle(parakarry->state.moveTime); if (gGameStatusPtr->frameCounter % 10 == 0) { - sfx_play_sound_at_position(SOUND_2009, SOUND_SPACE_MODE_0, parakarry->state.currentPos.x, parakarry->state.currentPos.y, parakarry->state.currentPos.z); + sfx_play_sound_at_position(SOUND_2009, SOUND_SPACE_MODE_0, parakarry->state.curPos.x, parakarry->state.curPos.y, parakarry->state.curPos.z); } - if (parakarry->state.currentPos.x > 240.0f) { + if (parakarry->state.curPos.x > 240.0f) { battleStatus->actionResult = temp_s4; return ApiStatus_DONE2; } break; } - parakarry->currentPos.x = actorState->currentPos.x; - parakarry->currentPos.y = actorState->currentPos.y; - parakarry->currentPos.z = actorState->currentPos.z; + parakarry->curPos.x = actorState->curPos.x; + parakarry->curPos.y = actorState->curPos.y; + parakarry->curPos.z = actorState->curPos.z; - targetActor->currentPos.x = actorState->currentPos.x + actorState->goalPos.x; - targetActor->currentPos.y = actorState->currentPos.y + actorState->goalPos.y; - targetActor->currentPos.z = actorState->currentPos.z + actorState->goalPos.z; + targetActor->curPos.x = actorState->curPos.x + actorState->goalPos.x; + targetActor->curPos.y = actorState->curPos.y + actorState->goalPos.y; + targetActor->curPos.z = actorState->curPos.z + actorState->goalPos.z; return ApiStatus_BLOCK; } @@ -474,9 +474,9 @@ API_CALLABLE(N(FlyAround)) { switch (script->functionTemp[0]) { case 0: - state->currentPos.x = partner->currentPos.x; - state->currentPos.y = partner->currentPos.y; - state->currentPos.z = partner->currentPos.z; + state->curPos.x = partner->curPos.x; + state->curPos.y = partner->curPos.y; + state->curPos.z = partner->curPos.z; state->angle = 60 - rand_int(10); state->bounceDivisor = 0.0f; state->moveTime = 90; @@ -484,15 +484,15 @@ API_CALLABLE(N(FlyAround)) { script->functionTemp[1] = 0; script->functionTemp[2] = 0; script->functionTemp[3] = 0; - airRaidEffect = fx_effect_65(0, state->currentPos.x, state->currentPos.y, state->currentPos.z, 1.0f, 0); + airRaidEffect = fx_effect_65(0, state->curPos.x, state->curPos.y, state->curPos.z, 1.0f, 0); script->functionTemp[0] = 1; break; case 1: - add_vec2D_polar(&state->currentPos.x, &state->currentPos.y, state->speed, state->angle); - airRaidEffect->data.unk_65->pos.x = state->currentPos.x; - airRaidEffect->data.unk_65->pos.y = state->currentPos.y; - airRaidEffect->data.unk_65->pos.z = state->currentPos.z; - if (state->currentPos.x < -190.0f) { + add_vec2D_polar(&state->curPos.x, &state->curPos.y, state->speed, state->angle); + airRaidEffect->data.unk_65->pos.x = state->curPos.x; + airRaidEffect->data.unk_65->pos.y = state->curPos.y; + airRaidEffect->data.unk_65->pos.z = state->curPos.z; + if (state->curPos.x < -190.0f) { if (script->functionTemp[1] != 0) { script->functionTemp[0] = 2; break; @@ -507,14 +507,14 @@ API_CALLABLE(N(FlyAround)) { } if (script->functionTemp[3] != 0) { - sfx_play_sound_at_position(SOUND_200A, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z); + sfx_play_sound_at_position(SOUND_200A, SOUND_SPACE_MODE_0, state->curPos.x, state->curPos.y, state->curPos.z); } else { - sfx_play_sound_at_position(SOUND_200B, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z); + sfx_play_sound_at_position(SOUND_200B, SOUND_SPACE_MODE_0, state->curPos.x, state->curPos.y, state->curPos.z); } script->functionTemp[3] = 1 - script->functionTemp[3]; } - if (state->currentPos.x > 190.0f) { + if (state->curPos.x > 190.0f) { if (script->functionTemp[1] != 0) { script->functionTemp[0] = 2; break; @@ -529,14 +529,14 @@ API_CALLABLE(N(FlyAround)) { } while (0); if (script->functionTemp[3] != 0) { - sfx_play_sound_at_position(SOUND_200A, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z); + sfx_play_sound_at_position(SOUND_200A, SOUND_SPACE_MODE_0, state->curPos.x, state->curPos.y, state->curPos.z); } else { - sfx_play_sound_at_position(SOUND_200B, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z); + sfx_play_sound_at_position(SOUND_200B, SOUND_SPACE_MODE_0, state->curPos.x, state->curPos.y, state->curPos.z); } script->functionTemp[3] = 1 - script->functionTemp[3]; } - if (state->currentPos.y < -30.0f) { + if (state->curPos.y < -30.0f) { if (script->functionTemp[1] != 0) { script->functionTemp[0] = 2; break; @@ -551,14 +551,14 @@ API_CALLABLE(N(FlyAround)) { } while (0); // TODO macro? if (script->functionTemp[3] != 0) { - sfx_play_sound_at_position(SOUND_200A, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z); + sfx_play_sound_at_position(SOUND_200A, SOUND_SPACE_MODE_0, state->curPos.x, state->curPos.y, state->curPos.z); } else { - sfx_play_sound_at_position(SOUND_200B, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z); + sfx_play_sound_at_position(SOUND_200B, SOUND_SPACE_MODE_0, state->curPos.x, state->curPos.y, state->curPos.z); } script->functionTemp[3] = 1 - script->functionTemp[3]; } - if (state->currentPos.y > 160.0f) { + if (state->curPos.y > 160.0f) { if (script->functionTemp[1] != 0) { script->functionTemp[0] = 2; break; @@ -573,9 +573,9 @@ API_CALLABLE(N(FlyAround)) { } while (0); // TODO macro? if (script->functionTemp[3] != 0) { - sfx_play_sound_at_position(SOUND_200A, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z); + sfx_play_sound_at_position(SOUND_200A, SOUND_SPACE_MODE_0, state->curPos.x, state->curPos.y, state->curPos.z); } else { - sfx_play_sound_at_position(SOUND_200B, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z); + sfx_play_sound_at_position(SOUND_200B, SOUND_SPACE_MODE_0, state->curPos.x, state->curPos.y, state->curPos.z); } script->functionTemp[3] = 1 - script->functionTemp[3]; } @@ -596,17 +596,17 @@ API_CALLABLE(N(FlyAround)) { airRaidEffect->flags |= FX_INSTANCE_FLAG_DISMISS; // fallthrough case 3: - add_vec2D_polar(&state->currentPos.x, &state->currentPos.y, state->speed, state->angle); + add_vec2D_polar(&state->curPos.x, &state->curPos.y, state->speed, state->angle); if (state->moveTime == 0) { - partner->rotation.z = 0.0f; + partner->rot.z = 0.0f; return ApiStatus_DONE2; } state->moveTime--; // fallthrough default: - partner->currentPos.x = state->currentPos.x; - partner->currentPos.y = state->currentPos.y; - partner->currentPos.z = state->currentPos.z; + partner->curPos.x = state->curPos.x; + partner->curPos.y = state->curPos.y; + partner->curPos.z = state->curPos.z; return ApiStatus_BLOCK; } } diff --git a/src/battle/partner/sushie.c b/src/battle/partner/sushie.c index 466497a00e..d5b2539a4c 100644 --- a/src/battle/partner/sushie.c +++ b/src/battle/partner/sushie.c @@ -41,19 +41,19 @@ API_CALLABLE(N(SetSquirtAngle)) { partner->state.goalPos.y += targetPart->projectileTargetOffset.y; partner->state.goalPos.z = partner->state.goalPos.z; // required to match - partner->state.currentPos.x = partner->currentPos.x + 8.0f; - partner->state.currentPos.y = partner->currentPos.y + 16.0f; - partner->state.currentPos.z = partner->currentPos.z; + partner->state.curPos.x = partner->curPos.x + 8.0f; + partner->state.curPos.y = partner->curPos.y + 16.0f; + partner->state.curPos.z = partner->curPos.z; partner->state.angle = atan2( - partner->state.currentPos.x, partner->state.currentPos.y, + partner->state.curPos.x, partner->state.curPos.y, partner->state.goalPos.x, partner->state.goalPos.y ); - partner->rotation.z = (partner->state.angle - 90.0f) * 0.25f; + partner->rot.z = (partner->state.angle - 90.0f) * 0.25f; - if (partner->rotation.z < 0.0f) { - partner->rotation.z = 0.0f; + if (partner->rot.z < 0.0f) { + partner->rot.z = 0.0f; } return ApiStatus_DONE2; @@ -177,7 +177,7 @@ API_CALLABLE(N(PlaySquirtFX)) { Actor* partnerActor = battleStatus->partnerActor; Actor* playerActor = battleStatus->playerActor; - sEffect = fx_squirt(1, partnerActor->currentPos.x - 5.5, partnerActor->currentPos.y + 15.5, partnerActor->currentPos.z + 5, playerActor->currentPos.x, playerActor->currentPos.y, playerActor->currentPos.z, (rand_int(10) * 0.1) + 1, 30); + sEffect = fx_squirt(1, partnerActor->curPos.x - 5.5, partnerActor->curPos.y + 15.5, partnerActor->curPos.z + 5, playerActor->curPos.x, playerActor->curPos.y, playerActor->curPos.z, (rand_int(10) * 0.1) + 1, 30); return ApiStatus_DONE2; } @@ -210,24 +210,24 @@ API_CALLABLE(N(ProcessTidalWave)) { switch (script->functionTemp[0]) { case 0: - state->currentPos.x = partner->currentPos.x; - state->currentPos.y = partner->currentPos.y; - state->currentPos.z = partner->currentPos.z; + state->curPos.x = partner->curPos.x; + state->curPos.y = partner->curPos.y; + state->curPos.z = partner->curPos.z; state->angle = 315.0f; state->bounceDivisor = 0.0f; state->moveTime = 90; state->speed = 32.0f; script->functionTemp[1] = 0; script->functionTemp[2] = 0; - sEffect = fx_water_fountain(1, state->currentPos.x, state->currentPos.y, state->currentPos.z, 1.0f, 0); + sEffect = fx_water_fountain(1, state->curPos.x, state->curPos.y, state->curPos.z, 1.0f, 0); sEffect->data.waterFountain->unk_38 = state->angle; sEffect->data.waterFountain->unk_3C = partner->scale.x; sEffect->data.waterFountain->unk_40 = partner->scale.x; script->functionTemp[0] = 1; break; case 1: - add_vec2D_polar(&state->currentPos.x, &state->currentPos.y, state->speed, state->angle); - if (state->currentPos.x < -160.0f) { + add_vec2D_polar(&state->curPos.x, &state->curPos.y, state->speed, state->angle); + if (state->curPos.x < -160.0f) { if (script->functionTemp[1] != 0) { script->functionTemp[0] = 2; break; @@ -242,7 +242,7 @@ API_CALLABLE(N(ProcessTidalWave)) { } } - if (state->currentPos.x > 160.0f) { + if (state->curPos.x > 160.0f) { if (script->functionTemp[1] != 0) { script->functionTemp[0] = 2; break; @@ -259,14 +259,14 @@ API_CALLABLE(N(ProcessTidalWave)) { } while (0); if (script->functionTemp[2] != 0) { - sfx_play_sound_at_position(SOUND_29B, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z); + sfx_play_sound_at_position(SOUND_29B, SOUND_SPACE_MODE_0, state->curPos.x, state->curPos.y, state->curPos.z); } else { - sfx_play_sound_at_position(SOUND_29C, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z); + sfx_play_sound_at_position(SOUND_29C, SOUND_SPACE_MODE_0, state->curPos.x, state->curPos.y, state->curPos.z); } script->functionTemp[2] = 1 - script->functionTemp[2]; } - if (state->currentPos.y < 0.0f) { + if (state->curPos.y < 0.0f) { if (script->functionTemp[1] != 0) { script->functionTemp[0] = 2; break; @@ -283,14 +283,14 @@ API_CALLABLE(N(ProcessTidalWave)) { } while (0); // TODO macro? if (script->functionTemp[2] != 0) { - sfx_play_sound_at_position(SOUND_29B, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z); + sfx_play_sound_at_position(SOUND_29B, SOUND_SPACE_MODE_0, state->curPos.x, state->curPos.y, state->curPos.z); } else { - sfx_play_sound_at_position(SOUND_29C, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z); + sfx_play_sound_at_position(SOUND_29C, SOUND_SPACE_MODE_0, state->curPos.x, state->curPos.y, state->curPos.z); } script->functionTemp[2] = 1 - script->functionTemp[2]; } - if (state->currentPos.y > 130.0f) { + if (state->curPos.y > 130.0f) { if (script->functionTemp[1] != 0) { script->functionTemp[0] = 2; break; @@ -307,15 +307,15 @@ API_CALLABLE(N(ProcessTidalWave)) { } while (0); // TODO macro? if (script->functionTemp[2] != 0) { - sfx_play_sound_at_position(SOUND_29B, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z); + sfx_play_sound_at_position(SOUND_29B, SOUND_SPACE_MODE_0, state->curPos.x, state->curPos.y, state->curPos.z); } else { - sfx_play_sound_at_position(SOUND_29C, SOUND_SPACE_MODE_0, state->currentPos.x, state->currentPos.y, state->currentPos.z); + sfx_play_sound_at_position(SOUND_29C, SOUND_SPACE_MODE_0, state->curPos.x, state->curPos.y, state->curPos.z); } script->functionTemp[2] = 1 - script->functionTemp[2]; } state->angle = clamp_angle(state->angle + (state->bounceDivisor * 0.5)); - partner->rotation.z = clamp_angle(state->angle - 315.0f); + partner->rot.z = clamp_angle(state->angle - 315.0f); partner->scale.z = partner->scale.y = partner->scale.x = partner->scale.x - 0.06; if (partner->scale.x < 1.0) { partner->scale.x = 1.0f; @@ -325,9 +325,9 @@ API_CALLABLE(N(ProcessTidalWave)) { x = 0.0f; y = 0.0f; add_vec2D_polar(&x, &y, partner->scale.x * -15.0f, state->angle); - sEffect->data.waterFountain->pos.x = state->currentPos.x + x; - sEffect->data.waterFountain->pos.y = state->currentPos.y + y; - sEffect->data.waterFountain->pos.z = state->currentPos.z + 5.0f; + sEffect->data.waterFountain->pos.x = state->curPos.x + x; + sEffect->data.waterFountain->pos.y = state->curPos.y + y; + sEffect->data.waterFountain->pos.z = state->curPos.z + 5.0f; sEffect->data.waterFountain->unk_38 = state->angle; sEffect->data.waterFountain->unk_3C = partner->scale.x; sEffect->data.waterFountain->unk_40 = partner->scale.x; @@ -349,24 +349,24 @@ API_CALLABLE(N(ProcessTidalWave)) { state->moveTime = 5; script->functionTemp[0] = 3; case 3: - add_vec2D_polar(&state->currentPos.x, &state->currentPos.y, state->speed, state->angle); - sEffect->data.waterFountain->pos.x = state->currentPos.x; - sEffect->data.waterFountain->pos.y = state->currentPos.y; - sEffect->data.waterFountain->pos.z = state->currentPos.z; + add_vec2D_polar(&state->curPos.x, &state->curPos.y, state->speed, state->angle); + sEffect->data.waterFountain->pos.x = state->curPos.x; + sEffect->data.waterFountain->pos.y = state->curPos.y; + sEffect->data.waterFountain->pos.z = state->curPos.z; sEffect->data.waterFountain->unk_38 = state->angle; sEffect->data.waterFountain->unk_3C = partner->scale.x; sEffect->data.waterFountain->unk_40 = partner->scale.x; if (state->moveTime == 0) { - partner->rotation.z = 0.0f; + partner->rot.z = 0.0f; sEffect->flags |= FX_INSTANCE_FLAG_DISMISS; return ApiStatus_DONE2; } state->moveTime--; default: - partner->currentPos.x = state->currentPos.x; - partner->currentPos.y = state->currentPos.y; - partner->currentPos.z = state->currentPos.z; - fx_water_splash(3, partner->currentPos.x, partner->currentPos.y, partner->currentPos.z, 1.0f, 10); + partner->curPos.x = state->curPos.x; + partner->curPos.y = state->curPos.y; + partner->curPos.z = state->curPos.z; + fx_water_splash(3, partner->curPos.x, partner->curPos.y, partner->curPos.z, 1.0f, 10); break; } return ApiStatus_BLOCK; diff --git a/src/battle/partner/watt.c b/src/battle/partner/watt.c index e50f10b1d2..8e3b8c5f9d 100644 --- a/src/battle/partner/watt.c +++ b/src/battle/partner/watt.c @@ -54,8 +54,8 @@ API_CALLABLE(N(WattFXUpdate)) { sWattEffectData_bouncePhase = 0; sWattEffectData_isActive = TRUE; sWattEffectData_currentEffectIndex = 0; - sWattEffectData_effect1 = fx_static_status(0, partner->currentPos.x, partner->currentPos.y, partner->currentPos.z, 1.0f, 5, 0); - sWattEffectData_effect2 = fx_static_status(1, partner->currentPos.x, NPC_DISPOSE_POS_Y, partner->currentPos.z, 1.0f, 5, 0); + sWattEffectData_effect1 = fx_static_status(0, partner->curPos.x, partner->curPos.y, partner->curPos.z, 1.0f, 5, 0); + sWattEffectData_effect2 = fx_static_status(1, partner->curPos.x, NPC_DISPOSE_POS_Y, partner->curPos.z, 1.0f, 5, 0); sWattEffectData_initialized = TRUE; } @@ -69,9 +69,9 @@ API_CALLABLE(N(WattFXUpdate)) { } partner->verticalRenderOffset = sin_rad(DEG_TO_RAD(sWattEffectData_bouncePhase)) * 3.0f; - x = partner->currentPos.x + partner->headOffset.x; - y = partner->currentPos.y + partner->headOffset.y + partner->verticalRenderOffset + 12.0f; - z = partner->currentPos.z + partner->headOffset.z; + x = partner->curPos.x + partner->headOffset.x; + y = partner->curPos.y + partner->headOffset.y + partner->verticalRenderOffset + 12.0f; + z = partner->curPos.z + partner->headOffset.z; if ((gBattleStatus.flags2 & (BS_FLAGS2_10 | BS_FLAGS2_4)) == BS_FLAGS2_4) { y = NPC_DISPOSE_POS_Y; } @@ -197,9 +197,9 @@ API_CALLABLE(N(PowerShockFX)) { API_CALLABLE(N(PowerShockDischargeFX)) { Bytecode* args = script->ptrReadPos; Actor* partner = gBattleStatus.partnerActor; - f32 x = partner->currentPos.x + partner->headOffset.x; - f32 y = partner->currentPos.y + partner->headOffset.y + partner->verticalRenderOffset + 12.0f; - f32 z = partner->currentPos.z + partner->headOffset.z; + f32 x = partner->curPos.x + partner->headOffset.x; + f32 y = partner->curPos.y + partner->headOffset.y + partner->verticalRenderOffset + 12.0f; + f32 z = partner->curPos.z + partner->headOffset.z; if (isInitialCall) { script->functionTemp[0] = evt_get_variable(script, *args++); @@ -254,18 +254,18 @@ API_CALLABLE(N(TurboChargeUnwindWatt)) { switch (script->functionTemp[0]) { case 0: script->functionTemp[2] = evt_get_variable(script, *args++); - partner->state.distance = dist2D(player->currentPos.x, player->currentPos.y, partner->currentPos.x, partner->currentPos.y); + partner->state.dist = dist2D(player->curPos.x, player->curPos.y, partner->curPos.x, partner->curPos.y); - partner->state.goalPos.x = player->currentPos.x; - partner->state.goalPos.y = player->currentPos.y + 36.0f; - partner->state.goalPos.z = player->currentPos.z; + partner->state.goalPos.x = player->curPos.x; + partner->state.goalPos.y = player->curPos.y + 36.0f; + partner->state.goalPos.z = player->curPos.z; - partner->state.currentPos.x = partner->currentPos.x; - partner->state.currentPos.y = partner->currentPos.y; - partner->state.currentPos.z = partner->currentPos.z; + partner->state.curPos.x = partner->curPos.x; + partner->state.curPos.y = partner->curPos.y; + partner->state.curPos.z = partner->curPos.z; partner->state.angle = 90.0f; - partner->state.velocity = 5.0f; + partner->state.vel = 5.0f; partner->state.acceleration = 0.5f; partner->state.moveTime = 90; script->functionTemp[1] = 10; @@ -275,13 +275,13 @@ API_CALLABLE(N(TurboChargeUnwindWatt)) { theta = DEG_TO_RAD(partner->state.angle); sinTheta = sin_rad(theta); cosTheta = cos_rad(theta); - partner->state.velocity += partner->state.acceleration; + partner->state.vel += partner->state.acceleration; angle = partner->state.angle; - angle += partner->state.velocity; - deltaX = partner->state.distance * sinTheta; - deltaY = -partner->state.distance * cosTheta; - partner->state.currentPos.x = partner->state.goalPos.x + deltaX; - partner->state.currentPos.y = partner->state.goalPos.y + deltaY; + angle += partner->state.vel; + deltaX = partner->state.dist * sinTheta; + deltaY = -partner->state.dist * cosTheta; + partner->state.curPos.x = partner->state.goalPos.x + deltaX; + partner->state.curPos.y = partner->state.goalPos.y + deltaY; partner->state.angle = angle; partner->state.angle = clamp_angle(angle); @@ -294,13 +294,13 @@ API_CALLABLE(N(TurboChargeUnwindWatt)) { theta = DEG_TO_RAD(partner->state.angle); sinTheta = sin_rad(theta); cosTheta = cos_rad(theta); - distance = partner->state.distance; + distance = partner->state.dist; angle = partner->state.angle; - angle += partner->state.velocity; - deltaX = partner->state.distance * sinTheta; - deltaY = -partner->state.distance * cosTheta; - partner->state.currentPos.x = partner->state.goalPos.x + deltaX; - partner->state.currentPos.y = partner->state.goalPos.y + deltaY; + angle += partner->state.vel; + deltaX = partner->state.dist * sinTheta; + deltaY = -partner->state.dist * cosTheta; + partner->state.curPos.x = partner->state.goalPos.x + deltaX; + partner->state.curPos.y = partner->state.goalPos.y + deltaY; partner->state.angle = angle; partner->state.angle = clamp_angle(angle); if (partner->state.angle < 45.0f) { @@ -319,9 +319,9 @@ API_CALLABLE(N(TurboChargeUnwindWatt)) { partner->yaw = 180.0f; } - partner->currentPos.x = partnerState->currentPos.x; - partner->currentPos.y = partnerState->currentPos.y; - partner->currentPos.z = partnerState->currentPos.z; + partner->curPos.x = partnerState->curPos.x; + partner->curPos.y = partnerState->curPos.y; + partner->curPos.z = partnerState->curPos.z; if (script->functionTemp[2] == 0) { player->yaw += script->functionTemp[1]; script->functionTemp[1]++; diff --git a/src/battle/use_items.c b/src/battle/use_items.c index ddbffe4289..b4e95f8c72 100644 --- a/src/battle/use_items.c +++ b/src/battle/use_items.c @@ -170,14 +170,14 @@ API_CALLABLE(LoadMysteryItemScript) { s32* itemPtr; s32 i; - battleStatus->currentTargetListFlags = item->targetFlags | TARGET_FLAG_8000; - battleStatus->currentAttackElement = 0; + battleStatus->curTargetListFlags = item->targetFlags | TARGET_FLAG_8000; + battleStatus->curAttackElement = 0; player_create_target_list(actor); target = &actor->targetData[actor->targetIndexList[0]]; - battleStatus->currentTargetID = target->actorID; - battleStatus->currentTargetPart = target->partID; + battleStatus->curTargetID = target->actorID; + battleStatus->curTargetPart = target->partID; itemPtr = &ItemKeys[0]; for (i = 0; *itemPtr != ITEM_NONE; i++, itemPtr++) { diff --git a/src/battle_cam.c b/src/battle_cam.c index 6a84579b2b..1da14074d3 100644 --- a/src/battle_cam.c +++ b/src/battle_cam.c @@ -167,9 +167,9 @@ s32 CamPresetUpdate_F(Evt* script, s32 isInitialCall) { if (actor == NULL) { return ApiStatus_BLOCK; } - x = actor->currentPos.x; - y = actor->currentPos.y + actor->size.y / 2 + actor->size.y / 4; - z = actor->currentPos.z; + x = actor->curPos.x; + y = actor->curPos.y + actor->size.y / 2 + actor->size.y / 4; + z = actor->curPos.z; sizeY = actor->size.y; sizeX = actor->size.x; @@ -180,9 +180,9 @@ s32 CamPresetUpdate_F(Evt* script, s32 isInitialCall) { return ApiStatus_BLOCK; } - targetX = targetActor->currentPos.x; - targetY = targetActor->currentPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; - targetZ = targetActor->currentPos.z; + targetX = targetActor->curPos.x; + targetY = targetActor->curPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; + targetZ = targetActor->curPos.z; targetAverageSize = (targetActor->size.y + targetActor->size.x) / 2; middlePosX = x + (targetX - x) / 2; @@ -206,9 +206,9 @@ s32 CamPresetUpdate_F(Evt* script, s32 isInitialCall) { if (actor == NULL) { return ApiStatus_BLOCK; } - x = actor->currentPos.x; - y = actor->currentPos.y + actor->size.y / 2 + actor->size.y / 4; - z = actor->currentPos.z; + x = actor->curPos.x; + y = actor->curPos.y + actor->size.y / 2 + actor->size.y / 4; + z = actor->curPos.z; sizeY = actor->size.y; sizeX = actor->size.x; @@ -219,9 +219,9 @@ s32 CamPresetUpdate_F(Evt* script, s32 isInitialCall) { return ApiStatus_BLOCK; } - targetX = targetActor->currentPos.x; - targetY = targetActor->currentPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; - targetZ = targetActor->currentPos.z; + targetX = targetActor->curPos.x; + targetY = targetActor->curPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; + targetZ = targetActor->curPos.z; targetAverageSize = (targetActor->size.y + targetActor->size.x) /2; middlePosX = x + (targetX - x) / 2; @@ -241,9 +241,9 @@ s32 CamPresetUpdate_F(Evt* script, s32 isInitialCall) { if (actor == NULL) { return ApiStatus_BLOCK; } - x = actor->currentPos.x; - y = actor->currentPos.y + actor->size.y / 2 + actor->size.y / 4; - z = actor->currentPos.z; + x = actor->curPos.x; + y = actor->curPos.y + actor->size.y / 2 + actor->size.y / 4; + z = actor->curPos.z; sizeY = actor->size.y; sizeX = actor->size.x; @@ -254,9 +254,9 @@ s32 CamPresetUpdate_F(Evt* script, s32 isInitialCall) { return ApiStatus_BLOCK; } - targetX = targetActor->currentPos.x; - targetY = targetActor->currentPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; - targetZ = targetActor->currentPos.z; + targetX = targetActor->curPos.x; + targetY = targetActor->curPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; + targetZ = targetActor->curPos.z; targetAverageSize = (targetActor->size.y + targetActor->size.x) / 2; middlePosX = x + (targetX - x) / 2; @@ -381,9 +381,9 @@ s32 CamPresetUpdate_M(Evt* script, s32 isInitialCall) { if (actor == NULL) { return ApiStatus_BLOCK; } - x = actor->currentPos.x; - y = actor->currentPos.y + actor->size.y / 2 + actor->size.y / 4; - z = actor->currentPos.z; + x = actor->curPos.x; + y = actor->curPos.y + actor->size.y / 2 + actor->size.y / 4; + z = actor->curPos.z; sizeY = actor->size.y; sizeX = actor->size.x; @@ -394,9 +394,9 @@ s32 CamPresetUpdate_M(Evt* script, s32 isInitialCall) { return ApiStatus_BLOCK; } - targetX = targetActor->currentPos.x; - targetY = targetActor->currentPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; - targetZ = targetActor->currentPos.z; + targetX = targetActor->curPos.x; + targetY = targetActor->curPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; + targetZ = targetActor->curPos.z; targetAverageSize = (targetActor->size.y + targetActor->size.x) / 2; middlePosX = x + (targetX - x) / 2; @@ -420,9 +420,9 @@ s32 CamPresetUpdate_M(Evt* script, s32 isInitialCall) { if (actor == NULL) { return ApiStatus_BLOCK; } - x = actor->currentPos.x; - y = actor->currentPos.y + actor->size.y / 2 + actor->size.y / 4; - z = actor->currentPos.z; + x = actor->curPos.x; + y = actor->curPos.y + actor->size.y / 2 + actor->size.y / 4; + z = actor->curPos.z; sizeY = actor->size.y; sizeX = actor->size.x; @@ -433,9 +433,9 @@ s32 CamPresetUpdate_M(Evt* script, s32 isInitialCall) { return ApiStatus_BLOCK; } - targetX = targetActor->currentPos.x; - targetY = targetActor->currentPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; - targetZ = targetActor->currentPos.z; + targetX = targetActor->curPos.x; + targetY = targetActor->curPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; + targetZ = targetActor->curPos.z; targetAverageSize = (targetActor->size.y + targetActor->size.x) /2; middlePosX = x + (targetX - x) / 2; @@ -455,9 +455,9 @@ s32 CamPresetUpdate_M(Evt* script, s32 isInitialCall) { if (actor == NULL) { return ApiStatus_BLOCK; } - x = actor->currentPos.x; - y = actor->currentPos.y + actor->size.y / 2 + actor->size.y / 4; - z = actor->currentPos.z; + x = actor->curPos.x; + y = actor->curPos.y + actor->size.y / 2 + actor->size.y / 4; + z = actor->curPos.z; sizeY = actor->size.y; sizeX = actor->size.x; @@ -468,9 +468,9 @@ s32 CamPresetUpdate_M(Evt* script, s32 isInitialCall) { return ApiStatus_BLOCK; } - targetX = targetActor->currentPos.x; - targetY = targetActor->currentPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; - targetZ = targetActor->currentPos.z; + targetX = targetActor->curPos.x; + targetY = targetActor->curPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; + targetZ = targetActor->curPos.z; targetAverageSize = (targetActor->size.y + targetActor->size.x) / 2; middlePosX = x + (targetX - x) / 2; @@ -592,9 +592,9 @@ s32 CamPresetUpdate_G(Evt* script, s32 isInitialCall) { if (actor == NULL) { return ApiStatus_BLOCK; } - x = actor->currentPos.x; - y = actor->currentPos.y + actor->size.y / 2 + actor->size.y / 4; - z = actor->currentPos.z; + x = actor->curPos.x; + y = actor->curPos.y + actor->size.y / 2 + actor->size.y / 4; + z = actor->curPos.z; sizeY = actor->size.y; sizeX = actor->size.x; @@ -604,9 +604,9 @@ s32 CamPresetUpdate_G(Evt* script, s32 isInitialCall) { return ApiStatus_BLOCK; } - targetX = targetActor->currentPos.x; - targetY = targetActor->currentPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; - targetZ = targetActor->currentPos.z; + targetX = targetActor->curPos.x; + targetY = targetActor->curPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; + targetZ = targetActor->curPos.z; targetAverageSize = (targetActor->size.y + targetActor->size.x) / 2; middlePosX = x + (targetX - x) / 2; @@ -626,9 +626,9 @@ s32 CamPresetUpdate_G(Evt* script, s32 isInitialCall) { if (actor == NULL) { return ApiStatus_BLOCK; } - x = actor->currentPos.x; - y = actor->currentPos.y + actor->size.y / 2 + actor->size.y / 4; - z = actor->currentPos.z; + x = actor->curPos.x; + y = actor->curPos.y + actor->size.y / 2 + actor->size.y / 4; + z = actor->curPos.z; sizeY = actor->size.y; sizeX = actor->size.x; @@ -638,9 +638,9 @@ s32 CamPresetUpdate_G(Evt* script, s32 isInitialCall) { return ApiStatus_BLOCK; } - targetX = targetActor->currentPos.x; - targetY = targetActor->currentPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; - targetZ = targetActor->currentPos.z; + targetX = targetActor->curPos.x; + targetY = targetActor->curPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; + targetZ = targetActor->curPos.z; targetAverageSize = (targetActor->size.y + targetActor->size.x) / 2; middlePosX = x + (targetX - x) / 2; @@ -661,9 +661,9 @@ s32 CamPresetUpdate_G(Evt* script, s32 isInitialCall) { return ApiStatus_BLOCK; } actorPart = get_actor_part(targetActor, BattleCam_TargetActorPart); - x = actorPart->absolutePosition.x; - y = actorPart->absolutePosition.y + actorPart->size.y / 2 + actorPart->size.y / 4; - z = actorPart->absolutePosition.z; + x = actorPart->absolutePos.x; + y = actorPart->absolutePos.y + actorPart->size.y / 2 + actorPart->size.y / 4; + z = actorPart->absolutePos.z; sizeY = actorPart->size.y; sizeX = actorPart->size.x; @@ -673,9 +673,9 @@ s32 CamPresetUpdate_G(Evt* script, s32 isInitialCall) { return ApiStatus_BLOCK; } - targetX = targetActor->currentPos.x; - targetY = targetActor->currentPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; - targetZ = targetActor->currentPos.z; + targetX = targetActor->curPos.x; + targetY = targetActor->curPos.y + targetActor->size.y / 2 + targetActor->size.y / 4; + targetZ = targetActor->curPos.z; targetAverageSize = (targetActor->size.y + targetActor->size.x) / 2; middlePosX = x + (targetX - x) / 2; @@ -786,9 +786,9 @@ s32 CamPresetUpdate_I(Evt* script, s32 isInitialCall) { btl_cam_use_preset(BTL_CAM_DEFAULT); return ApiStatus_BLOCK; } - x = actor->currentPos.x; - y = actor->currentPos.y + playerStatus->colliderHeight / 2; - z = actor->currentPos.z; + x = actor->curPos.x; + y = actor->curPos.y + playerStatus->colliderHeight / 2; + z = actor->curPos.z; sizeY = actor->size.y; sizeX = actor->size.x; @@ -800,9 +800,9 @@ s32 CamPresetUpdate_I(Evt* script, s32 isInitialCall) { btl_cam_use_preset(BTL_CAM_DEFAULT); return ApiStatus_BLOCK; } - x = actor->currentPos.x; - y = actor->currentPos.y + actor->size.y / 2; - z = actor->currentPos.z; + x = actor->curPos.x; + y = actor->curPos.y + actor->size.y / 2; + z = actor->curPos.z; sizeY = actor->size.y; sizeX = actor->size.x; @@ -814,9 +814,9 @@ s32 CamPresetUpdate_I(Evt* script, s32 isInitialCall) { btl_cam_use_preset(BTL_CAM_DEFAULT); return ApiStatus_BLOCK; } - x = actor->currentPos.x; - y = actor->currentPos.y + actor->size.y / 2; - z = actor->currentPos.z; + x = actor->curPos.x; + y = actor->curPos.y + actor->size.y / 2; + z = actor->curPos.z; sizeY = actor->size.y; sizeX = actor->size.x; @@ -908,36 +908,36 @@ s32 CamPresetUpdate_H(Evt* script, s32 isInitialCall) { if (actor == NULL) { return ApiStatus_BLOCK; } - currentX = actor->currentPos.x; + currentX = actor->curPos.x; x = actor->state.goalPos.x; y = actor->state.goalPos.y; z = actor->state.goalPos.z; averageSize = (actor->size.y + actor->size.x) / 2; - currentY = actor->currentPos.y + playerStatus->colliderHeight / 2; + currentY = actor->curPos.y + playerStatus->colliderHeight / 2; break; case ACTOR_CLASS_PARTNER: actor = battleStatus->partnerActor; if (actor == NULL) { return ApiStatus_BLOCK; } - currentX = actor->currentPos.x; + currentX = actor->curPos.x; x = actor->state.goalPos.x; y = actor->state.goalPos.y; z = actor->state.goalPos.z; averageSize = (actor->size.y + actor->size.x) / 2; - currentY = actor->currentPos.y + actor->size.y / 2; + currentY = actor->curPos.y + actor->size.y / 2; break; case ACTOR_CLASS_ENEMY: actor = battleStatus->enemyActors[actorID]; if (actor == NULL) { return ApiStatus_BLOCK; } - currentX = actor->currentPos.x; + currentX = actor->curPos.x; x = actor->state.goalPos.x; y = actor->state.goalPos.y; z = actor->state.goalPos.z; averageSize = (actor->size.y + actor->size.x) / 2; - currentY = actor->currentPos.y + actor->size.y / 2; + currentY = actor->curPos.y + actor->size.y / 2; break; default: return ApiStatus_DONE2; @@ -1297,19 +1297,19 @@ ApiStatus CamPresetUpdate_K(Evt* script, s32 isInitialCall) { if (battleStatus->playerActor == NULL) { return ApiStatus_BLOCK; } - y = battleStatus->playerActor->currentPos.y + (playerStatus->colliderHeight / 2); + y = battleStatus->playerActor->curPos.y + (playerStatus->colliderHeight / 2); break; case ACTOR_CLASS_PARTNER: if (battleStatus->partnerActor == NULL) { return ApiStatus_BLOCK; } - y = battleStatus->partnerActor->currentPos.y; + y = battleStatus->partnerActor->curPos.y; break; case ACTOR_CLASS_ENEMY: if (battleStatus->enemyActors[actorID] == NULL) { return ApiStatus_BLOCK; } - y = battleStatus->enemyActors[actorID]->currentPos.y; + y = battleStatus->enemyActors[actorID]->curPos.y; break; } @@ -1350,26 +1350,26 @@ ApiStatus CamPresetUpdate_L(Evt* script, s32 isInitialCall) { if (battleStatus->playerActor == NULL) { return ApiStatus_BLOCK; } - x = battleStatus->playerActor->currentPos.x; - y = battleStatus->playerActor->currentPos.y + (playerStatus->colliderHeight / 2); - z = battleStatus->playerActor->currentPos.z; + x = battleStatus->playerActor->curPos.x; + y = battleStatus->playerActor->curPos.y + (playerStatus->colliderHeight / 2); + z = battleStatus->playerActor->curPos.z; break; case ACTOR_CLASS_PARTNER: if (battleStatus->partnerActor == NULL) { return ApiStatus_BLOCK; } - x = battleStatus->partnerActor->currentPos.x; - y = battleStatus->partnerActor->currentPos.y; - z = battleStatus->partnerActor->currentPos.z; + x = battleStatus->partnerActor->curPos.x; + y = battleStatus->partnerActor->curPos.y; + z = battleStatus->partnerActor->curPos.z; break; case ACTOR_CLASS_ENEMY: default: if (battleStatus->enemyActors[actorID] == NULL) { return ApiStatus_BLOCK; } - x = battleStatus->enemyActors[actorID]->currentPos.x; - y = battleStatus->enemyActors[actorID]->currentPos.y; - z = battleStatus->enemyActors[actorID]->currentPos.z; + x = battleStatus->enemyActors[actorID]->curPos.x; + y = battleStatus->enemyActors[actorID]->curPos.y; + z = battleStatus->enemyActors[actorID]->curPos.z; break; } diff --git a/src/camera.c b/src/camera.c index 6aa7399348..89cf3b16d2 100644 --- a/src/camera.c +++ b/src/camera.c @@ -259,7 +259,7 @@ void func_80032970(Camera* camera, f32 arg1) { s32 flags = camera->flags & CAMERA_FLAG_1000; s32 a2 = flags != 0; - if (camera->currentController != NULL && camera->currentController->type == CAM_CONTROL_FIXED_POS_AND_ORIENTATION) { + if (camera->curController != NULL && camera->curController->type == CAM_CONTROL_FIXED_POS_AND_ORIENTATION) { a2 = TRUE; } @@ -368,7 +368,7 @@ void func_80032C64(Camera* camera) { f32 deltaPosX, deltaPosZ; f32 f24, f22, cosYaw, sinYaw; - rotationRad = camera->trueRotation.x / 180.0f * PI; + rotationRad = camera->trueRot.x / 180.0f * PI; leadAmount = camera->leadAmount; s2 = 0; cos_rad(rotationRad); @@ -399,8 +399,8 @@ void func_80032C64(Camera* camera) { } else { f24 = cosYaw = camera->targetPos.x - camera->unk_524; f22 = camera->targetPos.z - camera->unk_528; - cosYaw = -cos_deg(camera->currentYaw); - sinYaw = -sin_deg(camera->currentYaw); + cosYaw = -cos_deg(camera->curYaw); + sinYaw = -sin_deg(camera->curYaw); product = f24 * cosYaw + f22 * sinYaw; camera->unk_52C = (product > 0) ? -1 : (product < 0) ? 1 : 0; } diff --git a/src/collision.c b/src/collision.c index 05186cc83f..bc4e86b88b 100644 --- a/src/collision.c +++ b/src/collision.c @@ -973,25 +973,25 @@ s32 test_ray_entities(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f3 } dist = hitDepthHoriz + entity->effectiveSize; - if (startX > entity->position.x + dist || startX < entity->position.x - dist) { + if (startX > entity->pos.x + dist || startX < entity->pos.x - dist) { continue; } - if (startZ > entity->position.z + dist || startZ < entity->position.z - dist) { + if (startZ > entity->pos.z + dist || startZ < entity->pos.z - dist) { continue; } switch (type) { case ENTITY_TEST_ANY: case ENTITY_TEST_DOWN: - dist = entity->position.y; + dist = entity->pos.y; dist2 = hitDepthDown + entity->effectiveSize * 2; if (dist + dist2 < startY || startY < dist - dist2) { continue; } break; case ENTITY_TEST_LATERAL: - dist = entity->position.y; + dist = entity->pos.y; dist2 = entity->effectiveSize * 2; if (dist + dist2 < startY || startY < dist - dist2) { continue; @@ -1010,8 +1010,8 @@ s32 test_ray_entities(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f3 boxVertices[2].z = boxVertices[3].z = boxVertices[6].z = boxVertices[7].z = -aabbZ; guMtxXFMF(entity->inverseTransformMatrix, dirX, dirY, dirZ, &gCollisionRayDirX, &gCollisionRayDirY, &gCollisionRayDirZ); - guMtxXFMF(entity->inverseTransformMatrix, startX - entity->position.x, startY - entity->position.y, - startZ - entity->position.z, &gCollisionRayStartX, &gCollisionRayStartY, &gCollisionRayStartZ); + guMtxXFMF(entity->inverseTransformMatrix, startX - entity->pos.x, startY - entity->pos.y, + startZ - entity->pos.z, &gCollisionRayStartX, &gCollisionRayStartY, &gCollisionRayStartZ); for (j = 0; j < 12; j++) { Vec3f* v1 = triangle->v1 = &boxVertices[gEntityColliderFaces[j].x]; @@ -1052,12 +1052,12 @@ s32 test_ray_entities(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f3 break; } - guRotateF(tempMatrix1, entity->rotation.x, 1.0f, 0.0f, 0.0f); - guRotateF(tempMatrix2, entity->rotation.z, 0.0f, 0.0f, 1.0f); + guRotateF(tempMatrix1, entity->rot.x, 1.0f, 0.0f, 0.0f); + guRotateF(tempMatrix2, entity->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(tempMatrix1, tempMatrix2, tempMatrix1); - guRotateF(tempMatrix2, entity->rotation.y, 0.0f, 1.0f, 0.0f); + guRotateF(tempMatrix2, entity->rot.y, 0.0f, 1.0f, 0.0f); guMtxCatF(tempMatrix1, tempMatrix2, tempMatrix1); - guTranslateF(tempMatrix2, entity->position.x, entity->position.y, entity->position.z); + guTranslateF(tempMatrix2, entity->pos.x, entity->pos.y, entity->pos.z); guMtxCatF(tempMatrix1, tempMatrix2, tempMatrix1); guMtxXFMF(tempMatrix1, gCollisionPointX, gCollisionPointY, gCollisionPointZ, hitX, hitY, hitZ); diff --git a/src/common/ActorJumpToPos.inc.c b/src/common/ActorJumpToPos.inc.c index 9f6088ed65..c9e985b24d 100644 --- a/src/common/ActorJumpToPos.inc.c +++ b/src/common/ActorJumpToPos.inc.c @@ -2,35 +2,35 @@ API_CALLABLE(N(ActorJumpToPos)) { Actor* actor = get_actor(script->owner1.actorID); - Vec3f* temp_f0 = &actor->state.currentPos; + Vec3f* temp_f0 = &actor->state.curPos; if (isInitialCall) { script->functionTemp[0] = 0; } if (script->functionTemp[0] == 0) { - actor->state.currentPos.x = actor->currentPos.x; - actor->state.currentPos.y = actor->currentPos.y; - actor->state.currentPos.z = actor->currentPos.z; + actor->state.curPos.x = actor->curPos.x; + actor->state.curPos.y = actor->curPos.y; + actor->state.curPos.z = actor->curPos.z; script->functionTemp[0] = 1; } - if (actor->state.velocity > 0.0f) { + if (actor->state.vel > 0.0f) { set_animation(ACTOR_SELF, 1, actor->state.animJumpRise); } - if (actor->state.velocity < 0.0f) { + if (actor->state.vel < 0.0f) { set_animation(ACTOR_SELF, 1, actor->state.animJumpFall); } - actor->state.currentPos.y += actor->state.velocity; - actor->state.velocity = actor->state.velocity - actor->state.acceleration; + actor->state.curPos.y += actor->state.vel; + actor->state.vel = actor->state.vel - actor->state.acceleration; add_xz_vec3f(temp_f0, actor->state.speed, actor->state.angle); - actor->currentPos.x = actor->state.currentPos.x; - actor->currentPos.y = actor->state.currentPos.y; - actor->currentPos.z = actor->state.currentPos.z; + actor->curPos.x = actor->state.curPos.x; + actor->curPos.y = actor->state.curPos.y; + actor->curPos.z = actor->state.curPos.z; - if (actor->currentPos.y < 0.0f) { - actor->currentPos.y = 0.0f; - play_movement_dust_effects(2, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z, actor->yaw); + if (actor->curPos.y < 0.0f) { + actor->curPos.y = 0.0f; + play_movement_dust_effects(2, actor->curPos.x, actor->curPos.y, actor->curPos.z, actor->yaw); sfx_play_sound(SOUND_SOFT_LAND); return ApiStatus_DONE1; } diff --git a/src/common/GetItemEntityPosition.inc.c b/src/common/GetItemEntityPosition.inc.c index ddecfe1f24..9ce3b84d3a 100644 --- a/src/common/GetItemEntityPosition.inc.c +++ b/src/common/GetItemEntityPosition.inc.c @@ -5,8 +5,8 @@ API_CALLABLE(N(GetItemEntityPosition)) { Bytecode* args = script->ptrReadPos; ItemEntity* entity = get_item_entity(evt_get_variable(script, *args++)); - evt_set_variable(script, *args++, entity->position.x); - evt_set_variable(script, *args++, entity->position.y); - evt_set_variable(script, *args++, entity->position.z); + evt_set_variable(script, *args++, entity->pos.x); + evt_set_variable(script, *args++, entity->pos.y); + evt_set_variable(script, *args++, entity->pos.z); return ApiStatus_DONE2; } diff --git a/src/common/ItemEntityJumpToPos.inc.c b/src/common/ItemEntityJumpToPos.inc.c index 6323ceda9a..87011377e0 100644 --- a/src/common/ItemEntityJumpToPos.inc.c +++ b/src/common/ItemEntityJumpToPos.inc.c @@ -6,7 +6,7 @@ API_CALLABLE(N(ItemEntityJumpToPos)) { /* 0x0C */ f32 moveAngle; /* 0x10 */ f32 jumpAccel; /* 0x14 */ f32 moveSpeed; - /* 0x18 */ f32 jumpVelocity; + /* 0x18 */ f32 jumpVel; /* 0x1C */ s32 moveTime; /* 0x20 */ s32 itemEntityIndex; }* jumpState; @@ -25,11 +25,11 @@ API_CALLABLE(N(ItemEntityJumpToPos)) { jumpState->moveTime = evt_get_variable(script, *args++); jumpState->jumpAccel = evt_get_float_variable(script, *args++); item = get_item_entity(jumpState->itemEntityIndex); - moveDist = dist2D(item->position.x, item->position.z, jumpState->pos.x, jumpState->pos.z); - jumpState->moveAngle = atan2(item->position.x, item->position.z, jumpState->pos.x, jumpState->pos.z); + moveDist = dist2D(item->pos.x, item->pos.z, jumpState->pos.x, jumpState->pos.z); + jumpState->moveAngle = atan2(item->pos.x, item->pos.z, jumpState->pos.x, jumpState->pos.z); - temp_f2 = item->position.y; - jumpState->jumpVelocity = (jumpState->jumpAccel * jumpState->moveTime * 0.5f) + temp_f2 = item->pos.y; + jumpState->jumpVel = (jumpState->jumpAccel * jumpState->moveTime * 0.5f) + ((jumpState->pos.y - temp_f2) / jumpState->moveTime); temp_f2 = jumpState->moveTime; @@ -43,16 +43,16 @@ API_CALLABLE(N(ItemEntityJumpToPos)) { return ApiStatus_DONE2; } - item->position.x += (jumpState->moveSpeed * sin_deg(jumpState->moveAngle)); - item->position.z -= (jumpState->moveSpeed * cos_deg(jumpState->moveAngle)); - item->position.y += jumpState->jumpVelocity; + item->pos.x += (jumpState->moveSpeed * sin_deg(jumpState->moveAngle)); + item->pos.z -= (jumpState->moveSpeed * cos_deg(jumpState->moveAngle)); + item->pos.y += jumpState->jumpVel; jumpState->moveTime--; - jumpState->jumpVelocity = (jumpState->jumpVelocity - jumpState->jumpAccel); + jumpState->jumpVel = (jumpState->jumpVel - jumpState->jumpAccel); if (jumpState->moveTime < 0) { - item->position.x = jumpState->pos.x; - item->position.y = jumpState->pos.y; - item->position.z = jumpState->pos.z; - jumpState->jumpVelocity = 0.0f; + item->pos.x = jumpState->pos.x; + item->pos.y = jumpState->pos.y; + item->pos.z = jumpState->pos.z; + jumpState->jumpVel = 0.0f; heap_free((void*) script->functionTemp[0]); return ApiStatus_DONE1; } diff --git a/src/common/SetPlayerStatusPosYaw.inc.c b/src/common/SetPlayerStatusPosYaw.inc.c index 78b45f020b..1e9974ed87 100644 --- a/src/common/SetPlayerStatusPosYaw.inc.c +++ b/src/common/SetPlayerStatusPosYaw.inc.c @@ -7,9 +7,9 @@ API_CALLABLE(N(SetPlayerStatusPosYaw)) { f32 z = evt_get_float_variable(script, *args++); f32 yaw = evt_get_float_variable(script, *args++); - gPlayerStatus.position.x = x; - gPlayerStatus.position.y = y; - gPlayerStatus.position.z = z; + gPlayerStatus.pos.x = x; + gPlayerStatus.pos.y = y; + gPlayerStatus.pos.z = z; gPlayerStatus.targetYaw = yaw; return ApiStatus_DONE2; } diff --git a/src/common/UnkActorPosFunc.inc.c b/src/common/UnkActorPosFunc.inc.c index 7c9a771a46..9c4ae89832 100644 --- a/src/common/UnkActorPosFunc.inc.c +++ b/src/common/UnkActorPosFunc.inc.c @@ -5,22 +5,22 @@ API_CALLABLE(N(UnkActorPosFunc)) { ActorState* actorState = &actor->state; if (isInitialCall) { - actor->state.currentPos.x = actor->currentPos.x; - actor->state.currentPos.y = actor->currentPos.y; - actor->state.currentPos.z = actor->currentPos.z; + actor->state.curPos.x = actor->curPos.x; + actor->state.curPos.y = actor->curPos.y; + actor->state.curPos.z = actor->curPos.z; } - add_xz_vec3f(&actorState->currentPos, actor->state.speed, actor->state.angle); + add_xz_vec3f(&actorState->curPos, actor->state.speed, actor->state.angle); if (actor->state.speed < 4.0f) { - play_movement_dust_effects(0, actor->state.currentPos.x, actor->state.currentPos.y, actor->state.currentPos.z, actor->state.angle); + play_movement_dust_effects(0, actor->state.curPos.x, actor->state.curPos.y, actor->state.curPos.z, actor->state.angle); } else { - play_movement_dust_effects(1, actor->state.currentPos.x, actor->state.currentPos.y, actor->state.currentPos.z, actor->state.angle); + play_movement_dust_effects(1, actor->state.curPos.x, actor->state.curPos.y, actor->state.curPos.z, actor->state.angle); } actorState->speed /= 1.5; - actor->currentPos.x = actorState->currentPos.x; - actor->currentPos.y = actorState->currentPos.y; - actor->currentPos.z = actorState->currentPos.z; + actor->curPos.x = actorState->curPos.x; + actor->curPos.y = actorState->curPos.y; + actor->curPos.z = actorState->curPos.z; if (actorState->speed < 1.0) { return ApiStatus_DONE2; diff --git a/src/common/UnkSfxFunc.inc.c b/src/common/UnkSfxFunc.inc.c index fe64116623..290b252452 100644 --- a/src/common/UnkSfxFunc.inc.c +++ b/src/common/UnkSfxFunc.inc.c @@ -7,17 +7,17 @@ API_CALLABLE(N(UnkSfxFunc)) { f32 distZ; if (isInitialCall) { - distX = actor->state.goalPos.x - actor->currentPos.x; - distY = actor->state.goalPos.y - actor->currentPos.y; - distZ = actor->state.goalPos.z - actor->currentPos.z; + distX = actor->state.goalPos.x - actor->curPos.x; + distY = actor->state.goalPos.y - actor->curPos.y; + distZ = actor->state.goalPos.z - actor->curPos.z; script->functionTemp[0] = ((sqrtf(SQ(distX) + SQ(distY) + SQ(distZ)) / actor->state.speed) * 0.5f) + 1.0f; - sfx_play_sound_at_position(SOUND_359, SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(SOUND_359, SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } if (script->functionTemp[0]-- > 0) { return ApiStatus_BLOCK; } - sfx_play_sound_at_position(SOUND_359 | SOUND_ID_TRIGGER_CHANGE_SOUND, SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(SOUND_359 | SOUND_ID_TRIGGER_CHANGE_SOUND, SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); return ApiStatus_DONE2; } diff --git a/src/common/UnkStarFunc.inc.c b/src/common/UnkStarFunc.inc.c index 6d1c11085a..421cdc4159 100644 --- a/src/common/UnkStarFunc.inc.c +++ b/src/common/UnkStarFunc.inc.c @@ -4,7 +4,7 @@ API_CALLABLE(N(UnkStarFunc)) { PlayerData* playerData = &gPlayerData; Bytecode* args = script->ptrReadPos; - set_animation(ACTOR_PARTNER, 0, D_8029C890[playerData->currentPartner][evt_get_variable(script, *args++)]); + set_animation(ACTOR_PARTNER, 0, D_8029C890[playerData->curPartner][evt_get_variable(script, *args++)]); return ApiStatus_DONE2; } diff --git a/src/common/battle/ChompChainSupport.inc.c b/src/common/battle/ChompChainSupport.inc.c index b1559a55ad..5ef259c1ba 100644 --- a/src/common/battle/ChompChainSupport.inc.c +++ b/src/common/battle/ChompChainSupport.inc.c @@ -39,25 +39,25 @@ API_CALLABLE(N(ChompChainInit)) { chainParts = heap_malloc(NUM_CHAIN_LINKS * sizeof(*chainParts)); actor->state.functionTempPtr[0] = chainParts; - x = actor->currentPos.x + 12.0; - y = actor->currentPos.y + 5.0; - z = actor->currentPos.z; + x = actor->curPos.x + 12.0; + y = actor->curPos.y + 5.0; + z = actor->curPos.z; for (i = 0; i < NUM_CHAIN_LINKS; i++, chainParts++) { chainParts->outerLinkLen = 7.0f; chainParts->linkLengthZ = 7.0f; chainParts->innerLinkLen = 7.0f; - chainParts->currentPos.x = x; - chainParts->currentPos.y = y; - chainParts->currentPos.z = z; + chainParts->curPos.x = x; + chainParts->curPos.y = y; + chainParts->curPos.z = z; chainParts->settleAmt = 0; chainParts->settleRate = 0.6f; chainParts->gravAccel = 3.0f; chainParts->velY = 0; actorPart = get_actor_part(actor, baseChainPart + i); - actorPart->absolutePosition.x = chainParts->currentPos.x; - actorPart->absolutePosition.y = chainParts->currentPos.y; - actorPart->absolutePosition.z = chainParts->currentPos.z; + actorPart->absolutePos.x = chainParts->curPos.x; + actorPart->absolutePos.y = chainParts->curPos.y; + actorPart->absolutePos.z = chainParts->curPos.z; } return ApiStatus_DONE2; } @@ -67,8 +67,8 @@ void N(ChompChainAddPolarPos)(ChompChain* script, f32 magnitude, f32 angleDeg) { f32 dirX = sin_rad(angle); f32 dirY = cos_rad(angle); - script->currentPos.x += -magnitude * dirX; - script->currentPos.y += magnitude * dirY; + script->curPos.x += -magnitude * dirX; + script->curPos.y += magnitude * dirY; } void N(ChompChainGetPolarX)(f32* x, f32 magnitude, f32 angleDeg) { @@ -106,11 +106,11 @@ API_CALLABLE(N(ChompChainUpdate)) { // initialize prev positions to the rear of the actor's body chain = actor->state.functionTempPtr[0]; if (actor->debuff == STATUS_KEY_SHRINK) { - prevX = actor->currentPos.x + 6.0; - prevY = actor->currentPos.y + 2.5; + prevX = actor->curPos.x + 6.0; + prevY = actor->curPos.y + 2.5; } else { - prevX = actor->currentPos.x + 12.0; - prevY = actor->currentPos.y + 5.0; + prevX = actor->curPos.x + 12.0; + prevY = actor->curPos.y + 5.0; } // update each link in the chain @@ -130,27 +130,27 @@ API_CALLABLE(N(ChompChainUpdate)) { if (chain->velY < 2.0f * -chain->gravAccel) { chain->velY = 2.0f * -chain->gravAccel; if (actor->state.varTable[CHOMP_CHAIN_AVAR_SOUNDS] && i == 0) { - sfx_play_sound_at_position(SOUND_2063, SOUND_SPACE_MODE_0, actor->currentPos.x, actor->currentPos.y, actor->currentPos.z); + sfx_play_sound_at_position(SOUND_2063, SOUND_SPACE_MODE_0, actor->curPos.x, actor->curPos.y, actor->curPos.z); } } // add velocity and clamp position to roughly the radius of the chain (assuming ground at y = 0) - chain->currentPos.y += chain->velY; + chain->curPos.y += chain->velY; if (actor->debuff == STATUS_KEY_SHRINK) { - if (chain->currentPos.y < 2.5) { - chain->currentPos.y = 2.5f; + if (chain->curPos.y < 2.5) { + chain->curPos.y = 2.5f; chain->velY = 0.0f; } } else { - if (chain->currentPos.y < 5.0) { - chain->currentPos.y = 5.0f; + if (chain->curPos.y < 5.0) { + chain->curPos.y = 5.0f; chain->velY = 0.0f; } } // get distance from previous part of the chain - dist = dist2D(prevX, prevY, chain->currentPos.x, chain->currentPos.y); - angle = atan2(prevX, prevY, chain->currentPos.x, chain->currentPos.y); + dist = dist2D(prevX, prevY, chain->curPos.x, chain->curPos.y); + angle = atan2(prevX, prevY, chain->curPos.x, chain->curPos.y); if (dist >= chain->linkLengthZ) { N(ChompChainGetPolarX)(&sp18, dist - chain->linkLengthZ, angle); @@ -181,13 +181,13 @@ API_CALLABLE(N(ChompChainUpdate)) { } #if CHOMP_CHAIN_UPDATE_Z == TRUE - chain->currentPos.z = posZ; + chain->curPos.z = posZ; #endif part = get_actor_part(actor, baseChainPart + i); - part->absolutePosition.x = chain->currentPos.x; - part->absolutePosition.y = chain->currentPos.y; - part->absolutePosition.z = chain->currentPos.z; + part->absolutePos.x = chain->curPos.x; + part->absolutePos.y = chain->curPos.y; + part->absolutePos.z = chain->curPos.z; if (actor->debuff == STATUS_KEY_SHRINK) { part->scale.x = 0.5f; @@ -198,8 +198,8 @@ API_CALLABLE(N(ChompChainUpdate)) { part->scale.y = 1.0f; part->scale.z = 1.0f; } - prevX = chain->currentPos.x; - prevY = chain->currentPos.y; + prevX = chain->curPos.x; + prevY = chain->curPos.y; } return ApiStatus_DONE2; diff --git a/src/effects/attack_result_text.c b/src/effects/attack_result_text.c index 54193f57df..afe7af4d0b 100644 --- a/src/effects/attack_result_text.c +++ b/src/effects/attack_result_text.c @@ -193,7 +193,7 @@ void func_E0090444(EffectInstance* effect) { if (type < 5) { guTranslateF(mtxA, data->pos.x, data->pos.y, data->pos.z); - guRotateF(mtxB, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(mtxB, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(mtxB, mtxA, mtxA); guScaleF(mtxB, scale, scale, 1.0f); guMtxCatF(mtxB, mtxA, mtxA); diff --git a/src/effects/aura.c b/src/effects/aura.c index a961f93386..4a06975e31 100644 --- a/src/effects/aura.c +++ b/src/effects/aura.c @@ -250,7 +250,7 @@ void aura_render(EffectInstance* effect) { renderTask.appendGfx = aura_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -278,7 +278,7 @@ void aura_appendGfx(void* argEffect) { if (type == 2) { guRotateF(tempMtx, data->renderYaw, 0.0f, 1.0f, 0.0f); } else { - guRotateF(tempMtx, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(tempMtx, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); } guMtxCatF(tempMtx, translateMtx, transformMtx); guScaleF(tempMtx, data->scale.x, data->scale.y, 1.0f); @@ -297,7 +297,7 @@ void aura_appendGfx(void* argEffect) { if (type == 2) { guRotateF(tempMtx, data->renderYaw, 0.0f, 1.0f, 0.0f); } else { - guRotateF(tempMtx, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(tempMtx, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); } guMtxCatF(tempMtx, translateMtx, transformMtx); guScaleF(tempMtx, data->scale.x, data->scale.y, 1.0f); diff --git a/src/effects/balloon.c b/src/effects/balloon.c index 6409abc5e3..4c8fd93a4b 100644 --- a/src/effects/balloon.c +++ b/src/effects/balloon.c @@ -76,7 +76,7 @@ void balloon_render(EffectInstance* effect) { renderTask.appendGfx = balloon_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_SURFACE_OPA; retTask = queue_render_task(&renderTask); @@ -93,7 +93,7 @@ void balloon_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guScaleF(sp58, data->unk_18, data->unk_18, 1.0f); guMtxCatF(sp58, sp18, sp18); diff --git a/src/effects/big_smoke_puff.c b/src/effects/big_smoke_puff.c index 8706f8cca8..9cc3383f3b 100644 --- a/src/effects/big_smoke_puff.c +++ b/src/effects/big_smoke_puff.c @@ -112,7 +112,7 @@ void big_smoke_puff_render(EffectInstance* effect) { renderTask.appendGfx = big_smoke_puff_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -128,7 +128,7 @@ void big_smoke_puff_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - guPositionF(mtx, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, data->x, data->y, data->z); + guPositionF(mtx, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, data->x, data->y, data->z); guMtxF2L(mtx, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, diff --git a/src/effects/big_snowflakes.c b/src/effects/big_snowflakes.c index ef6219a512..12d8b33400 100644 --- a/src/effects/big_snowflakes.c +++ b/src/effects/big_snowflakes.c @@ -100,7 +100,7 @@ void big_snowflakes_render(EffectInstance* effect) { renderTask.appendGfx = big_snowflakes_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -120,7 +120,7 @@ void big_snowflakes_appendGfx(void* effect) { gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, data->unk_24); guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp98); data++; diff --git a/src/effects/blast.c b/src/effects/blast.c index e7a0ac71b1..0234038a72 100644 --- a/src/effects/blast.c +++ b/src/effects/blast.c @@ -85,7 +85,7 @@ void blast_render(EffectInstance* effect) { renderTask.appendGfx = blast_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -108,7 +108,7 @@ void blast_appendGfx(void *effect) { gSPDisplayList(gMainGfxPos++, D_E007C510[unk_20]); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp98); guScaleF(sp18, data->unk_10, data->unk_10, 1.0f); guMtxCatF(sp18, sp98, sp98); diff --git a/src/effects/bombette_breaking.c b/src/effects/bombette_breaking.c index f3d1bb3ba0..bafd182a64 100644 --- a/src/effects/bombette_breaking.c +++ b/src/effects/bombette_breaking.c @@ -195,7 +195,7 @@ void bombette_breaking_render(EffectInstance* effect) { renderTask.appendGfx = bombette_breaking_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -241,7 +241,7 @@ void bombette_breaking_appendGfx(void* effect) { data++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, data++) { gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, (data->alpha * mainAlpha) / 255); - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, unk_38, + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, unk_38, data->center.x, data->center.y, data->center.z); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], diff --git a/src/effects/breaking_junk.c b/src/effects/breaking_junk.c index 111b4d2460..9a53c13f8c 100644 --- a/src/effects/breaking_junk.c +++ b/src/effects/breaking_junk.c @@ -124,7 +124,7 @@ void breaking_junk_render(EffectInstance* effect) { renderTask.appendGfx = breaking_junk_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -142,7 +142,7 @@ void breaking_junk_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_E01187C0[0]); for (i = 0; i < ((EffectInstance*)effect)->numParts; i++, data++) { - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale * 0.5, data->pos.x, data->pos.y, data->pos.z); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, data->scale * 0.5, data->pos.x, data->pos.y, data->pos.z); guRotateF(sp60, data->rot, 0.0f, 0.0f, 1.0f); guMtxCatF(sp60, sp20, sp20); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/bulb_glow.c b/src/effects/bulb_glow.c index f047e12115..424a4e19b9 100644 --- a/src/effects/bulb_glow.c +++ b/src/effects/bulb_glow.c @@ -137,10 +137,10 @@ void bulb_glow_render(EffectInstance* effect) { renderTask.appendGfxArg = effect; renderTask.appendGfx = bulb_glow_appendGfx; if (data->unk_00 == 5) { - renderTask.distance = 0; + renderTask.dist = 0; renderTaskPtr->renderMode = RENDER_MODE_SURFACE_OPA; } else { - renderTask.distance = -100; + renderTask.dist = -100; renderTaskPtr->renderMode = RENDER_MODE_2D; } diff --git a/src/effects/butterflies.c b/src/effects/butterflies.c index 394ddea281..c36516215e 100644 --- a/src/effects/butterflies.c +++ b/src/effects/butterflies.c @@ -153,7 +153,7 @@ void butterflies_render(EffectInstance* effect) { renderTask.appendGfx = butterflies_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/chapter_change.c b/src/effects/chapter_change.c index a99c5b2133..28bdfffe49 100644 --- a/src/effects/chapter_change.c +++ b/src/effects/chapter_change.c @@ -219,7 +219,7 @@ void chapter_change_render(EffectInstance* effect) { renderTask.appendGfx = chapter_change_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/chomp_drop.c b/src/effects/chomp_drop.c index ac235af4b1..21e503b3e1 100644 --- a/src/effects/chomp_drop.c +++ b/src/effects/chomp_drop.c @@ -126,7 +126,7 @@ void chomp_drop_render(EffectInstance* effect) { renderTask.appendGfx = chomp_drop_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = -10; + renderTask.dist = -10; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; retTask = queue_render_task(&renderTask); diff --git a/src/effects/cloud_puff.c b/src/effects/cloud_puff.c index 5c4b681782..f73489b606 100644 --- a/src/effects/cloud_puff.c +++ b/src/effects/cloud_puff.c @@ -105,7 +105,7 @@ void cloud_puff_render(EffectInstance* effect) { renderTask.appendGfx = cloud_puff_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -125,7 +125,7 @@ void cloud_puff_appendGfx(void* effect) { for (i = 0; i < effectTemp->numParts; i++, part++) { if (part->alive) { - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, part->unk_0C, part->unk_10, part->unk_14); guScaleF(sp60, part->unk_18, part->unk_1C, part->unk_20); guMtxCatF(sp60, sp20, sp20); diff --git a/src/effects/cloud_trail.c b/src/effects/cloud_trail.c index ab349343e3..3882efd513 100644 --- a/src/effects/cloud_trail.c +++ b/src/effects/cloud_trail.c @@ -106,7 +106,7 @@ void cloud_trail_render(EffectInstance* effect) { renderTask.appendGfx = cloud_trail_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -126,7 +126,7 @@ void cloud_trail_appendGfx(void* effect) { for (i = 0; i < effectTemp->numParts; i++, part++) { if (part->alive) { - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, part->unk_0C, part->unk_10, part->unk_14); guScaleF(sp60, part->unk_1C, part->unk_20, part->unk_24); guMtxCatF(sp60, sp20, sp20); diff --git a/src/effects/cold_breath.c b/src/effects/cold_breath.c index 5b9ae7632b..1fc4433178 100644 --- a/src/effects/cold_breath.c +++ b/src/effects/cold_breath.c @@ -169,7 +169,7 @@ void cold_breath_render(EffectInstance* effect) { renderTask.appendGfx = cold_breath_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 6; + renderTask.dist = 6; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/confetti.c b/src/effects/confetti.c index 50da8aaaa5..b65c1bb95e 100644 --- a/src/effects/confetti.c +++ b/src/effects/confetti.c @@ -238,7 +238,7 @@ void confetti_render(EffectInstance* effect) { renderTask.appendGfx = confetti_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -271,7 +271,7 @@ void confetti_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09000940_38C4E0); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/damage_indicator.c b/src/effects/damage_indicator.c index b4f19d74ff..94a43666d5 100644 --- a/src/effects/damage_indicator.c +++ b/src/effects/damage_indicator.c @@ -205,7 +205,7 @@ void damage_indicator_render_impl(EffectInstance* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effect->graphics->data)); guTranslateF(mtxTransform, part->basePos.x, part->basePos.y, part->basePos.z); - guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(mtxTemp, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/damage_stars.c b/src/effects/damage_stars.c index 9269412e1e..3d0a3bec31 100644 --- a/src/effects/damage_stars.c +++ b/src/effects/damage_stars.c @@ -115,8 +115,8 @@ void damage_stars_main( part->unk_18 = arg6 + sp30[0][2] * var_f30 + sp30[1][2] * sp70 + sp30[2][2] * var_f28; break; case 3: - rotateX = sin_deg(gCameras[gCurrentCameraID].currentYaw); - rotateZ = -cos_deg(gCameras[gCurrentCameraID].currentYaw); + rotateX = sin_deg(gCameras[gCurrentCameraID].curYaw); + rotateZ = -cos_deg(gCameras[gCurrentCameraID].curYaw); guRotateF(sp30, (arg7 != 1) ? (i * 100) / (arg7 - 1) - 50 : 0.0f, rotateX, 0.0f, rotateZ); @@ -125,8 +125,8 @@ void damage_stars_main( part->unk_18 = sp30[0][2] * arg4 + sp30[1][2] * arg5 + sp30[2][2] * arg6; break; case 4: - rotateX = sin_deg(gCameras[gCurrentCameraID].currentYaw); - rotateZ = -cos_deg(gCameras[gCurrentCameraID].currentYaw); + rotateX = sin_deg(gCameras[gCurrentCameraID].curYaw); + rotateZ = -cos_deg(gCameras[gCurrentCameraID].curYaw); guRotateF(sp30, (i * 360.0f) / (arg7 - 1), rotateX, 0.0f, rotateZ); part->unk_10 = sp30[0][0] * arg4 + sp30[1][0] * arg5 + sp30[2][0] * arg6; part->unk_14 = sp30[0][1] * arg4 + sp30[1][1] * arg5 + sp30[2][1] * arg6; @@ -232,7 +232,7 @@ void damage_stars_render(EffectInstance* effect) { renderTask.appendGfx = damage_stars_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -260,7 +260,7 @@ void damage_stars_appendGfx(void* effect) { gDPSetPrimColor(gMainGfxPos++, 0, 0, D_E0030E90[rIdx % 36], D_E0030E90[gIdx % 36], D_E0030E90[bIdx % 36], part->unk_24); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/debuff.c b/src/effects/debuff.c index 35341bca66..d52501775d 100644 --- a/src/effects/debuff.c +++ b/src/effects/debuff.c @@ -123,7 +123,7 @@ void debuff_render(EffectInstance* effect) { renderTask.appendGfx = debuff_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -145,7 +145,7 @@ void debuff_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, dlist2); guTranslateF(mtxTranslate, data->pos.x, data->pos.y, data->pos.z); - guRotateF(mtxRotate, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(mtxRotate, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(mtxRotate, mtxTranslate, mtxTransform); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/disable_x.c b/src/effects/disable_x.c index b92c9332f0..fd1d751a03 100644 --- a/src/effects/disable_x.c +++ b/src/effects/disable_x.c @@ -217,7 +217,7 @@ void func_E0082580(DisableXFXData* data) { guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); guScaleF(sp58, data->scale, data->scale, 1.0f); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], diff --git a/src/effects/drop_leaves.c b/src/effects/drop_leaves.c index 9ee19e6859..87f0ade866 100644 --- a/src/effects/drop_leaves.c +++ b/src/effects/drop_leaves.c @@ -119,7 +119,7 @@ void drop_leaves_render(EffectInstance* effect) { renderTask.appendGfx = drop_leaves_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -138,7 +138,7 @@ void drop_leaves_appendGfx(void* effect) { gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, part->unk_24); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp98); part++; diff --git a/src/effects/dust.c b/src/effects/dust.c index 451d951c25..41716c6bd5 100644 --- a/src/effects/dust.c +++ b/src/effects/dust.c @@ -118,7 +118,7 @@ void dust_render(EffectInstance* effect) { renderTask.appendGfx = dust_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; retTask = queue_render_task(&renderTask); @@ -140,7 +140,7 @@ void dust_appendGfx(void* effect) { gDPSetEnvColor(gMainGfxPos++, part->unk_3C, part->unk_40, part->unk_44, 0); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp98); unk_00 = part->unk_00; diff --git a/src/effects/effect_3D.c b/src/effects/effect_3D.c index 1191c6c294..81e9539097 100644 --- a/src/effects/effect_3D.c +++ b/src/effects/effect_3D.c @@ -204,7 +204,7 @@ void effect_3D_render(EffectInstance* effect) { renderTask.appendGfx = effect_3D_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -234,7 +234,7 @@ void effect_3D_appendGfx(void* effect) { gDPSetPrimColor(gMainGfxPos++, 0, 0, 200, 255, 255, part->unk_58); guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guScaleF(sp58, part->unk_44, part->unk_48, part->unk_44); guMtxCatF(sp58, sp18, sp18); diff --git a/src/effects/effect_46.c b/src/effects/effect_46.c index c468996bb4..2ce46c9bc5 100644 --- a/src/effects/effect_46.c +++ b/src/effects/effect_46.c @@ -163,9 +163,9 @@ void effect_46_update(EffectInstance* effect) { } } - part->pos.x = part->player->position.x; - part->pos.y = part->player->position.y; - part->pos.z = part->player->position.z; + part->pos.x = part->player->pos.x; + part->pos.y = part->player->pos.y; + part->pos.z = part->player->pos.z; part++; for (i = 1; i < effect->numParts; i++, part++) { @@ -192,7 +192,7 @@ void effect_46_render(EffectInstance* effect) { renderTask.appendGfx = effect_46_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -216,7 +216,7 @@ void effect_46_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09000420_38EDB0); guTranslateF(mtxTransform, part->pos.x, part->pos.y, part->pos.z); - guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(mtxTemp, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/effect_63.c b/src/effects/effect_63.c index 4d09fdd118..97ff9c53ac 100644 --- a/src/effects/effect_63.c +++ b/src/effects/effect_63.c @@ -200,7 +200,7 @@ void effect_63_render(EffectInstance* effect) { renderTask.appendGfx = effect_63_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/effect_65.c b/src/effects/effect_65.c index d4ef369924..8b3bf49423 100644 --- a/src/effects/effect_65.c +++ b/src/effects/effect_65.c @@ -199,7 +199,7 @@ void effect_65_render(EffectInstance* effect) { renderTask.appendGfx = effect_65_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/effect_75.c b/src/effects/effect_75.c index 58911f3b10..730477d5a4 100644 --- a/src/effects/effect_75.c +++ b/src/effects/effect_75.c @@ -178,7 +178,7 @@ void effect_75_render(EffectInstance* effect) { } renderTaskPtr->appendGfx = effect_75_appendGfx; - renderTaskPtr->distance = -outDist; + renderTaskPtr->dist = -outDist; renderTaskPtr->appendGfxArg = effect; renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; diff --git a/src/effects/effect_86.c b/src/effects/effect_86.c index e7a9d8a278..d908c81fc5 100644 --- a/src/effects/effect_86.c +++ b/src/effects/effect_86.c @@ -100,7 +100,7 @@ void effect_86_render(EffectInstance* effect) { renderTask.appendGfx = effect_86_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/embers.c b/src/effects/embers.c index d371f29c4a..d5c90fbff5 100644 --- a/src/effects/embers.c +++ b/src/effects/embers.c @@ -175,7 +175,7 @@ void embers_render(EffectInstance* effect) { renderTask.appendGfx = embers_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/emote.c b/src/effects/emote.c index c7db3b7d14..74b1ab2916 100644 --- a/src/effects/emote.c +++ b/src/effects/emote.c @@ -63,14 +63,14 @@ void func_E0020000(EmoteFXData* part, s32 arg1) { f32 sin; f32 cos; - sin = sin_deg(gCameras[gCurrentCameraID].currentYaw); - cos = cos_deg(gCameras[gCurrentCameraID].currentYaw); + sin = sin_deg(gCameras[gCurrentCameraID].curYaw); + cos = cos_deg(gCameras[gCurrentCameraID].curYaw); guRotateF(sp18, -(unk_1C - 20.0f + arg1 * 20), sin, 0.0f, -cos); if (npc == PTR_LIST_END) { - part->unk_04 = gPlayerStatus.position.x + part->unk_10 + sp18[1][0] * (unk_20 + 16.0f); - part->unk_08 = gPlayerStatus.position.y + part->unk_14 + sp18[1][1] * (unk_20 + 16.0f); - part->unk_0C = gPlayerStatus.position.z + part->unk_18 + sp18[1][2] * (unk_20 + 16.0f); + part->unk_04 = gPlayerStatus.pos.x + part->unk_10 + sp18[1][0] * (unk_20 + 16.0f); + part->unk_08 = gPlayerStatus.pos.y + part->unk_14 + sp18[1][1] * (unk_20 + 16.0f); + part->unk_0C = gPlayerStatus.pos.z + part->unk_18 + sp18[1][2] * (unk_20 + 16.0f); } else if (npc != NULL) { part->unk_04 = npc->pos.x + part->unk_10 + sp18[1][0] * (unk_20 + 16.0f); part->unk_08 = npc->pos.y + part->unk_14 + sp18[1][1] * (unk_20 + 16.0f); @@ -194,7 +194,7 @@ void emote_render(EffectInstance* effect) { renderTask.appendGfx = emote_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -222,7 +222,7 @@ void emote_appendGfx(void* effect) { if (type != 1) { guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); matrix = &gDisplayContext->matrixStack[gMatrixListPos]; @@ -241,7 +241,7 @@ void emote_appendGfx(void* effect) { if (part->unk_38 == 0) { for (i = 0; i < 3; i++, part++) { guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guRotateF(sp58, part->unk_24, 0.0f, 0.0f, 1.0f); guMtxCatF(sp58, sp18, sp18); diff --git a/src/effects/ending_decals.c b/src/effects/ending_decals.c index e5a5f7bc01..caef475dea 100644 --- a/src/effects/ending_decals.c +++ b/src/effects/ending_decals.c @@ -118,7 +118,7 @@ void ending_decals_render(EffectInstance* effect) { renderTask.appendGfxArg = effect; renderTask.appendGfx = ending_decals_appendGfx; - renderTask.distance = 10; + renderTask.dist = 10; if (data->type == 0) { renderTaskPtr->renderMode = RENDER_MODE_SURFACE_OPA; } else { @@ -145,7 +145,7 @@ void ending_decals_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/energy_in_out.c b/src/effects/energy_in_out.c index a0c2c2bde5..feef352d33 100644 --- a/src/effects/energy_in_out.c +++ b/src/effects/energy_in_out.c @@ -230,7 +230,7 @@ void energy_in_out_render(EffectInstance* effect) { renderTask.appendGfx = energy_in_out_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -255,7 +255,7 @@ void energy_in_out_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, scale, part->pos.x, part->pos.y, part->pos.z); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, scale, part->pos.x, part->pos.y, part->pos.z); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/effects/energy_orb_wave.c b/src/effects/energy_orb_wave.c index 31478761ec..2f2dedd24a 100644 --- a/src/effects/energy_orb_wave.c +++ b/src/effects/energy_orb_wave.c @@ -209,7 +209,7 @@ void energy_orb_wave_render(EffectInstance* effect) { RenderTask* renderTaskPointer = &renderTask; renderTask.appendGfx = energy_orb_wave_appendGfx; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.appendGfxArg = effect; renderTask.renderMode = RENDER_MODE_2D; if (effect82->unk_00 >= 3) { diff --git a/src/effects/energy_shockwave.c b/src/effects/energy_shockwave.c index d45430fcd4..e9fc9cda48 100644 --- a/src/effects/energy_shockwave.c +++ b/src/effects/energy_shockwave.c @@ -130,7 +130,7 @@ void energy_shockwave_render(EffectInstance* effect) { renderTask.appendGfx = energy_shockwave_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3; retTask = queue_render_task(&renderTask); diff --git a/src/effects/explosion.c b/src/effects/explosion.c index dc869796a4..22c050e8d1 100644 --- a/src/effects/explosion.c +++ b/src/effects/explosion.c @@ -157,7 +157,7 @@ void explosion_render(EffectInstance* effect) { renderTask.appendGfx = explosion_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -176,7 +176,7 @@ void explosion_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/falling_leaves.c b/src/effects/falling_leaves.c index 8654a627bb..ea10a7f29f 100644 --- a/src/effects/falling_leaves.c +++ b/src/effects/falling_leaves.c @@ -114,7 +114,7 @@ void falling_leaves_render(EffectInstance* effect) { renderTask.appendGfx = falling_leaves_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -133,7 +133,7 @@ void falling_leaves_appendGfx(void* effect) { gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, part->unk_24); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp98); part++; diff --git a/src/effects/fire_breath.c b/src/effects/fire_breath.c index d8e3f2e172..e9427d4d92 100644 --- a/src/effects/fire_breath.c +++ b/src/effects/fire_breath.c @@ -168,9 +168,9 @@ void fire_breath_render(EffectInstance* effect) { renderTask.appendGfxArg = effect; if (gGameStatusPtr->isBattle == TRUE) { - renderTask.distance = data->pos.z + 1000.0f; + renderTask.dist = data->pos.z + 1000.0f; } else { - renderTask.distance = 0; + renderTask.dist = 0; } renderTaskPointer->renderMode = RENDER_MODE_2D; @@ -193,7 +193,7 @@ void fire_breath_appendGfx(void* effect) { if (type == FIRE_BREATH_SMALL) { guTranslateF(sp18, data->initPos.x, data->initPos.y, data->initPos.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); @@ -211,7 +211,7 @@ void fire_breath_appendGfx(void* effect) { gDPSetTileSize(gMainGfxPos++, 1, ((unk_5C * 32) + 32) * 4, 0, ((unk_5C * 32) + 64) * 4, 128); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guScaleF(sp58, data->scale, data->scale, 0.0f); guMtxCatF(sp58, sp18, sp18); diff --git a/src/effects/fire_flower.c b/src/effects/fire_flower.c index 303ebad828..a6d804516c 100644 --- a/src/effects/fire_flower.c +++ b/src/effects/fire_flower.c @@ -193,7 +193,7 @@ void fire_flower_render(EffectInstance* effect) { renderTask.appendGfx = fire_flower_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -215,7 +215,7 @@ void fire_flower_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/firework.c b/src/effects/firework.c index d1f85e2874..ac2a93542b 100644 --- a/src/effects/firework.c +++ b/src/effects/firework.c @@ -198,7 +198,7 @@ void func_E00863B4(EffectInstance* effect) { unk_28 = part->unk_28; - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, unk_28, part->unk_04, part->unk_08, part->unk_0C); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, unk_28, part->unk_04, part->unk_08, part->unk_0C); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/firework_rocket.c b/src/effects/firework_rocket.c index 38ea02f4f9..bd9627ab65 100644 --- a/src/effects/firework_rocket.c +++ b/src/effects/firework_rocket.c @@ -112,9 +112,9 @@ EffectInstance* firework_rocket_main(s32 variation, f32 centerX, f32 centerY, f3 data->pos.y = centerY; data->pos.z = centerZ; data->radius = 0; - data->velocity.x = velX; - data->velocity.y = velY; - data->velocity.z = velZ; + data->vel.x = velX; + data->vel.y = velY; + data->vel.z = velZ; data->maxRadius = radius; data->r = 255; data->g = 255; @@ -128,9 +128,9 @@ EffectInstance* firework_rocket_main(s32 variation, f32 centerX, f32 centerY, f3 data->rocketX[i] = data->pos.x; data->rocketY[i] = data->pos.y - 1000.0f; data->rocketZ[i] = data->pos.z; - data->rocketVelocityX[i] = 0; - data->rocketVelocityY[i] = 0; - data->rocketVelocityZ[i] = 0; + data->rocketVelX[i] = 0; + data->rocketVelY[i] = 0; + data->rocketVelZ[i] = 0; } return effect; @@ -169,31 +169,31 @@ void firework_rocket_update(EffectInstance* effect) { if (data->isExploded == TRUE) { factor = 0.95f; - data->pos.x += data->velocity.x; - data->pos.y += data->velocity.y; - data->pos.z += data->velocity.z; - data->velocity.x *= factor; - data->velocity.y *= factor; - data->velocity.z *= factor; + data->pos.x += data->vel.x; + data->pos.y += data->vel.y; + data->pos.z += data->vel.z; + data->vel.x *= factor; + data->vel.y *= factor; + data->vel.z *= factor; data->radius += (data->maxRadius - data->radius) * 0.11; - data->velocity.y -= 0.15; + data->vel.y -= 0.15; return; } i = lifeTime & 3; - data->rocketX[i] = data->pos.x - data->velocity.x * (32 - lifeTime); - data->rocketY[i] = data->pos.y - data->velocity.y * (32 - lifeTime) + data->rocketX[i] = data->pos.x - data->vel.x * (32 - lifeTime); + data->rocketY[i] = data->pos.y - data->vel.y * (32 - lifeTime) - (80.0f - sin_deg((s32)(lifeTime * 90) >> 5) * 80.0f); - data->rocketZ[i] = data->pos.z - data->velocity.z * (32 - lifeTime); - data->rocketVelocityX[i] = (rand_int(10) - 5) * 0.1f; - data->rocketVelocityY[i] = (rand_int(10) - 5) * 0.1f; - data->rocketVelocityZ[i] = (rand_int(10) - 5) * 0.1f; + data->rocketZ[i] = data->pos.z - data->vel.z * (32 - lifeTime); + data->rocketVelX[i] = (rand_int(10) - 5) * 0.1f; + data->rocketVelY[i] = (rand_int(10) - 5) * 0.1f; + data->rocketVelZ[i] = (rand_int(10) - 5) * 0.1f; for (i = 0; i < 4; i++) { - data->rocketX[i] += data->rocketVelocityX[i]; - data->rocketY[i] += data->rocketVelocityY[i]; - data->rocketZ[i] += data->rocketVelocityZ[i]; - data->rocketVelocityY[i] -= 0.15; + data->rocketX[i] += data->rocketVelX[i]; + data->rocketY[i] += data->rocketVelY[i]; + data->rocketZ[i] += data->rocketVelZ[i]; + data->rocketVelY[i] -= 0.15; if (lifeTime >= 27) { data->rocketY[i] = NPC_DISPOSE_POS_Y; } @@ -211,7 +211,7 @@ void firework_rocket_render(EffectInstance* effect) { renderTask.appendGfx = firework_rocket_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 700; + renderTask.dist = 700; renderTask.renderMode = RENDER_MODE_SURFACE_OPA; retTask = queue_render_task(&renderTask); @@ -238,7 +238,7 @@ void firework_rocket_appendGfx(void* effect) { Vec3b* sparkDir; s32 i; - negYaw = -camera->currentYaw; + negYaw = -camera->curYaw; sinTheta = sin_deg(negYaw); cosTheta = cos_deg(negYaw); isExploded = data->isExploded; diff --git a/src/effects/flame.c b/src/effects/flame.c index 5f68e61b4a..4d2c0f3e76 100644 --- a/src/effects/flame.c +++ b/src/effects/flame.c @@ -135,7 +135,7 @@ void flame_render(EffectInstance* effect) { } renderTaskPtr->appendGfx = flame_appendGfx; - renderTaskPtr->distance = -outDist; + renderTaskPtr->dist = -outDist; renderTaskPtr->appendGfxArg = effect; renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; @@ -178,7 +178,7 @@ void flame_appendGfx(void* effect) { gDPSetEnvColor(gMainGfxPos++, unkStruct->unk_04, unkStruct->unk_05, unkStruct->unk_06, 0); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp98); guScaleF(sp58, data->unk_10 * data->unk_30, data->unk_10 * data->unk_2C, data->unk_10); guMtxCatF(sp58, sp98, sp98); diff --git a/src/effects/flashing_box_shockwave.c b/src/effects/flashing_box_shockwave.c index ae20db3cb8..3aa7c372e1 100644 --- a/src/effects/flashing_box_shockwave.c +++ b/src/effects/flashing_box_shockwave.c @@ -128,7 +128,7 @@ void flashing_box_shockwave_render(EffectInstance* effect) { renderTask.appendGfx = flashing_box_shockwave_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3; retTask = queue_render_task(&renderTask); @@ -142,7 +142,7 @@ void flashing_box_shockwave_appendGfx(void* effect) { Matrix4f sp58; Matrix4f sp98; - guRotateF(sp98, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp98, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); diff --git a/src/effects/floating_cloud_puff.c b/src/effects/floating_cloud_puff.c index d88a0ca67d..74f8272cc6 100644 --- a/src/effects/floating_cloud_puff.c +++ b/src/effects/floating_cloud_puff.c @@ -103,7 +103,7 @@ void floating_cloud_puff_render(EffectInstance* effect) { renderTask.appendGfx = floating_cloud_puff_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/floating_flower.c b/src/effects/floating_flower.c index cebd73d9d2..56297d7599 100644 --- a/src/effects/floating_flower.c +++ b/src/effects/floating_flower.c @@ -133,7 +133,7 @@ void floating_flower_render(EffectInstance* effect) { renderTask.appendGfx = floating_flower_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/floating_rock.c b/src/effects/floating_rock.c index 1cdec17c6a..d5f17155d7 100644 --- a/src/effects/floating_rock.c +++ b/src/effects/floating_rock.c @@ -102,7 +102,7 @@ void floating_rock_render(EffectInstance *effect) { renderTask.appendGfx = floating_rock_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = effect76->pos.z; + renderTask.dist = effect76->pos.z; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/flower_splash.c b/src/effects/flower_splash.c index 6639c1bd53..5ef3ac5bda 100644 --- a/src/effects/flower_splash.c +++ b/src/effects/flower_splash.c @@ -25,13 +25,13 @@ void flower_splash_update_part_transform(FlowerFXData* effect) { } void flower_splash_update_part(FlowerFXData* effect) { - effect->velocityScaleA *= 0.85; - effect->pos.x += effect->velocityScaleA * effect->velocity.x; + effect->velScaleA *= 0.85; + effect->pos.x += effect->velScaleA * effect->vel.x; effect->integrator[2] += effect->integrator[3]; effect->integrator[1] += effect->integrator[2]; effect->integrator[0] += effect->integrator[1]; effect->pos.y += effect->integrator[0]; - effect->pos.z += effect->velocityScaleA * effect->velocity.z; + effect->pos.z += effect->velScaleA * effect->vel.z; if (effect->integrator[0] < 0.0f) { effect->integrator[2] = 0.004f; @@ -69,7 +69,7 @@ void flower_splash_main(f32 posX, f32 posY, f32 posZ, f32 angle) { for (i = 0; i < numParts; i++, part++) { part->alive = TRUE; part->rot.y = angle + (i * 72); - part->velocityScaleB = 0.29999998f; + part->velScaleB = 0.29999998f; part->visibilityAmt = 0.0f; part->unk_7C = 0.0f; @@ -92,10 +92,10 @@ void flower_splash_main(f32 posX, f32 posY, f32 posZ, f32 angle) { part->integrator[2] = 0.0f; part->integrator[3] = 0.0f; - part->velocityScaleA = -3.9f; + part->velScaleA = -3.9f; partAngle = clamp_angle(part->rot.y); - part->velocity.x = sin_deg(partAngle); - part->velocity.z = cos_deg(partAngle); + part->vel.x = sin_deg(partAngle); + part->vel.z = cos_deg(partAngle); } } @@ -131,7 +131,7 @@ void flower_splash_render(EffectInstance* effect) { renderTask.appendGfx = flower_splash_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); diff --git a/src/effects/flower_trail.c b/src/effects/flower_trail.c index 3da947c51f..547726abd1 100644 --- a/src/effects/flower_trail.c +++ b/src/effects/flower_trail.c @@ -35,9 +35,9 @@ void flower_trail_update_part(FlowerFXData* effect) { effect->integrator[2] += effect->integrator[3]; effect->integrator[1] += effect->integrator[2]; effect->integrator[0] += effect->integrator[1]; - effect->rot.z += effect->integrator[0] * effect->velocityScaleA; - effect->pos.x -= effect->integrator[0] * effect->velocityScaleB * effect->velocity.x; - effect->pos.z -= effect->integrator[0] * effect->velocityScaleB * effect->velocity.z; + effect->rot.z += effect->integrator[0] * effect->velScaleA; + effect->pos.x -= effect->integrator[0] * effect->velScaleB * effect->vel.x; + effect->pos.z -= effect->integrator[0] * effect->velScaleB * effect->vel.z; if (effect->integrator[0] < 0.0f) { effect->visibilityAmt = 0.0f; @@ -84,11 +84,11 @@ void flower_trail_main(s32 triggeredByNpc, f32 posX, f32 posY, f32 posZ, f32 ang part->primAlpha = 255; part->visibilityAmt = 1.0f; - part->velocityScaleB = 5.4f; + part->velScaleB = 5.4f; if (direction != 0.0f) { - part->velocityScaleA = -10.0f; + part->velScaleA = -10.0f; } else { - part->velocityScaleA = 10.0f; + part->velScaleA = 10.0f; } part->integrator[0] = 0.5f; @@ -110,8 +110,8 @@ void flower_trail_main(s32 triggeredByNpc, f32 posX, f32 posY, f32 posZ, f32 ang partAngle = clamp_angle(angle + angleOffset); } - part->velocity.x = sin_deg(partAngle); - part->velocity.z = cos_deg(partAngle); + part->vel.x = sin_deg(partAngle); + part->vel.z = cos_deg(partAngle); } } @@ -147,7 +147,7 @@ void flower_trail_render(EffectInstance* effect) { renderTask.appendGfx = flower_trail_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; queuedTaskPtr = queue_render_task(&renderTask); diff --git a/src/effects/footprint.c b/src/effects/footprint.c index af5ab7de39..a7808089b5 100644 --- a/src/effects/footprint.c +++ b/src/effects/footprint.c @@ -103,7 +103,7 @@ void footprint_render(EffectInstance* effect) { renderTask.appendGfx = footprint_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); diff --git a/src/effects/fright_jar.c b/src/effects/fright_jar.c index c447ed686a..55a54a4e4a 100644 --- a/src/effects/fright_jar.c +++ b/src/effects/fright_jar.c @@ -102,7 +102,7 @@ void fright_jar_render(EffectInstance* effect) { renderTask.appendGfx = fright_jar_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/gather_energy_pink.c b/src/effects/gather_energy_pink.c index b72ac6c337..662c6945e2 100644 --- a/src/effects/gather_energy_pink.c +++ b/src/effects/gather_energy_pink.c @@ -150,7 +150,7 @@ void gather_energy_pink_render(EffectInstance* effect) { renderTask.appendGfx = gather_energy_pink_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/gather_magic.c b/src/effects/gather_magic.c index 510299ba18..fd9dadc1ce 100644 --- a/src/effects/gather_magic.c +++ b/src/effects/gather_magic.c @@ -144,7 +144,7 @@ void gather_magic_render(EffectInstance* effect) { renderTask.appendGfx = gather_magic_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3; retTask = queue_render_task(&renderTask); @@ -165,7 +165,7 @@ void gather_magic_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); guTranslateF(sp18, part->unk_08, part->unk_0C, part->unk_10); - guRotateF(sp98, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp98, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp98, sp18, sp18); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/got_item_outline.c b/src/effects/got_item_outline.c index 8d055031a1..c96c7a9f3d 100644 --- a/src/effects/got_item_outline.c +++ b/src/effects/got_item_outline.c @@ -97,7 +97,7 @@ void got_item_outline_render(EffectInstance* effect) { renderTask.appendGfx = got_item_outline_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -129,7 +129,7 @@ void got_item_outline_appendGfx(void* effect) { } guTranslateF(mtxTransform, data->pos.x, data->pos.y, data->pos.z); - guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(mtxTemp, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guTranslateF(mtxTemp, 0.0f, 0.0f, -2.0f); guMtxCatF(mtxTemp, mtxTransform, mtxTransform); diff --git a/src/effects/green_impact.c b/src/effects/green_impact.c index 0098e7c7e3..2c58df095e 100644 --- a/src/effects/green_impact.c +++ b/src/effects/green_impact.c @@ -123,7 +123,7 @@ void green_impact_render(EffectInstance* effect) { renderTask.appendGfx = green_impact_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -163,7 +163,7 @@ void green_impact_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPDisplayList(gMainGfxPos++, dlist); - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, part->unk_04, part->unk_08, part->unk_0C); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, part->unk_04, part->unk_08, part->unk_0C); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/hieroglyphs.c b/src/effects/hieroglyphs.c index 14ff080eec..2901681a23 100644 --- a/src/effects/hieroglyphs.c +++ b/src/effects/hieroglyphs.c @@ -102,7 +102,7 @@ void hieroglyphs_render(EffectInstance* effect) { renderTask.appendGfx = hieroglyphs_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/huff_puff_breath.c b/src/effects/huff_puff_breath.c index 25fd9f341f..3363f45b2e 100644 --- a/src/effects/huff_puff_breath.c +++ b/src/effects/huff_puff_breath.c @@ -115,7 +115,7 @@ void huff_puff_breath_render(EffectInstance* effect) { renderTask.appendGfx = huff_puff_breath_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/ice_pillar.c b/src/effects/ice_pillar.c index d3b76a6a84..dd6c73084a 100644 --- a/src/effects/ice_pillar.c +++ b/src/effects/ice_pillar.c @@ -103,7 +103,7 @@ void ice_pillar_update(EffectInstance* effect) { ); iceShard->data.iceShard->animFrame = rand_int(10) * 0.1; iceShard->data.iceShard->animRate = (rand_int(30) * 0.01) + 0.1; - iceShard->data.iceShard->rotation = rand_int(359); + iceShard->data.iceShard->rot = rand_int(359); iceShard->data.iceShard->angularVel = rand_int(20); iceShard->data.iceShard->vel.x = rand_int(10) - 5; iceShard->data.iceShard->vel.y = rand_int(10) - 5; @@ -144,7 +144,7 @@ void ice_pillar_render(EffectInstance* effect) { renderTask.appendGfx = ice_pillar_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 5; + renderTask.dist = 5; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/ice_shard.c b/src/effects/ice_shard.c index ad6bf8976d..ae61b7e39a 100644 --- a/src/effects/ice_shard.c +++ b/src/effects/ice_shard.c @@ -59,7 +59,7 @@ EffectInstance* ice_shard_main( data->envCol.a = 255; data->animFrame = 0; data->animRate = (rand_int(1) * 2 - 1) * 0.25 * (rand_int(4) * 0.1 + 0.1); - data->rotation = rand_int(359); + data->rot = rand_int(359); data->vel.x = rand_int(10) - 5; data->vel.y = rand_int(10) - 5; data->vel.z = rand_int(10) - 5; @@ -109,7 +109,7 @@ void ice_shard_update(EffectInstance* effect) { data->pos.x += data->vel.x; data->pos.y += data->vel.y; data->pos.z += data->vel.z; - data->rotation += data->angularVel; + data->rot += data->angularVel; if (unk_00 >= 2 && data->pos.y < 0.0f && data->vel.y < 0.0f) { data->pos.y = 0.0f; @@ -123,7 +123,7 @@ void ice_shard_render(EffectInstance* effect) { renderTask.appendGfx = ice_shard_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -143,12 +143,12 @@ void ice_shard_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - guRotateF(sp20, data->rotation, 0.0f, 0.0f, 1.0f); + guRotateF(sp20, data->rot, 0.0f, 0.0f, 1.0f); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/landing_dust.c b/src/effects/landing_dust.c index a265602896..b51f3de479 100644 --- a/src/effects/landing_dust.c +++ b/src/effects/landing_dust.c @@ -250,7 +250,7 @@ void landing_dust_render(EffectInstance* effect) { renderTask.appendGfx = landing_dust_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -287,7 +287,7 @@ void landing_dust_appendGfx(void* effect) { spDC = temp_t0 & 0x40; guTranslateF(mtx1, part->x, part->y, part->z); - guRotateF(mtx2, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(mtx2, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(mtx2, mtx1, mtx3); guMtxF2L(mtx3, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/lens_flare.c b/src/effects/lens_flare.c index 3497010e89..0b49a41f4c 100644 --- a/src/effects/lens_flare.c +++ b/src/effects/lens_flare.c @@ -99,7 +99,7 @@ void lens_flare_render(EffectInstance* effect) { renderTask.appendGfx = lens_flare_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 20; + renderTask.dist = 20; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -120,7 +120,7 @@ void lens_flare_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_E0034788[type]); guTranslateF(mtxTransform, data->pos.x, data->pos.y, data->pos.z); - guRotateF(mtxTemp, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(mtxTemp, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(mtxTemp, mtxTransform, mtxShared); alpha = data->smallFlareAlpha; diff --git a/src/effects/light_rays.c b/src/effects/light_rays.c index fb0d0c2094..a168e1ae82 100644 --- a/src/effects/light_rays.c +++ b/src/effects/light_rays.c @@ -49,9 +49,9 @@ void func_E006A000(LightRaysFXData* part, s32 beamIdx) { part->unk_58 = part->unk_68; part->timeLeft = part->unk_7C; part->unk_8C = part->unk_6C; - part->rotation.x = part->initialRot.x; - part->rotation.y = part->initialRot.y; - part->rotation.z = part->initialRot.z; + part->rot.x = part->initialRot.x; + part->rot.y = part->initialRot.y; + part->rot.z = part->initialRot.z; } void func_E006A0BC(LightRaysFXData* part, s32 beamIdx) { @@ -59,9 +59,9 @@ void func_E006A0BC(LightRaysFXData* part, s32 beamIdx) { part->unk_58 = 0; part->timeLeft = beamIdx * 2 + 30; - part->rotation.x = D_E006AE10[idx++]; - part->rotation.y = D_E006AE10[idx++]; - part->rotation.z = D_E006AE10[idx++]; + part->rot.x = D_E006AE10[idx++]; + part->rot.y = D_E006AE10[idx++]; + part->rot.z = D_E006AE10[idx++]; part->alpha = 0; part->lifetime = 0; part->unk_34 = part->unk_38 = 0.0f; @@ -246,9 +246,9 @@ void light_rays_update(EffectInstance* effect) { func_E006A0BC(part, i); } if (part->unk_90 <= 0 || --part->unk_90 <= 0) { - part->rotation.x += part->unk_80; - part->rotation.y += part->unk_84; - part->rotation.z += part->unk_88; + part->rot.x += part->unk_80; + part->rot.y += part->unk_84; + part->rot.z += part->unk_88; } } } @@ -260,7 +260,7 @@ void light_rays_render(EffectInstance* effect) { renderTask.appendGfx = light_rays_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -306,11 +306,11 @@ void light_rays_appendGfx(void* effect) { func_E006A85C(part); } - guRotateF(mtxTemp, part->rotation.x, 1.0f, 0.0f, 0.0f); + guRotateF(mtxTemp, part->rot.x, 1.0f, 0.0f, 0.0f); guMtxCatF(mtxTemp, mtxTranslate, mtxTransform); if (type >= 2) { - unk_64 = part->rotation.z; + unk_64 = part->rot.z; if (type == 3) { angleZ = unk_64 + 45.0f; } else { @@ -319,7 +319,7 @@ void light_rays_appendGfx(void* effect) { guRotateF(mtxTemp, angleZ, 0.0f, 0.0f, 1.0f); guMtxCatF(mtxTemp, mtxTransform, mtxTransform); - guRotateF(mtxTemp, part->rotation.y, 0.0f, 1.0f, 0.0f); + guRotateF(mtxTemp, part->rot.y, 0.0f, 1.0f, 0.0f); guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guTranslateF(mtxTemp, part->unk_58, 0.0f, 0.0f); guMtxCatF(mtxTemp, mtxTransform, mtxTransform); @@ -346,9 +346,9 @@ void light_rays_appendGfx(void* effect) { gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 240, part->alpha); } else { - guRotateF(mtxTemp, part->rotation.y, 0.0f, 1.0f, 0.0f); + guRotateF(mtxTemp, part->rot.y, 0.0f, 1.0f, 0.0f); guMtxCatF(mtxTemp, mtxTransform, mtxTransform); - guRotateF(mtxTemp, part->rotation.z, 0.0f, 0.0f, 1.0f); + guRotateF(mtxTemp, part->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(mtxTemp, mtxTransform, mtxTransform); guTranslateF(mtxTemp, part->unk_58, 0.0f, 0.0f); guMtxCatF(mtxTemp, mtxTransform, mtxTransform); diff --git a/src/effects/lightning.c b/src/effects/lightning.c index fa4ba017af..74e74bb3a5 100644 --- a/src/effects/lightning.c +++ b/src/effects/lightning.c @@ -210,7 +210,7 @@ void lightning_render(EffectInstance* effect) { renderTask.appendGfx = lightning_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3; retTask = queue_render_task(&renderTask); @@ -263,7 +263,7 @@ void lightning_appendGfx(void* effect) { break; default: guTranslateF(sp20, data->unk_04, data->unk_08, data->unk_0C); - guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp60, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp60, sp20, sp20); guTranslateF(sp60, 0.0f, 0.0f, 1.0f); guMtxCatF(sp60, sp20, sp20); diff --git a/src/effects/lightning_bolt.c b/src/effects/lightning_bolt.c index 6d623829ce..46001c5fe1 100644 --- a/src/effects/lightning_bolt.c +++ b/src/effects/lightning_bolt.c @@ -156,9 +156,9 @@ void lightning_bolt_render(EffectInstance *effect) { renderTask.appendGfx = lightning_bolt_appendGfx; renderTask.appendGfxArg = effect; if (gGameStatusPtr->isBattle == TRUE) { - renderTask.distance = data->tipPos.z + 1000.0f; + renderTask.dist = data->tipPos.z + 1000.0f; } else { - renderTask.distance = 10; + renderTask.dist = 10; } renderTaskPointer->renderMode = RENDER_MODE_2D; diff --git a/src/effects/lil_oink.c b/src/effects/lil_oink.c index b385003de0..bc60b88a24 100644 --- a/src/effects/lil_oink.c +++ b/src/effects/lil_oink.c @@ -161,7 +161,7 @@ void lil_oink_render(EffectInstance* effect) { renderTask.appendGfx = lil_oink_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/merlin_house_stars.c b/src/effects/merlin_house_stars.c index 6a96602fc1..4828e853a5 100644 --- a/src/effects/merlin_house_stars.c +++ b/src/effects/merlin_house_stars.c @@ -116,7 +116,7 @@ void merlin_house_stars_render(EffectInstance* effect) { renderTask.appendGfx = merlin_house_stars_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/misc_particles.c b/src/effects/misc_particles.c index 21d39e99b6..85ecf28415 100644 --- a/src/effects/misc_particles.c +++ b/src/effects/misc_particles.c @@ -187,8 +187,8 @@ void misc_particles_update(EffectInstance* effect) { posX = particle->pos.x; posY = particle->pos.y; posZ = particle->pos.z; - temp_cos = cos_deg(gCameras[gCurrentCameraID].currentYaw); - temp_sin = sin_deg(gCameras[gCurrentCameraID].currentYaw); + temp_cos = cos_deg(gCameras[gCurrentCameraID].curYaw); + temp_sin = sin_deg(gCameras[gCurrentCameraID].curYaw); innerColorR = particle->innerColor.r; innerColorG = particle->innerColor.g; innerColorB = particle->innerColor.b; @@ -288,7 +288,7 @@ void misc_particles_render(EffectInstance* effect) { renderTask.appendGfx = misc_particles_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 7; + renderTask.dist = 7; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -314,7 +314,7 @@ void misc_particles_appendGfx(void* effect) { particle++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, particle++) { if (particle->animTime >= 0) { - guPositionF(mtxTransform, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, particle->scale * alphaScale, particle->pos.x, particle->pos.y, particle->pos.z); + guPositionF(mtxTransform, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, particle->scale * alphaScale, particle->pos.x, particle->pos.y, particle->pos.z); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/motion_blur_flame.c b/src/effects/motion_blur_flame.c index 68684a4d16..3973543fa7 100644 --- a/src/effects/motion_blur_flame.c +++ b/src/effects/motion_blur_flame.c @@ -113,7 +113,7 @@ void motion_blur_flame_render(EffectInstance* effect) { renderTask.appendGfx = motion_blur_flame_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 100; + renderTask.dist = 100; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/moving_cloud.c b/src/effects/moving_cloud.c index fd20cdce68..ae03a22a5f 100644 --- a/src/effects/moving_cloud.c +++ b/src/effects/moving_cloud.c @@ -169,7 +169,7 @@ void moving_cloud_render(EffectInstance* effect) { renderTask.appendGfx = moving_cloud_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/music_note.c b/src/effects/music_note.c index e70390aa3a..66775f6561 100644 --- a/src/effects/music_note.c +++ b/src/effects/music_note.c @@ -121,7 +121,7 @@ void music_note_render(EffectInstance* effect) { renderTask.appendGfx = music_note_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -147,7 +147,7 @@ void music_note_appendGfx(void* data) { D_E004C67C[rgbOffset], D_E004C67C[rgbOffset + 1], D_E004C67C[rgbOffset + 2], fxData->unk_14 ); guTranslateF(sp18, fxData->pos.x, fxData->pos.y, fxData->pos.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guScaleF(sp58, fxData->unk_10, fxData->unk_10, 0.0f); guMtxCatF(sp58, sp18, sp18); diff --git a/src/effects/peach_star_beam.c b/src/effects/peach_star_beam.c index 3e4d5fa879..66760979ed 100644 --- a/src/effects/peach_star_beam.c +++ b/src/effects/peach_star_beam.c @@ -75,8 +75,8 @@ EffectInstance* peach_star_beam_main(s32 type, f32 x, f32 y, f32 z, f32 arg4, s3 data->envG = 255; data->envB = 255; data->envA = 255; - data->rotationSpeed = 5.0f; - data->rotationAngle = 0; + data->rotSpeed = 5.0f; + data->rotAngle = 0; data->circleCenter.x = x; data->circleCenter.y = y + 50.0f; data->circleCenter.z = z; @@ -121,8 +121,8 @@ void peach_star_beam_update(EffectInstance* effect) { return; } - data->rotationAngle += data->rotationSpeed; - rotationAngle = data->rotationAngle; + data->rotAngle += data->rotSpeed; + rotationAngle = data->rotAngle; radius = data->circleRadius; centerX = data->circleCenter.x; centerY = data->circleCenter.y; @@ -155,7 +155,7 @@ void peach_star_beam_render(EffectInstance* effect) { renderTask.appendGfx = peach_star_beam_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/pink_sparkles.c b/src/effects/pink_sparkles.c index 288520938b..8955c403c3 100644 --- a/src/effects/pink_sparkles.c +++ b/src/effects/pink_sparkles.c @@ -220,7 +220,7 @@ void pink_sparkles_render(EffectInstance* effect) { renderTask.appendGfx = pink_sparkles_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -247,7 +247,7 @@ void pink_sparkles_appendGfx(void* effect) { colorIdx = (part->unk_20 - 1) * 3; guTranslateF(sp98, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp98, sp98); part++; diff --git a/src/effects/purple_ring.c b/src/effects/purple_ring.c index e837d13a80..559bdccc2c 100644 --- a/src/effects/purple_ring.c +++ b/src/effects/purple_ring.c @@ -181,7 +181,7 @@ void purple_ring_render(EffectInstance* effect) { renderTask.appendGfx = purple_ring_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/quizmo_assistant.c b/src/effects/quizmo_assistant.c index 9a98e995ad..3e3daf2a58 100644 --- a/src/effects/quizmo_assistant.c +++ b/src/effects/quizmo_assistant.c @@ -49,9 +49,9 @@ EffectInstance* quizmo_assistant_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f3 data->vanishTimer = arg5; } data->fadeInAmt = 255; - data->position.x = arg1; - data->position.y = arg2; - data->position.z = arg3; + data->pos.x = arg1; + data->pos.y = arg2; + data->pos.z = arg3; data->anim = 0; return effect; @@ -90,7 +90,7 @@ void quizmo_assistant_render(EffectInstance* effect) { renderTask.appendGfx = quizmo_assistant_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -108,8 +108,8 @@ void quizmo_assistant_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - guTranslateF(sp18, data->position.x, data->position.y, data->position.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guTranslateF(sp58, 89.5f, 0.0f, 2.0f); guMtxCatF(sp58, sp18, sp18); diff --git a/src/effects/quizmo_audience.c b/src/effects/quizmo_audience.c index 2e101e82a4..58924d3447 100644 --- a/src/effects/quizmo_audience.c +++ b/src/effects/quizmo_audience.c @@ -170,7 +170,7 @@ void quizmo_audience_render(EffectInstance* effect) { renderTask.appendGfx = quizmo_audience_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -191,7 +191,7 @@ void quizmo_audience_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/quizmo_stage.c b/src/effects/quizmo_stage.c index ac6869cc16..5dbc3a336e 100644 --- a/src/effects/quizmo_stage.c +++ b/src/effects/quizmo_stage.c @@ -98,7 +98,7 @@ void quizmo_stage_render(EffectInstance* effect) { renderTask.appendGfx = quizmo_stage_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_SURFACE_OPA; retTask = queue_render_task(&renderTask); @@ -115,7 +115,7 @@ void quizmo_stage_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); guTranslateF(sp18, data->origin.x, data->origin.y, data->origin.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/radial_shimmer.c b/src/effects/radial_shimmer.c index 1f1293cc01..eef0576e06 100644 --- a/src/effects/radial_shimmer.c +++ b/src/effects/radial_shimmer.c @@ -277,7 +277,7 @@ void radial_shimmer_render(EffectInstance* effect) { renderTask.appendGfx = radial_shimmer_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/radiating_energy_orb.c b/src/effects/radiating_energy_orb.c index 4f088a4323..99d7b0191d 100644 --- a/src/effects/radiating_energy_orb.c +++ b/src/effects/radiating_energy_orb.c @@ -121,7 +121,7 @@ void radiating_energy_orb_render(EffectInstance* effect) { renderTask.appendGfx = radiating_energy_orb_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER3; retTask = queue_render_task(&renderTask); diff --git a/src/effects/recover.c b/src/effects/recover.c index 0382a4ef21..79fc305e8a 100644 --- a/src/effects/recover.c +++ b/src/effects/recover.c @@ -177,7 +177,7 @@ void func_E0080448(EffectInstance* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp98); guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/red_impact.c b/src/effects/red_impact.c index 3f466cf726..e44de35759 100644 --- a/src/effects/red_impact.c +++ b/src/effects/red_impact.c @@ -133,7 +133,7 @@ void red_impact_render(EffectInstance* effect) { renderTask.appendGfx = red_impact_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -170,7 +170,7 @@ void red_impact_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPDisplayList(gMainGfxPos++, dlist); - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, part->unk_04, part->unk_08, part->unk_0C); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, part->unk_04, part->unk_08, part->unk_0C); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/ring_blast.c b/src/effects/ring_blast.c index 0b7243639f..202f6a4625 100644 --- a/src/effects/ring_blast.c +++ b/src/effects/ring_blast.c @@ -76,7 +76,7 @@ void ring_blast_render(EffectInstance* effect) { renderTask.appendGfx = ring_blast_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -98,7 +98,7 @@ void ring_blast_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPDisplayList(gMainGfxPos++, dlist2); - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z); guRotateF(sp60, data->unk_24, 0.0f, 0.0f, 1.0f); guMtxCatF(sp60, sp20, sp20); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/rising_bubble.c b/src/effects/rising_bubble.c index 0e83fa016f..c2ece900fe 100644 --- a/src/effects/rising_bubble.c +++ b/src/effects/rising_bubble.c @@ -98,7 +98,7 @@ void rising_bubble_render(EffectInstance* effect) { renderTask.appendGfx = rising_bubble_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -136,7 +136,7 @@ void rising_bubble_appendGfx(void* effect) { gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, data->unk_14); gDPSetEnvColor(gMainGfxPos++, 128, 128, 255, data->unk_14); - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z); } guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/shape_spell.c b/src/effects/shape_spell.c index 8e2588aa3c..d7529986a0 100644 --- a/src/effects/shape_spell.c +++ b/src/effects/shape_spell.c @@ -126,7 +126,7 @@ void shape_spell_render(EffectInstance* effect) { renderTask.appendGfx = shape_spell_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -183,7 +183,7 @@ void shape_spell_appendGfx(void* effect) { if (isChild == 0) { angle = timeLeft * 35; factor = 9.0f; - var_f30 = -gCameras[gCurrentCameraID].currentYaw; + var_f30 = -gCameras[gCurrentCameraID].curYaw; } else { angle = timeLeft * 25; factor = 6.0f; @@ -260,7 +260,7 @@ void shape_spell_appendGfx(void* effect) { if (!isChild) { var_f30 = 0.0f; } else { - var_f30 = -gCameras[gCurrentCameraID].currentYaw; + var_f30 = -gCameras[gCurrentCameraID].curYaw; } guPositionF(sp20, 0.0f, var_f30, 0.0f, 1.0f, data->pos.x, data->pos.y, data->pos.z); diff --git a/src/effects/shattering_stones.c b/src/effects/shattering_stones.c index 0c3278bd20..44678957e8 100644 --- a/src/effects/shattering_stones.c +++ b/src/effects/shattering_stones.c @@ -131,7 +131,7 @@ void shattering_stones_render(EffectInstance* effect) { renderTask.appendGfx = shattering_stones_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -153,7 +153,7 @@ void shattering_stones_appendGfx(void* effect) { guTranslateF(sp20, part->unk_00, part->unk_04, part->unk_08); guScaleF(sp60, 1.5f, 1.5f, 1.5f); guMtxCatF(sp60, sp20, spA0); - guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp60, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp60, spA0, spA0); guRotateF(sp60, part->unk_34, 0.0f, 0.0f, 1.0f); guMtxCatF(sp60, spA0, spA0); @@ -173,7 +173,7 @@ void shattering_stones_appendGfx(void* effect) { guTranslateF(sp20, part->unk_00, part->unk_04, part->unk_08); guScaleF(sp60, 1.5f, 1.5f, 1.5f); guMtxCatF(sp60, sp20, spA0); - guRotateF(sp60, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp60, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp60, spA0, spA0); guRotateF(spE0, part->unk_2C, 1.0f, 0.0f, 0.0f); diff --git a/src/effects/shimmer_burst.c b/src/effects/shimmer_burst.c index 4d2caef43b..328f155275 100644 --- a/src/effects/shimmer_burst.c +++ b/src/effects/shimmer_burst.c @@ -189,7 +189,7 @@ void shimmer_burst_render(EffectInstance* effect) { renderTask.appendGfx = shimmer_burst_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/shimmer_wave.c b/src/effects/shimmer_wave.c index ba87257ac6..bd262220c0 100644 --- a/src/effects/shimmer_wave.c +++ b/src/effects/shimmer_wave.c @@ -177,7 +177,7 @@ void shimmer_wave_render(EffectInstance* effect) { renderTask.appendGfx = shimmer_wave_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/shiny_flare.c b/src/effects/shiny_flare.c index b1a1dd1476..51192d333d 100644 --- a/src/effects/shiny_flare.c +++ b/src/effects/shiny_flare.c @@ -87,7 +87,7 @@ void shiny_flare_render(EffectInstance* effect) { renderTask.appendGfx = shiny_flare_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/shockwave.c b/src/effects/shockwave.c index 6c0cf94095..b282b86e39 100644 --- a/src/effects/shockwave.c +++ b/src/effects/shockwave.c @@ -258,7 +258,7 @@ void shockwave_render(EffectInstance* effect) { renderTask.appendGfx = shockwave_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -309,7 +309,7 @@ void shockwave_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPDisplayList(gMainGfxPos++, dlist2); - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, data->pos.x, data->pos.y, data->pos.z); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/sleep_bubble.c b/src/effects/sleep_bubble.c index da2b8e7a0a..348cfc809f 100644 --- a/src/effects/sleep_bubble.c +++ b/src/effects/sleep_bubble.c @@ -117,7 +117,7 @@ void sleep_bubble_render(EffectInstance* effect) { renderTask.appendGfx = sleep_bubble_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -153,7 +153,7 @@ void sleep_bubble_appendGfx(void* effect) { guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); - guRotateF(sp18, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp18, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guTranslateF(sp58, data->unk_C4, data->unk_C8, 0.0f); guMtxCatF(sp58, sp18, sp18); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/small_gold_sparkle.c b/src/effects/small_gold_sparkle.c index cd7b9d7265..222b909a2a 100644 --- a/src/effects/small_gold_sparkle.c +++ b/src/effects/small_gold_sparkle.c @@ -102,7 +102,7 @@ void small_gold_sparkle_render(EffectInstance* effect) { renderTask.appendGfx = small_gold_sparkle_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -117,7 +117,7 @@ void small_gold_sparkle_appendGfx(void* effect) { Mtx* spD8; s32 i; - guRotateF(sp98, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp98, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); spD8 = &gDisplayContext->matrixStack[gMatrixListPos++]; gDPPipeSync(gMainGfxPos++); diff --git a/src/effects/smoke_burst.c b/src/effects/smoke_burst.c index 6e40cf7189..fb927c239f 100644 --- a/src/effects/smoke_burst.c +++ b/src/effects/smoke_burst.c @@ -91,7 +91,7 @@ void smoke_burst_render(EffectInstance* effect) { renderTask.appendGfx = smoke_burst_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -113,7 +113,7 @@ void smoke_burst_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); gSPDisplayList(gMainGfxPos++, dlist2); - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z); guRotateF(sp60, 20.0f, 0.0f, 0.0f, 1.0f); guMtxCatF(sp60, sp20, sp20); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/smoke_impact.c b/src/effects/smoke_impact.c index fc8d969af2..36a70fc338 100644 --- a/src/effects/smoke_impact.c +++ b/src/effects/smoke_impact.c @@ -109,7 +109,7 @@ void smoke_impact_render(EffectInstance* effect) { renderTask.appendGfx = smoke_impact_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -135,7 +135,7 @@ void smoke_impact_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, dlist2); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp98); guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/smoke_ring.c b/src/effects/smoke_ring.c index 522d316452..09e88d9d67 100644 --- a/src/effects/smoke_ring.c +++ b/src/effects/smoke_ring.c @@ -112,7 +112,7 @@ void smoke_ring_render(EffectInstance* effect) { renderTask.appendGfx = smoke_ring_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -141,7 +141,7 @@ void smoke_ring_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09002950_32B7F0); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp98); guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/snaking_static.c b/src/effects/snaking_static.c index e259c8b6dc..79937a04b0 100644 --- a/src/effects/snaking_static.c +++ b/src/effects/snaking_static.c @@ -148,7 +148,7 @@ void snaking_static_render(EffectInstance* effect) { renderTask.appendGfx = snaking_static_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/snowfall.c b/src/effects/snowfall.c index 9561f15be1..22510d5e75 100644 --- a/src/effects/snowfall.c +++ b/src/effects/snowfall.c @@ -133,7 +133,7 @@ void snowfall_update(EffectInstance* effect) { if (timeLeft < 10) { data->unk_28 = timeLeft * 25; } - boomLength = camera->currentBoomLength; + boomLength = camera->curBoomLength; temp_s6 = (boomLength * 0.3) + 1.0; data++; @@ -153,7 +153,7 @@ void snowfall_render(EffectInstance* effect) { renderTask.appendGfx = snowfall_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -189,7 +189,7 @@ void snowfall_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09000C00_38DC70); gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, unk_28); - guRotateF(sp18, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp18, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); mtx = &gDisplayContext->matrixStack[gMatrixListPos++]; diff --git a/src/effects/snowflake.c b/src/effects/snowflake.c index 8bd75a62d5..82e5c7c90d 100644 --- a/src/effects/snowflake.c +++ b/src/effects/snowflake.c @@ -88,7 +88,7 @@ void snowflake_render(EffectInstance* effect) { RenderTask* renderTaskPtr = &renderTask; RenderTask* retTask; f32 effectPos = data->pos.x; - f32 playerPos = playerStatus->position.x; + f32 playerPos = playerStatus->pos.x; if (effectPos - playerPos > 200) { data->pos.x = effectPos - 400; @@ -99,7 +99,7 @@ void snowflake_render(EffectInstance* effect) { } effectPos = data->pos.z; - playerPos = playerStatus->position.z; + playerPos = playerStatus->pos.z; if (effectPos - playerPos > 200) { data->pos.z = effectPos - 400; } else { @@ -110,7 +110,7 @@ void snowflake_render(EffectInstance* effect) { renderTaskPtr->appendGfx = &snowflake_appendGfx; renderTaskPtr->appendGfxArg = effect; - renderTaskPtr->distance = 0; + renderTaskPtr->dist = 0; renderTaskPtr->renderMode = RENDER_MODE_2D; retTask = queue_render_task(renderTaskPtr); @@ -127,7 +127,7 @@ void snowflake_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09000900_331800); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - guRotateF(spD8, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(spD8, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(spD8, sp18, sp118); guMtxF2L(sp118, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/snowman_doll.c b/src/effects/snowman_doll.c index 52e6f1405a..0b52277178 100644 --- a/src/effects/snowman_doll.c +++ b/src/effects/snowman_doll.c @@ -279,7 +279,7 @@ void snowman_doll_render(EffectInstance* effect) { renderTask.appendGfx = snowman_doll_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = -10; + renderTask.dist = -10; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); diff --git a/src/effects/something_rotating.c b/src/effects/something_rotating.c index e67f2d0c9c..156e6c9fe5 100644 --- a/src/effects/something_rotating.c +++ b/src/effects/something_rotating.c @@ -245,7 +245,7 @@ void something_rotating_render(EffectInstance* effect) { renderTask.appendGfx = something_rotating_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; retTask = queue_render_task(&renderTask); @@ -258,7 +258,7 @@ void func_E01166E8(s32 arg0, SomethingRotatingFXData* part) { Matrix4f sp60; if (arg0 == 0) { - temp = gCameras[gCurrentCameraID].currentYaw; + temp = gCameras[gCurrentCameraID].curYaw; } else { temp = 0.0f; } diff --git a/src/effects/sparkles.c b/src/effects/sparkles.c index 2699a1d8cb..db1a464166 100644 --- a/src/effects/sparkles.c +++ b/src/effects/sparkles.c @@ -236,7 +236,7 @@ void sparkles_render(EffectInstance* effect) { renderTask.appendGfx = sparkles_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -257,7 +257,7 @@ void sparkles_appendGfx(void* effect) { colorIdx = (part->unk_20 - 1) * 3; guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp98); part++; diff --git a/src/effects/spiky_white_aura.c b/src/effects/spiky_white_aura.c index 6c2d467c5f..61408ad19d 100644 --- a/src/effects/spiky_white_aura.c +++ b/src/effects/spiky_white_aura.c @@ -95,8 +95,8 @@ void spiky_white_aura_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) { part->unk_08 = arg2; part->unk_0C = arg3; - sinYaw = sin_deg(gCameras[gCurrentCameraID].currentYaw); - cosYaw = -cos_deg(gCameras[gCurrentCameraID].currentYaw); + sinYaw = sin_deg(gCameras[gCurrentCameraID].curYaw); + cosYaw = -cos_deg(gCameras[gCurrentCameraID].curYaw); if (numParts != 1) { rotateA = (i * 100) / (numParts - 1) - 50; @@ -168,7 +168,7 @@ void spiky_white_aura_render(EffectInstance* effect) { renderTask.appendGfx = spiky_white_aura_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -187,7 +187,7 @@ void spiky_white_aura_appendGfx(void* effect) { for (i = 0; i < ((EffectInstance*)effect)->numParts; i++, part++) { guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guRotateF(sp58, part->unk_1C, 0.0f, 0.0f, 1.0f); guMtxCatF(sp58, sp18, sp18); diff --git a/src/effects/spirit_card.c b/src/effects/spirit_card.c index 7e8c64e654..42f000ee54 100644 --- a/src/effects/spirit_card.c +++ b/src/effects/spirit_card.c @@ -121,7 +121,7 @@ void spirit_card_render(EffectInstance* effect) { renderTask.appendGfx = spirit_card_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; retTask = queue_render_task(&renderTask); @@ -134,7 +134,7 @@ void func_E0112330(s32 arg0, SpiritCardFXData* data) { Matrix4f sp60; if (arg0 == 0) { - temp = gCameras[gCurrentCameraID].currentYaw; + temp = gCameras[gCurrentCameraID].curYaw; } else { temp = 0.0f; } diff --git a/src/effects/squirt.c b/src/effects/squirt.c index 5a5110ec50..f2d3a1fe3a 100644 --- a/src/effects/squirt.c +++ b/src/effects/squirt.c @@ -146,7 +146,7 @@ void squirt_render(EffectInstance* effect) { renderTask.appendGfx = squirt_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/star.c b/src/effects/star.c index fd8ea881e0..b3ea9feb8f 100644 --- a/src/effects/star.c +++ b/src/effects/star.c @@ -81,7 +81,7 @@ EffectInstance* star_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 part->unk_14 = temp_f22 * temp_f26; part->unk_18 = temp_f20 * temp_f26; - currentYaw = gCameras[gCurrentCameraID].currentYaw; + currentYaw = gCameras[gCurrentCameraID].curYaw; cosYaw = -cos_deg(currentYaw); sinYaw = -sin_deg(currentYaw); @@ -168,7 +168,7 @@ void star_update(EffectInstance* effect) { } } - if (playerStatus->position.y - data->unk_08 > 300.0f) { + if (playerStatus->pos.y - data->unk_08 > 300.0f) { data->unk_30 = -1; } @@ -190,7 +190,7 @@ void star_render(EffectInstance* effect) { renderTask.appendGfxArg = effect; renderTask.appendGfx = star_appendGfx; - renderTask.distance = 0; + renderTask.dist = 0; if (effect15->unk_38 != 0) { renderModeTemp = RENDER_MODE_2D; } else { @@ -216,7 +216,7 @@ void star_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, unk_240, data->unk_04, data->unk_08, data->unk_0C); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, unk_240, data->unk_04, data->unk_08, data->unk_0C); guRotateF(sp60, data->unk_24, 0.0f, 0.0f, 1.0f); guMtxCatF(sp60, sp20, sp20); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); @@ -243,7 +243,7 @@ void star_appendGfx(void* effect) { if (data->unk_1C <= 1.0f) { s32 baseIdx = (data->unk_3C + 5) % 8; - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, unk_240, data->unk_04, data->unk_08, data->unk_0C); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, unk_240, data->unk_04, data->unk_08, data->unk_0C); guRotateF(sp60, data->unk_20, 0.0f, 0.0f, 1.0f); guMtxCatF(sp60, sp20, sp20); guMtxF2L(sp20, &data->unk_40[data->unk_3C]); diff --git a/src/effects/star_outline.c b/src/effects/star_outline.c index 3205405364..736df7cd17 100644 --- a/src/effects/star_outline.c +++ b/src/effects/star_outline.c @@ -137,7 +137,7 @@ void star_outline_render(EffectInstance* effect) { renderTask.appendGfx = star_outline_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -211,7 +211,7 @@ void star_outline_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_E0126BC8[0]); if (unk_34 != 0) { - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, (f32) ((f64) data->unk_54 * 0.4), data->pos.x, data->pos.y, data->pos.z); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, (f32) ((f64) data->unk_54 * 0.4), data->pos.x, data->pos.y, data->pos.z); guPositionF(sp60, data->unk_48, data->unk_4C, data->unk_50, 1.0f, 0.0f, 0.0f, 0.0f); guMtxCatF(sp60, sp20, sp20); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); @@ -230,7 +230,7 @@ void star_outline_appendGfx(void* effect) { gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW); } - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_38 * 0.4, data->pos.x, data->pos.y, data->pos.z); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, data->unk_38 * 0.4, data->pos.x, data->pos.y, data->pos.z); guPositionF(sp60, data->unk_3C.x, data->unk_3C.y, data->unk_3C.z, 1.0f, 0.0f, 0.0f, 0.0f); guMtxCatF(sp60, sp20, sp20); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/star_spirits_energy.c b/src/effects/star_spirits_energy.c index a1c44540b6..39b5da0f93 100644 --- a/src/effects/star_spirits_energy.c +++ b/src/effects/star_spirits_energy.c @@ -328,7 +328,7 @@ void star_spirits_energy_render(EffectInstance* effect) { renderTask.appendGfx = star_spirits_energy_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -345,7 +345,7 @@ void star_spirits_energy_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, data->unk_3C, data->unk_08, data->unk_0C, data->unk_10); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/stars_burst.c b/src/effects/stars_burst.c index 6346219064..81538c498a 100644 --- a/src/effects/stars_burst.c +++ b/src/effects/stars_burst.c @@ -121,7 +121,7 @@ void stars_burst_render(EffectInstance* effect) { renderTask.appendGfx = stars_burst_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -155,7 +155,7 @@ void stars_burst_appendGfx(void* effect) { gDPSetPrimColor(gMainGfxPos++, 0, 0, D_E0042780[rIdx % 36], D_E0042780[gIdx % 36], D_E0042780[bIdx % 36], unk_2C); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guScaleF(sp58, part->unk_24, part->unk_24, 1.0f); guMtxCatF(sp58, sp18, sp18); diff --git a/src/effects/stars_orbiting.c b/src/effects/stars_orbiting.c index 9fa5a014f7..448e6b51ef 100644 --- a/src/effects/stars_orbiting.c +++ b/src/effects/stars_orbiting.c @@ -117,7 +117,7 @@ void func_E005E334(EffectInstance* effect) { gSPDisplayList(gMainGfxPos++, dlist2); guTranslateF(sp18, part->pos.x, part->pos.y, part->pos.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp98); guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/stars_shimmer.c b/src/effects/stars_shimmer.c index 973288bdbf..0f64f1d485 100644 --- a/src/effects/stars_shimmer.c +++ b/src/effects/stars_shimmer.c @@ -273,7 +273,7 @@ void stars_shimmer_render(EffectInstance* effect) { renderTask.appendGfx = stars_shimmer_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -297,7 +297,7 @@ void stars_shimmer_appendGfx(void* effect) { temp_s4 = (data->lifeTime - 1) * 3; guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp98); switch (type) { diff --git a/src/effects/stars_spread.c b/src/effects/stars_spread.c index 98e09dba3b..10f74886be 100644 --- a/src/effects/stars_spread.c +++ b/src/effects/stars_spread.c @@ -112,7 +112,7 @@ void stars_spread_render(EffectInstance* effect) { renderTask.appendGfx = stars_spread_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -131,7 +131,7 @@ void stars_spread_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09000440_360E70); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/stat_change.c b/src/effects/stat_change.c index 901e03d60d..88eee1a8b5 100644 --- a/src/effects/stat_change.c +++ b/src/effects/stat_change.c @@ -245,7 +245,7 @@ void func_E00AC2A4(EffectInstance* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, data->scale, data->pos.x, data->pos.y, data->pos.z); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/static_status.c b/src/effects/static_status.c index 0d07bf1a36..5acb44cbae 100644 --- a/src/effects/static_status.c +++ b/src/effects/static_status.c @@ -147,7 +147,7 @@ void static_status_update(EffectInstance* effect) { part->unk_18 = 0.0f; part->unk_1C = 0.0f; part->scale = 1.0f; - part->rotation = -angle - 45.0f; + part->rot = -angle - 45.0f; } if (type == 0) { @@ -178,7 +178,7 @@ void static_status_render(EffectInstance* effect) { renderTask.appendGfx = static_status_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_SURFACE_OPA; retTask = queue_render_task(&renderTask); @@ -212,7 +212,7 @@ void static_status_appendGfx(void* effect) { part++; for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) { if (part->frame >= 0) { - guPositionF(mtxTransform, 0.0f, 0.0f, part->rotation, part->scale, part->pos.x, part->pos.y, 0.0f); + guPositionF(mtxTransform, 0.0f, 0.0f, part->rot, part->scale, part->pos.x, part->pos.y, 0.0f); guMtxF2L(mtxTransform, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/effects/steam_burst.c b/src/effects/steam_burst.c index a2f84df52a..8d573ac3be 100644 --- a/src/effects/steam_burst.c +++ b/src/effects/steam_burst.c @@ -100,7 +100,7 @@ void steam_burst_render(EffectInstance* effect) { renderTask.appendGfx = steam_burst_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -124,7 +124,7 @@ void steam_burst_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, dlist2); guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp98); guMtxF2L(sp98, &gDisplayContext->matrixStack[gMatrixListPos]); diff --git a/src/effects/stop_watch.c b/src/effects/stop_watch.c index 51e75f6576..a63ff51839 100644 --- a/src/effects/stop_watch.c +++ b/src/effects/stop_watch.c @@ -168,7 +168,7 @@ void stop_watch_render(EffectInstance* effect) { renderTask.appendGfx = stop_watch_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/sun.c b/src/effects/sun.c index a28167e73e..4569169405 100644 --- a/src/effects/sun.c +++ b/src/effects/sun.c @@ -138,7 +138,7 @@ void sun_render(EffectInstance* effect) { renderTask.appendGfx = sun_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/sweat.c b/src/effects/sweat.c index 01bf92a8c9..97f4615aa3 100644 --- a/src/effects/sweat.c +++ b/src/effects/sweat.c @@ -33,7 +33,7 @@ void sweat_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, s32 ASSERT(data != NULL); data->unk_00 = arg0; - guRotateF(matrix, -arg5, sin_deg(gCameras[gCurrentCameraID].currentYaw), 0.0f, -cos_deg(gCameras[gCurrentCameraID].currentYaw)); + guRotateF(matrix, -arg5, sin_deg(gCameras[gCurrentCameraID].curYaw), 0.0f, -cos_deg(gCameras[gCurrentCameraID].curYaw)); temp_f2 = arg4 + 16.0f; data->pos.x = arg1 + (matrix[1][0] * temp_f2); data->pos.y = arg2 + (matrix[1][1] * temp_f2); @@ -74,7 +74,7 @@ void sweat_render(EffectInstance* effect) { renderTask.appendGfx = sweat_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -90,7 +90,7 @@ void sweat_appendGfx(void* effect) { gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guRotateF(sp58, data->unk_10, 0.0f, 0.0f, 1.0f); guMtxCatF(sp58, sp18, sp18); diff --git a/src/effects/throw_spiny.c b/src/effects/throw_spiny.c index a9c1b61bfb..bb5dcadf55 100644 --- a/src/effects/throw_spiny.c +++ b/src/effects/throw_spiny.c @@ -75,7 +75,7 @@ EffectInstance* throw_spiny_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg spinyObject->unk_34 = 180; spinyObject->unk_38 = 120; spinyObject->yaw = rand_int(360); - spinyObject->rotationSpeed = rand_int(10) + 5; + spinyObject->rotSpeed = rand_int(10) + 5; spinyObject->state = -1; spinyObject->xScale = 1.0f; spinyObject->yScale = 1.0f; @@ -120,14 +120,14 @@ void throw_spiny_update(EffectInstance* effectInstance) { spinyObject->pos.x += spinyObject->unk_44; spinyObject->pos.y += spinyObject->gravity; spinyObject->pos.z += spinyObject->unk_4C; - spinyObject->yaw += spinyObject->rotationSpeed; + spinyObject->yaw += spinyObject->rotSpeed; } if ((lifeDuration - 1) == spinyObject->timeUntilFall) { spinyObject->state = 0; spinyObject->gravity = -spinyObject->gravity; spinyObject->unk_44 = spinyObject->unk_44; - spinyObject->rotationSpeed = -4.0f; + spinyObject->rotSpeed = -4.0f; return; } @@ -135,7 +135,7 @@ void throw_spiny_update(EffectInstance* effectInstance) { if ((gravity < 0.0f) && (spinyObject->pos.y < 100.0 / 7.0)) { spinyObject->pos.y = 100.0f / 7.0f; - spinyObject->rotationSpeed = -20.0f; + spinyObject->rotSpeed = -20.0f; spinyObject->gravity = gravity - gravity; } } @@ -146,7 +146,7 @@ void throw_spiny_render(EffectInstance* effect) { renderTask.appendGfx = throw_spiny_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/thunderbolt_ring.c b/src/effects/thunderbolt_ring.c index ed11990298..e4738177ea 100644 --- a/src/effects/thunderbolt_ring.c +++ b/src/effects/thunderbolt_ring.c @@ -90,7 +90,7 @@ void thunderbolt_ring_render(EffectInstance* effect) { renderTask.appendGfx = thunderbolt_ring_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -110,7 +110,7 @@ void thunderbolt_ring_appendGfx(void* effect) { gDPPipeSync(gMainGfxPos++); gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data)); - guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, data->unk_28, data->pos.x, data->pos.y, data->pos.z); + guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, data->unk_28, data->pos.x, data->pos.y, data->pos.z); guMtxF2L(sp20, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/effects/tubba_heart_attack.c b/src/effects/tubba_heart_attack.c index f2ea275cb2..e80cbac137 100644 --- a/src/effects/tubba_heart_attack.c +++ b/src/effects/tubba_heart_attack.c @@ -286,7 +286,7 @@ void tubba_heart_attack_render(EffectInstance* effect) { renderTask.appendGfx = tubba_heart_attack_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/underwater.c b/src/effects/underwater.c index 373413f8b6..66ec12a5ba 100644 --- a/src/effects/underwater.c +++ b/src/effects/underwater.c @@ -142,7 +142,7 @@ void underwater_render(EffectInstance* effect) { renderTask.appendGfx = underwater_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 100; + renderTask.dist = 100; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/walking_dust.c b/src/effects/walking_dust.c index 0e77be6370..3a43673b45 100644 --- a/src/effects/walking_dust.c +++ b/src/effects/walking_dust.c @@ -85,7 +85,7 @@ void walking_dust_render(EffectInstance* effect) { renderTask.appendGfx = walking_dust_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_28; retTask = queue_render_task(&renderTask); @@ -155,7 +155,7 @@ void walking_dust_appendGfx(void* effect) { for (i = 0; i < effectTemp->numParts; i++, data++) { guTranslateF(sp18, data->unk_08, data->unk_0C, data->unk_10); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); guMtxF2L(sp18, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], diff --git a/src/effects/water_block.c b/src/effects/water_block.c index 6e177e4475..a1e527e379 100644 --- a/src/effects/water_block.c +++ b/src/effects/water_block.c @@ -207,7 +207,7 @@ void water_block_render(EffectInstance* effect) { renderTask.appendGfx = water_block_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 20; + renderTask.dist = 20; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/water_fountain.c b/src/effects/water_fountain.c index 62aa740806..d3004d16cf 100644 --- a/src/effects/water_fountain.c +++ b/src/effects/water_fountain.c @@ -195,7 +195,7 @@ void water_fountain_render(EffectInstance* effect) { renderTask.appendGfx = water_fountain_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/water_splash.c b/src/effects/water_splash.c index 6ba89ccb9d..6f7f8156fd 100644 --- a/src/effects/water_splash.c +++ b/src/effects/water_splash.c @@ -157,7 +157,7 @@ void water_splash_render(EffectInstance* effect) { renderTask.appendGfx = water_splash_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/waterfall.c b/src/effects/waterfall.c index be87eb12f3..7e8fccac6b 100644 --- a/src/effects/waterfall.c +++ b/src/effects/waterfall.c @@ -107,7 +107,7 @@ void waterfall_render(EffectInstance* effect) { renderTask.appendGfx = waterfall_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); diff --git a/src/effects/whirlwind.c b/src/effects/whirlwind.c index c5b99ca653..a397b918f6 100644 --- a/src/effects/whirlwind.c +++ b/src/effects/whirlwind.c @@ -136,7 +136,7 @@ void whirlwind_render(EffectInstance* effect) { renderTask.appendGfx = whirlwind_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_2D; queuedTask = queue_render_task(&renderTask); diff --git a/src/effects/windy_leaves.c b/src/effects/windy_leaves.c index 030076789a..7f8a245005 100644 --- a/src/effects/windy_leaves.c +++ b/src/effects/windy_leaves.c @@ -223,7 +223,7 @@ void windy_leaves_render(EffectInstance* effect) { renderTask.appendGfx = windy_leaves_appendGfx; renderTask.appendGfxArg = effect; - renderTask.distance = 0; + renderTask.dist = 0; renderTask.renderMode = RENDER_MODE_2D; retTask = queue_render_task(&renderTask); @@ -245,7 +245,7 @@ void windy_leaves_appendGfx(void* effect) { gSPDisplayList(gMainGfxPos++, D_09001180_33E790); gDPSetPrimColor(gMainGfxPos++, 0, 0, 20, 100, 20, part->alpha); guTranslateF(sp18, part->unk_04.x, part->unk_04.y, part->unk_04.z); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp98); part++; diff --git a/src/encounter.c b/src/encounter.c index 92c126db63..a773d4ce1b 100644 --- a/src/encounter.c +++ b/src/encounter.c @@ -457,8 +457,8 @@ ApiStatus OnFleeBattleDrops(Evt* script, s32 isInitialCall) { if (rand_int(100) < 50) { if (playerData->coins != 0) { playerData->coins--; - make_item_entity_delayed(ITEM_COIN, playerStatus->position.x, - playerStatus->position.y + playerStatus->colliderHeight, playerStatus->position.z, + make_item_entity_delayed(ITEM_COIN, playerStatus->pos.x, + playerStatus->pos.y + playerStatus->colliderHeight, playerStatus->pos.z, ITEM_SPAWN_MODE_TOSS_SPAWN_ALWAYS, 0, 0); } } @@ -519,15 +519,15 @@ void update_encounters_neutral(void) { currentEncounter->flags &= ~ENCOUNTER_STATUS_FLAG_2; currentEncounter->flags &= ~ENCOUNTER_STATUS_FLAG_4; - playerX = playerStatus->position.x; - playerY = playerStatus->position.y; - playerZ = playerStatus->position.z; + playerX = playerStatus->pos.x; + playerY = playerStatus->pos.y; + playerZ = playerStatus->pos.z; playerYaw = playerStatus->spriteFacingAngle; if (playerYaw < 180.0f) { - playerYaw = clamp_angle(camera->currentYaw - 90.0f); + playerYaw = clamp_angle(camera->curYaw - 90.0f); } else { - playerYaw = clamp_angle(camera->currentYaw + 90.0f); + playerYaw = clamp_angle(camera->curYaw + 90.0f); } if (currentEncounter->battleTriggerCooldown != 0) { @@ -632,7 +632,7 @@ void update_encounters_neutral(void) { if (!(enemy->flags & ENEMY_FLAG_400000)) { if (npc == playerStatus->encounteredNPC) { enemy->savedNpcYaw = npc->yaw; - npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); script = get_script_by_id(enemy->aiScriptID); if (script != NULL) { set_script_flags(script, EVT_FLAG_SUSPENDED); @@ -669,8 +669,8 @@ void update_encounters_neutral(void) { if (!(enemy->flags & ENEMY_FLAG_IGNORE_PARTNER) && partner_test_enemy_collision(npc)) { currentEncounter->hitType = ENCOUNTER_TRIGGER_PARTNER; enemy->encountered = ENCOUNTER_TRIGGER_PARTNER; - currentEncounter->currentEncounter = encounter; - currentEncounter->currentEnemy = enemy; + currentEncounter->curEncounter = encounter; + currentEncounter->curEnemy = enemy; currentEncounter->firstStrikeType = FIRST_STRIKE_PLAYER; goto START_BATTLE; } @@ -686,9 +686,9 @@ void update_encounters_neutral(void) { if (enemy->unk_DC != 0) { npcYaw = npc->yawCamOffset; if (npcYaw < 180.0f) { - npcYaw = clamp_angle(camera->currentYaw - 90.0f); + npcYaw = clamp_angle(camera->curYaw - 90.0f); } else { - npcYaw = clamp_angle(camera->currentYaw + 90.0f); + npcYaw = clamp_angle(camera->curYaw + 90.0f); } add_vec2D_polar(&npcX, &npcZ, enemy->unk_DC, npcYaw); @@ -704,12 +704,12 @@ void update_encounters_neutral(void) { y = playerY; z = playerZ; if (clamp_angle(playerStatus->spriteFacingAngle) < 180.0f) { - hammerDir = clamp_angle(camera->currentYaw - 90.0f); + hammerDir = clamp_angle(camera->curYaw - 90.0f); if (playerStatus->trueAnimation & SPRITE_ID_BACK_FACING) { hammerDir = clamp_angle(hammerDir + 30.0f); } } else { - hammerDir = clamp_angle(camera->currentYaw + 90.0f); + hammerDir = clamp_angle(camera->curYaw + 90.0f); if (playerStatus->trueAnimation & SPRITE_ID_BACK_FACING) { hammerDir = clamp_angle(hammerDir - 30.0f); } @@ -762,12 +762,12 @@ void update_encounters_neutral(void) { triggeredBattle = TRUE; } if (triggeredBattle) { - sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, SOUND_SPACE_MODE_0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z); + sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, SOUND_SPACE_MODE_0, playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z); currentEncounter->hitType = ENCOUNTER_TRIGGER_HAMMER; currentEncounter->hitTier = gPlayerData.hammerLevel; enemy->encountered = ENCOUNTER_TRIGGER_HAMMER; - currentEncounter->currentEncounter = encounter; - currentEncounter->currentEnemy = enemy; + currentEncounter->curEncounter = encounter; + currentEncounter->curEnemy = enemy; currentEncounter->firstStrikeType = FIRST_STRIKE_PLAYER; goto START_BATTLE; } @@ -823,8 +823,8 @@ void update_encounters_neutral(void) { if (gPlayerData.bootsLevel < 0) { currentEncounter->hitType = ENCOUNTER_TRIGGER_NONE; enemy->encountered = ENCOUNTER_TRIGGER_NONE; - currentEncounter->currentEncounter = encounter; - currentEncounter->currentEnemy = enemy; + currentEncounter->curEncounter = encounter; + currentEncounter->curEnemy = enemy; currentEncounter->firstStrikeType = FIRST_STRIKE_NONE; currentEncounter->hitTier = 0; goto START_BATTLE; @@ -848,10 +848,10 @@ void update_encounters_neutral(void) { currentEncounter->hitTier = 2; break; } - sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, SOUND_SPACE_MODE_0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z); + sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, SOUND_SPACE_MODE_0, playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z); enemy->encountered = ENCOUNTER_STATE_NEUTRAL; - currentEncounter->currentEncounter = encounter; - currentEncounter->currentEnemy = enemy; + currentEncounter->curEncounter = encounter; + currentEncounter->curEnemy = enemy; currentEncounter->firstStrikeType = FIRST_STRIKE_PLAYER; goto START_BATTLE; } @@ -896,26 +896,26 @@ void update_encounters_neutral(void) { triggeredBattle = TRUE; } if ((playerStatus->animFlags & PA_FLAG_SPINNING) && !(enemy->flags & ENEMY_FLAG_IGNORE_SPIN) && triggeredBattle) { - sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, SOUND_SPACE_MODE_0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z); - testX = playerStatus->position.x + ((npc->pos.x - playerStatus->position.x) * 0.5f); - testY = playerStatus->position.y + (((npc->pos.y + npc->collisionHeight) - (playerStatus->position.y + playerStatus->colliderHeight)) * 0.5f); - testZ = playerStatus->position.z + ((npc->pos.z - playerStatus->position.z) * 0.5f); + sfx_play_sound_at_position(SOUND_HIT_PLAYER_NORMAL, SOUND_SPACE_MODE_0, playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z); + testX = playerStatus->pos.x + ((npc->pos.x - playerStatus->pos.x) * 0.5f); + testY = playerStatus->pos.y + (((npc->pos.y + npc->collisionHeight) - (playerStatus->pos.y + playerStatus->colliderHeight)) * 0.5f); + testZ = playerStatus->pos.z + ((npc->pos.z - playerStatus->pos.z) * 0.5f); fx_damage_stars(3, testX, testY, testZ, 0.0f, -1.0f, 0.0f, 3); currentEncounter->hitType = ENCOUNTER_TRIGGER_SPIN; playerStatus->animFlags |= PA_FLAG_DIZZY_ATTACK_ENCOUNTER; enemy->encountered = ENCOUNTER_TRIGGER_SPIN; - currentEncounter->currentEncounter = encounter; - currentEncounter->currentEnemy = enemy; + currentEncounter->curEncounter = encounter; + currentEncounter->curEnemy = enemy; currentEncounter->firstStrikeType = FIRST_STRIKE_NONE; } else { currentEncounter->hitType = ENCOUNTER_TRIGGER_NONE; playerStatus->animFlags &= ~PA_FLAG_DIZZY_ATTACK_ENCOUNTER; enemy->encountered = ENCOUNTER_TRIGGER_NONE; - currentEncounter->currentEncounter = encounter; - currentEncounter->currentEnemy = enemy; - testX = playerStatus->position.x + ((npc->pos.x - playerStatus->position.x) * 0.5f); - testY = playerStatus->position.y + (((npc->pos.y + npc->collisionHeight) - (playerStatus->position.y + playerStatus->colliderHeight)) * 0.5f); - testZ = playerStatus->position.z + ((npc->pos.z - playerStatus->position.z) * 0.5f); + currentEncounter->curEncounter = encounter; + currentEncounter->curEnemy = enemy; + testX = playerStatus->pos.x + ((npc->pos.x - playerStatus->pos.x) * 0.5f); + testY = playerStatus->pos.y + (((npc->pos.y + npc->collisionHeight) - (playerStatus->pos.y + playerStatus->colliderHeight)) * 0.5f); + testZ = playerStatus->pos.z + ((npc->pos.z - playerStatus->pos.z) * 0.5f); fx_damage_stars(3, testX, testY, testZ, 0.0f, -1.0f, 0.0f, 3); // if the hitbox is active, trigger a first strike firstStrikeType = FIRST_STRIKE_NONE; @@ -945,26 +945,26 @@ START_BATTLE: case 0: break; case ENCOUNTER_TRIGGER_NONE: - currentEnemy = enemy = currentEncounter->currentEnemy; + currentEnemy = enemy = currentEncounter->curEnemy; if (enemy->aiScript != NULL) { suspend_all_script(enemy->aiScriptID); } if (enemy->auxScript != NULL) { suspend_all_script(enemy->auxScriptID); } - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; if (enemy == NULL) { continue; } - if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->currentEnemy) { + if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->curEnemy) { continue; } if (enemy->flags & ENEMY_FLAG_DISABLE_AI) { continue; } - if ((currentEnemy->flags & ENEMY_FLAG_PROJECTILE) && enemy != currentEncounter->currentEnemy) { + if ((currentEnemy->flags & ENEMY_FLAG_PROJECTILE) && enemy != currentEncounter->curEnemy) { continue; } @@ -999,26 +999,26 @@ START_BATTLE: gEncounterSubState = ENCOUNTER_SUBSTATE_PRE_BATTLE_INIT; break; case ENCOUNTER_TRIGGER_SPIN: - currentEnemy = enemy = currentEncounter->currentEnemy; + currentEnemy = enemy = currentEncounter->curEnemy; if (enemy->aiScript != NULL) { suspend_all_script(enemy->aiScriptID); } if (enemy->auxScript != NULL) { suspend_all_script(enemy->auxScriptID); } - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; if (enemy == NULL) { continue; } - if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->currentEnemy) { + if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->curEnemy) { continue; } if (enemy->flags & ENEMY_FLAG_DISABLE_AI) { continue; } - if ((currentEnemy->flags & ENEMY_FLAG_PROJECTILE) && enemy != currentEncounter->currentEnemy) { + if ((currentEnemy->flags & ENEMY_FLAG_PROJECTILE) && enemy != currentEncounter->curEnemy) { continue; } @@ -1043,14 +1043,14 @@ START_BATTLE: playerStatus->flags |= PS_FLAG_ENTERING_BATTLE; break; case ENCOUNTER_TRIGGER_JUMP: - currentEnemy = enemy = currentEncounter->currentEnemy; + currentEnemy = enemy = currentEncounter->curEnemy; if (enemy->aiScript != NULL) { suspend_all_script(enemy->aiScriptID); } if (enemy->auxScript != NULL) { suspend_all_script(enemy->auxScriptID); } - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; cond2 = FALSE; for (i = 0; i < encounter->count; i++) { @@ -1059,13 +1059,13 @@ START_BATTLE: if (enemy == NULL) { continue; } - if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->currentEnemy) { + if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->curEnemy) { continue; } if (enemy->flags & ENEMY_FLAG_DISABLE_AI) { continue; } - if ((currentEnemy->flags & ENEMY_FLAG_PROJECTILE) && enemy != currentEncounter->currentEnemy) { + if ((currentEnemy->flags & ENEMY_FLAG_PROJECTILE) && enemy != currentEncounter->curEnemy) { continue; } if (enemy->hitBytecode != NULL) { @@ -1078,16 +1078,16 @@ START_BATTLE: script->groupFlags = enemy->scriptGroup; npc = get_npc_unsafe(enemy->npcID); cond2 = TRUE; - testX = playerStatus->position.x + ((npc->pos.x - playerStatus->position.x) * 0.5f); - testY = playerStatus->position.y + (((npc->pos.y + npc->collisionHeight) - (playerStatus->position.y + playerStatus->colliderHeight)) * 0.5f); - testZ = playerStatus->position.z + ((npc->pos.z - playerStatus->position.z) * 0.5f); + testX = playerStatus->pos.x + ((npc->pos.x - playerStatus->pos.x) * 0.5f); + testY = playerStatus->pos.y + (((npc->pos.y + npc->collisionHeight) - (playerStatus->pos.y + playerStatus->colliderHeight)) * 0.5f); + testZ = playerStatus->pos.z + ((npc->pos.z - playerStatus->pos.z) * 0.5f); fx_damage_stars(3, testX, testY, testZ, 0.0f, -1.0f, 0.0f, 3); } else if (!(enemy->flags & ENEMY_FLAG_PASSIVE)) { npc = get_npc_unsafe(enemy->npcID); cond2 = TRUE; - testX = playerStatus->position.x + ((npc->pos.x - playerStatus->position.x) * 0.5f); - testY = playerStatus->position.y + (((npc->pos.y + npc->collisionHeight) - (playerStatus->position.y + playerStatus->colliderHeight)) * 0.5f); - testZ = playerStatus->position.z + ((npc->pos.z - playerStatus->position.z) * 0.5f); + testX = playerStatus->pos.x + ((npc->pos.x - playerStatus->pos.x) * 0.5f); + testY = playerStatus->pos.y + (((npc->pos.y + npc->collisionHeight) - (playerStatus->pos.y + playerStatus->colliderHeight)) * 0.5f); + testZ = playerStatus->pos.z + ((npc->pos.z - playerStatus->pos.z) * 0.5f); fx_damage_stars(3, testX, testY, testZ, 0.0f, -1.0f, 0.0f, 3); } } @@ -1106,26 +1106,26 @@ START_BATTLE: gEncounterSubState = ENCOUNTER_SUBSTATE_PRE_BATTLE_INIT; break; case ENCOUNTER_TRIGGER_HAMMER: - currentEnemy = enemy = currentEncounter->currentEnemy; + currentEnemy = enemy = currentEncounter->curEnemy; if (enemy->aiScript != NULL) { suspend_all_script(enemy->aiScriptID); } if (enemy->auxScript != NULL) { suspend_all_script(enemy->auxScriptID); } - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; if (enemy == NULL) { continue; } - if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->currentEnemy) { + if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->curEnemy) { continue; } if (enemy->flags & ENEMY_FLAG_DISABLE_AI) { continue; } - if ((currentEnemy->flags & ENEMY_FLAG_PROJECTILE) && enemy != currentEncounter->currentEnemy) { + if ((currentEnemy->flags & ENEMY_FLAG_PROJECTILE) && enemy != currentEncounter->curEnemy) { continue; } if (enemy->hitBytecode != NULL) { @@ -1137,15 +1137,15 @@ START_BATTLE: script->owner2.npcID = enemy->npcID; script->groupFlags = enemy->scriptGroup; npc = get_npc_unsafe(enemy->npcID); - testX = playerStatus->position.x + ((npc->pos.x - playerStatus->position.x) * 0.5f); - testY = playerStatus->position.y + (((npc->pos.y + npc->collisionHeight) - (playerStatus->position.y + playerStatus->colliderHeight)) * 0.5f); - testZ = playerStatus->position.z + ((npc->pos.z - playerStatus->position.z) * 0.5f); + testX = playerStatus->pos.x + ((npc->pos.x - playerStatus->pos.x) * 0.5f); + testY = playerStatus->pos.y + (((npc->pos.y + npc->collisionHeight) - (playerStatus->pos.y + playerStatus->colliderHeight)) * 0.5f); + testZ = playerStatus->pos.z + ((npc->pos.z - playerStatus->pos.z) * 0.5f); fx_damage_stars(3, testX, testY, testZ, 0.0f, -1.0f, 0.0f, 3); } else if (!(enemy->flags & ENEMY_FLAG_PASSIVE)) { npc = get_npc_unsafe(enemy->npcID); - testX = playerStatus->position.x + ((npc->pos.x - playerStatus->position.x) * 0.5f); - testY = playerStatus->position.y + (((npc->pos.y + npc->collisionHeight) - (playerStatus->position.y + playerStatus->colliderHeight)) * 0.5f); - testZ = playerStatus->position.z + ((npc->pos.z - playerStatus->position.z) * 0.5f); + testX = playerStatus->pos.x + ((npc->pos.x - playerStatus->pos.x) * 0.5f); + testY = playerStatus->pos.y + (((npc->pos.y + npc->collisionHeight) - (playerStatus->pos.y + playerStatus->colliderHeight)) * 0.5f); + testZ = playerStatus->pos.z + ((npc->pos.z - playerStatus->pos.z) * 0.5f); fx_damage_stars(3, npc->pos.x, npc->pos.y + npc->collisionHeight, npc->pos.z, 0.0f, -1.0f, 0.0f, 3); } } @@ -1162,11 +1162,11 @@ START_BATTLE: break; case ENCOUNTER_TRIGGER_CONVERSATION: suspend_all_group(EVT_GROUP_01); - enemy = currentEncounter->currentEnemy; + enemy = currentEncounter->curEnemy; if (enemy != NULL && enemy->aiScript != NULL) { suspend_all_script(enemy->aiScriptID); } - enemy = currentEncounter->currentEnemy; + enemy = currentEncounter->curEnemy; if (enemy->interactBytecode != NULL) { enemy->encountered = ENCOUNTER_TRIGGER_CONVERSATION; script = start_script(enemy->interactBytecode, EVT_PRIORITY_A, 0); @@ -1187,27 +1187,27 @@ START_BATTLE: gEncounterSubState = ENCOUNTER_SUBSTATE_CONVERSATION_INIT; break; case ENCOUNTER_TRIGGER_PARTNER: - currentEnemy = enemy = currentEncounter->currentEnemy; + currentEnemy = enemy = currentEncounter->curEnemy; if (enemy->aiScript != NULL) { suspend_all_script(enemy->aiScriptID); } if (enemy->auxScript != NULL) { suspend_all_script(enemy->auxScriptID); } - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; if (enemy == NULL) { continue; } - if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->currentEnemy) { + if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->curEnemy) { continue; } if (enemy->flags & ENEMY_FLAG_DISABLE_AI) { continue; } - if ((currentEnemy->flags & ENEMY_FLAG_PROJECTILE) && enemy != currentEncounter->currentEnemy) { + if ((currentEnemy->flags & ENEMY_FLAG_PROJECTILE) && enemy != currentEncounter->curEnemy) { continue; } if (enemy->hitBytecode != NULL) { @@ -1284,7 +1284,7 @@ void update_encounters_pre_battle(void) { } } - enemy = currentEncounter->currentEnemy; + enemy = currentEncounter->curEnemy; if ((enemy->flags & ENEMY_FLAG_100000) && !currentEncounter->scriptedBattle) { currentEncounter->unk_94 = 0; currentEncounter->battleStartCountdown = 0; @@ -1301,7 +1301,7 @@ void update_encounters_pre_battle(void) { return; } - enemy = currentEncounter->currentEnemy; + enemy = currentEncounter->curEnemy; if (currentEncounter->hitType != ENCOUNTER_TRIGGER_NONE && currentEncounter->hitType != ENCOUNTER_TRIGGER_SPIN && is_ability_active(ABILITY_FIRST_ATTACK) @@ -1316,14 +1316,14 @@ void update_encounters_pre_battle(void) { return; } - enemy = currentEncounter->currentEnemy; + enemy = currentEncounter->curEnemy; if (( (is_ability_active(ABILITY_BUMP_ATTACK)) && (playerData->level >= enemy->npcSettings->level) && (!(enemy->flags & ENEMY_FLAG_PROJECTILE) && !(currentEncounter->scriptedBattle)) ) || ( - (enemy = currentEncounter->currentEnemy, + (enemy = currentEncounter->curEnemy, (currentEncounter->hitType == ENCOUNTER_TRIGGER_SPIN)) && (is_ability_active(ABILITY_SPIN_ATTACK)) && playerData->level >= enemy->npcSettings->level && @@ -1364,11 +1364,11 @@ void update_encounters_pre_battle(void) { break; } - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; if (enemy != NULL && - ((!(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || enemy == currentEncounter->currentEnemy)) && + ((!(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || enemy == currentEncounter->curEnemy)) && !(enemy->flags & ENEMY_FLAG_DISABLE_AI) && enemy->hitScript != NULL) { @@ -1381,7 +1381,7 @@ void update_encounters_pre_battle(void) { currentEncounter->dizzyAttackStatus = 0; currentEncounter->dizzyAttackDuration = 0; - enemy = currentEncounter->currentEnemy; + enemy = currentEncounter->curEnemy; currentEncounter->instigatorValue = enemy->instigatorValue; if (is_ability_active(ABILITY_DIZZY_ATTACK) && currentEncounter->hitType == ENCOUNTER_TRIGGER_SPIN) { @@ -1415,11 +1415,11 @@ void update_encounters_pre_battle(void) { break; } - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; if (enemy != NULL && - (!(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || enemy == currentEncounter->currentEnemy) && + (!(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || enemy == currentEncounter->curEnemy) && !(enemy->flags & ENEMY_FLAG_DISABLE_AI) && (enemy->hitScript != 0)) { @@ -1454,7 +1454,7 @@ void update_encounters_pre_battle(void) { void draw_encounters_pre_battle(void) { EncounterStatus* encounter = &gCurrentEncounter; - Npc* npc = get_npc_unsafe(encounter->currentEnemy->npcID); + Npc* npc = get_npc_unsafe(encounter->curEnemy->npcID); PlayerStatus* playerStatus = &gPlayerStatus; if (encounter->unk_94 != 0) { @@ -1474,9 +1474,9 @@ void draw_encounters_pre_battle(void) { encounter->fadeOutAmount = 255; } - playerX = playerStatus->position.x; - playerY = playerStatus->position.y; - playerZ = playerStatus->position.z; + playerX = playerStatus->pos.x; + playerY = playerStatus->pos.y; + playerZ = playerStatus->pos.z; otherX = npc->pos.x; otherY = npc->pos.y; @@ -1637,7 +1637,7 @@ void update_encounters_post_battle(void) { break; case ENCOUNTER_SUBSTATE_POST_BATTLE_WON_CHECK_MERLEE_BONUS: if (currentEncounter->hasMerleeCoinBonus) { - if (get_coin_drop_amount(currentEncounter->currentEnemy) != 0) { + if (get_coin_drop_amount(currentEncounter->curEnemy) != 0) { D_800A0BB0 = start_script(&EVS_MerleeDropCoins, EVT_PRIORITY_A, 0); D_800A0BB0->groupFlags = 0; D_800A0BB4 = D_800A0BB0->id; @@ -1649,7 +1649,7 @@ void update_encounters_post_battle(void) { gEncounterSubState = ENCOUNTER_SUBSTATE_POST_BATTLE_PLAY_NPC_DEFEAT; break; case ENCOUNTER_SUBSTATE_POST_BATTLE_PLAY_NPC_DEFEAT: - if (currentEncounter->hasMerleeCoinBonus && (get_coin_drop_amount(currentEncounter->currentEnemy) != 0)) { + if (currentEncounter->hasMerleeCoinBonus && (get_coin_drop_amount(currentEncounter->curEnemy) != 0)) { currentEncounter->fadeOutAccel += 4; currentEncounter->fadeOutAmount -= currentEncounter->fadeOutAccel; if (currentEncounter->fadeOutAmount < 0) { @@ -1659,13 +1659,13 @@ void update_encounters_post_battle(void) { break; } } - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; if (enemy == NULL) { continue; } - if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->currentEnemy) { + if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->curEnemy) { continue; } if (enemy->flags & ENEMY_FLAG_DISABLE_AI) { @@ -1706,13 +1706,13 @@ void update_encounters_post_battle(void) { break; case ENCOUNTER_SUBSTATE_POST_BATTLE_WON_KILL: hasDefeatScript = FALSE; - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; if (enemy == NULL) { continue; } - if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->currentEnemy) { + if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->curEnemy) { continue; } if (enemy->flags & ENEMY_FLAG_DISABLE_AI) { @@ -1728,7 +1728,7 @@ void update_encounters_post_battle(void) { if (!(currentEncounter->flags & ENCOUNTER_STATUS_FLAG_1) && !D_8009A63C && currentEncounter->battleStartCountdown == 1) { suggest_player_anim_allow_backward(ANIM_Mario1_ThumbsUp); } - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; enemy = encounter->enemy[i]; @@ -1738,7 +1738,7 @@ void update_encounters_post_battle(void) { if (enemy->flags & ENEMY_FLAG_4) { continue; } - if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->currentEnemy) { + if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->curEnemy) { continue; } if (!(enemy->flags & ENEMY_FLAG_PASSIVE)) { @@ -1797,13 +1797,13 @@ void update_encounters_post_battle(void) { gEncounterSubState = ENCOUNTER_SUBSTATE_NEUTRAL; break; case ENCOUNTER_SUBSTATE_POST_BATTLE_FLED_INIT: - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; if (enemy == NULL) { continue; } - if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->currentEnemy) { + if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->curEnemy) { continue; } @@ -1835,7 +1835,7 @@ void update_encounters_post_battle(void) { } break; case ENCOUNTER_SUBSTATE_POST_BATTLE_102: - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; hasDefeatScript = FALSE; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; @@ -1870,8 +1870,8 @@ void update_encounters_post_battle(void) { } } - enemy = currentEncounter->currentEnemy; - encounter = currentEncounter->currentEncounter; + enemy = currentEncounter->curEnemy; + encounter = currentEncounter->curEncounter; if (!(enemy->flags & ENEMY_FLAG_40000)) { enemy->aiSuspendTime = 45; playerStatus->blinkTimer = 45; @@ -1891,7 +1891,7 @@ void update_encounters_post_battle(void) { } } - enemy = currentEncounter->currentEnemy; + enemy = currentEncounter->curEnemy; if (!(currentEncounter->flags & ENCOUNTER_STATUS_FLAG_4)) { script = start_script(&EVS_FleeBattleDrops, EVT_PRIORITY_A, 0); enemy->defeatScript = script; @@ -1917,7 +1917,7 @@ void update_encounters_post_battle(void) { case ENCOUNTER_SUBSTATE_POST_BATTLE_103: if (currentEncounter->unk_94 != 0) { currentEncounter->unk_94--; - if (gGameStatusPtr->currentButtons[0] == 0 && gGameStatusPtr->stickX[0] == 0 && gGameStatusPtr->stickY[0] == 0) { + if (gGameStatusPtr->curButtons[0] == 0 && gGameStatusPtr->stickX[0] == 0 && gGameStatusPtr->stickY[0] == 0) { break; } } @@ -1931,13 +1931,13 @@ void update_encounters_post_battle(void) { break; case ENCOUNTER_SUBSTATE_POST_BATTLE_LOST_INIT: suggest_player_anim_allow_backward(ANIM_MarioW2_LayingDown); - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; if (enemy == NULL) { continue; } - if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->currentEnemy) { + if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->curEnemy) { continue; } @@ -1969,7 +1969,7 @@ void update_encounters_post_battle(void) { break; case ENCOUNTER_SUBSTATE_POST_BATTLE_202: hasDefeatScript = FALSE; - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; if (enemy == NULL) { @@ -2012,7 +2012,7 @@ void update_encounters_post_battle(void) { case ENCOUNTER_SUBSTATE_POST_BATTLE_LOST_TO_NEUTRAL: if (currentEncounter->unk_94 != 0) { currentEncounter->unk_94--; - if (gGameStatusPtr->currentButtons[0] == 0 && gGameStatusPtr->stickX[0] == 0 && gGameStatusPtr->stickY[0] == 0) { + if (gGameStatusPtr->curButtons[0] == 0 && gGameStatusPtr->stickX[0] == 0 && gGameStatusPtr->stickY[0] == 0) { break; } } @@ -2049,13 +2049,13 @@ void update_encounters_post_battle(void) { gEncounterSubState = ENCOUNTER_SUBSTATE_NEUTRAL; break; case ENCOUNTER_SUBSTATE_POST_BATTLE_ENEMY_FLED_INIT: - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; if (enemy == NULL) { continue; } - if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->currentEnemy) { + if ((enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) && enemy != currentEncounter->curEnemy) { continue; } @@ -2087,7 +2087,7 @@ void update_encounters_post_battle(void) { break; case ENCOUNTER_SUBSTATE_POST_BATTLE_ENEMY_FLED_TO_NEUTRAL: hasDefeatScript = FALSE; - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; if (enemy == NULL) { @@ -2121,9 +2121,9 @@ void update_encounters_post_battle(void) { } } - enemy = currentEncounter->currentEnemy; + enemy = currentEncounter->curEnemy; if (!(enemy->flags & ENEMY_FLAG_4)) { - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; enemy->aiSuspendTime = 45; playerStatus->blinkTimer = 45; for (j = 0; j < encounter->count; j++) { @@ -2197,7 +2197,7 @@ void update_encounters_conversation(void) { switch (gEncounterSubState) { case ENCOUNTER_SUBSTATE_CONVERSATION_INIT: - currentEnemy = encounter->currentEnemy; + currentEnemy = encounter->curEnemy; flag = FALSE; if (currentEnemy->interactScript != NULL) { @@ -2223,7 +2223,7 @@ void update_encounters_conversation(void) { case ENCOUNTER_SUBSTATE_CONVERSATION_END: resume_all_group(EVT_GROUP_01); - currentEnemy = encounter->currentEnemy; + currentEnemy = encounter->curEnemy; if (currentEnemy != NULL && currentEnemy->aiScript != NULL) { resume_all_script(currentEnemy->aiScriptID); } @@ -2275,9 +2275,9 @@ s32 check_conversation_trigger(void) { playerStatus->flags &= ~PS_FLAG_HAS_CONVERSATION_NPC; playerColliderHeight = playerStatus->colliderHeight; playerColliderRadius = playerStatus->colliderDiameter / 2; - playerX = playerStatus->position.x; - playerY = playerStatus->position.y; - playerZ = playerStatus->position.z; + playerX = playerStatus->pos.x; + playerY = playerStatus->pos.y; + playerZ = playerStatus->pos.z; if (gPartnerStatus.partnerActionState != PARTNER_ACTION_NONE) { return FALSE; @@ -2332,12 +2332,12 @@ s32 check_conversation_trigger(void) { } if (clamp_angle(playerStatus->spriteFacingAngle) < 180.0f) { - angle = clamp_angle(camera->currentYaw - 120.0f); + angle = clamp_angle(camera->curYaw - 120.0f); if (playerStatus->trueAnimation & SPRITE_ID_BACK_FACING) { angle = clamp_angle(angle + 60.0f); } } else { - angle = clamp_angle(camera->currentYaw + 120.0f); + angle = clamp_angle(camera->curYaw + 120.0f); if (playerStatus->trueAnimation & SPRITE_ID_BACK_FACING) { angle = clamp_angle(angle - 60.0f); } @@ -2376,8 +2376,8 @@ s32 check_conversation_trigger(void) { close_status_bar(); gCurrentEncounter.hitType = ENCOUNTER_TRIGGER_CONVERSATION; enemy->encountered = ENCOUNTER_TRIGGER_CONVERSATION; - encounterStatus->currentEncounter = encounter; - encounterStatus->currentEnemy = enemy; + encounterStatus->curEncounter = encounter; + encounterStatus->curEnemy = enemy; encounterStatus->firstStrikeType = FIRST_STRIKE_PLAYER; return TRUE; } diff --git a/src/encounter_api.c b/src/encounter_api.c index 147662ceb8..547a898d30 100644 --- a/src/encounter_api.c +++ b/src/encounter_api.c @@ -182,7 +182,7 @@ ApiStatus DoNpcDefeat(Evt* script, s32 isInitialCall) { Evt* newScript; kill_script(script); - npc->currentAnim = owner->animList[6]; + npc->curAnim = owner->animList[6]; newScript = start_script(&EVS_NpcDefeat, EVT_PRIORITY_A, 0); owner->defeatScript = newScript; owner->defeatScriptID = newScript->id; @@ -203,8 +203,8 @@ void start_battle(Evt* script, s32 songID) { currentEncounter->hitType = ENCOUNTER_TRIGGER_NONE; enemy->encountered = TRUE; - currentEncounter->currentEnemy = enemy; - currentEncounter->currentEncounter = currentEncounter->encounterList[enemy->encounterIndex]; + currentEncounter->curEnemy = enemy; + currentEncounter->curEncounter = currentEncounter->encounterList[enemy->encounterIndex]; currentEncounter->firstStrikeType = FIRST_STRIKE_NONE; currentEncounter->allowFleeing = FALSE; currentEncounter->songID = songID; @@ -221,10 +221,10 @@ void start_battle(Evt* script, s32 songID) { disable_player_input(); partner_disable_input(); - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; - if (enemy != NULL && (!(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || enemy == currentEncounter->currentEnemy)) { + if (enemy != NULL && (!(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || enemy == currentEncounter->curEnemy)) { if (enemy->hitBytecode != NULL) { Evt* hitEvtInstance; enemy->encountered = TRUE; @@ -274,8 +274,8 @@ ApiStatus StartBossBattle(Evt* script, s32 isInitialCall) { currentEncounter->hitType = ENCOUNTER_TRIGGER_NONE; enemy->encountered = TRUE; - currentEncounter->currentEnemy = enemy; - currentEncounter->currentEncounter = currentEncounter->encounterList[enemy->encounterIndex]; + currentEncounter->curEnemy = enemy; + currentEncounter->curEncounter = currentEncounter->encounterList[enemy->encounterIndex]; currentEncounter->firstStrikeType = FIRST_STRIKE_NONE; currentEncounter->allowFleeing = TRUE; currentEncounter->songID = songID; @@ -292,11 +292,11 @@ ApiStatus StartBossBattle(Evt* script, s32 isInitialCall) { disable_player_input(); partner_disable_input(); - encounter = currentEncounter->currentEncounter; + encounter = currentEncounter->curEncounter; for (i = 0; i < encounter->count; i++) { enemy = encounter->enemy[i]; if ((enemy != NULL && ( - !(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || enemy == currentEncounter->currentEnemy) + !(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || enemy == currentEncounter->curEnemy) ) && enemy->hitBytecode != NULL) { enemy->encountered = TRUE; @@ -698,9 +698,9 @@ ApiStatus SetSelfRotation(Evt* script, s32 isInitialCall) { s32 rotY = evt_get_variable(script, *args++); s32 rotZ = evt_get_variable(script, *args++); - self->rotation.x = rotX; - self->rotation.y = rotY; - self->rotation.z = rotZ; + self->rot.x = rotX; + self->rot.y = rotY; + self->rot.z = rotZ; return ApiStatus_DONE2; } @@ -854,7 +854,7 @@ ApiStatus OnPlayerFled(Evt* script, s32 isInitialCall) { EffectInstance* unk; if (!(enemy->aiFlags & ENEMY_AI_FLAG_10)) { - npc->currentAnim = *enemy->animList; + npc->curAnim = *enemy->animList; } if (!(enemy->aiFlags & ENEMY_AI_FLAG_8)) { diff --git a/src/entity.c b/src/entity.c index 7fd193d2a8..d049409811 100644 --- a/src/entity.c +++ b/src/entity.c @@ -111,7 +111,7 @@ void update_entities(void) { } if (entity->flags & ENTITY_FLAG_ALWAYS_FACE_CAMERA) { - entity->rotation.y = -gCameras[gCurrentCameraID].currentYaw; + entity->rot.y = -gCameras[gCurrentCameraID].curYaw; } if (!(entity->flags & ENTITY_FLAG_SKIP_UPDATE_TRANSFORM_MATRIX)) { @@ -150,7 +150,7 @@ void update_entities(void) { } if (entity->flags & ENTITY_FLAG_ALWAYS_FACE_CAMERA) { - entity->rotation.y = -gCameras[gCurrentCameraID].currentYaw; + entity->rot.y = -gCameras[gCurrentCameraID].curYaw; } if (!gGameStatusPtr->disableScripts) { @@ -214,7 +214,7 @@ void update_shadows(void) { if (!(shadow->flags & ENTITY_FLAG_SKIP_UPDATE)) { if (shadow->flags & ENTITY_FLAG_ALWAYS_FACE_CAMERA) { - shadow->rotation.y = -gCameras[gCurrentCameraID].currentYaw; + shadow->rot.y = -gCameras[gCurrentCameraID].curYaw; } update_shadow_transform_matrix(shadow); @@ -346,10 +346,10 @@ void render_entities(void) { if (!gGameStatusPtr->isBattle) { if (gEntityHideMode != ENTITY_HIDE_MODE_0 && !(entity->flags & ENTITY_FLAG_IGNORE_DISTANCE_CULLING) && - dist2D(gPlayerStatusPtr->position.x, - gPlayerStatusPtr->position.z, - entity->position.x, - entity->position.z) > 200.0f + dist2D(gPlayerStatusPtr->pos.x, + gPlayerStatusPtr->pos.z, + entity->pos.x, + entity->pos.z) > 200.0f ) { continue; } @@ -482,10 +482,10 @@ void update_entity_transform_matrix(Entity* entity) { return; } - guTranslateF(sp58, entity->position.x, entity->position.y, entity->position.z); - guRotateF(spD8, entity->rotation.x, 1.0f, 0.0f, 0.0f); - guRotateF(sp118, entity->rotation.y, 0.0f, 1.0f, 0.0f); - guRotateF(sp158, entity->rotation.z, 0.0f, 0.0f, 1.0f); + guTranslateF(sp58, entity->pos.x, entity->pos.y, entity->pos.z); + guRotateF(spD8, entity->rot.x, 1.0f, 0.0f, 0.0f); + guRotateF(sp118, entity->rot.y, 0.0f, 1.0f, 0.0f); + guRotateF(sp158, entity->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(sp158, spD8, sp18); guMtxCatF(sp18, sp118, sp98); guScaleF(sp198, entity->scale.x, entity->scale.y, entity->scale.z); @@ -503,10 +503,10 @@ void update_shadow_transform_matrix(Shadow* shadow) { Matrix4f sp158; Matrix4f sp198; - guTranslateF(sp58, shadow->position.x, shadow->position.y, shadow->position.z); - guRotateF(sp118, shadow->rotation.x, 1.0f, 0.0f, 0.0f); - guRotateF(spD8, shadow->rotation.y, 0.0f, 1.0f, 0.0f); - guRotateF(sp158, shadow->rotation.z, 0.0f, 0.0f, 1.0f); + guTranslateF(sp58, shadow->pos.x, shadow->pos.y, shadow->pos.z); + guRotateF(sp118, shadow->rot.x, 1.0f, 0.0f, 0.0f); + guRotateF(spD8, shadow->rot.y, 0.0f, 1.0f, 0.0f); + guRotateF(sp158, shadow->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(sp158, sp118, sp98); guMtxCatF(spD8, sp98, sp98); guScaleF(sp198, shadow->scale.x, shadow->scale.y, shadow->scale.z); @@ -519,10 +519,10 @@ void update_entity_inverse_rotation_matrix(Entity* entity) { Matrix4f sp18; Matrix4f sp58; - guRotateF(sp18, -entity->rotation.y, 0.0f, 1.0f, 0.0f); - guRotateF(sp58, -entity->rotation.z, 0.0f, 0.0f, 1.0f); + guRotateF(sp18, -entity->rot.y, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -entity->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(sp18, sp58, sp18); - guRotateF(sp58, -entity->rotation.x, 1.0f, 0.0f, 0.0f); + guRotateF(sp58, -entity->rot.x, 1.0f, 0.0f, 0.0f); guMtxCatF(sp18, sp58, entity->inverseTransformMatrix); entity->effectiveSize = sqrtf(((SQ(entity->aabb.x) + SQ(entity->aabb.z)) * 0.25f) + SQ(entity->aabb.y)); @@ -642,7 +642,7 @@ s32 entity_get_collision_flags(Entity* entity) { entity->flags &= ~ENTITY_FLAG_PARTNER_COLLISION; } - flag = gCollisionStatus.currentFloor; + flag = gCollisionStatus.curFloor; if (flag != -1 && (flag & COLLISION_WITH_ENTITY_BIT) && listIndex == (u8)flag) { entityFlags |= ENTITY_COLLISION_PLAYER_TOUCH_FLOOR; } @@ -652,7 +652,7 @@ s32 entity_get_collision_flags(Entity* entity) { entityFlags |= ENTITY_COLLISION_PLAYER_LAST_FLOOR; } - flag = gCollisionStatus.currentCeiling; + flag = gCollisionStatus.curCeiling; if (flag != -1 && (flag & COLLISION_WITH_ENTITY_BIT) && listIndex == (u8)flag) { entityFlags |= ENTITY_COLLISION_PLAYER_TOUCH_CEILING; } @@ -667,7 +667,7 @@ s32 entity_get_collision_flags(Entity* entity) { entityFlags |= ENTITY_COLLISION_PLAYER_HAMMER; } - flag = gCollisionStatus.currentWall; + flag = gCollisionStatus.curWall; if (flag != -1 && (flag & COLLISION_WITH_ENTITY_BIT) && listIndex == (u8)flag && gPlayerStatusPtr->pressedButtons & BUTTON_A) { entityFlags |= ENTITY_COLLISION_PLAYER_TOUCH_WALL; } @@ -733,7 +733,7 @@ s32 entity_try_partner_interaction_trigger(s32 entityIdx) { } s32 test_player_entity_aabb(Entity* entity) { - f32 yTemp = entity->position.y - (gPlayerStatus.position.y + gPlayerStatus.colliderHeight); + f32 yTemp = entity->pos.y - (gPlayerStatus.pos.y + gPlayerStatus.colliderHeight); f32 xCollRadius; f32 zCollRadius; f32 xDist; @@ -744,9 +744,9 @@ s32 test_player_entity_aabb(Entity* entity) { } xCollRadius = (gPlayerStatus.colliderDiameter + entity->aabb.x) * 0.5; - xDist = fabsf(gPlayerStatus.position.x - entity->position.x); + xDist = fabsf(gPlayerStatus.pos.x - entity->pos.x); zCollRadius = ((gPlayerStatus.colliderDiameter + entity->aabb.z) * 0.5); - zDist = fabsf(gPlayerStatus.position.z - entity->position.z); + zDist = fabsf(gPlayerStatus.pos.z - entity->pos.z); if (xCollRadius < xDist || zCollRadius < zDist) { return 0; @@ -1261,12 +1261,12 @@ s32 create_entity(EntityBlueprint* bp, ...) { entity->collisionFlags = 0; entity->collisionTimer = 0; entity->renderSetupFunc = NULL; - entity->position.x = x; - entity->position.y = y; - entity->position.z = z; - entity->rotation.x = 0.0f; - entity->rotation.y = rotY; - entity->rotation.z = 0.0f; + entity->pos.x = x; + entity->pos.y = y; + entity->pos.z = z; + entity->rot.x = 0.0f; + entity->rot.y = rotY; + entity->rot.z = 0.0f; entity->scale.x = 1.0f; entity->scale.y = 1.0f; entity->scale.z = 1.0f; @@ -1333,9 +1333,9 @@ s32 create_shadow_from_data(ShadowBlueprint* bp, f32 x, f32 y, f32 z) { shadow->flags = bp->flags | ENTITY_FLAG_CREATED; shadow->alpha = 128; shadow->unk_06 = 0x80; - shadow->position.x = x; - shadow->position.y = y; - shadow->position.z = z; + shadow->pos.x = x; + shadow->pos.y = y; + shadow->pos.z = z; shadow->scale.x = 1.0f; shadow->scale.y = 1.0f; shadow->scale.z = 1.0f; @@ -1607,9 +1607,9 @@ void update_entity_shadow_position(Entity* entity) { } } - rayX = entity->position.x; - rayY = entity->position.y; - rayZ = entity->position.z; + rayX = entity->pos.x; + rayY = entity->pos.y; + rayZ = entity->pos.z; if (!entity_raycast_down(&rayX, &rayY, &rayZ, &hitYaw, &hitPitch, &hitLength) && hitLength == 32767.0f) { hitLength = 0.0f; @@ -1627,17 +1627,17 @@ void update_entity_shadow_position(Entity* entity) { shadow->scale.z = (entity->aabb.z / hitLength) * entity->scale.z; } - shadow->position.x = entity->position.x; - shadow->position.z = entity->position.z; - shadow->position.y = rayY; + shadow->pos.x = entity->pos.x; + shadow->pos.z = entity->pos.z; + shadow->pos.y = rayY; entity->shadowPosY = rayY; - shadow->rotation.x = hitYaw; - shadow->rotation.z = hitPitch; - shadow->rotation.y = entity->rotation.y; + shadow->rot.x = hitYaw; + shadow->rot.z = hitPitch; + shadow->rot.y = entity->rot.y; - if (entity->position.y < rayY) { + if (entity->pos.y < rayY) { shadow->flags |= ENTITY_FLAG_SKIP_UPDATE; - entity->position.y = rayY + 10.0f; + entity->pos.y = rayY + 10.0f; } else { shadow->flags &= ~ENTITY_FLAG_SKIP_UPDATE; } @@ -1753,9 +1753,9 @@ void set_peach_shadow_scale(Shadow* shadow, f32 scale) { } s32 is_block_on_ground(Entity* block) { - f32 x = block->position.x; - f32 y = block->position.y; - f32 z = block->position.z; + f32 x = block->pos.x; + f32 y = block->pos.y; + f32 z = block->pos.z; f32 hitYaw; f32 hitPitch; f32 hitLength; diff --git a/src/entity/Block.c b/src/entity/Block.c index d4d38156c4..f1b58ac18b 100644 --- a/src/entity/Block.c +++ b/src/entity/Block.c @@ -49,7 +49,7 @@ void entity_base_block_setupGfx(s32 entityIndex) { } void entity_base_block_play_vanish_effect(Entity* entity) { - fx_cold_breath(0, entity->position.x, entity->position.y, entity->position.z, 1.0f, 0x3C); + fx_cold_breath(0, entity->pos.x, entity->pos.y, entity->pos.z, 1.0f, 0x3C); } f32 entity_block_hit_init_scale(Entity* entity) { @@ -58,12 +58,12 @@ f32 entity_block_hit_init_scale(Entity* entity) { entity->scale.y = 0.23f; entity->scale.x = 1.04f; entity->scale.z = 1.04f; - entity->position.y += 18.0f; + entity->pos.y += 18.0f; } else { entity->scale.y = 0.46f; entity->scale.x = 2.08f; entity->scale.z = 2.08f; - entity->position.y += 18.0f; + entity->pos.y += 18.0f; } } @@ -73,12 +73,12 @@ void entity_block_hit_animate_scale(Entity* entity) { entity->scale.x -= 0.09; entity->scale.z -= 0.09; entity->scale.y += 0.045; - entity->position.y -= 3.0f; + entity->pos.y -= 3.0f; } else { entity->scale.x -= 0.18; entity->scale.z -= 0.18; entity->scale.y += 0.09; - entity->position.y -= 3.0f; + entity->pos.y -= 3.0f; } entity_base_block_idle(entity); } @@ -99,10 +99,10 @@ void entity_base_block_update_slow_sinking(Entity* entity) { return; } - if (entity->position.y < data->initialY - 25.0f) { - deltaY = (entity->position.y - data->initialY + 50.0f) * 0.125f; + if (entity->pos.y < data->initialY - 25.0f) { + deltaY = (entity->pos.y - data->initialY + 50.0f) * 0.125f; } else { - deltaY = (data->initialY - entity->position.y) * 0.125f; + deltaY = (data->initialY - entity->pos.y) * 0.125f; } if (deltaY > 1.2) { @@ -112,10 +112,10 @@ void entity_base_block_update_slow_sinking(Entity* entity) { deltaY = 0.3f; } - entity->position.y += deltaY; + entity->pos.y += deltaY; - if (data->initialY < entity->position.y) { - entity->position.y = data->initialY; + if (data->initialY < entity->pos.y) { + entity->pos.y = data->initialY; data->sinkingTimer = -1; entity->flags &= ~ENTITY_FLAG_200000; } @@ -124,10 +124,10 @@ void entity_base_block_update_slow_sinking(Entity* entity) { if (!(playerStatus->flags & PS_FLAG_JUMPING)) { Shadow* shadow = get_shadow_by_index(entity->shadowIndex); if (shadow != NULL) { - f32 temp2 = entity->position.y - shadow->position.y; + f32 temp2 = entity->pos.y - shadow->pos.y; - if (entity->position.y - temp2 <= playerStatus->colliderHeight + 1) { - entity->position.y = playerStatus->colliderHeight + 1; + if (entity->pos.y - temp2 <= playerStatus->colliderHeight + 1) { + entity->pos.y = playerStatus->colliderHeight + 1; data->sinkingTimer = 1; } } @@ -139,8 +139,8 @@ void entity_base_block_update_slow_sinking(Entity* entity) { } else { Shadow* shadow = get_shadow_by_index(entity->shadowIndex); if (shadow != NULL) { - if (entity->position.y <= shadow->position.y) { - entity->position.y = shadow->position.y; + if (entity->pos.y <= shadow->pos.y) { + entity->pos.y = shadow->pos.y; data->sinkingTimer = 1; } } @@ -151,10 +151,10 @@ void entity_base_block_update_slow_sinking(Entity* entity) { return; } - if (entity->position.y < data->initialY - 25.0f) { - deltaY = (entity->position.y - data->initialY + 50.0f) * 0.125f; + if (entity->pos.y < data->initialY - 25.0f) { + deltaY = (entity->pos.y - data->initialY + 50.0f) * 0.125f; } else { - deltaY = (data->initialY - entity->position.y) * 0.125f; + deltaY = (data->initialY - entity->pos.y) * 0.125f; } if (deltaY > 1.2) { @@ -164,10 +164,10 @@ void entity_base_block_update_slow_sinking(Entity* entity) { deltaY = 0.3f; } - entity->position.y -= deltaY; + entity->pos.y -= deltaY; - if (entity->position.y < data->initialY - 50.0f) { - entity->position.y = data->initialY - 50.0f; + if (entity->pos.y < data->initialY - 50.0f) { + entity->pos.y = data->initialY - 50.0f; data->sinkingTimer = 1; } } @@ -183,7 +183,7 @@ s32 entity_base_block_idle(Entity* entity) { entity_base_block_update_slow_sinking(entity); if (data->item != -1) { ItemEntity* itemEntity = get_item_entity(data->item); - itemEntity->position.y = entity->position.y + 4.0f; + itemEntity->pos.y = entity->pos.y + 4.0f; } } } @@ -195,7 +195,7 @@ void entity_base_block_init(Entity* entity) { BlockData* data = entity->dataBuf.block; data->item = -1; - data->initialY = entity->position.y; + data->initialY = entity->pos.y; data->sinkingTimer = -1; entity->flags &= ~ENTITY_FLAG_200000; } @@ -211,8 +211,8 @@ void entity_inactive_block_hit_anim(Entity* entity) { f64 currentY; entity_MulticoinBlock_update_timer(entity); - currentY = entity->position.y; - entity->position.y = currentY + ((f64)sin_rad(DEG_TO_RAD(data->recoilInterpPhase)) * 2); + currentY = entity->pos.y; + entity->pos.y = currentY + ((f64)sin_rad(DEG_TO_RAD(data->recoilInterpPhase)) * 2); data->recoilInterpPhase += 60.0f; if (data->recoilInterpPhase > 450.0f) { data->recoilInterpPhase = clamp_angle(data->recoilInterpPhase); @@ -225,12 +225,12 @@ void entity_inactive_block_recoil_anim(Entity* entity) { f64 currentY; entity_MulticoinBlock_update_timer(entity); - currentY = entity->position.y; - entity->position.y = currentY + ((f64)sin_rad(DEG_TO_RAD(data->recoilInterpPhase))); + currentY = entity->pos.y; + entity->pos.y = currentY + ((f64)sin_rad(DEG_TO_RAD(data->recoilInterpPhase))); data->recoilInterpPhase += 60.0f; if (data->recoilInterpPhase >= 360.0f) { data->recoilInterpPhase = 0.0f; - entity->position.y = data->initialY; + entity->pos.y = data->initialY; exec_entity_commandlist(entity); } } @@ -258,7 +258,7 @@ void entity_MulticoinBlock_spawn_coin(Entity* entity) { itemSpawnMode = ITEM_SPAWN_MODE_ITEM_BLOCK_SPAWN_ALWAYS; flagIndex = 0; } - make_item_entity_nodelay(ITEM_COIN, entity->position.x, entity->position.y + 28.0, entity->position.z, + make_item_entity_nodelay(ITEM_COIN, entity->pos.x, entity->pos.y + 28.0, entity->pos.z, itemSpawnMode, flagIndex); data->coinsLeft -= 1; } @@ -266,8 +266,8 @@ void entity_MulticoinBlock_spawn_coin(Entity* entity) { if ((data->coinsLeft == 0) || (data->timeLeft == 0)) { data->empty = TRUE; set_entity_commandlist(get_entity_by_index(create_entity(&Entity_InertYellowBlock, - (s32)entity->position.x, (s32)entity->position.y, (s32)entity->position.z, - (s32)entity->rotation.y, MAKE_ENTITY_END)), Entity_CreatedInertBlock_Script); + (s32)entity->pos.x, (s32)entity->pos.y, (s32)entity->pos.z, + (s32)entity->rot.y, MAKE_ENTITY_END)), Entity_CreatedInertBlock_Script); entity->flags |= (ENTITY_FLAG_DISABLE_COLLISION | ENTITY_FLAG_PENDING_INSTANCE_DELETE); } } @@ -296,7 +296,7 @@ void entity_MulticoinBlock_idle(Entity* entity) { entity_MulticoinBlock_update_timer(entity); entity_base_block_idle(entity); if (data->empty) { - create_entity(&Entity_InertYellowBlock, (s32)entity->position.x, (s32)entity->position.y, (s32)entity->position.z, (s32)entity->rotation.y, MAKE_ENTITY_END); + create_entity(&Entity_InertYellowBlock, (s32)entity->pos.x, (s32)entity->pos.y, (s32)entity->pos.z, (s32)entity->rot.y, MAKE_ENTITY_END); entity->flags |= (ENTITY_FLAG_DISABLE_COLLISION | ENTITY_FLAG_PENDING_INSTANCE_DELETE); } } @@ -306,7 +306,7 @@ void entity_MulticoinBlock_check_if_inactive(Entity* entity) { if (data->gameFlagIndex != 0xFFFF) { if (get_global_flag(data->gameFlagIndex) != 0) { - create_entity(&Entity_InertYellowBlock, (s32)entity->position.x, (s32)entity->position.y, (s32)entity->position.z, (s32)entity->rotation.y, MAKE_ENTITY_END); + create_entity(&Entity_InertYellowBlock, (s32)entity->pos.x, (s32)entity->pos.y, (s32)entity->pos.z, (s32)entity->rot.y, MAKE_ENTITY_END); entity->flags |= (ENTITY_FLAG_DISABLE_COLLISION | ENTITY_FLAG_PENDING_INSTANCE_DELETE); } } @@ -388,7 +388,7 @@ s32 entity_block_handle_collision(Entity* entity) { return TRUE; } set_entity_commandlist(entity, Entity_BreakingBlock_Script); - sfx_play_sound_at_position(SOUND_14F, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z); + sfx_play_sound_at_position(SOUND_14F, SOUND_SPACE_MODE_0, entity->pos.x, entity->pos.y, entity->pos.z); break; case ENTITY_TYPE_HAMMER2_BLOCK: case ENTITY_TYPE_HAMMER2_BLOCK_TINY: @@ -403,7 +403,7 @@ s32 entity_block_handle_collision(Entity* entity) { return TRUE; } set_entity_commandlist(entity, Entity_BreakingBlock_Script); - sfx_play_sound_at_position(SOUND_150, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z); + sfx_play_sound_at_position(SOUND_150, SOUND_SPACE_MODE_0, entity->pos.x, entity->pos.y, entity->pos.z); break; case ENTITY_TYPE_HAMMER3_BLOCK: case ENTITY_TYPE_HAMMER3_BLOCK_TINY: @@ -411,7 +411,7 @@ s32 entity_block_handle_collision(Entity* entity) { return TRUE; } set_entity_commandlist(entity, Entity_BreakingBlock_Script); - sfx_play_sound_at_position(SOUND_151, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z); + sfx_play_sound_at_position(SOUND_151, SOUND_SPACE_MODE_0, entity->pos.x, entity->pos.y, entity->pos.z); break; case ENTITY_TYPE_MULTI_TRIGGER_BLOCK: case ENTITY_TYPE_HEALING_BLOCK: @@ -441,7 +441,7 @@ void entity_init_HammerBlock_small(Entity* entity) { BlockData* data = entity->dataBuf.block; data->item = -1; - data->initialY = entity->position.y; + data->initialY = entity->pos.y; data->sinkingTimer = -1; entity->flags &= ~ENTITY_FLAG_200000; entity->scale.x = 0.5f; diff --git a/src/entity/BlueWarpPipe.c b/src/entity/BlueWarpPipe.c index 85fabdd5ab..0fffe2f088 100644 --- a/src/entity/BlueWarpPipe.c +++ b/src/entity/BlueWarpPipe.c @@ -25,7 +25,7 @@ void entity_BlueWarpPipe_rise_up(Entity* entity) { pipeData->timer--; if ((pipeData->timer != -1) && (pipeData->isRaised == 0)) { - entity->position.y += 2.3125; + entity->pos.y += 2.3125; } else { pipeData->timer = 0; exec_entity_commandlist(entity); @@ -38,12 +38,12 @@ void entity_BlueWarpPipe_wait_for_player_to_get_off(Entity* entity) { if (pipeData->entryID == gGameStatusPtr->entryID) { switch (pipeData->timer) { case 0: - if (gCollisionStatus.currentFloor > 0) { + if (gCollisionStatus.curFloor > 0) { pipeData->timer = 1; } break; case 1: - if (gCollisionStatus.currentFloor <= NO_COLLIDER) { + if (gCollisionStatus.curFloor <= NO_COLLIDER) { pipeData->timer = 2; } break; @@ -94,7 +94,7 @@ void entity_BlueWarpPipe_set_player_move_to_center(Entity* entity) { entryX = (*mapSettings->entryList)[pipeData->entryID].x; entryZ = (*mapSettings->entryList)[pipeData->entryID].z; - angle = atan2(playerStatus->position.x, playerStatus->position.z, entryX, entryZ); + angle = atan2(playerStatus->pos.x, playerStatus->pos.z, entryX, entryZ); disable_player_input(); disable_player_static_collisions(); move_player(pipeData->timer, angle, playerStatus->runSpeed); @@ -112,7 +112,7 @@ void entity_BlueWarpPipe_enter_pipe_init(Entity* bluePipe) { PlayerStatus* playerStatus = &gPlayerStatus; BlueWarpPipeData* pipeData = bluePipe->dataBuf.bluePipe; - playerStatus->targetYaw = gCameras[gCurrentCameraID].currentYaw + 180.0f; + playerStatus->targetYaw = gCameras[gCurrentCameraID].curYaw + 180.0f; pipeData->timer = 25; playerStatus->renderMode = RENDER_MODE_ALPHATEST; @@ -125,12 +125,12 @@ void entity_BlueWarpPipe_enter_pipe_update(Entity* entity) { PlayerStatus* playerStatus = &gPlayerStatus; BlueWarpPipeData* pipeData = entity->dataBuf.bluePipe; - playerStatus->position.y--; + playerStatus->pos.y--; pipeData->timer--; if (pipeData->timer == -1) { playerStatus->renderMode = RENDER_MODE_ALPHATEST; - playerStatus->position.y -= 50.0f; + playerStatus->pos.y -= 50.0f; set_player_imgfx_all(ANIM_Mario1_Idle, IMGFX_CLEAR, 0, 0, 0, 0, 0); exec_entity_commandlist(entity); } @@ -152,7 +152,7 @@ void entity_BlueWarpPipe_setupGfx(s32 entityIndex) { Matrix4f sp50; guScaleF(sp10, entity->scale.x, entity->scale.y, entity->scale.z); - guTranslateF(sp50, entity->position.x, data->finalPosY + 1.0f, entity->position.z); + guTranslateF(sp50, entity->pos.x, data->finalPosY + 1.0f, entity->pos.z); guMtxCatF(sp10, sp50, sp50); guMtxF2L(sp50, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -173,10 +173,10 @@ void entity_init_BlueWarpPipe(Entity* entity) { data->entryID = entryID; data->onEnterPipeEvt = enterPipeEvt; data->flagIndex = flagIndex; - data->finalPosY = entity->position.y; + data->finalPosY = entity->pos.y; data->isRaised = get_global_flag(data->flagIndex); - entity->position.y -= (data->isRaised ? 15.0 : 52.0); + entity->pos.y -= (data->isRaised ? 15.0 : 52.0); } EntityScript Entity_BlueWarpPipe_Script = { diff --git a/src/entity/Chest.c b/src/entity/Chest.c index 4ec4e50d8d..a9efbfdf44 100644 --- a/src/entity/Chest.c +++ b/src/entity/Chest.c @@ -124,8 +124,8 @@ void entity_Chest_idle(Entity* entity) { ChestData* data; PlayerStatus* playerStatus = &gPlayerStatus; - rotation = clamp_angle(180.0f - entity->rotation.y); - angle = fabsf(rotation - clamp_angle(atan2(entity->position.x, entity->position.z, playerStatus->position.x, playerStatus->position.z))); + rotation = clamp_angle(180.0f - entity->rot.y); + angle = fabsf(rotation - clamp_angle(atan2(entity->pos.x, entity->pos.z, playerStatus->pos.x, playerStatus->pos.z))); if ((!(playerStatus->animFlags & PA_FLAG_USING_WATT)) && (!(entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR)) && ((angle <= 40.0f) || (angle >= 320.0f))) { @@ -302,14 +302,14 @@ void entity_GiantChest_open(Entity* entity) { if (chest->giveItemHeightInterpPhase < 140.0f) { chest->itemEntityPos.y += cos_rad(DEG_TO_RAD(chest->giveItemHeightInterpPhase)) * 3.0f; } else { - dy = (chest->itemEntityPos.y - playerStatus->position.y - 30.0f) * 0.25f; + dy = (chest->itemEntityPos.y - playerStatus->pos.y - 30.0f) * 0.25f; if (dy <= 0.4) { dy = 0.4f; } chest->itemEntityPos.y -= dy; } giveItemLerpAlpha = sin_rad(DEG_TO_RAD(chest->giveItemRadiusInterpPhase)); - theta = intermediateTheta = clamp_angle(atan2(entity->position.x, entity->position.z, playerStatus->position.x, playerStatus->position.z)); + theta = intermediateTheta = clamp_angle(atan2(entity->pos.x, entity->pos.z, playerStatus->pos.x, playerStatus->pos.z)); if (gGameStatusPtr->areaID == AREA_KZN) { radius = 3.0f; @@ -332,8 +332,8 @@ void entity_GiantChest_open(Entity* entity) { chest->state++; if (chest->itemID != 0) { suggest_player_anim_always_forward(ANIM_MarioW1_Lift); - sin_cos_rad(DEG_TO_RAD(90.0f - gCameras[CAM_DEFAULT].currentYaw), &sinRight, &cosRight); - sin_cos_rad(DEG_TO_RAD(180.0f - gCameras[CAM_DEFAULT].currentYaw), &sinFwd, &cosFwd); + sin_cos_rad(DEG_TO_RAD(90.0f - gCameras[CAM_DEFAULT].curYaw), &sinRight, &cosRight); + sin_cos_rad(DEG_TO_RAD(180.0f - gCameras[CAM_DEFAULT].curYaw), &sinFwd, &cosFwd); horizontalOffset = 0.0f; depthOffset = 4.0f; //RadialFlowOut @@ -382,10 +382,10 @@ void entity_GiantChest_give_equipment(Entity* entity) { } if (data->itemID != 0) { - angle = DEG_TO_RAD(entity->rotation.y); - data->itemEntityPos.x = entity->position.x + (sin_rad(angle) * 10.0f); - data->itemEntityPos.y = entity->position.y; - data->itemEntityPos.z = entity->position.z + (cos_rad(angle) * 10.0f); + angle = DEG_TO_RAD(entity->rot.y); + data->itemEntityPos.x = entity->pos.x + (sin_rad(angle) * 10.0f); + data->itemEntityPos.y = entity->pos.y; + data->itemEntityPos.z = entity->pos.z + (cos_rad(angle) * 10.0f); data->itemEntityIndex = make_item_entity_nodelay(data->itemID, data->itemEntityPos.x, data->itemEntityPos.y, data->itemEntityPos.z, ITEM_SPAWN_MODE_DECORATION, -1); diff --git a/src/entity/HeartBlock.c b/src/entity/HeartBlock.c index 68bf8f24fa..0ef979791d 100644 --- a/src/entity/HeartBlock.c +++ b/src/entity/HeartBlock.c @@ -81,9 +81,9 @@ void entity_HeartBlockContent_set_initial_pos(Entity* entity) { HeartBlockContentData* temp = entity->dataBuf.heartBlockContent; Entity* entityTemp = get_entity_by_index(temp->parentEntityIndex); - entity->position.x = entityTemp->position.x; - entity->position.y = entityTemp->position.y + 14.0f; - entity->position.z = entityTemp->position.z; + entity->pos.x = entityTemp->pos.x; + entity->pos.y = entityTemp->pos.y + 14.0f; + entity->pos.z = entityTemp->pos.z; } void entity_HeartBlockContent__reset(Entity* entity) { @@ -107,9 +107,9 @@ void entity_HeartBlockContent__reset(Entity* entity) { data->unk_0C = 0; data->unk_10 = 0; - entity->rotation.x = 0.0f; - entity->rotation.y = 0.0f; - entity->rotation.z = 0.0f; + entity->rot.x = 0.0f; + entity->rot.y = 0.0f; + entity->rot.z = 0.0f; entity->scale.y = entity->scale.x; entity->scale.z = entity->scale.x; @@ -148,7 +148,7 @@ void entity_HeartBlockContent_anim_idle(Entity* entity, s32 arg1) { data->sparkleTimer--; if (data->sparkleTimer <= 0) { data->sparkleTimer = 50; - fx_stars_shimmer(data->sparkleEffectType, entity->position.x, entity->position.y, entity->position.z, 22.0f, 8.0f, 4, 20); + fx_stars_shimmer(data->sparkleEffectType, entity->pos.x, entity->pos.y, entity->pos.z, 22.0f, 8.0f, 4, 20); } } break; @@ -157,7 +157,7 @@ void entity_HeartBlockContent_anim_idle(Entity* entity, s32 arg1) { if (entity_can_collide_with_jumping_player(get_entity_by_index(data->parentEntityIndex))) { exec_entity_commandlist(entity); disable_player_input(); - gPlayerStatus.currentSpeed = 0; + gPlayerStatus.curSpeed = 0; gPlayerStatus.animFlags |= PA_FLAG_RAISED_ARMS; set_time_freeze_mode(TIME_FREEZE_PARTIAL); gOverrideFlags |= GLOBAL_OVERRIDES_40; @@ -171,7 +171,7 @@ void entity_HeartBlockContent_reset_data(Entity* entity) { entity->scale.x = 1.0f; entity->scale.y = 1.0f; entity->scale.z = 1.0f; - entity->rotation.z = 0.0f; + entity->rot.z = 0.0f; } void entity_HeartBlockContent__anim_heal(Entity* entity, s32 arg1) { @@ -181,31 +181,31 @@ void entity_HeartBlockContent__anim_heal(Entity* entity, s32 arg1) { switch (data->state) { case 0: - fx_sparkles(FX_SPARKLES_0, entity->position.x, entity->position.y, entity->position.z, 2.0f); + fx_sparkles(FX_SPARKLES_0, entity->pos.x, entity->pos.y, entity->pos.z, 2.0f); data->bouncePhase = 0.0f; data->state++; - data->riseVelocity = 6.0f; + data->riseVel = 6.0f; break; case 1: - entity->position.y = entity->position.y + data->riseVelocity; - data->riseVelocity -= 1.0f; - if (data->riseVelocity <= 2.0f) { + entity->pos.y = entity->pos.y + data->riseVel; + data->riseVel -= 1.0f; + if (data->riseVel <= 2.0f) { data->state++; entity->flags &= ~ENTITY_FLAG_ALWAYS_FACE_CAMERA; - data->rotationRate = -10.0f; + data->rotRate = -10.0f; entity_set_render_script(entity, &Entity_HeartBlockContent_RenderScriptHit); entity->renderSetupFunc = entity_HeartBlockContent_setupGfx; } break; case 2: - entity->position.y += sin_rad(DEG_TO_RAD(data->bouncePhase)) * 0.5f; + entity->pos.y += sin_rad(DEG_TO_RAD(data->bouncePhase)) * 0.5f; data->bouncePhase -= 30.0f; if (data->bouncePhase < 0.0f) { data->bouncePhase += 360.0f; } - entity->rotation.y += data->rotationRate; - data->rotationRate += 2.0f; - if (data->rotationRate >= 0.0f) { + entity->rot.y += data->rotRate; + data->rotRate += 2.0f; + if (data->rotRate >= 0.0f) { data->sparkleTrailAngle = 0.0f; data->sparkleTrailRadius = 0.0f; data->state++; @@ -215,7 +215,7 @@ void entity_HeartBlockContent__anim_heal(Entity* entity, s32 arg1) { recover_fp(-1); sfx_play_sound(SOUND_131); } - data->yawBuffer[data->yawBufferPos] = entity->rotation.y; + data->yawBuffer[data->yawBufferPos] = entity->rot.y; data->yawBufferPos++; if (data->yawBufferPos > ARRAY_COUNT(data->yawBuffer)) { data->yawBufferPos = 0; @@ -237,9 +237,9 @@ void entity_HeartBlockContent__anim_heal(Entity* entity, s32 arg1) { data->sparkleTrailPosY -= 0.7; if ((data->sparkleTrailTimer++ & 1) != 0) { - fx_sparkles(FX_SPARKLES_3, playerStatus->position.x + offsetX, - playerStatus->position.y + offsetY, - playerStatus->position.z - offsetZ, + fx_sparkles(FX_SPARKLES_3, playerStatus->pos.x + offsetX, + playerStatus->pos.y + offsetY, + playerStatus->pos.z - offsetZ, 8.0f ); } @@ -249,18 +249,18 @@ void entity_HeartBlockContent__anim_heal(Entity* entity, s32 arg1) { } // fallthrough case 4: - entity->position.y += sin_rad(DEG_TO_RAD(data->bouncePhase)) * 0.5f; + entity->pos.y += sin_rad(DEG_TO_RAD(data->bouncePhase)) * 0.5f; data->bouncePhase -= 30.0f; if (data->bouncePhase < 0.0f) { data->bouncePhase += 360.0f; } - data->rotationRate += 1.0; - if (data->rotationRate > 30.0f) { - data->rotationRate = 30.0f; + data->rotRate += 1.0; + if (data->rotRate > 30.0f) { + data->rotRate = 30.0f; } - entity->rotation.y += data->rotationRate; - if (entity->rotation.y >= 360.0f) { - entity->rotation.y -= 360.0f; + entity->rot.y += data->rotRate; + if (entity->rot.y >= 360.0f) { + entity->rot.y -= 360.0f; } entity->alpha -= 5; if (entity->alpha < 7) { @@ -269,7 +269,7 @@ void entity_HeartBlockContent__anim_heal(Entity* entity, s32 arg1) { data->state++; } } - data->yawBuffer[data->yawBufferPos] = entity->rotation.y; + data->yawBuffer[data->yawBufferPos] = entity->rot.y; data->yawBufferPos++; if (data->yawBufferPos > ARRAY_COUNT(data->yawBuffer)) { data->yawBufferPos = 0; @@ -385,7 +385,7 @@ s8 entity_HeartBlock_create_child_entity(Entity* entity, EntityBlueprint* bp) { HeartBlockContentData* data; entity_base_block_init(entity); - childEntity = get_entity_by_index(create_entity(bp, (s32)entity->position.x, (s32)entity->position.y, (s32)entity->position.z, 0, MAKE_ENTITY_END)); + childEntity = get_entity_by_index(create_entity(bp, (s32)entity->pos.x, (s32)entity->pos.y, (s32)entity->pos.z, 0, MAKE_ENTITY_END)); data = childEntity->dataBuf.heartBlockContent; data->parentEntityIndex = entity->listIndex; diff --git a/src/entity/HiddenPanel.c b/src/entity/HiddenPanel.c index 4482643e29..055dce2384 100644 --- a/src/entity/HiddenPanel.c +++ b/src/entity/HiddenPanel.c @@ -22,9 +22,9 @@ void entity_HiddenPanel_setupGfx(s32 entityIndex) { Matrix4f rotMtx; Matrix4f tempMtx; - if (entity->position.y != data->initialY) { + if (entity->pos.y != data->initialY) { guMtxIdentF(rotMtx); - guTranslateF(tempMtx, entity->position.x, data->initialY + 1.0f, entity->position.z); + guTranslateF(tempMtx, entity->pos.x, data->initialY + 1.0f, entity->pos.z); guMtxCatF(tempMtx, rotMtx, tempMtx); guMtxF2L(tempMtx, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -64,35 +64,35 @@ void entity_HiddenPanel_idle(Entity* entity) { data->standingNpcIndex = -1; data->npcFlags = 0; - if (gCurrentHiddenPanels.tryFlipTrigger && fabs(gCurrentHiddenPanels.flipTriggerPosY - entity->position.y) <= 10.0) { + if (gCurrentHiddenPanels.tryFlipTrigger && fabs(gCurrentHiddenPanels.flipTriggerPosY - entity->pos.y) <= 10.0) { data->state = 10; - distToPlayer = get_xz_dist_to_player(entity->position.x, entity->position.z); + distToPlayer = get_xz_dist_to_player(entity->pos.x, entity->pos.z); if (distToPlayer <= 100) { if (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR) { - data->riseVelocity = 0.5f; + data->riseVel = 0.5f; exec_entity_commandlist(entity); } else if (entity_HiddenPanel_is_item_on_top(entity)) { - data->riseVelocity = 0.5f; + data->riseVel = 0.5f; exec_entity_commandlist(entity); } else { s32 npcIndex = npc_find_standing_on_entity(entity->listIndex); if (npcIndex >= 0) { Npc* npc = get_npc_by_index(npcIndex); - dist2D(entity->position.x, entity->position.z, npc->pos.x, npc->pos.z); + dist2D(entity->pos.x, entity->pos.z, npc->pos.x, npc->pos.z); data->standingNpcIndex = npcIndex; data->npcFlags = npc->flags & (NPC_FLAG_GRAVITY | NPC_FLAG_8); npc->flags &= ~NPC_FLAG_8; npc->flags |= NPC_FLAG_GRAVITY; - data->riseVelocity = 0.5f; + data->riseVel = 0.5f; exec_entity_commandlist(entity); } else { entity->flags |= ENTITY_FLAG_DISABLE_COLLISION; if (distToPlayer > 60) { - data->riseVelocity = 0.5f; + data->riseVel = 0.5f; exec_entity_commandlist(entity); } else { data->state = 0; - data->riseVelocity = 10.0f; + data->riseVel = 10.0f; exec_entity_commandlist(entity); } } @@ -107,12 +107,12 @@ void entity_HiddenPanel_flip_over(Entity* entity) { f32 rotAngle; s32 flipAxis; - yaw = clamp_angle(gCameras[CAM_DEFAULT].currentYaw + 45.0f); + yaw = clamp_angle(gCameras[CAM_DEFAULT].curYaw + 45.0f); if (yaw < 90.0f || yaw >= 180.0f && yaw < 270.0f) { - rotAngle = entity->rotation.z; + rotAngle = entity->rot.z; flipAxis = 1; } else { - rotAngle = entity->rotation.x; + rotAngle = entity->rot.x; flipAxis = 0; } @@ -122,24 +122,24 @@ void entity_HiddenPanel_flip_over(Entity* entity) { data->state = 1; data->unk_02 = TRUE; data->riseInterpPhase = 90.0f; - data->rotationSpeed = 65.0f; + data->rotSpeed = 65.0f; set_time_freeze_mode(TIME_FREEZE_PARTIAL); disable_player_static_collisions(); gPlayerStatusPtr->animFlags |= PA_FLAG_OPENED_HIDDEN_PANEL; if (data->needSpawnItem) { data->needSpawnItem = FALSE; data->spawnedItemIndex = make_item_entity_nodelay(data->itemID, - entity->position.x, entity->position.y + 2.0, entity->position.z, + entity->pos.x, entity->pos.y + 2.0, entity->pos.z, ITEM_SPAWN_MODE_TOSS_NEVER_VANISH, data->pickupVar); } entity->flags &= ~ENTITY_FLAG_HIDDEN; break; case 1: - entity->position.y += data->riseVelocity * sin_rad(DEG_TO_RAD(data->riseInterpPhase)); - if (entity->position.y <= data->initialY) { - entity->position.y = data->initialY; - entity->rotation.x = 0.0f; - entity->rotation.z = 0.0f; + entity->pos.y += data->riseVel * sin_rad(DEG_TO_RAD(data->riseInterpPhase)); + if (entity->pos.y <= data->initialY) { + entity->pos.y = data->initialY; + entity->rot.x = 0.0f; + entity->rot.z = 0.0f; rotAngle = 0.0f; data->timer = 10; } @@ -152,19 +152,19 @@ void entity_HiddenPanel_flip_over(Entity* entity) { } if (data->riseInterpPhase > 110.0f) { - rotAngle += data->rotationSpeed; + rotAngle += data->rotSpeed; if (rotAngle >= 360.0f) { rotAngle -= 360.0f; } } break; case 2: - data->rotationSpeed -= 2.0f; - if (data->rotationSpeed <= 0.0f) { - data->rotationSpeed = 0.0f; + data->rotSpeed -= 2.0f; + if (data->rotSpeed <= 0.0f) { + data->rotSpeed = 0.0f; } - rotAngle += data->rotationSpeed; + rotAngle += data->rotSpeed; if (rotAngle >= 360.0f) { rotAngle -= 360.0f; } @@ -174,28 +174,28 @@ void entity_HiddenPanel_flip_over(Entity* entity) { } break; case 3: - data->rotationSpeed -= 5.0f; - if (data->rotationSpeed <= 0.0f) { - data->rotationSpeed = 0.0f; + data->rotSpeed -= 5.0f; + if (data->rotSpeed <= 0.0f) { + data->rotSpeed = 0.0f; } - rotAngle += data->rotationSpeed; + rotAngle += data->rotSpeed; if (rotAngle >= 360.0f) { rotAngle = 360.0f; } - entity->position.y += data->riseVelocity * sin_rad(DEG_TO_RAD(data->riseInterpPhase)); + entity->pos.y += data->riseVel * sin_rad(DEG_TO_RAD(data->riseInterpPhase)); data->riseInterpPhase += 10.0f; if (data->riseInterpPhase > 270.0f) { data->riseInterpPhase = 270.0f; } - if (entity->position.y <= data->initialY) { + if (entity->pos.y <= data->initialY) { data->state++; - entity->position.y = data->initialY; - entity->rotation.x = 0.0f; - entity->rotation.z = 0.0f; + entity->pos.y = data->initialY; + entity->rot.x = 0.0f; + entity->rot.z = 0.0f; rotAngle = 0.0f; data->timer = 10; exec_ShakeCamX(CAM_DEFAULT, CAM_SHAKE_DECAYING_VERTICAL, 1, 0.2f); @@ -207,18 +207,18 @@ void entity_HiddenPanel_flip_over(Entity* entity) { break; case 5: data->state = 11; - entity->position.y += 2.0f; + entity->pos.y += 2.0f; break; case 10: entity->flags &= ~ENTITY_FLAG_HIDDEN; data->unk_02 = FALSE; data->state++; - entity->position.y += 6.0f; + entity->pos.y += 6.0f; break; case 11: - entity->position.y -= 1.0f; - if (entity->position.y <= data->initialY) { - entity->position.y = data->initialY; + entity->pos.y -= 1.0f; + if (entity->pos.y <= data->initialY) { + entity->pos.y = data->initialY; data->timer = 1; data->state++; entity->flags |= ENTITY_FLAG_HIDDEN | ENTITY_FLAG_DISABLE_COLLISION; @@ -247,18 +247,18 @@ void entity_HiddenPanel_flip_over(Entity* entity) { } if (flipAxis == 0) { - entity->rotation.x = rotAngle; + entity->rot.x = rotAngle; } else { - entity->rotation.z = rotAngle; + entity->rot.z = rotAngle; } if (data->spawnedItemIndex >= 0) { ItemEntity* itemEntity = get_item_entity(data->spawnedItemIndex); if (itemEntity != NULL) { if (itemEntity->flags & ITEM_ENTITY_FLAG_10) { - data->spawnedItemPos.x = itemEntity->position.x; - data->spawnedItemPos.y = itemEntity->position.y; - data->spawnedItemPos.z = itemEntity->position.z; + data->spawnedItemPos.x = itemEntity->pos.x; + data->spawnedItemPos.y = itemEntity->pos.y; + data->spawnedItemPos.z = itemEntity->pos.z; } else { data->spawnedItemPos.x = 0x8000; data->spawnedItemPos.y = 0x8000; @@ -277,8 +277,8 @@ s32 entity_HiddenPanel_is_item_on_top(Entity* entity) { ItemEntity* itemEntity = get_item_entity(data->spawnedItemIndex); if (itemEntity != NULL) { if (itemEntity->flags & ITEM_ENTITY_FLAG_10) { - if (fabs(entity->position.x - data->spawnedItemPos.x) <= 34.0) { - if (fabs(entity->position.z - data->spawnedItemPos.z) <= 34.0) { + if (fabs(entity->pos.x - data->spawnedItemPos.x) <= 34.0) { + if (fabs(entity->pos.z - data->spawnedItemPos.z) <= 34.0) { return TRUE; } } @@ -298,7 +298,7 @@ void entity_HiddenPanel_init(Entity* entity) { mem_clear(&gCurrentHiddenPanels, sizeof(gCurrentHiddenPanels)); entity->renderSetupFunc = entity_HiddenPanel_setupGfx; data->pickupVar = 0xFFFF; - data->initialY = entity->position.y; + data->initialY = entity->pos.y; data->modelID = CreateEntityVarArgBuffer[0]; data->itemID = CreateEntityVarArgBuffer[1]; data->needSpawnItem = TRUE; @@ -309,12 +309,12 @@ void entity_HiddenPanel_init(Entity* entity) { } guMtxIdentF(data->entityMatrix); - guTranslateF(sp18, entity->position.x, entity->position.y, entity->position.z); - guRotateF(sp58, entity->rotation.y, 0.0f, 1.0f, 0.0f); + guTranslateF(sp18, entity->pos.x, entity->pos.y, entity->pos.z); + guRotateF(sp58, entity->rot.y, 0.0f, 1.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); - guRotateF(sp58, entity->rotation.x, 1.0f, 0.0f, 0.0f); + guRotateF(sp58, entity->rot.x, 1.0f, 0.0f, 0.0f); guMtxCatF(sp58, sp18, sp18); - guRotateF(sp58, entity->rotation.z, 0.0f, 0.0f, 1.0f); + guRotateF(sp58, entity->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(sp58, sp18, sp18); guScaleF(sp58, entity->scale.x, entity->scale.y, entity->scale.z); guMtxCatF(sp58, sp18, data->entityMatrix); diff --git a/src/entity/ItemBlock.c b/src/entity/ItemBlock.c index 146d94bcbd..dbcb679790 100644 --- a/src/entity/ItemBlock.c +++ b/src/entity/ItemBlock.c @@ -68,11 +68,11 @@ void entity_ItemBlock_spawn_item(Entity* entity) { entity->flags |= ENTITY_FLAG_100000; if (data->item == ITEM_COIN) { - make_item_entity(ITEM_COIN, entity->position.x, entity->position.y + 28.0, entity->position.z, + make_item_entity(ITEM_COIN, entity->pos.x, entity->pos.y + 28.0, entity->pos.z, ITEM_SPAWN_MODE_ITEM_BLOCK_COIN, 0, angle, data->gameFlagIndex); } else { angle += 360; - make_item_entity(data->item, entity->position.x, entity->position.y + 20.0, entity->position.z, + make_item_entity(data->item, entity->pos.x, entity->pos.y + 20.0, entity->pos.z, (gItemTable[data->item].typeFlags & ITEM_TYPE_FLAG_BADGE) ? ITEM_SPAWN_MODE_ITEM_BLOCK_BADGE : ITEM_SPAWN_MODE_ITEM_BLOCK_ITEM, 0, angle, data->gameFlagIndex); } @@ -84,7 +84,7 @@ void entity_TriggerBlock_start_bound_script_2(Entity* entity) { } void entity_TriggerBlock_play_vanish_effect(Entity* entity) { - TriggerBlockVanishEffect = fx_cold_breath(0, entity->position.x, entity->position.y, entity->position.z, 1.0f, 0x3C); + TriggerBlockVanishEffect = fx_cold_breath(0, entity->pos.x, entity->pos.y, entity->pos.z, 1.0f, 0x3C); } void entity_HitItemBlock_play_anim(Entity* entity) { @@ -119,7 +119,7 @@ void entity_ItemBlock_check_if_inactive(Entity* entity) { } else { bp = &Entity_InertRedBlock; } - create_entity(bp, (s32)entity->position.x, (s32)entity->position.y, (s32)entity->position.z, (s32)entity->rotation.y, MAKE_ENTITY_END); + create_entity(bp, (s32)entity->pos.x, (s32)entity->pos.y, (s32)entity->pos.z, (s32)entity->rot.y, MAKE_ENTITY_END); set_entity_commandlist(entity, D_802EA310); } else { exec_entity_commandlist(entity); @@ -146,7 +146,7 @@ void entity_ItemBlock_replace_with_inactive(Entity* entity) { } // this child entity is the inert block - childEntityIndex = create_entity(bp, (s32)entity->position.x, (s32)entity->position.y, (s32)entity->position.z, (s32)entity->rotation.y, MAKE_ENTITY_END); + childEntityIndex = create_entity(bp, (s32)entity->pos.x, (s32)entity->pos.y, (s32)entity->pos.z, (s32)entity->rot.y, MAKE_ENTITY_END); childEntity = get_entity_by_index(childEntityIndex); childEntity->flags |= ENTITY_FLAG_HIDDEN; @@ -172,7 +172,7 @@ void entity_ItemBlock_replace_with_inactive(Entity* entity) { } // child entity is now the animated block which appears before it turns inert - childEntity = get_entity_by_index(create_entity(bp, (s32)entity->position.x, (s32)entity->position.y, (s32)entity->position.z, (s32)entity->rotation.y, MAKE_ENTITY_END)); + childEntity = get_entity_by_index(create_entity(bp, (s32)entity->pos.x, (s32)entity->pos.y, (s32)entity->pos.z, (s32)entity->rot.y, MAKE_ENTITY_END)); childEntity->alpha = entity->alpha; if ((entity->flags & ENTITY_FLAG_HIDDEN) || (entity->alpha < 255)) { childEntity->alpha = 32; @@ -212,7 +212,7 @@ s32 entity_TriggerBlock_start_bound_script(Entity* entity) { void entity_TriggerBlock_disable_player_input(void) { disable_player_input(); - gPlayerStatus.currentSpeed = 0.0f; + gPlayerStatus.curSpeed = 0.0f; gPlayerStatus.flags |= PS_FLAG_SCRIPTED_FALL; set_action_state(ACTION_STATE_FALLING); gravity_use_fall_parms(); diff --git a/src/entity/SaveBlock.c b/src/entity/SaveBlock.c index 467751b5bb..05a22ca418 100644 --- a/src/entity/SaveBlock.c +++ b/src/entity/SaveBlock.c @@ -82,7 +82,7 @@ void entity_SaveBlock_idle(Entity* entity) { void entity_SaveBlock_pause_game(void) { set_time_freeze_mode(TIME_FREEZE_PARTIAL); disable_player_input(); - gPlayerStatusPtr->currentSpeed = 0.0f; + gPlayerStatusPtr->curSpeed = 0.0f; } void entity_SaveBlock_resume_game(void) { @@ -91,9 +91,9 @@ void entity_SaveBlock_resume_game(void) { } void entity_SaveBlock_save_data(void) { - gGameStatusPtr->savedPos.x = gPlayerStatusPtr->position.x; - gGameStatusPtr->savedPos.y = gPlayerStatusPtr->position.y; - gGameStatusPtr->savedPos.z = gPlayerStatusPtr->position.z; + gGameStatusPtr->savedPos.x = gPlayerStatusPtr->pos.x; + gGameStatusPtr->savedPos.y = gPlayerStatusPtr->pos.y; + gGameStatusPtr->savedPos.z = gPlayerStatusPtr->pos.z; fio_save_game(gGameStatusPtr->saveSlot); } @@ -135,7 +135,7 @@ void entity_SaveBlock_wait_for_close_result(Entity* entity) { void entity_SaveBlock_wait_for_close_choice(Entity* entity) { if (SaveBlockTutorialPrinterClosed) { - if (SaveBlockTutorialPrinter->currentOption == 1) { + if (SaveBlockTutorialPrinter->curOption == 1) { set_entity_commandlist(entity, Entity_SaveBlock_ScriptResume); } else { exec_entity_commandlist(entity); diff --git a/src/entity/ShatteringBlock.c b/src/entity/ShatteringBlock.c index 0e7942dd75..8cb5c902f4 100644 --- a/src/entity/ShatteringBlock.c +++ b/src/entity/ShatteringBlock.c @@ -115,7 +115,7 @@ void entity_shattering_block_init(Entity* entity) { Mtx* fragmentMatrices = NULL; Gfx** fragmentDisplayLists = NULL; - entity->dataBuf.shatteringBlock->originalPosY = entity->position.y; + entity->dataBuf.shatteringBlock->originalPosY = entity->pos.y; type = get_entity_type(entity->listIndex); if (type == ENTITY_TYPE_HAMMER1_BLOCK_TINY || @@ -144,7 +144,7 @@ void entity_shattering_block_init(Entity* entity) { fragmentMatrices = Entity_ShatteringHammer3Block_FragmentsMatrices; break; case ENTITY_TYPE_BRICK_BLOCK: - sfx_play_sound_at_position(SOUND_158, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z); + sfx_play_sound_at_position(SOUND_158, SOUND_SPACE_MODE_0, entity->pos.x, entity->pos.y, entity->pos.z); fragmentDisplayLists = Entity_ShatteringBrickBlock_FragmentsRender; fragmentMatrices = Entity_ShatteringBrickBlock_FragmentsMatrices; break; @@ -202,5 +202,5 @@ void entity_breakable_block_create_shattering_entity(Entity* entity) { return; } - create_entity(bp, (s32)entity->position.x, (s32)entity->position.y, (s32)entity->position.z, 0, MAKE_ENTITY_END); + create_entity(bp, (s32)entity->pos.x, (s32)entity->pos.y, (s32)entity->pos.z, 0, MAKE_ENTITY_END); } diff --git a/src/entity/ShatteringBlock_common.c b/src/entity/ShatteringBlock_common.c index c144e67010..5ec4f646f5 100644 --- a/src/entity/ShatteringBlock_common.c +++ b/src/entity/ShatteringBlock_common.c @@ -19,8 +19,8 @@ void entity_shattering_init_pieces(Entity* entity, Gfx** dlists, Mtx* matrices) data->fragmentDisplayLists = ENTITY_ADDR(entity, Gfx**, dlists); entity->renderSetupFunc = entity_shattering_setupGfx; entity->alpha = 255; - entity->position.y = data->originalPosY; - guTranslateF(mtxTrans, entity->position.x, entity->position.y, entity->position.z); + entity->pos.y = data->originalPosY; + guTranslateF(mtxTrans, entity->pos.x, entity->pos.y, entity->pos.z); s7 = 2; if (!is_block_on_ground(entity)) { @@ -166,9 +166,9 @@ void entity_shattering_setupGfx(s32 entityIndex) { Gfx* fragmentDlist; Gfx** gfx = data->fragmentDisplayLists; - x_inv = -entity->position.x; - y_inv = -entity->position.y; - z_inv = -entity->position.z; + x_inv = -entity->pos.x; + y_inv = -entity->pos.y; + z_inv = -entity->pos.z; for (i = 0; i < 24; i++) { if (data->alpha == 255) { diff --git a/src/entity/Signpost.c b/src/entity/Signpost.c index ab74287bee..c0bdc34747 100644 --- a/src/entity/Signpost.c +++ b/src/entity/Signpost.c @@ -6,8 +6,8 @@ extern Gfx Entity_Signpost_Render[]; void entity_Signpost_idle(Entity* entity) { PlayerStatus* playerStatus = &gPlayerStatus; - f32 val = fabsf(clamp_angle(180.0f - entity->rotation.y) - clamp_angle(atan2(entity->position.x, entity->position.z, - playerStatus->position.x, playerStatus->position.z))); + f32 val = fabsf(clamp_angle(180.0f - entity->rot.y) - clamp_angle(atan2(entity->pos.x, entity->pos.z, + playerStatus->pos.x, playerStatus->pos.z))); if (!(playerStatus->animFlags & PA_FLAG_USING_WATT) && !(entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR) && (val <= 40.0f || val >= 320.0f)) { entity->flags |= ENTITY_FLAG_SHOWS_INSPECT_PROMPT; diff --git a/src/entity/SimpleSpring.c b/src/entity/SimpleSpring.c index 92f58a9d8e..1073adf664 100644 --- a/src/entity/SimpleSpring.c +++ b/src/entity/SimpleSpring.c @@ -22,7 +22,7 @@ void entity_ScriptSpring_idle(Entity* entity) { set_action_state(ACTION_STATE_USE_SPRING); } exec_entity_commandlist(entity); - sfx_play_sound_at_position(SOUND_2086, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z); + sfx_play_sound_at_position(SOUND_2086, SOUND_SPACE_MODE_0, entity->pos.x, entity->pos.y, entity->pos.z); } } @@ -31,15 +31,15 @@ void entity_SimpleSpring_idle(Entity* entity) { PlayerStatus* playerStatus = &gPlayerStatus; if (playerStatus->actionState != ACTION_STATE_RIDE && (entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR)) { - if (data->launchVelocity >= 70) { + if (data->launchVel >= 70) { playerStatus->camResetDelay = 5; } play_model_animation(entity->virtualModelIndex, Entity_SimpleSpring_AnimLaunch); entity_start_script(entity); exec_entity_commandlist(entity); - sfx_play_sound_at_position(SOUND_2086, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z); + sfx_play_sound_at_position(SOUND_2086, SOUND_SPACE_MODE_0, entity->pos.x, entity->pos.y, entity->pos.z); disable_player_input(); - playerStatus->currentSpeed = 0; + playerStatus->curSpeed = 0; } } @@ -49,8 +49,8 @@ void entity_SimpleSpring_set_jump_params(Entity* entity) { set_action_state(ACTION_STATE_LAUNCH); gPlayerStatus.gravityIntegrator[0] = 15.0f; gPlayerStatus.gravityIntegrator[1] = 0; - gPlayerStatus.gravityIntegrator[2] = data->launchVelocity; - gPlayerStatus.gravityIntegrator[3] = entity->position.y; + gPlayerStatus.gravityIntegrator[2] = data->launchVel; + gPlayerStatus.gravityIntegrator[3] = entity->pos.y; } void entity_SimpleSpring_enable_player_input(Entity* ent) { @@ -61,7 +61,7 @@ void entity_ScriptSpring_init(Entity* entity) { } void entity_SimpleSpring_init(Entity* entity) { - entity->dataBuf.simpleSpring->launchVelocity = CreateEntityVarArgBuffer[0]; + entity->dataBuf.simpleSpring->launchVel = CreateEntityVarArgBuffer[0]; } EntityScript Entity_ScriptSpring_Script = { diff --git a/src/entity/SuperBlock.c b/src/entity/SuperBlock.c index e21c3283c5..4a53ee1822 100644 --- a/src/entity/SuperBlock.c +++ b/src/entity/SuperBlock.c @@ -47,7 +47,7 @@ void entity_upgrade_block_check_if_inactive(Entity* entity) { Entity* childEntity; SuperBlockContentData* childData; - parentData->childEntityIndex = create_entity(&Entity_SuperBlockContent, (s32)entity->position.x, (s32)entity->position.y, (s32)entity->position.z, 0, MAKE_ENTITY_END); + parentData->childEntityIndex = create_entity(&Entity_SuperBlockContent, (s32)entity->pos.x, (s32)entity->pos.y, (s32)entity->pos.z, 0, MAKE_ENTITY_END); childEntity = get_entity_by_index(parentData->childEntityIndex); childData = childEntity->dataBuf.superBlockContent; childData->parentEntityIndex = entity->listIndex; @@ -58,7 +58,7 @@ void entity_upgrade_block_init(Entity* entity) { BlockData* data = entity->dataBuf.block; entity_base_block_init(entity); - entity->rotation.y += 180.0f; + entity->rot.y += 180.0f; data->gameFlagIndex = 0xFFFF; data->childEntityIndex = -1; } @@ -75,9 +75,9 @@ void entity_SuperBlockContent_attach_to_parent(Entity* entity) { SuperBlockContentData* data = entity->dataBuf.superBlockContent; Entity* parentEntity = get_entity_by_index(data->parentEntityIndex); - entity->position.x = parentEntity->position.x; - entity->position.y = parentEntity->position.y + 14.0f; - entity->position.z = parentEntity->position.z; + entity->pos.x = parentEntity->pos.x; + entity->pos.y = parentEntity->pos.y + 14.0f; + entity->pos.z = parentEntity->pos.z; } EntityScript Entity_SuperBlock_Script = { @@ -190,8 +190,8 @@ void entity_SuperBlockContent_idle(Entity* entity) { entity->renderSetupFunc = NULL; } - entity->rotation.y = clamp_angle(entity->rotation.y + 3.0); - data->yawBuffer[data->yawBufferPos] = entity->rotation.y; + entity->rot.y = clamp_angle(entity->rot.y + 3.0); + data->yawBuffer[data->yawBufferPos] = entity->rot.y; data->yawBufferPos++; if (data->yawBufferPos > ARRAY_COUNT(data->yawBuffer)) { @@ -201,7 +201,7 @@ void entity_SuperBlockContent_idle(Entity* entity) { if (!data->isHidden && gOverrideFlags == 0) { if (--data->effectTimer <= 0) { data->effectTimer = 50; - fx_stars_shimmer(3, entity->position.x, entity->position.y, entity->position.z, 22.0f, 8.0f, 4, 20); + fx_stars_shimmer(3, entity->pos.x, entity->pos.y, entity->pos.z, 22.0f, 8.0f, 4, 20); } } } diff --git a/src/entity/Switch.c b/src/entity/Switch.c index f2eaeb845d..3404ce40a4 100644 --- a/src/entity/Switch.c +++ b/src/entity/Switch.c @@ -30,7 +30,7 @@ void entity_GreenStompSwitch_retract(Entity* entity) { u16 curTime = data->greenMotionTimer--; if (curTime != 0) { - entity->position.y -= 1.8625; + entity->pos.y -= 1.8625; return; } entity_start_script(entity); @@ -43,7 +43,7 @@ void entity_GreenStompSwitch_extend(Entity* entity) { u16 curTime = data->greenMotionTimer--; if (curTime != 0) { - entity->position.y += 1.8625; + entity->pos.y += 1.8625; return; } exec_entity_commandlist(entity); @@ -53,22 +53,22 @@ void entity_GreenStompSwitch_extend(Entity* entity) { void entity_switch_fall_down(Entity* entity) { SwitchData* data = entity->dataBuf.swtch; f32 hitDepth = 10.0f; - f32 x = entity->position.x; - f32 y = entity->position.y; - f32 z = entity->position.z; + f32 x = entity->pos.x; + f32 y = entity->pos.y; + f32 z = entity->pos.z; f32 hitYaw; f32 hitPitch; entity_raycast_down(&x, &y, &z, &hitYaw, &hitPitch, &hitDepth); - if (entity->position.y != y && entity->position.y > y) { - f32 fallVelocity = data->fallVelocity; + if (entity->pos.y != y && entity->pos.y > y) { + f32 fallVelocity = data->fallVel; fallVelocity += 0.5; - data->fallVelocity = fallVelocity; - entity->position.y -= fallVelocity; - if (entity->position.y < y) { - entity->position.y = y; + data->fallVel = fallVelocity; + entity->pos.y -= fallVelocity; + if (entity->pos.y < y) { + entity->pos.y = y; } } } @@ -139,7 +139,7 @@ void entity_RedSwitch_wait_and_reset(Entity* entity) { void entity_base_switch_anim_init(Entity* entity) { SwitchData* data = entity->dataBuf.swtch; - data->fallVelocity = 1.0f; + data->fallVel = 1.0f; data->deltaScaleX = 0.1f; data->deltaScaleY = -0.1f; data->animStateScaleX = 0; @@ -430,7 +430,7 @@ void entity_base_switch_animate_scale(Entity* entity) { data->scaleAnimTimer++; if (data->scaleAnimTimer == 10 && data->linkedSwitch == NULL) { - fx_cold_breath(0, entity->position.x, entity->position.y, entity->position.z, 1.0f, 60); + fx_cold_breath(0, entity->pos.x, entity->pos.y, entity->pos.z, 1.0f, 60); } } diff --git a/src/entity/WoodenCrate.c b/src/entity/WoodenCrate.c index 2846d1d61f..5496ec7405 100644 --- a/src/entity/WoodenCrate.c +++ b/src/entity/WoodenCrate.c @@ -21,8 +21,8 @@ void entity_WoodenCrate_init_fragments(Entity* entity, Gfx** dlists, Mtx* matric data->fragmentsGfx = ENTITY_ADDR(entity, Gfx**, dlists); entity->renderSetupFunc = entity_WoodenCrate_setupGfx; entity->alpha = 255; - entity->position.y = data->basePosY; - guTranslateF(mtxTrans, entity->position.x, entity->position.y, entity->position.z); + entity->pos.y = data->basePosY; + guTranslateF(mtxTrans, entity->pos.x, entity->pos.y, entity->pos.z); for (i = 0; i < 35; i++) { guMtxL2F(mtxFragment, ENTITY_ADDR(entity, Mtx*, matrices++)); @@ -35,9 +35,9 @@ void entity_WoodenCrate_init_fragments(Entity* entity, Gfx** dlists, Mtx* matric rotationSpeed = rand_int(5); if (i % 2 != 0) { - data->fragmentRotationSpeed[i] = rotationSpeed + 10; + data->fragmentRotSpeed[i] = rotationSpeed + 10; } else { - data->fragmentRotationSpeed[i] = -10 - rotationSpeed; + data->fragmentRotSpeed[i] = -10 - rotationSpeed; } data->fragmentFallSpeed[i] = 10.0f; @@ -58,7 +58,7 @@ void entity_WoodenCrate_init(Entity* entity) { void entity_WoodenCrate_reset_fragments(Entity* entity) { WoodenCrateData* data = entity->dataBuf.crate; - data->basePosY = entity->position.y; + data->basePosY = entity->pos.y; entity_WoodenCrate_init_fragments(entity, Entity_WoodenCrate_FragmentsRender, Entity_WoodenCrate_FragmentsMatrices); } @@ -79,26 +79,26 @@ void entity_WoodenCrate_update_fragments(Entity* entity) { switch (data->fragmentRebounds[i]) { case 0: reboundSpeed = 2.0f; - rotSpeed = data->fragmentRotationSpeed[i]; + rotSpeed = data->fragmentRotSpeed[i]; lateralSpeed = data->fragmentLateralSpeed[i] / 10.0f; if (rotSpeed >= 0.0f) { - data->fragmentRotationSpeed[i] = rotSpeed - 0.4; + data->fragmentRotSpeed[i] = rotSpeed - 0.4; } else { - data->fragmentRotationSpeed[i] = rotSpeed + 0.5; + data->fragmentRotSpeed[i] = rotSpeed + 0.5; } break; case 1: lateralSpeed = 1.0f; reboundSpeed = 0.0f; - rotSpeed = data->fragmentRotationSpeed[i] * 0.25f; + rotSpeed = data->fragmentRotSpeed[i] * 0.25f; break; case 2: - data->fragmentRotationSpeed[i] += 1.0f; - if (data->fragmentRotationSpeed[i] > 20.0f) { - data->fragmentRotationSpeed[i] = 20.0f; + data->fragmentRotSpeed[i] += 1.0f; + if (data->fragmentRotSpeed[i] > 20.0f) { + data->fragmentRotSpeed[i] = 20.0f; } - data->fragmentPosY[i] -= data->fragmentRotationSpeed[i] / 70.0f; + data->fragmentPosY[i] -= data->fragmentRotSpeed[i] / 70.0f; data->fragmentMoveAngle[i] -= 5; if (data->fragmentMoveAngle[i] <= 5) { @@ -156,7 +156,7 @@ void entity_WoodenCrate_update_fragments(Entity* entity) { data->fragmentFallSpeed[i] = reboundSpeed; if (data->fragmentRebounds[i] == 2) { data->fragmentMoveAngle[i] = 254; - data->fragmentRotationSpeed[i] = 0.0f; + data->fragmentRotSpeed[i] = 0.0f; } } @@ -185,9 +185,9 @@ void entity_WoodenCrate_setupGfx(s32 entityIndex) { Gfx* fragmentDlist; Gfx** gfx = data->fragmentsGfx; - x_inv = -entity->position.x; - y_inv = -entity->position.y; - z_inv = -entity->position.z; + x_inv = -entity->pos.x; + y_inv = -entity->pos.y; + z_inv = -entity->pos.z; for (i = 0; i < 35; i++) { if (data->fragmentRebounds[i] < 2) { @@ -252,7 +252,7 @@ void entity_WoodenCrate_shatter(Entity* entity, f32 arg1) { } if (flag) { - make_item_entity(data->itemID, entity->position.x, entity->position.y + 33.0, entity->position.z, + make_item_entity(data->itemID, entity->pos.x, entity->pos.y + 33.0, entity->pos.z, ITEM_SPAWN_MODE_ITEM_BLOCK_ITEM, 0, player_get_camera_facing_angle(), data->globalFlagIndex); } } diff --git a/src/entity/default/BoardedFloor.c b/src/entity/default/BoardedFloor.c index 01f38d36ee..bfbf9629c6 100644 --- a/src/entity/default/BoardedFloor.c +++ b/src/entity/default/BoardedFloor.c @@ -18,8 +18,8 @@ void Entity_BoardedFloor_init_fragments(Entity* entity, Gfx** dlists, Mtx* matri data->fragmentsGfx = ENTITY_ADDR(entity, Gfx**, dlists); entity->renderSetupFunc = Entity_BoardedFloor_setupGfx; entity->alpha = 255; - entity->position.y = data->inititalY; - guTranslateF(mtxTrans, entity->position.x, entity->position.y, entity->position.z); + entity->pos.y = data->inititalY; + guTranslateF(mtxTrans, entity->pos.x, entity->pos.y, entity->pos.z); for (i = 0; i < 12; i++) { guMtxL2F(mtxFragment, ENTITY_ADDR(entity, Mtx*, matrices++)); @@ -32,9 +32,9 @@ void Entity_BoardedFloor_init_fragments(Entity* entity, Gfx** dlists, Mtx* matri rotationSpeed = rand_int(5); if (i % 2 != 0) { - data->fragmentRotationSpeed[i] = rotationSpeed + 10; + data->fragmentRotSpeed[i] = rotationSpeed + 10; } else { - data->fragmentRotationSpeed[i] = -10 - rotationSpeed; + data->fragmentRotSpeed[i] = -10 - rotationSpeed; } data->fragmentFallSpeed[i] = 10.0f; @@ -45,7 +45,7 @@ void Entity_BoardedFloor_init_fragments(Entity* entity, Gfx** dlists, Mtx* matri } void Entity_BoardedFloor_init(Entity* entity) { - entity->dataBuf.boardedFloor->inititalY = entity->position.y; + entity->dataBuf.boardedFloor->inititalY = entity->pos.y; Entity_BoardedFloor_init_fragments(entity, Entity_BoardedFloor_FragmentsRender, Entity_BoardedFloor_FragmentMatrices); } @@ -66,26 +66,26 @@ void Entity_BoardedFloor_update_fragments(Entity* entity) { switch (data->fragmentRebounds[i]) { case 0: reboundSpeed = 2.0f; - rotSpeed = data->fragmentRotationSpeed[i]; + rotSpeed = data->fragmentRotSpeed[i]; lateralSpeed = data->fragmentLateralSpeed[i] / 10.0f; if (rotSpeed >= 0.0f) { - data->fragmentRotationSpeed[i] = rotSpeed - 0.4; + data->fragmentRotSpeed[i] = rotSpeed - 0.4; } else { - data->fragmentRotationSpeed[i] = rotSpeed + 0.5; + data->fragmentRotSpeed[i] = rotSpeed + 0.5; } break; case 1: lateralSpeed = 1.0f; reboundSpeed = 0.0f; - rotSpeed = data->fragmentRotationSpeed[i] * 0.25f; + rotSpeed = data->fragmentRotSpeed[i] * 0.25f; break; case 2: - data->fragmentRotationSpeed[i] += 1.0f; - if (data->fragmentRotationSpeed[i] > 20.0f) { - data->fragmentRotationSpeed[i] = 20.0f; + data->fragmentRotSpeed[i] += 1.0f; + if (data->fragmentRotSpeed[i] > 20.0f) { + data->fragmentRotSpeed[i] = 20.0f; } - data->fragmentPosY[i] -= data->fragmentRotationSpeed[i] / 70.0f; + data->fragmentPosY[i] -= data->fragmentRotSpeed[i] / 70.0f; data->fragmentMoveAngle[i] -= 5; if (data->fragmentMoveAngle[i] <= 5) { @@ -143,7 +143,7 @@ void Entity_BoardedFloor_update_fragments(Entity* entity) { data->fragmentFallSpeed[i] = reboundSpeed; if (data->fragmentRebounds[i] == 2) { data->fragmentMoveAngle[i] = 254; - data->fragmentRotationSpeed[i] = 0.0f; + data->fragmentRotSpeed[i] = 0.0f; } } @@ -172,9 +172,9 @@ void Entity_BoardedFloor_setupGfx(s32 entityIndex) { Gfx* fragmentDlist; Gfx** gfx = data->fragmentsGfx; - x_inv = -entity->position.x; - y_inv = -entity->position.y; - z_inv = -entity->position.z; + x_inv = -entity->pos.x; + y_inv = -entity->pos.y; + z_inv = -entity->pos.z; for (i = 0; i < 12; i++) { if (data->fragmentRebounds[i] < 2) { diff --git a/src/entity/default/BombableRock.c b/src/entity/default/BombableRock.c index 761734e8b5..d36b5f6f76 100644 --- a/src/entity/default/BombableRock.c +++ b/src/entity/default/BombableRock.c @@ -21,8 +21,8 @@ void entity_BombableRock_init_fragments(Entity* entity, Gfx** dlists, Mtx* matri data->fragmentsGfx = ENTITY_ADDR(entity, Gfx**, dlists); entity->renderSetupFunc = entity_BombableRock_setupGfx; entity->alpha = 255; - entity->position.y = data->inititalY; - guTranslateF(mtxTrans, entity->position.x, entity->position.y, entity->position.z); + entity->pos.y = data->inititalY; + guTranslateF(mtxTrans, entity->pos.x, entity->pos.y, entity->pos.z); for (i = 0; i < 5; i++) { guMtxL2F(mtxFragment, ENTITY_ADDR(entity, Mtx*, matrices++)); @@ -57,9 +57,9 @@ void entity_BombableRock_init_fragments(Entity* entity, Gfx** dlists, Mtx* matri rotationSpeed = rand_int(5); if (i % 2 != 0) { - data->fragmentRotationSpeed[i] = rotationSpeed + 10; + data->fragmentRotSpeed[i] = rotationSpeed + 10; } else { - data->fragmentRotationSpeed[i] = -10 - rotationSpeed; + data->fragmentRotSpeed[i] = -10 - rotationSpeed; } data->fragmentFallSpeed[i] = 10.0f; @@ -70,7 +70,7 @@ void entity_BombableRock_init_fragments(Entity* entity, Gfx** dlists, Mtx* matri } void entity_BombableRock_init(Entity* entity) { - entity->dataBuf.bombableRock->inititalY = entity->position.y; + entity->dataBuf.bombableRock->inititalY = entity->pos.y; entity_BombableRock_init_fragments(entity, Entity_BombableRock_FragmentsRender, Entity_BombableRock_FragmentMatrices); } @@ -91,26 +91,26 @@ void entity_BombableRock_update_fragments(Entity* entity) { switch (data->fragmentRebounds[i]) { case 0: reboundSpeed = 2.0f; - rotSpeed = data->fragmentRotationSpeed[i]; + rotSpeed = data->fragmentRotSpeed[i]; lateralSpeed = data->fragmentLateralSpeed[i] / 10.0f; if (rotSpeed >= 0.0f) { - data->fragmentRotationSpeed[i] = rotSpeed - 0.4; + data->fragmentRotSpeed[i] = rotSpeed - 0.4; } else { - data->fragmentRotationSpeed[i] = rotSpeed + 0.5; + data->fragmentRotSpeed[i] = rotSpeed + 0.5; } break; case 1: lateralSpeed = 1.0f; reboundSpeed = 0.0f; - rotSpeed = data->fragmentRotationSpeed[i] * 0.25f; + rotSpeed = data->fragmentRotSpeed[i] * 0.25f; break; case 2: - data->fragmentRotationSpeed[i] += 1.0f; - if (data->fragmentRotationSpeed[i] > 20.0f) { - data->fragmentRotationSpeed[i] = 20.0f; + data->fragmentRotSpeed[i] += 1.0f; + if (data->fragmentRotSpeed[i] > 20.0f) { + data->fragmentRotSpeed[i] = 20.0f; } - data->fragmentPosY[i] -= data->fragmentRotationSpeed[i] / 70.0f; + data->fragmentPosY[i] -= data->fragmentRotSpeed[i] / 70.0f; data->fragmentMoveAngle[i] -= 5; if (data->fragmentMoveAngle[i] <= 5) { @@ -168,7 +168,7 @@ void entity_BombableRock_update_fragments(Entity* entity) { data->fragmentFallSpeed[i] = reboundSpeed; if (data->fragmentRebounds[i] == 2) { data->fragmentMoveAngle[i] = 254; - data->fragmentRotationSpeed[i] = 0.0f; + data->fragmentRotSpeed[i] = 0.0f; } } @@ -197,9 +197,9 @@ void entity_BombableRock_setupGfx(s32 entityIndex) { Gfx* fragmentDlist; Gfx** gfx = data->fragmentsGfx; - x_inv = -entity->position.x; - y_inv = -entity->position.y; - z_inv = -entity->position.z; + x_inv = -entity->pos.x; + y_inv = -entity->pos.y; + z_inv = -entity->pos.z; for (i = 0; i < 5; i++) { if (data->fragmentRebounds[i] < 2) { @@ -232,7 +232,7 @@ void entity_BombableRock_idle(Entity* entity) { if (entity->collisionFlags & ENTITY_COLLISION_PARTNER) { entity_start_script(entity); exec_entity_commandlist(entity); - fx_big_smoke_puff(entity->position.x, entity->position.y + 25.0f, entity->position.z); + fx_big_smoke_puff(entity->pos.x, entity->pos.y + 25.0f, entity->pos.z); } } diff --git a/src/entity/default/Padlock.c b/src/entity/default/Padlock.c index b5ac8f5a6b..57c25d6549 100644 --- a/src/entity/default/Padlock.c +++ b/src/entity/default/Padlock.c @@ -29,17 +29,17 @@ void entity_Padlock_setupGfx(s32 entityIndex) { guMtxL2F(sp98, data->shackleMtx); guMtxCatF(sp58, sp98, sp98); sp98[3][0] += data->shacklePos; - guRotateF(spD8, entity->rotation.x, -1.0f, 0.0f, 0.0f); + guRotateF(spD8, entity->rot.x, -1.0f, 0.0f, 0.0f); guMtxCatF(spD8, sp98, sp98); - guRotateF(spD8, entity->rotation.z, 0.0f, 0.0f, 1.0f); - guRotateF(sp18, entity->rotation.x, 1.0f, 0.0f, 0.0f); + guRotateF(spD8, entity->rot.z, 0.0f, 0.0f, 1.0f); + guRotateF(sp18, entity->rot.x, 1.0f, 0.0f, 0.0f); guMtxCatF(spD8, sp18, sp18); - guRotateF(spD8, entity->rotation.y, 0.0f, 1.0f, 0.0f); + guRotateF(spD8, entity->rot.y, 0.0f, 1.0f, 0.0f); guMtxCatF(sp18, spD8, spD8); guMtxCatF(sp98, spD8, sp98); guScaleF(sp18, entity->scale.x, entity->scale.y, entity->scale.z); guMtxCatF(sp98, sp18, sp18); - guTranslateF(sp58, entity->position.x, entity->position.y, entity->position.z); + guTranslateF(sp58, entity->pos.x, entity->pos.y, entity->pos.z); guMtxCatF(sp18, sp58, sp58); guMtxF2L(sp58, &gDisplayContext->matrixStack[gMatrixListPos]); @@ -53,7 +53,7 @@ void entity_Padlock_push_player(Entity* entity) { PadlockData* data = entity->dataBuf.padlock; f32 deltaX, deltaZ; - if (playerStatus->colliderHeight < fabs(playerStatus->position.y - entity->position.y)) { + if (playerStatus->colliderHeight < fabs(playerStatus->pos.y - entity->pos.y)) { entity->flags |= ENTITY_FLAG_DISABLE_COLLISION; } else { entity->flags &= ~ENTITY_FLAG_DISABLE_COLLISION; @@ -70,11 +70,11 @@ void entity_Padlock_push_player(Entity* entity) { data->pushSpeed = 2.5f; } - deltaX = data->pushSpeed * sin_rad(DEG_TO_RAD(180.0f - entity->rotation.y)); - deltaZ = data->pushSpeed * cos_rad(DEG_TO_RAD(180.0f - entity->rotation.y)); + deltaX = data->pushSpeed * sin_rad(DEG_TO_RAD(180.0f - entity->rot.y)); + deltaZ = data->pushSpeed * cos_rad(DEG_TO_RAD(180.0f - entity->rot.y)); - playerStatus->position.x += deltaX; - playerStatus->position.z -= deltaZ; + playerStatus->pos.x += deltaX; + playerStatus->pos.z -= deltaZ; } else { data->pushSpeed = 0.0f; } @@ -96,39 +96,39 @@ void entity_Padlock_idle(Entity* entity) { if (data->shacklePos >= 20.0f) { data->shacklePos = 20.0f; data->state++; - entity->rotation.z += 12.0; + entity->rot.z += 12.0; data->fallSpeed = -2.0f; - data->rotationSpeed = 0.2f; + data->rotSpeed = 0.2f; } break; case 2: - data->rotationSpeed += 0.2; - entity->rotation.x += data->rotationSpeed; + data->rotSpeed += 0.2; + entity->rot.x += data->rotSpeed; data->fallSpeed -= 1.0; - entity->position.y += data->fallSpeed; + entity->pos.y += data->fallSpeed; - if (entity->position.y <= entity->shadowPosY) { - entity->position.y = entity->shadowPosY; + if (entity->pos.y <= entity->shadowPosY) { + entity->pos.y = entity->shadowPosY; data->fallSpeed = 5.0f; - data->rotationSpeed = 3.0f; + data->rotSpeed = 3.0f; data->state++; - fx_sparkles(FX_SPARKLES_0, entity->position.x, entity->position.y + 25.0f, entity->position.z, 10.0f); + fx_sparkles(FX_SPARKLES_0, entity->pos.x, entity->pos.y + 25.0f, entity->pos.z, 10.0f); entity->flags |= ENTITY_FLAG_DISABLE_COLLISION; } break; case 3: - data->rotationSpeed += 0.2; - entity->rotation.x += data->rotationSpeed; + data->rotSpeed += 0.2; + entity->rot.x += data->rotSpeed; data->fallSpeed -= 2.0; - entity->position.y += data->fallSpeed; + entity->pos.y += data->fallSpeed; - if (entity->position.y <= entity->shadowPosY) { - entity->position.y = entity->shadowPosY; + if (entity->pos.y <= entity->shadowPosY) { + entity->pos.y = entity->shadowPosY; data->timer = 2; data->fallSpeed = 10.0f; - data->rotationSpeed = 0.2f; + data->rotSpeed = 0.2f; data->state++; sfx_play_sound(SOUND_26A); } @@ -139,26 +139,26 @@ void entity_Padlock_idle(Entity* entity) { } break; case 5: - data->rotationSpeed *= 2.0f; - if (data->rotationSpeed > 30.0f) { - data->rotationSpeed = 30.0f; + data->rotSpeed *= 2.0f; + if (data->rotSpeed > 30.0f) { + data->rotSpeed = 30.0f; } - entity->rotation.x += data->rotationSpeed; - if (entity->rotation.x >= 90.0) { - entity->rotation.x = 90.0f; - data->rotationSpeed = -20.0f; + entity->rot.x += data->rotSpeed; + if (entity->rot.x >= 90.0) { + entity->rot.x = 90.0f; + data->rotSpeed = -20.0f; data->state++; sfx_play_sound(SOUND_26A); } break; case 6: - data->rotationSpeed += 10.0f; - if (data->rotationSpeed > 30.0f) { - data->rotationSpeed = 30.0f; + data->rotSpeed += 10.0f; + if (data->rotSpeed > 30.0f) { + data->rotSpeed = 30.0f; } - entity->rotation.x += data->rotationSpeed; - if (entity->rotation.x >= 90.0) { - entity->rotation.x = 90.0f; + entity->rot.x += data->rotSpeed; + if (entity->rot.x >= 90.0) { + entity->rot.x = 90.0f; data->timer = 5; data->state++; sfx_play_sound(SOUND_26A); diff --git a/src/entity/jan_iwa/Plants1.c b/src/entity/jan_iwa/Plants1.c index c8166c4259..d1914095a4 100644 --- a/src/entity/jan_iwa/Plants1.c +++ b/src/entity/jan_iwa/Plants1.c @@ -36,10 +36,10 @@ void entity_SpinningFlower_setupGfx(s32 entityIndex) { Gfx* gfx; guMtxL2F(sp18, ENTITY_ADDR(entity, Mtx*, &D_0A000B70_E9D470)); - guRotateF(sp58, data->rotation.x, 1.0f, 0.0f, 0.0f); - guRotateF(sp98, data->rotation.z, 0.0f, 0.0f, 1.0f); + guRotateF(sp58, data->rot.x, 1.0f, 0.0f, 0.0f); + guRotateF(sp98, data->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(sp58, sp98, sp98); - guRotateF(sp58, data->rotation.y, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, data->rot.y, 0.0f, 1.0f, 0.0f); guMtxCatF(sp98, sp58, sp58); guMtxCatF(sp58, sp18, sp18); guMtxF2L(sp18, &data->unk_30); @@ -77,8 +77,8 @@ void func_802BB0A0_E2D9D0(Entity* entity) { data->unk_18 = 0; data->unk_00 = 0; data->state = 1; - data->rotation.x = 0.0f; - data->rotation.z = 0.0f; + data->rot.x = 0.0f; + data->rot.z = 0.0f; break; case 1: if (!(entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR)) { @@ -97,11 +97,11 @@ void func_802BB0A0_E2D9D0(Entity* entity) { break; } - data->rotation.y = clamp_angle(data->rotation.y + data->spinSpeed); + data->rot.y = clamp_angle(data->rot.y + data->spinSpeed); if (!(entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR) && (playerStatus->animFlags & PA_FLAG_SPINNING) && - fabs(dist2D(entity->position.x, entity->position.z, playerStatus->position.x, playerStatus->position.z)) < 60.0) + fabs(dist2D(entity->pos.x, entity->pos.z, playerStatus->pos.x, playerStatus->pos.z)) < 60.0) { exec_entity_commandlist(entity); } @@ -115,7 +115,7 @@ void func_802BB228_E2DB58(Entity* entity) { if (data->spinSpeed > 40.0f) { data->spinSpeed = 40.0f; } - data->rotation.y = clamp_angle(data->rotation.y + data->spinSpeed); + data->rot.y = clamp_angle(data->rot.y + data->spinSpeed); } void entity_SpinningFlower_init(Entity* entity) { @@ -126,9 +126,9 @@ void entity_SpinningFlower_init(Entity* entity) { y = CreateEntityVarArgBuffer[1]; z = CreateEntityVarArgBuffer[2]; if (!(x | y | z)) { - x = entity->position.x; - y = entity->position.y + 100.0f; - z = entity->position.z; + x = entity->pos.x; + y = entity->pos.y + 100.0f; + z = entity->pos.z; } data->unk_28 = x; @@ -139,7 +139,7 @@ void entity_SpinningFlower_init(Entity* entity) { } void func_802BB314_E2DC44(Entity* entity) { - sfx_play_sound_at_position(SOUND_8000006A, SOUND_SPACE_MODE_0, entity->position.x, entity->position.y, entity->position.z); + sfx_play_sound_at_position(SOUND_8000006A, SOUND_SPACE_MODE_0, entity->pos.x, entity->pos.y, entity->pos.z); } void func_802BB34C_E2DC7C(void) { @@ -155,19 +155,19 @@ void entity_PinkFlowerLight_setupGfx(s32 entityIndex) { Matrix4f sp58; f32 sinAngle, cosAngle; - guRotateF(sp58, entity->rotation.y, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, entity->rot.y, 0.0f, 1.0f, 0.0f); guScaleF(sp18, entity->scale.x, entity->scale.x, entity->scale.x); guMtxCatF(sp18, sp58, sp58); guMtxL2F(sp18, ENTITY_ADDR(entity, Mtx*, &D_0A001098_E9C598)); - sin_cos_rad(DEG_TO_RAD(gCameras[CAM_DEFAULT].currentYaw + 180.0f), &sinAngle, &cosAngle); + sin_cos_rad(DEG_TO_RAD(gCameras[CAM_DEFAULT].curYaw + 180.0f), &sinAngle, &cosAngle); sp18[3][1] += 10.0f; sp18[3][2] -= 10.0f; guMtxCatF(sp58, sp18, sp18); - guRotateF(sp58, entity->rotation.z, 0.0f, 0.0f, 1.0f); + guRotateF(sp58, entity->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(sp18, sp58, sp18); guRotateF(sp58, data->initialRotY, 0.0f, 1.0f, 0.0f); guMtxCatF(sp18, sp58, sp18); - guTranslateF(sp58, entity->position.x + 16.0f * sinAngle, entity->position.y , entity->position.z - 16.0f * cosAngle); + guTranslateF(sp58, entity->pos.x + 16.0f * sinAngle, entity->pos.y , entity->pos.z - 16.0f * cosAngle); guMtxCatF(sp18, sp58, sp18); gDPSetCombineMode(gfxPos++, PM_CC_01, PM_CC_02); gDPSetPrimColor(gfxPos++, 0, 0, 0, 0, 0, entity->alpha); @@ -201,12 +201,12 @@ void entity_PinkFlower_init(Entity* entity) { s32 entityIndex; get_animator_by_index(entity->virtualModelIndex)->renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; - entityIndex = create_entity(&Entity_PinkFlowerLight, (s32)entity->position.x, (s32)entity->position.y, (s32)entity->position.z, 0, MAKE_ENTITY_END); + entityIndex = create_entity(&Entity_PinkFlowerLight, (s32)entity->pos.x, (s32)entity->pos.y, (s32)entity->pos.z, 0, MAKE_ENTITY_END); data->linkedEntityIndex = entityIndex; newEntity = get_entity_by_index(entityIndex); data = newEntity->dataBuf.pinkFlower; data->linkedEntityIndex = entity->listIndex; - data->initialRotY = newEntity->rotation.y; + data->initialRotY = newEntity->rot.y; } void entity_PinkFlowerLight_init(Entity* entity) { @@ -222,15 +222,15 @@ void entity_PinkFlowerLight_idle(Entity* entity) { if (data->state != 0) { data->state = 0; data->timer++; - entity->rotation.z = -25.0f; + entity->rot.z = -25.0f; entity->scale.x = 1.8f; entity->alpha = 255; } break; case 1: - entity->rotation.z += 1.0f; - if (entity->rotation.z >= 8.0f) { - entity->rotation.z = 8.0f; + entity->rot.z += 1.0f; + if (entity->rot.z >= 8.0f) { + entity->rot.z = 8.0f; } entity->alpha -= 6; @@ -248,22 +248,22 @@ void entity_PinkFlowerLight_idle(Entity* entity) { break; } - data->initialRotY = get_entity_by_index(data->linkedEntityIndex)->rotation.y; - entity->rotation.y = gCameras[CAM_DEFAULT].currentYaw; + data->initialRotY = get_entity_by_index(data->linkedEntityIndex)->rot.y; + entity->rot.y = gCameras[CAM_DEFAULT].curYaw; } void func_802BB8D4_E2E204(Entity* entity) { CymbalPlantData* data = entity->dataBuf.cymbalPlant; - data->dist = fabs(dist2D(entity->position.x - 2.0f, entity->position.z - 2.0f, gPlayerStatus.position.x, gPlayerStatus.position.z) * 0.25); - data->angle = atan2(gPlayerStatus.position.x, gPlayerStatus.position.z, entity->position.x - 2.0f, entity->position.z - 2.0f); + data->dist = fabs(dist2D(entity->pos.x - 2.0f, entity->pos.z - 2.0f, gPlayerStatus.pos.x, gPlayerStatus.pos.z) * 0.25); + data->angle = atan2(gPlayerStatus.pos.x, gPlayerStatus.pos.z, entity->pos.x - 2.0f, entity->pos.z - 2.0f); } void func_802BB98C_E2E2BC(Entity* entity) { CymbalPlantData* data = entity->dataBuf.cymbalPlant; - gCameras[CAM_DEFAULT].targetPos.x = gPlayerStatus.position.x; - gCameras[CAM_DEFAULT].targetPos.y = gPlayerStatus.position.y; - gCameras[CAM_DEFAULT].targetPos.z = gPlayerStatus.position.z; - add_vec2D_polar(&gPlayerStatus.position.x, &gPlayerStatus.position.z, data->dist, data->angle); + gCameras[CAM_DEFAULT].targetPos.x = gPlayerStatus.pos.x; + gCameras[CAM_DEFAULT].targetPos.y = gPlayerStatus.pos.y; + gCameras[CAM_DEFAULT].targetPos.z = gPlayerStatus.pos.z; + add_vec2D_polar(&gPlayerStatus.pos.x, &gPlayerStatus.pos.z, data->dist, data->angle); } void entity_CymbalPlant_idle(Entity* entity) { diff --git a/src/entity/jan_iwa/Plants2.c b/src/entity/jan_iwa/Plants2.c index 90bab258f4..0863b30d4c 100644 --- a/src/entity/jan_iwa/Plants2.c +++ b/src/entity/jan_iwa/Plants2.c @@ -57,10 +57,10 @@ void entity_TrumpetPlant_idle(Entity* entity) { void entity_TrumpetPlant_create_effect(Entity* entity) { f32 xOffset, zOffset, angle; - angle = DEG_TO_RAD(clamp_angle(entity->rotation.y)); + angle = DEG_TO_RAD(clamp_angle(entity->rot.y)); xOffset = -26.0 * cos_rad(angle); zOffset = 6.0 * sin_rad(angle); - fx_stars_burst(0, entity->position.x + xOffset, entity->position.y + 62.0f, entity->position.z + zOffset, clamp_angle(entity->rotation.y - 90.0), 54.0f, 2); + fx_stars_burst(0, entity->pos.x + xOffset, entity->pos.y + 62.0f, entity->pos.z + zOffset, clamp_angle(entity->rot.y - 90.0), 54.0f, 2); } void entity_TrumpetPlant_spawn_coin(Entity* entity) { @@ -70,17 +70,17 @@ void entity_TrumpetPlant_spawn_coin(Entity* entity) { if (data->numCoins < 3) { f32 xOffset, zOffset, angle; - angle = DEG_TO_RAD(clamp_angle(entity->rotation.y)); + angle = DEG_TO_RAD(clamp_angle(entity->rot.y)); xOffset = -26.0 * cos_rad(angle); zOffset = 6.0 * sin_rad(angle); if (rand_int(32) > 16) { - f32 facingAngle = entity->rotation.y - 110.0f + (data->numCoins % 3) * 30; + f32 facingAngle = entity->rot.y - 110.0f + (data->numCoins % 3) * 30; data->numCoins++; make_item_entity(ITEM_COIN, - entity->position.x + xOffset, - entity->position.y + 62.0f, - entity->position.z + zOffset, + entity->pos.x + xOffset, + entity->pos.y + 62.0f, + entity->pos.z + zOffset, ITEM_SPAWN_MODE_TOSS_SPAWN_ALWAYS, 0, facingAngle, 0); } @@ -88,7 +88,7 @@ void entity_TrumpetPlant_spawn_coin(Entity* entity) { } void entity_Munchlesia_init(Entity* entity) { - make_item_entity_nodelay(ITEM_COIN, entity->position.x, entity->position.y + 30.0f, entity->position.z, + make_item_entity_nodelay(ITEM_COIN, entity->pos.x, entity->pos.y + 30.0f, entity->pos.z, ITEM_SPAWN_MODE_FIXED_SPAWN_ALWAYS_NEVER_VANISH, 0); } @@ -113,21 +113,21 @@ void func_802BC0B8_E2E9E8(Entity* entity) { void func_802BC0F0_E2EA20(Entity* entity) { MunchlesiaData* data = entity->dataBuf.munchlesia; - data->unk_18 = fabs(dist2D(entity->position.x, entity->position.z, gPlayerStatus.position.x, gPlayerStatus.position.z) * 0.25); - data->unk_14 = atan2(gPlayerStatus.position.x, gPlayerStatus.position.z, entity->position.x, entity->position.z); + data->unk_18 = fabs(dist2D(entity->pos.x, entity->pos.z, gPlayerStatus.pos.x, gPlayerStatus.pos.z) * 0.25); + data->unk_14 = atan2(gPlayerStatus.pos.x, gPlayerStatus.pos.z, entity->pos.x, entity->pos.z); } void func_802BC17C_E2EAAC(Entity* entity) { MunchlesiaData* data = entity->dataBuf.munchlesia; - gCameras[CAM_DEFAULT].targetPos.x = gPlayerStatus.position.x; - gCameras[CAM_DEFAULT].targetPos.y = gPlayerStatus.position.y; - gCameras[CAM_DEFAULT].targetPos.z = gPlayerStatus.position.z; - add_vec2D_polar(&gPlayerStatus.position.x, &gPlayerStatus.position.z, data->unk_18, data->unk_14); + gCameras[CAM_DEFAULT].targetPos.x = gPlayerStatus.pos.x; + gCameras[CAM_DEFAULT].targetPos.y = gPlayerStatus.pos.y; + gCameras[CAM_DEFAULT].targetPos.z = gPlayerStatus.pos.z; + add_vec2D_polar(&gPlayerStatus.pos.x, &gPlayerStatus.pos.z, data->unk_18, data->unk_14); } s32 entity_Munchlesia_create_child(Entity* entity, EntityBlueprint* EntityBlueprint) { - return create_entity(EntityBlueprint, (s32)entity->position.x, (s32)entity->position.y, (s32)entity->position.z, (s32)entity->rotation.y); + return create_entity(EntityBlueprint, (s32)entity->pos.x, (s32)entity->pos.y, (s32)entity->pos.z, (s32)entity->rot.y); } void func_802BC220_E2EB50(Entity* entity) { @@ -178,13 +178,13 @@ void func_802BC3A0_E2ECD0(void) { void entity_MunchlesiaChewing_init(Entity* entity) { MunchlesiaData* data = entity->dataBuf.munchlesia; - data->unk_0C = gPlayerStatus.position.y; + data->unk_0C = gPlayerStatus.pos.y; data->unk_10 = 0; } void func_802BC3E4_E2ED14(Entity* entity) { MunchlesiaData* data = entity->dataBuf.munchlesia; - gPlayerStatus.position.y = data->unk_0C + (sin_rad(DEG_TO_RAD(data->unk_10)) * 3.0f); + gPlayerStatus.pos.y = data->unk_0C + (sin_rad(DEG_TO_RAD(data->unk_10)) * 3.0f); data->unk_10 += 24.0f; if (data->unk_10 > 360.0f) { diff --git a/src/entity/sbk_omo/StarBoxLauncher.c b/src/entity/sbk_omo/StarBoxLauncher.c index 41d57725bf..90393d8b2f 100644 --- a/src/entity/sbk_omo/StarBoxLauncher.c +++ b/src/entity/sbk_omo/StarBoxLauncher.c @@ -37,7 +37,7 @@ void entity_StarBoxLauncher_setupGfx(s32 entityIndex) { Matrix4f sp50; guMtxIdentF(sp10); - guTranslateF(sp50, entity->position.x, data->basePosY, entity->position.z); + guTranslateF(sp50, entity->pos.x, data->basePosY, entity->pos.z); guMtxCatF(sp50, sp10, sp50); guMtxF2L(sp50, &gDisplayContext->matrixStack[gMatrixListPos]); gSPMatrix(gfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -60,7 +60,7 @@ void entity_StarBoxLauncher_setupGfx(s32 entityIndex) { } void entity_StarBoxLauncher_check_launch(Entity* entity) { - u16 currentFloor = gCollisionStatus.currentFloor; + u16 currentFloor = gCollisionStatus.curFloor; StarBoxLauncherData* data = entity->dataBuf.starBoxLauncher; PlayerStatus* playerStatus = &gPlayerStatus; s32 actionState = playerStatus->actionState; @@ -68,9 +68,9 @@ void entity_StarBoxLauncher_check_launch(Entity* entity) { s32 result = 0; if ((currentFloor & COLLISION_WITH_ENTITY_BIT) && (currentFloor & 0xFF) == entity->listIndex && actionState == ACTION_STATE_HAMMER) { - x = playerStatus->position.x; - y = playerStatus->position.y + 5.0f; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y + 5.0f; + z = playerStatus->pos.z; hitDepth = 10.0f; add_vec2D_polar(&x, &z, 10.0f, func_800E5348()); @@ -87,11 +87,11 @@ void entity_StarBoxLauncher_check_launch(Entity* entity) { if (result != 0) { data->flags &= ~1; - fx_damage_stars(3, entity->position.x, entity->position.y + 35.0f, entity->position.z, 0, -1.0f, 0, 3); + fx_damage_stars(3, entity->pos.x, entity->pos.y + 35.0f, entity->pos.z, 0, -1.0f, 0, 3); if (result > 0) { data->flags |= 1; } - entity->position.y -= 2.0f; + entity->pos.y -= 2.0f; exec_entity_commandlist(entity); data->timer = 4; disable_player_static_collisions(); @@ -116,14 +116,14 @@ void entity_StarBoxLauncher_update_face_anim(Entity* entity) { void entity_StarBoxLauncher_shake_box(Entity* entity) { StarBoxLauncherData* data = entity->dataBuf.starBoxLauncher; - entity->position.x = data->basePosX + (data->timer & 1 ? 1.0f : -1.0f); + entity->pos.x = data->basePosX + (data->timer & 1 ? 1.0f : -1.0f); data->timer--; } void entity_StarBoxLauncher_restore_pos(Entity* entity) { StarBoxLauncherData* data = entity->dataBuf.starBoxLauncher; - entity->position.x = data->basePosX; - entity->position.z = data->basePosZ; + entity->pos.x = data->basePosX; + entity->pos.z = data->basePosZ; } void entity_StarBoxLauncher_launch(Entity* entity) { @@ -141,67 +141,67 @@ void entity_StarBoxLauncher_launch(Entity* entity) { sfx_play_sound(SOUND_2085); // fallthrough case 1: - temp = entity->position.y; - entity->position.y = temp + 8.0 * sin_rad(DEG_TO_RAD(data->riseSpeedPhase)); + temp = entity->pos.y; + entity->pos.y = temp + 8.0 * sin_rad(DEG_TO_RAD(data->riseSpeedPhase)); data->riseSpeedPhase += 2.0f; if (data->riseSpeedPhase >= 180.0f) { data->riseSpeedPhase = 180.0f; } - if (entity->position.y > data->basePosY + 50.0f) { - entity->position.y = data->basePosY + 50.0f; - data->maxRotationZ = 2.0f; + if (entity->pos.y > data->basePosY + 50.0f) { + entity->pos.y = data->basePosY + 50.0f; + data->maxRotZ = 2.0f; data->state++; - data->riseVelocity = 3.0f; - data->rotationZPhase = 90.0f; + data->riseVel = 3.0f; + data->rotZPhase = 90.0f; } break; case 2: - entity->rotation.z = data->maxRotationZ * sin_rad(DEG_TO_RAD(data->rotationZPhase)); - clamp_angle(entity->rotation.z); - data->rotationZPhase += 30.0f; - if (data->rotationZPhase >= 360.0f) { - data->rotationZPhase -= 360.0f; + entity->rot.z = data->maxRotZ * sin_rad(DEG_TO_RAD(data->rotZPhase)); + clamp_angle(entity->rot.z); + data->rotZPhase += 30.0f; + if (data->rotZPhase >= 360.0f) { + data->rotZPhase -= 360.0f; } - entity->position.y += data->riseVelocity * cos_rad(DEG_TO_RAD(data->riseSpeedPhase)); + entity->pos.y += data->riseVel * cos_rad(DEG_TO_RAD(data->riseSpeedPhase)); data->riseSpeedPhase += 30.0f; if (data->riseSpeedPhase >= 360.0f) { data->riseSpeedPhase -= 360.0f; } - data->riseVelocity -= 0.08; - if (data->riseVelocity < 2.8) { + data->riseVel -= 0.08; + if (data->riseVel < 2.8) { data->state++; } break; case 3: - data->maxRotationZ -= 0.1; - if (data->maxRotationZ <= 0.0f) { - data->maxRotationZ = 0.0f; + data->maxRotZ -= 0.1; + if (data->maxRotZ <= 0.0f) { + data->maxRotZ = 0.0f; } - entity->rotation.z = data->maxRotationZ * sin_rad(DEG_TO_RAD(data->rotationZPhase)); - clamp_angle(entity->rotation.z); - data->rotationZPhase += 30.0f; - if (data->rotationZPhase >= 360.0f) { - data->rotationZPhase -= 360.0f; + entity->rot.z = data->maxRotZ * sin_rad(DEG_TO_RAD(data->rotZPhase)); + clamp_angle(entity->rot.z); + data->rotZPhase += 30.0f; + if (data->rotZPhase >= 360.0f) { + data->rotZPhase -= 360.0f; } entity_StarBoxLauncher_update_face_anim(entity); - entity->position.y += data->riseVelocity * cos_rad(DEG_TO_RAD(data->riseSpeedPhase)); + entity->pos.y += data->riseVel * cos_rad(DEG_TO_RAD(data->riseSpeedPhase)); data->riseSpeedPhase += 30.0f; if (data->riseSpeedPhase >= 360.0f) { data->riseSpeedPhase -= 360.0f; } - data->riseVelocity -= 0.08; - if (data->riseVelocity <= 0.0f) { - data->riseVelocity = 0.0f; + data->riseVel -= 0.08; + if (data->riseVel <= 0.0f) { + data->riseVel = 0.0f; data->timer = 8; data->state++; - entity->rotation.z = 0.0f; + entity->rot.z = 0.0f; } break; case 4: @@ -210,9 +210,9 @@ void entity_StarBoxLauncher_launch(Entity* entity) { } break; case 5: - entity->position.y -= 8.0f; - if (entity->position.y <= data->basePosY) { - entity->position.y = data->basePosY; + entity->pos.y -= 8.0f; + if (entity->pos.y <= data->basePosY) { + entity->pos.y = data->basePosY; data->state++; } break; @@ -240,9 +240,9 @@ void entity_StarBoxLauncher_start_script(Entity* entity) { void entity_StarBoxLauncher_init(Entity* entity) { StarBoxLauncherData* data = entity->dataBuf.starBoxLauncher; entity->renderSetupFunc = entity_StarBoxLauncher_setupGfx; - data->basePosX = entity->position.x; - data->basePosY = entity->position.y; - data->basePosZ = entity->position.z; + data->basePosX = entity->pos.x; + data->basePosY = entity->pos.y; + data->basePosZ = entity->pos.z; } EntityScript Entity_StarBoxLauncher_Script = { diff --git a/src/entity/sbk_omo/Tweester.c b/src/entity/sbk_omo/Tweester.c index 5b7524ce01..ffac563cdf 100644 --- a/src/entity/sbk_omo/Tweester.c +++ b/src/entity/sbk_omo/Tweester.c @@ -129,8 +129,8 @@ void entity_Tweester_update_face_anim(Entity* entity) { s32 entity_Tweester_has_reached_target(Entity* entity) { TweesterData* data = entity->dataBuf.tweester; s32 count = 0; - f32 deltaX = fabsf(data->targetX - entity->position.x); - f32 deltaZ = fabsf(data->targetZ - entity->position.z); + f32 deltaX = fabsf(data->targetX - entity->pos.x); + f32 deltaZ = fabsf(data->targetZ - entity->pos.z); if (deltaX <= 10.0f) { count++; @@ -157,14 +157,14 @@ void entity_Tweester_select_target_point(Entity* entity) { } j = rand_int(i * 10 - 1) / 10; paths = data->paths; - data->currentPath = paths[j]; + data->curPath = paths[j]; } - pathPtr = &data->currentPath[pathOffset]; + pathPtr = &data->curPath[pathOffset]; if (*pathPtr != TWEESTER_PATH_STOP) { pathOffset += 3; if (*pathPtr == TWEESTER_PATH_LOOP){ pathOffset = 0; - pathPtr = data->currentPath; + pathPtr = data->curPath; data->targetX = *pathPtr++; data->targetY = *pathPtr++; data->targetZ = *pathPtr++; @@ -181,7 +181,7 @@ void entity_Tweester_move(Entity* entity) { TweesterData* data = entity->dataBuf.tweester; f32 yawRad; - f32 temp_f4 = (atan2(entity->position.x, entity->position.z, data->targetX, data->targetZ) - data->yaw) * 0.03125f; + f32 temp_f4 = (atan2(entity->pos.x, entity->pos.z, data->targetX, data->targetZ) - data->yaw) * 0.03125f; if (temp_f4 >= 0.0f && temp_f4 < 0.01) { temp_f4 = 0.01f; } @@ -191,8 +191,8 @@ void entity_Tweester_move(Entity* entity) { data->yaw = clamp_angle(data->yaw + temp_f4); yawRad = DEG_TO_RAD(data->yaw); - entity->position.x += sin_rad(yawRad); - entity->position.z -= cos_rad(yawRad); + entity->pos.x += sin_rad(yawRad); + entity->pos.z -= cos_rad(yawRad); if (entity_Tweester_has_reached_target(entity)) { entity_Tweester_select_target_point(entity); @@ -210,7 +210,7 @@ void entity_Tweester_idle(Entity* entity) { if (get_time_freeze_mode() == TIME_FREEZE_NORMAL && !is_picking_up_item() && !(playerStatus->flags & PS_FLAG_PAUSED) && - (playerData->currentPartner != PARTNER_GOOMBARIO || + (playerData->curPartner != PARTNER_GOOMBARIO || playerStatus->inputDisabledCount == 0 || playerStatus->actionState == ACTION_STATE_USE_TWEESTER )) { @@ -222,28 +222,28 @@ void entity_Tweester_idle(Entity* entity) { if (data->frameCounter < 100) { targetRotationSpeed = 3.5f; - delta = (targetRotationSpeed - data->rotationSpeed) / 28.0f; + delta = (targetRotationSpeed - data->rotSpeed) / 28.0f; if (delta < 0.02) { delta = 0.02f; } - data->rotationSpeed += delta; - if (data->rotationSpeed >= targetRotationSpeed){ - data->rotationSpeed = targetRotationSpeed; + data->rotSpeed += delta; + if (data->rotSpeed >= targetRotationSpeed){ + data->rotSpeed = targetRotationSpeed; } } else { targetRotationSpeed = 1.3f; - delta = (targetRotationSpeed - data->rotationSpeed) * 0.0625f; + delta = (targetRotationSpeed - data->rotSpeed) * 0.0625f; if (delta > -0.02) { delta = -0.02f; } - data->rotationSpeed += delta; - if (data->rotationSpeed <= targetRotationSpeed){ - data->rotationSpeed = targetRotationSpeed; + data->rotSpeed += delta; + if (data->rotSpeed <= targetRotationSpeed){ + data->rotSpeed = targetRotationSpeed; data->frameCounter = 0; } } - data->innerWhirlRotY += data->rotationSpeed; + data->innerWhirlRotY += data->rotSpeed; if (data->innerWhirlRotY > 360.0f) { data->innerWhirlRotY = 0.0f; } @@ -263,11 +263,11 @@ void entity_Tweester_idle(Entity* entity) { data->outerWhirlTexOffsetX += 4; data->outerWhirlTexOffsetY -= 16; - entity->rotation.y = -gCameras[CAM_DEFAULT].currentYaw; + entity->rot.y = -gCameras[CAM_DEFAULT].curYaw; if (partnerStatus->partnerActionState == PARTNER_ACTION_NONE || partnerStatus->actingPartner != PARTNER_BOW) { if (playerStatus->actionState == ACTION_STATE_USE_TWEESTER) { - Npc* npc = npc_find_closest_simple(entity->position.x, entity->position.y, entity->position.z, 50.0f); + Npc* npc = npc_find_closest_simple(entity->pos.x, entity->pos.y, entity->pos.z, 50.0f); if (npc != NULL && (npc->flags & NPC_FLAG_PARTNER)) { TweesterTouchingPartner = entity; } @@ -277,7 +277,7 @@ void entity_Tweester_idle(Entity* entity) { !(playerStatus->flags & PS_FLAG_PAUSED) && playerStatus->actionState != ACTION_STATE_USE_TWEESTER && playerStatus->blinkTimer == 0 && - fabs(dist2D(entity->position.x, entity->position.z, playerStatus->position.x, playerStatus->position.z)) <= 50.0 + fabs(dist2D(entity->pos.x, entity->pos.z, playerStatus->pos.x, playerStatus->pos.z)) <= 50.0 ) { TweesterTouchingPlayer = entity; playerStatus->animFlags |= PA_FLAG_INTERRUPT_USE_PARTNER; diff --git a/src/entity_model.c b/src/entity_model.c index 08509a28dd..224c9cc8a2 100644 --- a/src/entity_model.c +++ b/src/entity_model.c @@ -437,7 +437,7 @@ void draw_entity_model_A(s32 modelIdx, Mtx* transformMtx) { rtPtr->renderMode = model->renderMode; rtPtr->appendGfxArg = model; rtPtr->appendGfx = (void(*)(void*))appendGfx_entity_model; - rtPtr->distance = ((u32)(model->flags & 0xF000) >> 8) + inZ; + rtPtr->dist = ((u32)(model->flags & 0xF000) >> 8) + inZ; queue_render_task(rtPtr); } } @@ -476,7 +476,7 @@ void draw_entity_model_B(s32 modelIdx, Mtx* transformMtx, s32 vertexSegment, Vec rtPtr->renderMode = model->renderMode; rtPtr->appendGfxArg = model; rtPtr->appendGfx = (void(*)(void*))appendGfx_entity_model; - rtPtr->distance = ((u32)(model->flags & 0xF000) >> 8) + inZ; + rtPtr->dist = ((u32)(model->flags & 0xF000) >> 8) + inZ; queue_render_task(rtPtr); } } @@ -506,7 +506,7 @@ void draw_entity_model_C(s32 modelIdx, Mtx* transformMtx) { rtPtr->renderMode = model->renderMode; rtPtr->appendGfxArg = model; rtPtr->appendGfx = (void(*)(void*))appendGfx_entity_model; - rtPtr->distance = (u32)(model->flags & 0xF000) >> 8; + rtPtr->dist = (u32)(model->flags & 0xF000) >> 8; queue_render_task(rtPtr); } } @@ -537,7 +537,7 @@ void draw_entity_model_D(s32 modelIdx, Mtx* transformMtx, s32 arg2, Vec3s* verte rtPtr->renderMode = model->renderMode; rtPtr->appendGfxArg = model; rtPtr->appendGfx = (void(*)(void*))appendGfx_entity_model; - rtPtr->distance = (u32)(model->flags & 0xF000) >> 8; + rtPtr->dist = (u32)(model->flags & 0xF000) >> 8; queue_render_task(rtPtr); } } diff --git a/src/evt/cam_api.c b/src/evt/cam_api.c index e623ba1595..ae76572542 100644 --- a/src/evt/cam_api.c +++ b/src/evt/cam_api.c @@ -82,8 +82,8 @@ ApiStatus func_802CA988(Evt* script, s32 isInitialCall) { gCameras[id].updateMode = CAM_UPDATE_MODE_2; gCameras[id].needsInit = FALSE; - gCameras[id].auxPitch = -round(gCameras[id].currentPitch); - gCameras[id].auxBoomLength = -gCameras[id].currentBlendedYawNegated; + gCameras[id].auxPitch = -round(gCameras[id].curPitch); + gCameras[id].auxBoomLength = -gCameras[id].curBlendedYawNegated; dx = gCameras[id].lookAt_obj.x - gCameras[id].lookAt_eye.x; dy = gCameras[id].lookAt_obj.y - gCameras[id].lookAt_eye.y; @@ -663,9 +663,9 @@ ApiStatus AdjustCam(Evt* script, s32 isInitialCall) { if (isInitialCall) { hitDepth = 32767.0f; - posX = playerStatus->position.x; - posY = playerStatus->position.y; - posZ = playerStatus->position.z; + posX = playerStatus->pos.x; + posY = playerStatus->pos.y; + posZ = playerStatus->pos.z; zoneID = test_ray_zones(posX, posY + 10.0f, posZ, 0.0f, -1.0f, 0.0f, &hitX, &hitY, &hitZ, &hitDepth, &nX, &nY, &nZ); if (zoneID >= 0) { camera->controlSettings = *gZoneCollisionData.colliderList[zoneID].camSettings; @@ -699,9 +699,9 @@ ApiStatus ResetCam(Evt* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; if (isInitialCall) { - f32 x = playerStatus->position.x; - f32 y = playerStatus->position.y; - f32 z = playerStatus->position.z; + f32 x = playerStatus->pos.x; + f32 y = playerStatus->pos.y; + f32 z = playerStatus->pos.z; f32 hitX, hitY, hitZ; f32 hitDepth = 32767.0f; f32 nx, ny, nz; diff --git a/src/evt/evt.c b/src/evt/evt.c index d7041d3597..139a1bfe55 100644 --- a/src/evt/evt.c +++ b/src/evt/evt.c @@ -908,7 +908,7 @@ ApiStatus evt_handle_call(Evt* script) { } else { script->callFunction = (ApiFunc)evt_get_variable(script, *args++); script->ptrReadPos = args; - script->currentArgc--; + script->curArgc--; script->blocked = TRUE; isInitialCall = TRUE; func = script->callFunction; @@ -976,7 +976,7 @@ ApiStatus evt_handle_exec_wait(Evt* script) { Bytecode* args = script->ptrReadPos; start_child_script(script, (EvtScript*) evt_get_variable(script, *args++), 0); - script->currentOpcode = EVT_OP_INTERNAL_FETCH; + script->curOpcode = EVT_OP_INTERNAL_FETCH; return ApiStatus_FINISH; } @@ -1371,15 +1371,15 @@ s32 evt_execute_next_command(Evt* script) { s32* lines; s32 nargs; - switch (script->currentOpcode) { + switch (script->curOpcode) { case EVT_OP_INTERNAL_FETCH: - script->ptrCurrentLine = script->ptrNextLine; + script->ptrCurLine = script->ptrNextLine; lines = script->ptrNextLine; - script->currentOpcode = *lines++; + script->curOpcode = *lines++; nargs = *lines++; script->ptrReadPos = lines; script->blocked = FALSE; - script->currentArgc = nargs; + script->curArgc = nargs; lines = &lines[nargs]; script->ptrNextLine = lines; status = ApiStatus_REPEAT; @@ -1684,10 +1684,10 @@ s32 evt_execute_next_command(Evt* script) { if (status == ApiStatus_BLOCK) { // return 0 } else if (status == ApiStatus_DONE1) { - script->currentOpcode = EVT_OP_INTERNAL_FETCH; + script->curOpcode = EVT_OP_INTERNAL_FETCH; // return 0 } else if (status == ApiStatus_DONE2) { - script->currentOpcode = EVT_OP_INTERNAL_FETCH; + script->curOpcode = EVT_OP_INTERNAL_FETCH; if (gGameStatusPtr->disableScripts != status) { continue; } diff --git a/src/evt/f8f60_len_1560.c b/src/evt/f8f60_len_1560.c index 7476907b06..00ec8ce94f 100644 --- a/src/evt/f8f60_len_1560.c +++ b/src/evt/f8f60_len_1560.c @@ -65,7 +65,7 @@ ApiStatus GetAngleToNPC(Evt* script, s32 isInitialCall) { Bytecode outVar = *args++; Npc* npc = resolve_npc(script, npcID); - evt_set_variable(script, outVar, atan2(playerStatus->position.x, playerStatus->position.z, npc->pos.x, npc->pos.z)); + evt_set_variable(script, outVar, atan2(playerStatus->pos.x, playerStatus->pos.z, npc->pos.x, npc->pos.z)); return ApiStatus_DONE2; } @@ -78,7 +78,7 @@ ApiStatus GetAngleToPlayer(Evt* script, s32 isInitialCall) { Bytecode outVar = *args++; Npc* npc = resolve_npc(script, npcID); - evt_set_variable(script, outVar, atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z)); + evt_set_variable(script, outVar, atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z)); return ApiStatus_DONE2; } @@ -100,7 +100,7 @@ ApiStatus AwaitPlayerApproach(Evt* script, s32 isInitialCall) { } distance = dist2D( - playerStatus->position.x, playerStatus->position.z, + playerStatus->pos.x, playerStatus->pos.z, *targetX, *targetZ ); @@ -130,7 +130,7 @@ ApiStatus IsPlayerWithin(Evt* script, s32 isInitialCall) { } distance = dist2D( - playerStatus->position.x, playerStatus->position.z, + playerStatus->pos.x, playerStatus->pos.z, *targetX, *targetZ ); @@ -159,7 +159,7 @@ ApiStatus AwaitPlayerLeave(Evt* script, s32 isInitialCall) { } distance = dist2D( - playerStatus->position.x, playerStatus->position.z, + playerStatus->pos.x, playerStatus->pos.z, *targetX, *targetZ ); diff --git a/src/evt/fa4c0_len_3bf0.c b/src/evt/fa4c0_len_3bf0.c index c2ff5b1349..13d05cd0c9 100644 --- a/src/evt/fa4c0_len_3bf0.c +++ b/src/evt/fa4c0_len_3bf0.c @@ -709,9 +709,9 @@ ApiStatus SetItemPos(Evt* script, s32 isInitialCall) { z = evt_get_variable(script, *args++); ptrItemEntity = (ItemEntity*) get_item_entity(itemEntityIndex); - ptrItemEntity->position.x = x; - ptrItemEntity->position.y = y; - ptrItemEntity->position.z = z; + ptrItemEntity->pos.x = x; + ptrItemEntity->pos.y = y; + ptrItemEntity->pos.z = z; return ApiStatus_DONE2; } diff --git a/src/evt/fx_api.c b/src/evt/fx_api.c index 1046ad3f31..ca6a15a4ff 100644 --- a/src/evt/fx_api.c +++ b/src/evt/fx_api.c @@ -225,9 +225,9 @@ ApiStatus ShowSweat(Evt* script, s32 isInitialCall) { switch (emoterType) { case EMOTER_PLAYER: - x = gPlayerStatus.position.x; - y = gPlayerStatus.position.y + (gPlayerStatus.colliderHeight * 2) / 3; - z = gPlayerStatus.position.z; + x = gPlayerStatus.pos.x; + y = gPlayerStatus.pos.y + (gPlayerStatus.colliderHeight * 2) / 3; + z = gPlayerStatus.pos.z; r = gPlayerStatus.colliderHeight / 3; break; case EMOTER_NPC: @@ -270,9 +270,9 @@ ApiStatus ShowSleepBubble(Evt* script, s32 isInitialCall) { switch (emoterType) { case EMOTER_PLAYER: - x = gPlayerStatus.position.x; - y = gPlayerStatus.position.y + (gPlayerStatus.colliderHeight * 2) / 3; - z = gPlayerStatus.position.z; + x = gPlayerStatus.pos.x; + y = gPlayerStatus.pos.y + (gPlayerStatus.colliderHeight * 2) / 3; + z = gPlayerStatus.pos.z; r = gPlayerStatus.colliderHeight / 3; break; case EMOTER_NPC: diff --git a/src/evt/map_api.c b/src/evt/map_api.c index 4d051af6e1..1d49fc63e4 100644 --- a/src/evt/map_api.c +++ b/src/evt/map_api.c @@ -590,10 +590,10 @@ ApiStatus ResetFromLava(Evt* script, s32 isInitialCall) { LastSafeFloor = -1; } - if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) { - collider = &gCollisionData.colliderList[collisionStatus->currentFloor]; + if (!(collisionStatus->curFloor & COLLISION_WITH_ENTITY_BIT)) { + collider = &gCollisionData.colliderList[collisionStatus->curFloor]; if (collider->flags & COLLIDER_FLAG_SAFE_FLOOR) { - LastSafeFloor = collisionStatus->currentFloor; + LastSafeFloor = collisionStatus->curFloor; return ApiStatus_BLOCK; } } diff --git a/src/evt/model_api.c b/src/evt/model_api.c index bf0d3944d3..ae9052ce30 100644 --- a/src/evt/model_api.c +++ b/src/evt/model_api.c @@ -77,7 +77,7 @@ ApiStatus LoadAnimatedModel(Evt* script, s32 isInitialCall) { animModel->scale.x = 1.0f; animModel->scale.y = 1.0f; animModel->scale.z = 1.0f; - animModel->currentAnimData = NULL; + animModel->curAnimData = NULL; guMtxIdent(&animModel->mtx); return ApiStatus_DONE2; @@ -101,7 +101,7 @@ ApiStatus LoadAnimatedMesh(Evt* script, s32 isInitialCall) { animModel->scale.x = 1.0f; animModel->scale.y = 1.0f; animModel->scale.z = 1.0f; - animModel->currentAnimData = NULL; + animModel->curAnimData = NULL; guMtxIdent(&animModel->mtx); return ApiStatus_DONE2; @@ -113,7 +113,7 @@ ApiStatus PlayModelAnimation(Evt* script, s32 isInitialCall) { s16* var2 = (s16*) evt_get_variable(script, *args++); AnimatedModel* model = (*gCurrentMeshAnimationListPtr)[index]; - model->currentAnimData = var2; + model->curAnimData = var2; play_model_animation(model->animModelID, var2); return ApiStatus_DONE2; @@ -126,7 +126,7 @@ ApiStatus PlayModelAnimationStartingFrom(Evt* script, s32 isInitialCall) { s32 var3 = evt_get_variable(script, *args++); AnimatedModel* model = (*gCurrentMeshAnimationListPtr)[index]; - model->currentAnimData = var2; + model->curAnimData = var2; play_model_animation_starting_from(model->animModelID, var2, var3); return ApiStatus_DONE2; @@ -138,11 +138,11 @@ ApiStatus ChangeModelAnimation(Evt* script, s32 isInitialCall) { s16* var2 = (s16*) evt_get_variable(script, *args++); AnimatedModel* model = (*gCurrentMeshAnimationListPtr)[index]; - if (model->currentAnimData == var2) { + if (model->curAnimData == var2) { return ApiStatus_DONE2; } - model->currentAnimData = var2; + model->curAnimData = var2; play_model_animation(model->animModelID, var2); return ApiStatus_DONE2; } @@ -312,9 +312,9 @@ ApiStatus GetAnimatedNodeRotation(Evt* script, s32 isInitialCall) { AnimatedModel* model = (*gCurrentMeshAnimationListPtr)[listIndex]; AnimatorNode* node = get_animator_node_with_id(get_animator_by_index(model->animModelID), treeIndex); - evt_set_variable(script, outX, node->rotation.x); - evt_set_variable(script, outY, node->rotation.y); - evt_set_variable(script, outZ, node->rotation.z); + evt_set_variable(script, outX, node->rot.x); + evt_set_variable(script, outY, node->rot.y); + evt_set_variable(script, outZ, node->rot.z); return ApiStatus_DONE2; } @@ -348,9 +348,9 @@ ApiStatus GetAnimatedRotationByTreeIndex(Evt* script, s32 isInitialCall) { AnimatedModel* model = (*gCurrentMeshAnimationListPtr)[listIndex]; AnimatorNode* node = get_animator_node_for_tree_index(get_animator_by_index(model->animModelID), treeIndex); - evt_set_variable(script, outX, node->rotation.x); - evt_set_variable(script, outY, node->rotation.y); - evt_set_variable(script, outZ, node->rotation.z); + evt_set_variable(script, outX, node->rot.x); + evt_set_variable(script, outY, node->rot.y); + evt_set_variable(script, outZ, node->rot.z); return ApiStatus_DONE2; } diff --git a/src/evt/msg_api.c b/src/evt/msg_api.c index 4e4c3301b6..0c8b89803e 100644 --- a/src/evt/msg_api.c +++ b/src/evt/msg_api.c @@ -85,8 +85,8 @@ s32 _show_message(Evt* script, s32 isInitialCall, s32 mode) { } if (speakerNpcID == NPC_PLAYER) { - get_screen_coords(gCurrentCameraID, playerStatus->position.x, - playerStatus->position.y + playerStatus->colliderHeight, playerStatus->position.z, + get_screen_coords(gCurrentCameraID, playerStatus->pos.x, + playerStatus->pos.y + playerStatus->colliderHeight, playerStatus->pos.z, &screenX, &screenY, &screenZ); script->functionTemp[3] = playerStatus->anim; speakerNpc = (Npc*) NPC_PLAYER; @@ -95,7 +95,7 @@ s32 _show_message(Evt* script, s32 isInitialCall, s32 mode) { speakerNpc = resolve_npc(script, speakerNpcID); get_screen_coords(gCurrentCameraID, speakerNpc->pos.x, speakerNpc->pos.y + speakerNpc->collisionHeight, speakerNpc->pos.z, &screenX, &screenY, &screenZ); - script->functionTemp[3] = speakerNpc->currentAnim; + script->functionTemp[3] = speakerNpc->curAnim; script->varTable[15] = speakerNpc->yaw; } @@ -110,7 +110,7 @@ s32 _show_message(Evt* script, s32 isInitialCall, s32 mode) { angle = atan2(speakerNpc->pos.x, speakerNpc->pos.z, targetNpc->pos.x, targetNpc->pos.z); } else { listenerYaw = &playerStatus->targetYaw; - angle = atan2(speakerNpc->pos.x, speakerNpc->pos.z, playerStatus->position.x, playerStatus->position.z); + angle = atan2(speakerNpc->pos.x, speakerNpc->pos.z, playerStatus->pos.x, playerStatus->pos.z); } reverseAngle = clamp_angle(angle + 180.0f); @@ -151,7 +151,7 @@ s32 _show_message(Evt* script, s32 isInitialCall, s32 mode) { set_npc_animation(speakerNpc, animID); } } else { - get_screen_coords(gCurrentCameraID, playerStatus->position.x, playerStatus->position.y + playerStatus->colliderHeight, playerStatus->position.z, &screenX, &screenY, &screenZ); + get_screen_coords(gCurrentCameraID, playerStatus->pos.x, playerStatus->pos.y + playerStatus->colliderHeight, playerStatus->pos.z, &screenX, &screenY, &screenZ); if (script->varTable[13] != -1) { if (gCurrentPrintContext->stateFlags & MSG_STATE_FLAG_80) { playerStatus->anim = script->varTable[13]; @@ -208,7 +208,7 @@ ApiStatus ShowMessageAtScreenPos(Evt* script, s32 isInitialCall) { return ApiStatus_BLOCK; } - script->varTable[0] = gCurrentPrintContext->currentOption; + script->varTable[0] = gCurrentPrintContext->curOption; return ApiStatus_DONE1; } @@ -242,7 +242,7 @@ ApiStatus ShowMessageAtWorldPos(Evt* script, s32 isInitialCall) { return ApiStatus_BLOCK; } - script->varTable[0] = gCurrentPrintContext->currentOption; + script->varTable[0] = gCurrentPrintContext->curOption; return ApiStatus_DONE1; } @@ -256,7 +256,7 @@ ApiStatus CloseMessage(Evt* script, s32 isInitialCall) { } else if (D_802DB264 != 1) { return ApiStatus_BLOCK; } else { - script->varTable[0] = gCurrentPrintContext->currentOption; + script->varTable[0] = gCurrentPrintContext->curOption; return ApiStatus_DONE1; } } @@ -273,7 +273,7 @@ ApiStatus SwitchMessage(Evt* script, s32 isInitialCall) { } else if (D_802DB264 != 1) { return ApiStatus_BLOCK; } else { - script->varTable[0] = gCurrentPrintContext->currentOption; + script->varTable[0] = gCurrentPrintContext->curOption; return ApiStatus_DONE1; } } @@ -290,7 +290,7 @@ ApiStatus ShowChoice(Evt* script, s32 isInitialCall) { } temp802DB268 = &D_802DB268; - script->varTable[0] = gCurrentPrintContext->currentOption = (*temp802DB268)->currentOption; + script->varTable[0] = gCurrentPrintContext->curOption = (*temp802DB268)->curOption; if ((*temp802DB268)->stateFlags & MSG_STATE_FLAG_40) { return ApiStatus_DONE1; diff --git a/src/evt/npc_api.c b/src/evt/npc_api.c index e69d5cb7b7..da53950096 100644 --- a/src/evt/npc_api.c +++ b/src/evt/npc_api.c @@ -19,11 +19,11 @@ void set_npc_animation(Npc* npc, u32 animID) { PlayerData* playerData = &gPlayerData; if (PARTNER_ANIM_STILL <= animID && animID <= PARTNER_ANIM_HURT) { - npc->currentAnim = gPartnerAnimations[playerData->currentPartner].anims[animID - PARTNER_ANIM_STILL]; + npc->curAnim = gPartnerAnimations[playerData->curPartner].anims[animID - PARTNER_ANIM_STILL]; } else if (ENEMY_ANIM_IDLE <= animID && animID <= ENEMY_ANIM_F) { - npc->currentAnim = get_enemy(npc->npcID)->animList[animID - ENEMY_ANIM_IDLE]; + npc->curAnim = get_enemy(npc->npcID)->animList[animID - ENEMY_ANIM_IDLE]; } else { - npc->currentAnim = animID; + npc->curAnim = animID; } } @@ -101,9 +101,9 @@ ApiStatus SetNpcRotation(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } - npc->rotation.x = rotX; - npc->rotation.y = rotY; - npc->rotation.z = rotZ; + npc->rot.x = rotX; + npc->rot.y = rotY; + npc->rot.z = rotZ; return ApiStatus_DONE2; } @@ -118,7 +118,7 @@ ApiStatus SetNpcRotationPivot(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } - npc->rotationPivotOffsetY = value; + npc->rotPivotOffsetY = value; return ApiStatus_DONE2; } @@ -208,7 +208,7 @@ ApiStatus GetNpcAnimation(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } - evt_set_variable(script, outVar, npc->currentAnim); + evt_set_variable(script, outVar, npc->curAnim); return ApiStatus_DONE2; } @@ -334,19 +334,19 @@ ApiStatus _npc_jump_to(Evt* script, s32 isInitialCall, s32 snapYaw) { } npc->flags |= NPC_FLAG_JUMPING; - npc->jumpVelocity = (npc->jumpScale * npc->duration * 0.5f) + (goalY / npc->duration); + npc->jumpVel = (npc->jumpScale * npc->duration * 0.5f) + (goalY / npc->duration); script->functionTemp[0] =1; } npc = script->functionTempPtr[1]; npc_move_heading(npc, npc->moveSpeed, *yaw); - npc->pos.y += npc->jumpVelocity; - npc->jumpVelocity -= npc->jumpScale; + npc->pos.y += npc->jumpVel; + npc->jumpVel -= npc->jumpScale; npc->duration--; if (npc->duration < 0) { - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; npc->pos.x = npc->moveToPos.x; npc->pos.y = npc->moveToPos.y; npc->pos.z = npc->moveToPos.z; @@ -529,7 +529,7 @@ ApiStatus NpcFacePlayer(Evt* script, s32 isInitialCall) { } *initialYaw = npc->yaw; - *deltaYaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z) - *initialYaw; + *deltaYaw = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z) - *initialYaw; script->functionTempPtr[0] = npc; *turnTime = evt_get_variable(script, *args++); npc->duration = 0; @@ -798,7 +798,7 @@ s32 BringPartnerOut(Evt* script, s32 isInitialCall) { if (isInitialCall) { wExtraPartnerID = evt_get_variable(script, *args++); - if (playerData->currentPartner == wExtraPartnerID) { + if (playerData->curPartner == wExtraPartnerID) { wExtraPartnerID = 0; return ApiStatus_DONE2; } @@ -821,12 +821,12 @@ s32 BringPartnerOut(Evt* script, s32 isInitialCall) { npc->scale.z = 0.0f; npc->moveToPos.x = targetX = partner->pos.x; - playerY = playerStatus->position.y; - npc->moveToPos.y = playerStatus->position.y; + playerY = playerStatus->pos.y; + npc->moveToPos.y = playerStatus->pos.y; npc->moveToPos.z = targetZ = partner->pos.z + 30.0f; - npc->pos.x = playerX = playerStatus->position.x; - npc->pos.y = targetY = playerStatus->position.y + (playerStatus->colliderHeight / 2); - playerZ = playerStatus->position.z; + npc->pos.x = playerX = playerStatus->pos.x; + npc->pos.y = targetY = playerStatus->pos.y + (playerStatus->colliderHeight / 2); + playerZ = playerStatus->pos.z; npc->moveSpeed = 4.0f; npc->jumpScale = 1.6f; npc->pos.z = playerZ; @@ -840,16 +840,16 @@ s32 BringPartnerOut(Evt* script, s32 isInitialCall) { npc->moveSpeed = npc->planarFlyDist / npc->duration; } - npc->jumpVelocity = ((playerY - targetY) + (npc->jumpScale * npc->duration * npc->duration * 0.5f)) / npc->duration; - npc->currentAnim = gPartnerAnimations[wExtraPartnerID].walk; + npc->jumpVel = ((playerY - targetY) + (npc->jumpScale * npc->duration * npc->duration * 0.5f)) / npc->duration; + npc->curAnim = gPartnerAnimations[wExtraPartnerID].walk; return ApiStatus_BLOCK; } npc = get_npc_by_index(wExtraPartnerNpcID); - npc->jumpVelocity -= npc->jumpScale; - npc->pos.y += npc->jumpVelocity; - if (npc->jumpVelocity <= 0.0f) { - npc->currentAnim = gPartnerAnimations[wExtraPartnerID].jump; + npc->jumpVel -= npc->jumpScale; + npc->pos.y += npc->jumpVel; + if (npc->jumpVel <= 0.0f) { + npc->curAnim = gPartnerAnimations[wExtraPartnerID].jump; } npc_move_heading(npc, npc->moveSpeed, npc->yaw); duration = npc->duration; @@ -862,8 +862,8 @@ s32 BringPartnerOut(Evt* script, s32 isInitialCall) { npc->duration--; if (npc->duration < 0) { - npc->currentAnim = gPartnerAnimations[wExtraPartnerID].idle; - npc->jumpVelocity = 0.0f; + npc->curAnim = gPartnerAnimations[wExtraPartnerID].idle; + npc->jumpVel = 0.0f; npc->pos.y = npc->moveToPos.y; npc->scale.x = 1.0f; npc->scale.y = 1.0f; @@ -889,13 +889,13 @@ ApiStatus PutPartnerAway(Evt* script, s32 isInitialCall) { if (wExtraPartnerID != 0) { partner->flags &= ~NPC_FLAG_GRAVITY; partner->flags &= ~NPC_FLAG_8; - targetX = playerStatus->position.x; + targetX = playerStatus->pos.x; partner->moveToPos.x = targetX; partnerX = partner->pos.x; - targetY = playerStatus->position.y + (playerStatus->colliderHeight / 2); + targetY = playerStatus->pos.y + (playerStatus->colliderHeight / 2); partner->moveToPos.y = targetY; partnerY = partner->pos.y; - targetZ = playerStatus->position.z; + targetZ = playerStatus->pos.z; partner->moveToPos.z = targetZ; partnerZ = partner->pos.z; partner->moveSpeed = 4.0f; @@ -910,18 +910,18 @@ ApiStatus PutPartnerAway(Evt* script, s32 isInitialCall) { } partnerY = targetY - partnerY; - partner->jumpVelocity = (partnerY + (partner->jumpScale * partner->duration * partner->duration * 0.5f)) / partner->duration; - partner->currentAnim = gPartnerAnimations[wExtraPartnerID].walk; + partner->jumpVel = (partnerY + (partner->jumpScale * partner->duration * partner->duration * 0.5f)) / partner->duration; + partner->curAnim = gPartnerAnimations[wExtraPartnerID].walk; return ApiStatus_BLOCK; } else { return ApiStatus_DONE2; } } - partner->jumpVelocity -= partner->jumpScale; - partner->pos.y += partner->jumpVelocity; - if (partner->jumpVelocity <= 0.0f) { - partner->currentAnim = gPartnerAnimations[wExtraPartnerID].jump; + partner->jumpVel -= partner->jumpScale; + partner->pos.y += partner->jumpVel; + if (partner->jumpVel <= 0.0f) { + partner->curAnim = gPartnerAnimations[wExtraPartnerID].jump; } npc_move_heading(partner, partner->moveSpeed, partner->yaw); @@ -936,8 +936,8 @@ ApiStatus PutPartnerAway(Evt* script, s32 isInitialCall) { partner->duration--; if (partner->duration < 0) { - partner->currentAnim = gPartnerAnimations[wExtraPartnerID].fall; - partner->jumpVelocity = 0.0f; + partner->curAnim = gPartnerAnimations[wExtraPartnerID].fall; + partner->jumpVel = 0.0f; partner->pos.y = partner->moveToPos.y; free_npc_by_index(wExtraPartnerNpcID); get_npc_unsafe(-5)->npcID = NPC_PARTNER; @@ -947,7 +947,7 @@ ApiStatus PutPartnerAway(Evt* script, s32 isInitialCall) { } ApiStatus GetCurrentPartnerID(Evt* script, s32 isInitialCall) { - evt_set_variable(script, *script->ptrReadPos, gPlayerData.currentPartner); + evt_set_variable(script, *script->ptrReadPos, gPlayerData.curPartner); return ApiStatus_DONE2; } diff --git a/src/evt/player_api.c b/src/evt/player_api.c index 9ca438ada0..aa0a3bae81 100644 --- a/src/evt/player_api.c +++ b/src/evt/player_api.c @@ -72,9 +72,9 @@ ApiStatus SetPlayerPos(Evt* script, s32 isInitialCall) { playerNpc->pos.y = y; playerNpc->pos.z = z; - playerStatus->position.x = playerNpc->pos.x; - playerStatus->position.y = playerNpc->pos.y; - playerStatus->position.z = playerNpc->pos.z; + playerStatus->pos.x = playerNpc->pos.x; + playerStatus->pos.y = playerNpc->pos.y; + playerStatus->pos.z = playerNpc->pos.z; return ApiStatus_DONE2; } @@ -112,7 +112,7 @@ ApiStatus SetPlayerAnimation(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; AnimID anim = evt_get_variable(script, *args++); - gPlayerStatus.anim = playerNpc->currentAnim = anim; + gPlayerStatus.anim = playerNpc->curAnim = anim; if (gPlayerStatus.anim == ANIM_MarioW2_Collapse) { exec_ShakeCam1(0, 0, 2); @@ -145,14 +145,14 @@ ApiStatus PlayerMoveTo(Evt* script, s32 isInitialCall) { f32 moveSpeed; script->functionTemp[0] = evt_get_variable(script, *args++); - playerStatus->targetYaw = atan2(playerStatus->position.x, playerStatus->position.z, targetX, targetZ); + playerStatus->targetYaw = atan2(playerStatus->pos.x, playerStatus->pos.z, targetX, targetZ); if (script->functionTemp[0] == 0) { - script->functionTemp[0] = dist2D(playerStatus->position.x, playerStatus->position.z, targetX, + script->functionTemp[0] = dist2D(playerStatus->pos.x, playerStatus->pos.z, targetX, targetZ) / playerNpc->moveSpeed; moveSpeed = playerNpc->moveSpeed; } else { - moveSpeed = dist2D(playerStatus->position.x, playerStatus->position.z, targetX, targetZ) / script->functionTemp[0]; + moveSpeed = dist2D(playerStatus->pos.x, playerStatus->pos.z, targetX, targetZ) / script->functionTemp[0]; } move_player(script->functionTemp[0], playerStatus->targetYaw, moveSpeed); } @@ -173,8 +173,8 @@ ApiStatus func_802D1270(Evt* script, s32 isInitialCall) { f32 dist; f32 moveSpeed; - playerStatus->targetYaw = atan2(playerStatus->position.x, playerStatus->position.z, targetX, targetZ); - dist = dist2D(playerStatus->position.x, playerStatus->position.z, targetX, targetZ); + playerStatus->targetYaw = atan2(playerStatus->pos.x, playerStatus->pos.z, targetX, targetZ); + dist = dist2D(playerStatus->pos.x, playerStatus->pos.z, targetX, targetZ); script->functionTemp[0] = dist / var3; moveSpeed = dist / script->functionTemp[0]; @@ -195,12 +195,12 @@ ApiStatus func_802D1380(Evt* script, s32 isInitialCall) { f32 targetZ = evt_get_variable(script, *args++); playerNpc->duration = evt_get_variable(script, *args++); - playerStatus->targetYaw = atan2(playerStatus->position.x, playerStatus->position.z, targetX, targetZ); + playerStatus->targetYaw = atan2(playerStatus->pos.x, playerStatus->pos.z, targetX, targetZ); if (playerNpc->duration != 0) { - playerNpc->moveSpeed = dist2D(playerStatus->position.x, playerStatus->position.z, targetX, targetZ) / (f32) playerNpc->duration; + playerNpc->moveSpeed = dist2D(playerStatus->pos.x, playerStatus->pos.z, targetX, targetZ) / (f32) playerNpc->duration; } else { - playerNpc->duration = dist2D(playerStatus->position.x, playerStatus->position.z, targetX, targetZ) / playerNpc->moveSpeed; + playerNpc->duration = dist2D(playerStatus->pos.x, playerStatus->pos.z, targetX, targetZ) / playerNpc->moveSpeed; if (playerNpc->duration == 0) { playerNpc->duration = 1; } @@ -218,7 +218,7 @@ s32 player_jump(Evt* script, s32 isInitialCall, s32 mode) { f32 xTemp; f32 yTemp; f32 zTemp; - f32 jumpVelocity; + f32 jumpVel; s32 duration; AnimID anim; f32 dist; @@ -233,9 +233,9 @@ s32 player_jump(Evt* script, s32 isInitialCall, s32 mode) { zTemp = evt_get_variable(script, *args++); duration = evt_get_variable(script, *args++); - playerNpc->pos.x = playerStatus->position.x; - playerNpc->pos.y = playerStatus->position.y; - playerNpc->pos.z = playerStatus->position.z; + playerNpc->pos.x = playerStatus->pos.x; + playerNpc->pos.y = playerStatus->pos.y; + playerNpc->pos.z = playerStatus->pos.z; playerNpc->moveToPos.x = xTemp; playerNpc->moveToPos.y = yTemp; playerNpc->moveToPos.z = zTemp; @@ -255,7 +255,7 @@ s32 player_jump(Evt* script, s32 isInitialCall, s32 mode) { playerNpc->moveSpeed = dist / playerNpc->duration; } - playerNpc->jumpVelocity = (playerNpc->jumpScale * (playerNpc->duration - 1) / 2) + (yTemp / playerNpc->duration); + playerNpc->jumpVel = (playerNpc->jumpScale * (playerNpc->duration - 1) / 2) + (yTemp / playerNpc->duration); playerStatus->flags |= PS_FLAG_FLYING; playerStatus->animFlags |= PA_FLAG_NO_OOB_RESPAWN; @@ -276,11 +276,11 @@ s32 player_jump(Evt* script, s32 isInitialCall, s32 mode) { } npc_move_heading(playerNpc, playerNpc->moveSpeed, playerNpc->yaw); - playerNpc->pos.y += playerNpc->jumpVelocity; - jumpVelocity = playerNpc->jumpVelocity; // TODO: temp needed and used specifically only once below for this to match - playerNpc->jumpVelocity -= playerNpc->jumpScale; + playerNpc->pos.y += playerNpc->jumpVel; + jumpVel = playerNpc->jumpVel; // TODO: temp needed and used specifically only once below for this to match + playerNpc->jumpVel -= playerNpc->jumpScale; - if (mode == 0 && jumpVelocity > 0.0f && playerNpc->jumpVelocity <= 0.0f) { + if (mode == 0 && jumpVel > 0.0f && playerNpc->jumpVel <= 0.0f) { if (!(playerStatus->animFlags & PA_FLAG_8BIT_MARIO)) { if (!(playerStatus->animFlags & PA_FLAG_USING_WATT)) { anim = ANIM_Mario1_Fall; @@ -293,9 +293,9 @@ s32 player_jump(Evt* script, s32 isInitialCall, s32 mode) { suggest_player_anim_allow_backward(anim); } - playerStatus->position.x = playerNpc->pos.x; - playerStatus->position.y = playerNpc->pos.y; - playerStatus->position.z = playerNpc->pos.z; + playerStatus->pos.x = playerNpc->pos.x; + playerStatus->pos.y = playerNpc->pos.y; + playerStatus->pos.z = playerNpc->pos.z; if (mode == 0) { playerStatus->targetYaw = playerNpc->yaw; @@ -323,10 +323,10 @@ s32 player_jump(Evt* script, s32 isInitialCall, s32 mode) { if (mode == 0 || mode == 2) { s32 colliderID; - yTemp = player_check_collision_below(playerNpc->jumpVelocity, &colliderID); + yTemp = player_check_collision_below(playerNpc->jumpVel, &colliderID); if (colliderID >= 0) { - playerStatus->position.y = yTemp; + playerStatus->pos.y = yTemp; player_handle_floor_collider_type(colliderID); handle_floor_behavior(); } @@ -409,7 +409,7 @@ ApiStatus PlayerFaceNpc(Evt* script, s32 isInitialCall) { } *playerTargetYaw = playerNpc->yaw = playerStatus->targetYaw; - *angle = atan2(playerStatus->position.x, playerStatus->position.z, npc->pos.x, npc->pos.z) - *playerTargetYaw; + *angle = atan2(playerStatus->pos.x, playerStatus->pos.z, npc->pos.x, npc->pos.z) - *playerTargetYaw; *ft3 = evt_get_variable(script, *args++); playerNpc->duration = 0; @@ -468,9 +468,9 @@ ApiStatus GetPlayerPos(Evt* script, s32 isInitialCall) { Bytecode outVar2 = *args++; Bytecode outVar3 = *args++; - evt_set_variable(script, outVar1, playerStatus->position.x); - evt_set_variable(script, outVar2, playerStatus->position.y); - evt_set_variable(script, outVar3, playerStatus->position.z); + evt_set_variable(script, outVar1, playerStatus->pos.x); + evt_set_variable(script, outVar2, playerStatus->pos.y); + evt_set_variable(script, outVar3, playerStatus->pos.z); return ApiStatus_DONE2; } @@ -527,10 +527,10 @@ ApiStatus UseEntryHeading(Evt* script, s32 isInitialCall) { sin_cos_deg(clamp_angle((*mapSettings->entryList)[gGameStatusPtr->entryID].yaw + 180.0f), &sinTheta, &cosTheta); exitTangentFrac = gGameStatusPtr->exitTangent * 0.3f; - gPlayerStatus.position.x = (entryX + (var1 * sinTheta)) - (exitTangentFrac * cosTheta); - gPlayerStatus.position.z = (entryZ - (var1 * cosTheta)) - (exitTangentFrac * sinTheta); + gPlayerStatus.pos.x = (entryX + (var1 * sinTheta)) - (exitTangentFrac * cosTheta); + gPlayerStatus.pos.z = (entryZ - (var1 * cosTheta)) - (exitTangentFrac * sinTheta); - script->varTableF[5] = dist2D(gPlayerStatus.position.x, gPlayerStatus.position.z, entryX, entryZ) / var2; + script->varTableF[5] = dist2D(gPlayerStatus.pos.x, gPlayerStatus.pos.z, entryX, entryZ) / var2; gPlayerStatus.flags |= PS_FLAG_CAMERA_DOESNT_FOLLOW; return ApiStatus_DONE2; @@ -553,7 +553,7 @@ ApiStatus UseExitHeading(Evt* script, s32 isInitialCall) { f32 entryX = (*mapSettings->entryList)[entryID].x; f32 entryZ = (*mapSettings->entryList)[entryID].z; f32 temp = (var1 + 10.0f) / 2; - f32 temp_f2 = dist2D(entryX, entryZ, playerStatus->position.x, playerStatus->position.z) - temp; + f32 temp_f2 = dist2D(entryX, entryZ, playerStatus->pos.x, playerStatus->pos.z) - temp; f32 sinTheta; f32 cosTheta; f32 exitTangentFrac; @@ -566,10 +566,10 @@ ApiStatus UseExitHeading(Evt* script, s32 isInitialCall) { } sin_cos_deg(clamp_angle((*mapSettings->entryList)[entryID].yaw + 180.0f), &sinTheta, &cosTheta); - gGameStatusPtr->exitTangent = (cosTheta * (playerStatus->position.x - entryX)) - (sinTheta * (entryZ - playerStatus->position.z)); + gGameStatusPtr->exitTangent = (cosTheta * (playerStatus->pos.x - entryX)) - (sinTheta * (entryZ - playerStatus->pos.z)); exitTangentFrac = gGameStatusPtr->exitTangent * 0.3f; - script->varTable[1] = (playerStatus->position.x + (var1 * sinTheta)) - (exitTangentFrac * cosTheta); - script->varTable[3] = (playerStatus->position.z - (var1 * cosTheta)) - (exitTangentFrac * sinTheta); + script->varTable[1] = (playerStatus->pos.x + (var1 * sinTheta)) - (exitTangentFrac * cosTheta); + script->varTable[3] = (playerStatus->pos.z - (var1 * cosTheta)) - (exitTangentFrac * sinTheta); script->varTable[2] = (*mapSettings->entryList)[entryID].y; *varTableVar5 = var1 / 15; playerStatus->animFlags |= PA_FLAG_CHANGING_MAP; @@ -591,7 +591,7 @@ s32 func_802D23F8(void) { } ApiStatus WaitForPlayerTouchingFloor(Evt* script, s32 isInitialCall) { - if ((gCollisionStatus.currentFloor >= 0) && func_802D23F8()) { + if ((gCollisionStatus.curFloor >= 0) && func_802D23F8()) { return ApiStatus_DONE2; } else { return ApiStatus_BLOCK; @@ -599,7 +599,7 @@ ApiStatus WaitForPlayerTouchingFloor(Evt* script, s32 isInitialCall) { } ApiStatus func_802D2484(Evt* script, s32 isInitialCall) { - if (gCollisionStatus.currentFloor >= 0) { + if (gCollisionStatus.curFloor >= 0) { return ApiStatus_DONE2; } else { return ApiStatus_BLOCK; @@ -610,7 +610,7 @@ ApiStatus IsPlayerOnValidFloor(Evt* script, s32 isInitialCall) { Bytecode* args = script->ptrReadPos; s32 result = FALSE; - if (gCollisionStatus.currentFloor >= 0) { + if (gCollisionStatus.curFloor >= 0) { result = (func_802D23F8() != 0); } evt_set_variable(script, *args++, result); @@ -723,8 +723,8 @@ ApiStatus FacePlayerTowardPoint(Evt* script, s32 isInitialCall) { *initialYaw = playerNpc->yaw = playerStatus->targetYaw; - if (playerStatus->position.x != targetX || playerStatus->position.z != targetY) { - targetYaw = atan2(playerStatus->position.x, playerStatus->position.z, targetX, targetY); + if (playerStatus->pos.x != targetX || playerStatus->pos.z != targetY) { + targetYaw = atan2(playerStatus->pos.x, playerStatus->pos.z, targetX, targetY); } else { targetYaw = playerStatus->targetYaw; } @@ -777,7 +777,7 @@ ApiStatus GetPartnerInUse(Evt* script, s32 isInitialCall) { s32 currentPartner = PARTNER_NONE; if (gPartnerStatus.partnerActionState != PARTNER_ACTION_NONE) { - currentPartner = playerData->currentPartner; + currentPartner = playerData->curPartner; } evt_set_variable(script, outVar, currentPartner); @@ -830,9 +830,9 @@ ApiStatus SetPlayerPushVelocity(Evt* script, s32 isInitialCall) { f32 y; f32 z; - gPlayerStatus.pushVelocity.x = x; - gPlayerStatus.pushVelocity.y = evt_get_variable(script, *args++); - gPlayerStatus.pushVelocity.z = evt_get_variable(script, *args++); + gPlayerStatus.pushVel.x = x; + gPlayerStatus.pushVel.y = evt_get_variable(script, *args++); + gPlayerStatus.pushVel.z = evt_get_variable(script, *args++); return ApiStatus_DONE2; } diff --git a/src/evt/script_list.c b/src/evt/script_list.c index 72914065af..4714c1ceae 100644 --- a/src/evt/script_list.c +++ b/src/evt/script_list.c @@ -255,11 +255,11 @@ Evt* start_script(EvtScript* source, s32 priority, s32 flags) { ASSERT(newScript != NULL); newScript->stateFlags = flags | EVT_FLAG_ACTIVE; - newScript->currentOpcode = EVT_OP_INTERNAL_FETCH; + newScript->curOpcode = EVT_OP_INTERNAL_FETCH; newScript->priority = priority; newScript->ptrNextLine = (Bytecode*)source; newScript->ptrFirstLine = (Bytecode*)source; - newScript->ptrCurrentLine = (Bytecode*)source; + newScript->ptrCurLine = (Bytecode*)source; newScript->userData = NULL; newScript->blockingParent = NULL; newScript->childScript = NULL; @@ -327,12 +327,12 @@ Evt* start_script_in_group(EvtScript* source, u8 priority, u8 flags, u8 groupFla // Some of this function is surely macros. I think we'll learn more as we do others in this file. -Ethan do { newScript->stateFlags = flags | EVT_FLAG_ACTIVE; - newScript->currentOpcode = EVT_OP_INTERNAL_FETCH; + newScript->curOpcode = EVT_OP_INTERNAL_FETCH; newScript->priority = priority; newScript->id = gStaticScriptCounter++; newScript->ptrNextLine = (Bytecode*)source; newScript->ptrFirstLine = (Bytecode*)source; - newScript->ptrCurrentLine = (Bytecode*)source; + newScript->ptrCurLine = (Bytecode*)source; newScript->userData = 0; newScript->blockingParent = 0; newScript->childScript = 0; @@ -396,10 +396,10 @@ Evt* start_child_script(Evt* parentScript, EvtScript* source, s32 flags) { parentScript->childScript = child; parentScript->stateFlags |= EVT_FLAG_BLOCKED_BY_CHILD; child->stateFlags = flags | EVT_FLAG_ACTIVE; - child->ptrCurrentLine = child->ptrFirstLine = child->ptrNextLine = (Bytecode*)source; + child->ptrCurLine = child->ptrFirstLine = child->ptrNextLine = (Bytecode*)source; - child->currentOpcode = EVT_OP_INTERNAL_FETCH; + child->curOpcode = EVT_OP_INTERNAL_FETCH; child->userData = NULL; child->blockingParent = parentScript; child->childScript = NULL; @@ -466,8 +466,8 @@ Evt* func_802C39F8(Evt* parentScript, Bytecode* nextLine, s32 newState) { child->stateFlags = newState | EVT_FLAG_ACTIVE; child->ptrNextLine = nextLine; child->ptrFirstLine = nextLine; - child->ptrCurrentLine = nextLine; - child->currentOpcode = EVT_OP_INTERNAL_FETCH; + child->ptrCurLine = nextLine; + child->curOpcode = EVT_OP_INTERNAL_FETCH; child->userData = NULL; child->blockingParent = NULL; child->parentScript = parentScript; @@ -517,8 +517,8 @@ Evt* func_802C3C10(Evt* script, Bytecode* line, s32 arg2) { script->ptrNextLine = line; script->ptrFirstLine = line; - script->ptrCurrentLine = line; - script->currentOpcode = EVT_OP_INTERNAL_FETCH; + script->ptrCurLine = line; + script->curOpcode = EVT_OP_INTERNAL_FETCH; script->frameCounter = 0; script->stateFlags |= arg2; script->timeScale = 1.0f; @@ -559,10 +559,10 @@ Evt* restart_script(Evt* script) { script->loopDepth = -1; script->switchDepth = -1; script->frameCounter = 0; - script->currentOpcode = EVT_OP_INTERNAL_FETCH; + script->curOpcode = EVT_OP_INTERNAL_FETCH; script->ptrNextLine = ptrFirstLine; - script->ptrCurrentLine = ptrFirstLine; + script->ptrCurLine = ptrFirstLine; script->timeScale = 1.0f; script->frameCounter = 0; script->unk_158 = 0; diff --git a/src/evt/virtual_entity.c b/src/evt/virtual_entity.c index 33b53a2811..069524af6e 100644 --- a/src/evt/virtual_entity.c +++ b/src/evt/virtual_entity.c @@ -412,14 +412,14 @@ ApiStatus VirtualEntityJumpTo(Evt* script, s32 isInitialCall) { virtualEntity->moveSpeed = virtualEntity->moveDist / virtualEntity->moveTime; } - virtualEntity->jumpVelocity = (virtualEntity->jumpGravity * virtualEntity->moveTime / 2) + + virtualEntity->jumpVel = (virtualEntity->jumpGravity * virtualEntity->moveTime / 2) + (yTemp / virtualEntity->moveTime); script->functionTemp[0] = 1; } virtualEntity = (*gCurrentVirtualEntityListPtr)[script->functionTemp[1]]; - virtualEntity->pos.y += virtualEntity->jumpVelocity; - virtualEntity->jumpVelocity -= virtualEntity->jumpGravity; + virtualEntity->pos.y += virtualEntity->jumpVel; + virtualEntity->jumpVel -= virtualEntity->jumpGravity; virtual_entity_move_polar(virtualEntity, virtualEntity->moveSpeed, virtualEntity->moveAngle); @@ -448,8 +448,8 @@ ApiStatus VirtualEntityLandJump(Evt* script, s32 isInitialCall) { } virtualEntity = (*gCurrentVirtualEntityListPtr)[script->functionTemp[1]]; - virtualEntity->pos.y += virtualEntity->jumpVelocity; - virtualEntity->jumpVelocity -= virtualEntity->jumpGravity; + virtualEntity->pos.y += virtualEntity->jumpVel; + virtualEntity->jumpVel -= virtualEntity->jumpGravity; virtual_entity_move_polar(virtualEntity, virtualEntity->moveSpeed, virtualEntity->moveAngle); diff --git a/src/hud_element.c b/src/hud_element.c index 1c2b04b4c0..4b72fc6387 100644 --- a/src/hud_element.c +++ b/src/hud_element.c @@ -1467,16 +1467,16 @@ void render_hud_element(HudElement* hudElement) { guTranslateF(sp220, -transform->pivot.x, transform->pivot.y, 0.0f); guTranslateF( sp1A0, - hudElement->renderPosX + hudElement->screenPosOffset.x + hudElement->worldPosOffset.x + transform->position.x, - -hudElement->renderPosY - hudElement->screenPosOffset.y + hudElement->worldPosOffset.y + transform->position.y, - - (hudElement->worldPosOffset.z / 10.0) + transform->position.z + hudElement->renderPosX + hudElement->screenPosOffset.x + hudElement->worldPosOffset.x + transform->pos.x, + -hudElement->renderPosY - hudElement->screenPosOffset.y + hudElement->worldPosOffset.y + transform->pos.y, + - (hudElement->worldPosOffset.z / 10.0) + transform->pos.z ); guScaleF(sp260, hudElement->uniformScale * xScaleFactor * transform->scale.x, hudElement->uniformScale * yScaleFactor * transform->scale.y, transform->scale.z); - guRotateF(sp120, transform->rotation.y, 0.0f, 1.0f, 0.0f); - guRotateF(sp160, transform->rotation.z, 0.0f, 0.0f, 1.0f); - guRotateF(spE0, transform->rotation.x, 1.0f, 0.0f, 0.0f); + guRotateF(sp120, transform->rot.y, 0.0f, 1.0f, 0.0f); + guRotateF(sp160, transform->rot.z, 0.0f, 0.0f, 1.0f); + guRotateF(spE0, transform->rot.x, 1.0f, 0.0f, 0.0f); guMtxCatF(sp160, spE0, sp20); guMtxCatF(sp20, sp120, spA0); guMtxCatF(sp260, sp1E0, sp20); @@ -2116,12 +2116,12 @@ void hud_element_create_transform_A(s32 id) { ASSERT(transform != NULL); element->flags |= HUD_ELEMENT_FLAG_TRANSFORM; transform->imgfxIdx = imgfx_get_free_instances(1); - transform->position.x = 0.0f; - transform->position.y = 0.0f; - transform->position.z = 0.0f; - transform->rotation.x = 0.0f; - transform->rotation.y = 0.0f; - transform->rotation.z = 0.0f; + transform->pos.x = 0.0f; + transform->pos.y = 0.0f; + transform->pos.z = 0.0f; + transform->rot.x = 0.0f; + transform->rot.y = 0.0f; + transform->rot.z = 0.0f; transform->scale.x = 1.0f; transform->scale.y = 1.0f; transform->scale.z = 1.0f; @@ -2138,12 +2138,12 @@ void hud_element_create_transform_B(s32 id) { ASSERT(transform != NULL); element->flags |= HUD_ELEMENT_FLAG_TRANSFORM | HUD_ELEMENT_FLAG_NO_FOLD; transform->imgfxIdx = 0; - transform->position.x = 0.0f; - transform->position.y = 0.0f; - transform->position.z = 0.0f; - transform->rotation.x = 0.0f; - transform->rotation.y = 0.0f; - transform->rotation.z = 0.0f; + transform->pos.x = 0.0f; + transform->pos.y = 0.0f; + transform->pos.z = 0.0f; + transform->rot.x = 0.0f; + transform->rot.y = 0.0f; + transform->rot.z = 0.0f; transform->scale.x = 1.0f; transform->scale.y = 1.0f; transform->scale.z = 1.0f; @@ -2158,12 +2158,12 @@ void hud_element_create_transform_C(s32 id) { ASSERT(transform != NULL); element->flags |= HUD_ELEMENT_FLAG_40000000 | HUD_ELEMENT_FLAG_NO_FOLD | HUD_ELEMENT_FLAG_TRANSFORM; transform->imgfxIdx = 0; - transform->position.x = 0.0f; - transform->position.y = 0.0f; - transform->position.z = 0.0f; - transform->rotation.x = 0.0f; - transform->rotation.y = 0.0f; - transform->rotation.z = 0.0f; + transform->pos.x = 0.0f; + transform->pos.y = 0.0f; + transform->pos.z = 0.0f; + transform->rot.x = 0.0f; + transform->rot.y = 0.0f; + transform->rot.z = 0.0f; transform->scale.x = 1.0f; transform->scale.y = 1.0f; transform->scale.z = 1.0f; @@ -2188,9 +2188,9 @@ void hud_element_set_transform_pos(s32 id, f32 x, f32 y, f32 z) { HudTransform* transform = element->hudTransform; if (element->flags & HUD_ELEMENT_FLAG_TRANSFORM) { - transform->position.x = x; - transform->position.y = y; - transform->position.z = z; + transform->pos.x = x; + transform->pos.y = y; + transform->pos.z = z; } } @@ -2210,9 +2210,9 @@ void hud_element_set_transform_rotation(s32 id, f32 x, f32 y, f32 z) { HudTransform* transform = element->hudTransform; if (element->flags & HUD_ELEMENT_FLAG_TRANSFORM) { - transform->rotation.x = x; - transform->rotation.y = y; - transform->rotation.z = z; + transform->rot.x = x; + transform->rot.y = y; + transform->rot.z = z; } } diff --git a/src/hud_element.h b/src/hud_element.h index 6f6bf22e56..88b9c0dc47 100644 --- a/src/hud_element.h +++ b/src/hud_element.h @@ -145,7 +145,7 @@ typedef struct Shop { /* 0x002 */ s16 numItems; /* 0x004 */ s16 numSpecialPrices; /* 0x006 */ char unk_06[0x2]; - /* 0x008 */ s32 currentItemSlot; + /* 0x008 */ s32 curItemSlot; /* 0x00C */ s32 selectedStoreItemSlot; /* 0x010 */ ShopOwner* owner; /* 0x014 */ ShopItemLocation* itemDataPositions; @@ -168,8 +168,8 @@ typedef struct VtxRect { typedef struct HudTransform { /* 0x00 */ s32 imgfxIdx; - /* 0x04 */ Vec3f position; - /* 0x10 */ Vec3f rotation; + /* 0x04 */ Vec3f pos; + /* 0x10 */ Vec3f rot; /* 0x1C */ Vec3f scale; /* 0x28 */ Vec2s pivot; /* 0x30 */ VtxRect unk_30[3]; diff --git a/src/i_spy.c b/src/i_spy.c index 8e5adc7842..1bb4393d06 100644 --- a/src/i_spy.c +++ b/src/i_spy.c @@ -38,7 +38,7 @@ void appendGfx_ispy_icon(void) { if (gPlayerStatus.animFlags & PA_FLAG_ISPY_VISIBLE) { guScaleF(matrix1, ISpyPtr->scale, ISpyPtr->scale, ISpyPtr->scale); - guRotateF(matrix2, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(matrix2, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(matrix1, matrix2, matrix1); guTranslateF(matrix2, ISpyPtr->pos.x, ISpyPtr->pos.y, ISpyPtr->pos.z); guMtxCatF(matrix1, matrix2, matrix2); @@ -90,9 +90,9 @@ void appendGfx_ispy_icon(void) { void ispy_notification_setup(void) { mem_clear(ISpyPtr, sizeof(*ISpyPtr)); - ISpyPtr->pos.x = gPlayerStatus.position.x; - ISpyPtr->pos.y = gPlayerStatus.position.y + gPlayerStatus.colliderHeight + 8.0f; - ISpyPtr->pos.z = gPlayerStatus.position.z; + ISpyPtr->pos.x = gPlayerStatus.pos.x; + ISpyPtr->pos.y = gPlayerStatus.pos.y + gPlayerStatus.colliderHeight + 8.0f; + ISpyPtr->pos.z = gPlayerStatus.pos.z; ISpyPtr->alpha = 255; @@ -106,9 +106,9 @@ void ispy_notification_update(void) { s32 cond; ISpyPtr->pos.y += - (playerStatus->position.y + playerStatus->colliderHeight + 10.0f - ISpyPtr->pos.y) / 1.5f; - ISpyPtr->pos.x = playerStatus->position.x; - ISpyPtr->pos.z = playerStatus->position.z; + (playerStatus->pos.y + playerStatus->colliderHeight + 10.0f - ISpyPtr->pos.y) / 1.5f; + ISpyPtr->pos.x = playerStatus->pos.x; + ISpyPtr->pos.z = playerStatus->pos.z; switch (ISpyPtr->state) { case I_SPY_DELAY: diff --git a/src/imgfx.c b/src/imgfx.c index e3426c62fc..1d0de4b0c8 100644 --- a/src/imgfx.c +++ b/src/imgfx.c @@ -979,8 +979,8 @@ void imgfx_appendGfx_mesh(ImgFXState* state, Matrix4f mtx) { gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); gSPSetGeometryMode(gMainGfxPos++, G_SHADE | G_LIGHTING | G_SHADING_SMOOTH); - angle1 = cosine(currentCam->currentYaw) * 120.0f; - angle2 = cosine(currentCam->currentYaw + 90.0f) * 120.0f; + angle1 = cosine(currentCam->curYaw) * 120.0f; + angle2 = cosine(currentCam->curYaw + 90.0f) * 120.0f; dirX1 = -angle1; dirZ2 = -angle2; ImgFXLights.l[0].l.dir[0] = dirX1; diff --git a/src/input.c b/src/input.c index aaee101fce..07e5396301 100644 --- a/src/input.c +++ b/src/input.c @@ -8,7 +8,7 @@ SHIFT_BSS s16 D_8009A6A4; SHIFT_BSS s16 D_8009A6A6; void func_800287F0(void) { - gGameStatusPtr->currentButtons[0] = 0; + gGameStatusPtr->curButtons[0] = 0; gGameStatusPtr->pressedButtons[0] = 0; gGameStatusPtr->heldButtons[0] = 0; gGameStatusPtr->stickX[0] = 0; @@ -207,17 +207,17 @@ void update_input(void) { } } - gGameStatusPtr->currentButtons[0] = buttons; - gGameStatusPtr->pressedButtons[0] = gGameStatusPtr->currentButtons[0] ^ gGameStatusPtr->prevButtons[0]; - gGameStatusPtr->pressedButtons[0] &= gGameStatusPtr->currentButtons[0]; + gGameStatusPtr->curButtons[0] = buttons; + gGameStatusPtr->pressedButtons[0] = gGameStatusPtr->curButtons[0] ^ gGameStatusPtr->prevButtons[0]; + gGameStatusPtr->pressedButtons[0] &= gGameStatusPtr->curButtons[0]; do { - if (gGameStatusPtr->currentButtons[0] == 0) { + if (gGameStatusPtr->curButtons[0] == 0) { gGameStatusPtr->heldButtons[0] = 0; - } else if (gGameStatusPtr->prevButtons[0] != gGameStatusPtr->currentButtons[0]) { - gGameStatusPtr->heldButtons[0] = gGameStatusPtr->currentButtons[0]; + } else if (gGameStatusPtr->prevButtons[0] != gGameStatusPtr->curButtons[0]) { + gGameStatusPtr->heldButtons[0] = gGameStatusPtr->curButtons[0]; gGameStatusPtr->unk_60 = -1; - gGameStatusPtr->heldButtons[0] = gGameStatusPtr->currentButtons[0] ^ gGameStatusPtr->prevButtons[0]; - gGameStatusPtr->heldButtons[0] &= gGameStatusPtr->currentButtons[0]; + gGameStatusPtr->heldButtons[0] = gGameStatusPtr->curButtons[0] ^ gGameStatusPtr->prevButtons[0]; + gGameStatusPtr->heldButtons[0] &= gGameStatusPtr->curButtons[0]; gGameStatusPtr->unk_58 = gGameStatusPtr->unk_48[0]; } else { if (gGameStatusPtr->unk_60 >= 0) { @@ -225,7 +225,7 @@ void update_input(void) { if (gGameStatusPtr->unk_60 != 0) { gGameStatusPtr->heldButtons[0] = 0; } else { - gGameStatusPtr->heldButtons[0] = gGameStatusPtr->currentButtons[0]; + gGameStatusPtr->heldButtons[0] = gGameStatusPtr->curButtons[0]; gGameStatusPtr->unk_60 = gGameStatusPtr->unk_50[0]; } } else { @@ -233,12 +233,12 @@ void update_input(void) { if (gGameStatusPtr->unk_58 != 0) { gGameStatusPtr->heldButtons[0] = 0; } else { - gGameStatusPtr->heldButtons[0] = gGameStatusPtr->currentButtons[0]; + gGameStatusPtr->heldButtons[0] = gGameStatusPtr->curButtons[0]; gGameStatusPtr->unk_60 = gGameStatusPtr->unk_50[0]; } } } } while (0); - gGameStatusPtr->prevButtons[0] = gGameStatusPtr->currentButtons[0]; + gGameStatusPtr->prevButtons[0] = gGameStatusPtr->curButtons[0]; } diff --git a/src/inspect_icon.c b/src/inspect_icon.c index ef761f2b67..f1334e4370 100644 --- a/src/inspect_icon.c +++ b/src/inspect_icon.c @@ -44,13 +44,13 @@ void interact_inspect_setup(void) { if (playerStatus->animFlags & PA_FLAG_INTERACT_PROMPT_AVAILABLE) { mem_clear(InspectIconPtr, sizeof(*InspectIconPtr)); D_8010C950 = -1; - InspectIconPtr->pos.x = playerStatus->position.x; - InspectIconPtr->pos.y = playerStatus->position.y + playerStatus->colliderHeight + + InspectIconPtr->pos.x = playerStatus->pos.x; + InspectIconPtr->pos.y = playerStatus->pos.y + playerStatus->colliderHeight + (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) ? 8.0f : 2.0f); - InspectIconPtr->pos.z = playerStatus->position.z; + InspectIconPtr->pos.z = playerStatus->pos.z; InspectIconPtr->scale = 0.4f; InspectIconPtr->state = INSPECT_ICON_APPEAR; - InspectIconPtr->yaw = -gCameras[gCurrentCameraID].currentYaw; + InspectIconPtr->yaw = -gCameras[gCurrentCameraID].curYaw; InteractNotificationCallback = interact_inspect_update; InspectIconPtr->brightness = 255; InspectIconPtr->alpha = 255; @@ -63,7 +63,7 @@ void appendGfx_interact_prompt(void) { if (gPlayerStatus.animFlags & PA_FLAG_INTERACT_PROMPT_AVAILABLE) { guScaleF(sp38, InspectIconPtr->scale, InspectIconPtr->scale, InspectIconPtr->scale); - guRotateF(sp78, InspectIconPtr->yaw - gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp78, InspectIconPtr->yaw - gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp38, sp78, sp38); guTranslateF(sp78, InspectIconPtr->pos.x, InspectIconPtr->pos.y, InspectIconPtr->pos.z); guMtxCatF(sp38, sp78, sp78); @@ -94,11 +94,11 @@ void appendGfx_interact_prompt(void) { s32 should_continue_inspect(void) { CollisionStatus* collisionStatus = &gCollisionStatus; PlayerStatus* playerStatus = &gPlayerStatus; - s32 curInteraction = collisionStatus->currentWall; + s32 curInteraction = collisionStatus->curWall; Npc* npc = playerStatus->encounteredNPC; if (curInteraction == NO_COLLIDER) { - s32 floor = gCollisionStatus.currentFloor; + s32 floor = gCollisionStatus.curFloor; if (floor >= 0 && (floor & COLLISION_WITH_ENTITY_BIT)) { curInteraction = floor; @@ -175,12 +175,12 @@ void update_inspect_icon_pos(void) { InspectIconPtr->iconBounceVel = -4; } - delta = (playerStatus->position.x - InspectIconPtr->pos.x) * 0.666f; + delta = (playerStatus->pos.x - InspectIconPtr->pos.x) * 0.666f; InspectIconPtr->pos.x += delta; - delta = (playerStatus->position.z - InspectIconPtr->pos.z) * 0.666f; + delta = (playerStatus->pos.z - InspectIconPtr->pos.z) * 0.666f; InspectIconPtr->pos.z += delta; - playerHeadY = playerStatus->position.y + playerStatus->colliderHeight; + playerHeadY = playerStatus->pos.y + playerStatus->colliderHeight; bounceDeltaY = InspectIconPtr->iconBounceVel; lastPosY = InspectIconPtr->pos.y; if (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)) { diff --git a/src/main_loop.c b/src/main_loop.c index bc91bde355..0c87a80bf5 100644 --- a/src/main_loop.c +++ b/src/main_loop.c @@ -15,7 +15,7 @@ s8 gGameStepDelayAmount = 1; s8 gGameStepDelayCount = 5; GameStatus gGameStatus = { - .currentButtons = {0}, + .curButtons = {0}, .pressedButtons = {0}, .heldButtons = {0}, .prevButtons = {0}, diff --git a/src/model.c b/src/model.c index 7b050b1a84..b7007fd532 100644 --- a/src/model.c +++ b/src/model.c @@ -2666,7 +2666,7 @@ void render_models(void) { } else { rtPtr->appendGfx = appendGfx_model; } - rtPtr->distance = -distance; + rtPtr->dist = -distance; rtPtr->renderMode = model->renderMode; queue_render_task(rtPtr); } @@ -2705,7 +2705,7 @@ void render_models(void) { if (!(transformGroup->flags & TRANSFORM_GROUP_FLAG_HIDDEN)) { rtPtr->appendGfx = render_transform_group; rtPtr->appendGfxArg = transformGroup; - rtPtr->distance = -distance; + rtPtr->dist = -distance; rtPtr->renderMode = transformGroup->renderMode; queue_render_task(rtPtr); } @@ -4349,7 +4349,7 @@ RenderTask* queue_render_task(RenderTask* task) { ret->appendGfxArg = task->appendGfxArg; ret->appendGfx = task->appendGfx; - ret->distance = mdl_renderTaskBasePriorities[task->renderMode] - task->distance; + ret->dist = mdl_renderTaskBasePriorities[task->renderMode] - task->dist; return ret; } @@ -4379,7 +4379,7 @@ void execute_render_tasks(void) { s32 t2 = sorted[j]; task = &taskList[t1]; task2 = &taskList[t2]; - if (task->distance > task2->distance) { + if (task->dist > task2->dist) { sorted[i] = t2; sorted[j] = t1; } @@ -4390,13 +4390,13 @@ void execute_render_tasks(void) { taskList = mdl_renderTaskLists[mdl_renderTaskQueueIdx]; for (i = 0; i < taskCount - 1; i++) { task = &taskList[sorted[i]]; - if (task->distance >= 3000000) { + if (task->dist >= 3000000) { for (j = i + 1; j < taskCount; j++) { s32 t1 = sorted[i]; s32 t2 = sorted[j]; task = &taskList[t1]; task2 = &taskList[t2]; - if (task->distance < task2->distance) { + if (task->dist < task2->dist) { sorted[i] = t2; sorted[j] = t1; } @@ -4408,7 +4408,7 @@ void execute_render_tasks(void) { taskList = mdl_renderTaskLists[mdl_renderTaskQueueIdx]; for (i = 0; i < taskCount - 1; i++) { task = &taskList[sorted[i]]; - if (task->distance > 800000) { + if (task->dist > 800000) { break; } for (j = i + 1; j < taskCount; j++) { @@ -4416,10 +4416,10 @@ void execute_render_tasks(void) { s32 t2 = sorted[j]; task = &taskList[t1]; task2 = &taskList[t2]; - if (task2->distance > 800000) { + if (task2->dist > 800000) { break; } - if (task->distance < task2->distance) { + if (task->dist < task2->dist) { sorted[i] = t2; sorted[j] = t1; } diff --git a/src/msg.c b/src/msg.c index 4fc1587bb5..6f61ee2bb9 100644 --- a/src/msg.c +++ b/src/msg.c @@ -340,9 +340,9 @@ s32 _update_message(MessagePrintState* printer) { if (printer->stateFlags & MSG_STATE_FLAG_80000) { buttons = BUTTON_A | BUTTON_C_DOWN; } - if ((buttons & gGameStatusPtr->pressedButtons[0]) || (gGameStatusPtr->currentButtons[0] & BUTTON_B)) { + if ((buttons & gGameStatusPtr->pressedButtons[0]) || (gGameStatusPtr->curButtons[0] & BUTTON_B)) { printer->windowState = MSG_WINDOW_STATE_PRINTING; - printer->currentPrintDelay = 0; + printer->curPrintDelay = 0; printer->stateFlags |= MSG_STATE_FLAG_4; if (gGameStatusPtr->pressedButtons[0] & (BUTTON_A | BUTTON_C_DOWN)) { cond = TRUE; @@ -362,11 +362,11 @@ s32 _update_message(MessagePrintState* printer) { } } else if ((gGameStatusPtr->pressedButtons[0] & BUTTON_Z) && !(printer->stateFlags & MSG_STATE_FLAG_40000) && - (printer->currentLine != 0)) + (printer->curLine != 0)) { printer->windowState = MSG_WINDOW_STATE_B; printer->unk_4CC = 0; - printer->unkArraySize = printer->currentLine - 1; + printer->unkArraySize = printer->curLine - 1; printer->unk_4C8 = abs(printer->curLinePos - printer->lineEndPos[printer->unkArraySize]); sfx_play_sound_with_params(SOUND_CD, 0, 0, 0); } @@ -375,7 +375,7 @@ s32 _update_message(MessagePrintState* printer) { if (gGameStatusPtr->pressedButtons[0] & BUTTON_B) { printer->windowState = MSG_WINDOW_STATE_B; printer->unk_4CC = 0; - printer->unkArraySize = printer->currentLine; + printer->unkArraySize = printer->curLine; printer->unk_4C8 = abs(printer->curLinePos - printer->lineEndPos[printer->unkArraySize]); sfx_play_sound_with_params(SOUND_CC, 0, 0, 0); } else if (gGameStatusPtr->pressedButtons[0] & BUTTON_Z) { @@ -405,26 +405,26 @@ s32 _update_message(MessagePrintState* printer) { sfx_play_sound_with_params(SOUND_MENU_NEXT, 0, 0, 0); } else if (printer->cancelOption != 0xFF && (gGameStatusPtr->pressedButtons[0] & BUTTON_B)) { if (printer->cancelOption >= printer->maxOption) { - printer->selectedOption = printer->currentOption; + printer->selectedOption = printer->curOption; } else { printer->selectedOption = printer->cancelOption; } printer->madeChoice = 1; printer->windowState = MSG_WINDOW_STATE_PRINTING; printer->scrollingTime = 0; - printer->currentOption = printer->cancelOption; + printer->curOption = printer->cancelOption; printer->stateFlags |= MSG_STATE_FLAG_20000; sfx_play_sound_with_params(SOUND_MENU_BACK, 0, 0, 0); } else if (gGameStatusPtr->heldButtons[0] & BUTTON_STICK_DOWN) { - if (printer->currentOption != printer->maxOption - 1) { - printer->targetOption = printer->currentOption + 1; + if (printer->curOption != printer->maxOption - 1) { + printer->targetOption = printer->curOption + 1; printer->windowState = MSG_WINDOW_STATE_SCROLLING_BACK; printer->scrollingTime = 1; sfx_play_sound_with_params(SOUND_MENU_CHANGE_SELECTION, 0, 0, 0); } } else if (gGameStatusPtr->heldButtons[0] & BUTTON_STICK_UP) { - if (printer->currentOption != 0) { - printer->targetOption = printer->currentOption - 1; + if (printer->curOption != 0) { + printer->targetOption = printer->curOption - 1; printer->windowState = MSG_WINDOW_STATE_SCROLLING_BACK; printer->scrollingTime = 1; sfx_play_sound_with_params(SOUND_MENU_CHANGE_SELECTION, 0, 0, 0); @@ -438,8 +438,8 @@ s32 _update_message(MessagePrintState* printer) { printer->scrollingTime++; if (printer->scrollingTime >= 5) { printer->windowState = MSG_WINDOW_STATE_WAITING_FOR_CHOICE; - printer->currentOption = printer->targetOption; - printer->selectedOption = printer->currentOption; + printer->curOption = printer->targetOption; + printer->selectedOption = printer->curOption; } break; } @@ -448,11 +448,11 @@ s32 _update_message(MessagePrintState* printer) { (gGameStatusPtr->pressedButtons[0] & BUTTON_A)) { printer->windowState = MSG_WINDOW_STATE_PRINTING; - printer->currentPrintDelay = 0; + printer->curPrintDelay = 0; printer->stateFlags |= MSG_STATE_FLAG_4; } - if (printer->stateFlags & MSG_STATE_FLAG_4 && !(gGameStatusPtr->currentButtons[0] & BUTTON_A)) { + if (printer->stateFlags & MSG_STATE_FLAG_4 && !(gGameStatusPtr->curButtons[0] & BUTTON_A)) { printer->stateFlags &= ~MSG_STATE_FLAG_4; } @@ -464,7 +464,7 @@ s32 _update_message(MessagePrintState* printer) { switch (printer->windowState) { case MSG_WINDOW_STATE_PRINTING: - if ((gGameStatusPtr->pressedButtons[0] & BUTTON_A) | (gGameStatusPtr->currentButtons[0] & BUTTON_B)) { + if ((gGameStatusPtr->pressedButtons[0] & BUTTON_A) | (gGameStatusPtr->curButtons[0] & BUTTON_B)) { if (!(printer->stateFlags & (MSG_STATE_FLAG_20 | MSG_STATE_FLAG_10)) && !cond) { printer->stateFlags |= MSG_STATE_FLAG_PRINT_QUICKLY; @@ -475,19 +475,19 @@ s32 _update_message(MessagePrintState* printer) { charsToPrint = printer->charsPerChunk; if (printer->windowState == MSG_WINDOW_STATE_INIT) { printer->windowState = MSG_WINDOW_STATE_PRINTING; - printer->currentPrintDelay = 0; + printer->curPrintDelay = 0; } else if (printer->stateFlags & MSG_STATE_FLAG_PRINT_QUICKLY) { charsToPrint = 12; - printer->currentPrintDelay = 0; + printer->curPrintDelay = 0; } else if (!(printer->stateFlags & MSG_STATE_FLAG_4)) { if (!(printer->stateFlags & (MSG_STATE_FLAG_20 | MSG_STATE_FLAG_10)) && - (gGameStatusPtr->currentButtons[0] & BUTTON_A)) + (gGameStatusPtr->curButtons[0] & BUTTON_A)) { charsToPrint = 6; - printer->currentPrintDelay = 0; + printer->curPrintDelay = 0; } } - if ((printer->currentPrintDelay == 0) || --printer->currentPrintDelay == 0) { + if ((printer->curPrintDelay == 0) || --printer->curPrintDelay == 0) { msg_copy_to_print_buffer(printer, charsToPrint, 0); } break; @@ -500,7 +500,7 @@ s32 _update_message(MessagePrintState* printer) { printer->curLinePos += printer->unk_464; if ((printer->stateFlags & MSG_STATE_FLAG_PRINT_QUICKLY) || (!(printer->stateFlags & (MSG_STATE_FLAG_10 | MSG_STATE_FLAG_4)) && - (gGameStatusPtr->currentButtons[0] & BUTTON_A))) + (gGameStatusPtr->curButtons[0] & BUTTON_A))) { printer->curLinePos += 6; } @@ -514,11 +514,11 @@ s32 _update_message(MessagePrintState* printer) { printer->style == MSG_STYLE_LAMPPOST || printer->srcBuffer[printer->srcBufferPos] == MSG_CHAR_READ_WAIT) { - printer->currentPrintDelay = 0; + printer->curPrintDelay = 0; } else { - printer->currentPrintDelay = 5; + printer->curPrintDelay = 5; } - printer->lineEndPos[printer->currentLine] = printer->curLinePos; + printer->lineEndPos[printer->curLine] = printer->curLinePos; } break; case MSG_WINDOW_STATE_B: @@ -559,7 +559,7 @@ s32 _update_message(MessagePrintState* printer) { if (printer->curLinePos >= printer->lineEndPos[printer->unkArraySize]) { printer->curLinePos = printer->lineEndPos[printer->unkArraySize]; printer->windowState = MSG_WINDOW_STATE_C; - if (printer->unkArraySize == printer->currentLine) { + if (printer->unkArraySize == printer->curLine) { printer->windowState = MSG_WINDOW_STATE_WAITING; printer->rewindArrowAnimState = REWIND_ARROW_STATE_INIT; printer->rewindArrowCounter = 0; @@ -717,7 +717,7 @@ void msg_copy_to_print_buffer(MessagePrintState* printer, s32 arg1, s32 arg2) { } break; case MSG_CHAR_READ_PAUSE: - printer->currentPrintDelay = *srcBuf++; + printer->curPrintDelay = *srcBuf++; printer->delayFlags |= MSG_DELAY_FLAG_1; printer->stateFlags &= ~MSG_STATE_FLAG_80; break; @@ -743,8 +743,8 @@ void msg_copy_to_print_buffer(MessagePrintState* printer, s32 arg1, s32 arg2) { break; case MSG_CHAR_READ_NEXT: if (printer->lineCount != 0) { - printer->lineEndPos[printer->currentLine] = printer->curLinePos; - printer->currentLine++; + printer->lineEndPos[printer->curLine] = printer->curLinePos; + printer->curLine++; *printBuf++ = MSG_CHAR_PRINT_NEXT; printer->nextLinePos = printer->curLinePos + (gMsgCharsets[printer->font]->newLineY + D_802EB644[printer->style]) * printer->lineCount; printer->windowState = MSG_WINDOW_STATE_SCROLLING; @@ -922,8 +922,8 @@ void msg_copy_to_print_buffer(MessagePrintState* printer, s32 arg1, s32 arg2) { printer->delayFlags |= MSG_DELAY_FLAG_1; break; case MSG_READ_FUNC_SCROLL: - printer->lineEndPos[printer->currentLine] = printer->curLinePos; - printer->currentLine++; + printer->lineEndPos[printer->curLine] = printer->curLinePos; + printer->curLine++; *printBuf++ = MSG_CHAR_PRINT_NEXT; arg = *srcBuf++; printer->nextLinePos = printer->curLinePos + (gMsgCharsets[printer->font]->newLineY + D_802EB644[printer->style]) * arg; @@ -978,7 +978,7 @@ void msg_copy_to_print_buffer(MessagePrintState* printer, s32 arg1, s32 arg2) { *printBuf++ = MSG_PRINT_FUNC_INLINE_IMAGE; *printBuf++ = *srcBuf++; arg1--; - printer->currentPrintDelay = printer->printDelayTime; + printer->curPrintDelay = printer->printDelayTime; if (arg1 <= 0) { printer->delayFlags |= MSG_DELAY_FLAG_1; } @@ -992,7 +992,7 @@ void msg_copy_to_print_buffer(MessagePrintState* printer, s32 arg1, s32 arg2) { *printBuf++ = *srcBuf++; *printBuf++ = *srcBuf++; *printBuf++ = *srcBuf++; - printer->currentPrintDelay = printer->printDelayTime; + printer->curPrintDelay = printer->printDelayTime; if (--arg1 <= 0) { printer->delayFlags |= MSG_DELAY_FLAG_1; } @@ -1016,7 +1016,7 @@ void msg_copy_to_print_buffer(MessagePrintState* printer, s32 arg1, s32 arg2) { romEnd = icon_ROM_START + gItemIconPaletteOffsets[offset] + 0x20; dma_copy(icon_ROM_START + gItemIconPaletteOffsets[offset], romEnd, D_8015C7E0); - printer->currentPrintDelay = printer->printDelayTime; + printer->curPrintDelay = printer->printDelayTime; if (--arg1 <= 0) { printer->delayFlags |= MSG_DELAY_FLAG_1; } @@ -1025,7 +1025,7 @@ void msg_copy_to_print_buffer(MessagePrintState* printer, s32 arg1, s32 arg2) { } break; case MSG_READ_FUNC_IMAGE: - printer->currentImageIndex = *srcBuf++; + printer->curImageIndex = *srcBuf++; arg = *srcBuf++; argQ = *srcBuf++; printer->varImageScreenPos.x = arg << 8 | argQ; @@ -1092,7 +1092,7 @@ void msg_copy_to_print_buffer(MessagePrintState* printer, s32 arg1, s32 arg2) { sfx_play_sound_with_params(SOUND_MENU_START_TUTORIAL, 0, 0, 0); printer->maxOption = *srcBuf++; printer->madeChoice = 0; - printer->currentOption = 0; + printer->curOption = 0; printer->selectedOption = 0; printer->windowState = MSG_WINDOW_STATE_WAITING_FOR_CHOICE; printer->delayFlags |= MSG_DELAY_FLAG_1; @@ -1233,7 +1233,7 @@ void msg_copy_to_print_buffer(MessagePrintState* printer, s32 arg1, s32 arg2) { if (!(printer->delayFlags & (MSG_DELAY_FLAG_4 | MSG_DELAY_FLAG_2)) && arg1 <= 0) { printer->delayFlags |= MSG_DELAY_FLAG_1; - printer->currentPrintDelay = printer->printDelayTime; + printer->curPrintDelay = printer->printDelayTime; } msg_play_speech_sound(printer, argQ); if (printer->stateFlags & MSG_STATE_FLAG_800000) { @@ -1295,7 +1295,7 @@ void msg_copy_to_print_buffer(MessagePrintState* printer, s32 arg1, s32 arg2) { if (!(printer->delayFlags & (MSG_DELAY_FLAG_4 | MSG_DELAY_FLAG_2)) && arg1 <= 0) { printer->delayFlags |= MSG_DELAY_FLAG_1; - printer->currentPrintDelay = printer->printDelayTime; + printer->curPrintDelay = printer->printDelayTime; } if (!(printer->delayFlags & MSG_DELAY_FLAG_1)) { continue; @@ -1326,7 +1326,7 @@ void initialize_printer(MessagePrintState* printer, s32 arg1, s32 arg2) { printer->unk_464 = 6; printer->srcBuffer = NULL; printer->msgID = 0; - printer->currentPrintDelay = 0; + printer->curPrintDelay = 0; printer->windowOffsetPos.x = 0; printer->windowOffsetPos.y = 0; printer->windowBasePos.x = 0; @@ -1335,11 +1335,11 @@ void initialize_printer(MessagePrintState* printer, s32 arg1, s32 arg2) { printer->rewindArrowCounter = 0; printer->rewindArrowPos.x = 0; printer->rewindArrowPos.y = 0; - printer->currentLine = 0; + printer->curLine = 0; printer->unkArraySize = 0; printer->maxOption = 0; printer->madeChoice = 0; - printer->currentOption = 0; + printer->curOption = 0; printer->selectedOption = 0; printer->cancelOption = -1; printer->windowState = MSG_WINDOW_STATE_DONE; @@ -1356,7 +1356,7 @@ void initialize_printer(MessagePrintState* printer, s32 arg1, s32 arg2) { printer->lineCount = 0; for (i = 0; i < ARRAY_COUNT(printer->animTimers); i++) { - printer->currentAnimFrame[i] = 0; + printer->curAnimFrame[i] = 0; printer->animTimers[i] = -1; } @@ -1377,7 +1377,7 @@ void initialize_printer(MessagePrintState* printer, s32 arg1, s32 arg2) { printer->speedSoundIDA = 0; printer->speedSoundIDB = 0; printer->varBufferReadPos = 0; - printer->currentImageIndex = 0; + printer->curImageIndex = 0; printer->varImageScreenPos.x = 0; printer->varImageScreenPos.y = 0; printer->varImgHasBorder = 0; @@ -2450,7 +2450,7 @@ void appendGfx_message(MessagePrintState* printer, s16 posX, s16 posY, u16 addit msg_drawState->visiblePrintedCount = 0; msg_drawState->centerPos = 0; msg_drawState->fontVariant = 0; - msg_drawState->currentPosX = 0; + msg_drawState->curPosX = 0; msg_drawState->nextPos[0] = 0; msg_drawState->nextPos[1] = 0; msg_drawState->font = 0; @@ -2499,7 +2499,7 @@ void appendGfx_message(MessagePrintState* printer, s16 posX, s16 posY, u16 addit case MSG_CHAR_PRINT_FULL_SPACE: case MSG_CHAR_PRINT_HALF_SPACE: msg_drawState->nextPos[0] += msg_get_draw_char_width(msg_drawState->printBuffer[msg_drawState->drawBufferPos], - msg_drawState->font, msg_drawState->fontVariant, msg_drawState->msgScale.x, msg_drawState->currentPosX, + msg_drawState->font, msg_drawState->fontVariant, msg_drawState->msgScale.x, msg_drawState->curPosX, msg_drawState->printModeFlags); msg_drawState->drawBufferPos++; break; @@ -2983,7 +2983,7 @@ void appendGfx_message(MessagePrintState* printer, s16 posX, s16 posY, u16 addit msg_drawState->drawBufferPos += 2; break; case MSG_PRINT_FUNC_SPACING: - msg_drawState->currentPosX = msg_drawState->printBuffer[msg_drawState->drawBufferPos + 1]; + msg_drawState->curPosX = msg_drawState->printBuffer[msg_drawState->drawBufferPos + 1]; msg_drawState->drawBufferPos += 2; break; case MSG_PRINT_FUNC_SIZE: @@ -3087,7 +3087,7 @@ void appendGfx_message(MessagePrintState* printer, s16 posX, s16 posY, u16 addit printer->animTimers[animIdx] = msg_drawState->printBuffer[msg_drawState->drawBufferPos + 3]; } if (printer->animTimers[animIdx] == 0) { - printer->currentAnimFrame[animIdx]++; + printer->curAnimFrame[animIdx]++; } dbPos = msg_drawState->drawBufferPos; @@ -3095,7 +3095,7 @@ void appendGfx_message(MessagePrintState* printer, s16 posX, s16 posY, u16 addit if ((msg_drawState->printBuffer[dbPos - 1] == MSG_CHAR_PRINT_FUNCTION) && (msg_drawState->printBuffer[dbPos] == MSG_PRINT_FUNC_ANIM_DELAY) && (msg_drawState->printBuffer[dbPos + 1] == animIdx)) { - if (msg_drawState->printBuffer[dbPos + 2] != printer->currentAnimFrame[animIdx]) { + if (msg_drawState->printBuffer[dbPos + 2] != printer->curAnimFrame[animIdx]) { dbPos += 4; } else { break; @@ -3106,7 +3106,7 @@ void appendGfx_message(MessagePrintState* printer, s16 posX, s16 posY, u16 addit (msg_drawState->printBuffer[dbPos + 2] == animIdx)) { if (printer->animTimers[animIdx] == 0) { - printer->currentAnimFrame[animIdx] = msg_drawState->printBuffer[dbPos + 3]; + printer->curAnimFrame[animIdx] = msg_drawState->printBuffer[dbPos + 3]; dbPos = msg_drawState->drawBufferPos; continue; } else { @@ -3364,7 +3364,7 @@ void appendGfx_message(MessagePrintState* printer, s16 posX, s16 posY, u16 addit phi_s2_5 = (f32) phi_s2_5 * 0.35; } if ((printer->windowState == MSG_WINDOW_STATE_WAITING_FOR_CHOICE) && (msg_drawState->printModeFlags & MSG_PRINT_FLAG_20)) { - if (msg_drawState->unk_2D == printer->currentOption) { + if (msg_drawState->unk_2D == printer->curOption) { msg_drawState->effectFlags |= MSG_FX_FLAG_DROP_SHADOW | MSG_FX_FLAG_GLOBAL_RAINBOW | MSG_FX_FLAG_GLOBAL_WAVE; } else { msg_drawState->effectFlags &= ~MSG_FX_FLAG_GLOBAL_RAINBOW; @@ -3598,7 +3598,7 @@ void appendGfx_message(MessagePrintState* printer, s16 posX, s16 posY, u16 addit msg_drawState->nextPos[0] += msg_get_draw_char_width(msg_drawState->printBuffer[msg_drawState->drawBufferPos], msg_drawState->font, msg_drawState->fontVariant, msg_drawState->msgScale.x, - msg_drawState->currentPosX, msg_drawState->printModeFlags); + msg_drawState->curPosX, msg_drawState->printModeFlags); msg_drawState->drawBufferPos++; break; } @@ -3609,7 +3609,7 @@ void appendGfx_message(MessagePrintState* printer, s16 posX, s16 posY, u16 addit s16 varImgFinalAlpha; varImgFinalAlpha = printer->varImgFinalAlpha; - msgVarImage = &(*gMsgVarImages)[printer->currentImageIndex]; + msgVarImage = &(*gMsgVarImages)[printer->curImageIndex]; switch (printer->varImgHasBorder) { case 0: diff --git a/src/npc.c b/src/npc.c index 6b8b05985e..84937150cc 100644 --- a/src/npc.c +++ b/src/npc.c @@ -120,17 +120,17 @@ s32 create_npc_impl(NpcBlueprint* blueprint, AnimID* animList, s32 isPeachNpc) { npc->renderMode = 13; npc->blur.any = NULL; npc->yaw = 0.0f; - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; npc->pos.x = 0.0f; npc->pos.y = 0.0f; npc->pos.z = 0.0f; npc->colliderPos.x = 0.0f; npc->colliderPos.y = 0.0f; npc->colliderPos.z = 0.0f; - npc->rotationPivotOffsetY = 0.0f; - npc->rotation.x = 0.0f; - npc->rotation.y = 0.0f; - npc->rotation.z = 0.0f; + npc->rotPivotOffsetY = 0.0f; + npc->rot.x = 0.0f; + npc->rot.y = 0.0f; + npc->rot.z = 0.0f; npc->homePos.x = 0.0f; npc->homePos.y = 0.0f; npc->homePos.z = 0.0f; @@ -143,7 +143,7 @@ s32 create_npc_impl(NpcBlueprint* blueprint, AnimID* animList, s32 isPeachNpc) { npc->scale.x = 1.0f; npc->scale.y = 1.0f; npc->scale.z = 1.0f; - npc->currentAnim = blueprint->initialAnim; + npc->curAnim = blueprint->initialAnim; npc->animationSpeed = 1.0f; npc->renderYaw = 0.0f; npc->imgfxType = IMGFX_CLEAR; @@ -152,8 +152,8 @@ s32 create_npc_impl(NpcBlueprint* blueprint, AnimID* animList, s32 isPeachNpc) { npc->isFacingAway = FALSE; npc->yawCamOffset = 0; npc->turnAroundYawAdjustment = 0; - npc->currentFloor = NO_COLLIDER; - npc->currentWall = NO_COLLIDER; + npc->curFloor = NO_COLLIDER; + npc->curWall = NO_COLLIDER; npc->palSwapType = 0; npc->palSwapPrevType = 0; npc->screenSpaceOffset2D[0] = 0.0f; @@ -178,9 +178,9 @@ s32 create_npc_impl(NpcBlueprint* blueprint, AnimID* animList, s32 isPeachNpc) { npc->extraAnimList = animList; if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE)) { if (!(npc->flags & NPC_FLAG_PARTNER)) { - npc->spriteInstanceID = spr_load_npc_sprite(npc->currentAnim, animList); + npc->spriteInstanceID = spr_load_npc_sprite(npc->curAnim, animList); } else { - npc->spriteInstanceID = spr_load_npc_sprite(npc->currentAnim | SPRITE_ID_TAIL_ALLOCATE, animList); + npc->spriteInstanceID = spr_load_npc_sprite(npc->curAnim | SPRITE_ID_TAIL_ALLOCATE, animList); } } else { npc->flags |= NPC_FLAG_INVISIBLE; @@ -313,7 +313,7 @@ void npc_do_world_collision(Npc* npc) { if (hit) { npc->flags |= (NPC_FLAG_COLLDING_WITH_WORLD | NPC_FLAG_COLLDING_FORWARD_WITH_WORLD); - npc->currentWall = NpcHitQueryColliderID; + npc->curWall = NpcHitQueryColliderID; npc->pos.x = testX; npc->pos.z = testZ; } else { @@ -470,16 +470,16 @@ s32 npc_do_player_collision(Npc* npc) { return FALSE; } - if (playerStatus->position.y + playerStatus->colliderHeight < npc->pos.y) { + if (playerStatus->pos.y + playerStatus->colliderHeight < npc->pos.y) { return FALSE; } - if (npc->pos.y + npc->collisionHeight < playerStatus->position.y) { + if (npc->pos.y + npc->collisionHeight < playerStatus->pos.y) { return FALSE; } - playerX = playerStatus->position.x; - playerZ = playerStatus->position.z; + playerX = playerStatus->pos.x; + playerZ = playerStatus->pos.z; npcColRadius = npc->collisionDiameter / 2; playerColRadius = playerStatus->colliderDiameter / 2; @@ -514,28 +514,28 @@ s32 npc_do_player_collision(Npc* npc) { if (playerStatus->animFlags & PA_FLAG_RIDING_PARTNER) { if (fabsf(get_clamped_angle_diff(yaw, playerYaw)) < 45.0f) { - playerStatus->position.x -= deltaX; - playerStatus->position.z -= deltaZ; + playerStatus->pos.x -= deltaX; + playerStatus->pos.z -= deltaZ; wPartnerNpc->pos.x -= deltaX; wPartnerNpc->pos.z -= deltaZ; } else { - playerStatus->position.x -= deltaX * 0.5f; - playerStatus->position.z -= deltaZ * 0.5f; + playerStatus->pos.x -= deltaX * 0.5f; + playerStatus->pos.z -= deltaZ * 0.5f; wPartnerNpc->pos.x -= deltaX * 0.5f; wPartnerNpc->pos.z -= deltaZ * 0.5f; } } else { if (playerStatus->flags & (PS_FLAG_JUMPING | PS_FLAG_FALLING)) { - playerStatus->position.x -= deltaX * 0.4f; - playerStatus->position.z -= deltaZ * 0.4f; + playerStatus->pos.x -= deltaX * 0.4f; + playerStatus->pos.z -= deltaZ * 0.4f; } else { dist = get_clamped_angle_diff(yaw, playerYaw); // required to match if (fabsf(dist) < 45.0f) { - playerStatus->position.x -= deltaX; - playerStatus->position.z -= deltaZ; + playerStatus->pos.x -= deltaX; + playerStatus->pos.z -= deltaZ; } else { - playerStatus->position.x -= deltaX * 0.5f; - playerStatus->position.z -= deltaZ * 0.5f; + playerStatus->pos.x -= deltaX * 0.5f; + playerStatus->pos.z -= deltaZ * 0.5f; } } } @@ -562,13 +562,13 @@ void npc_try_apply_gravity(Npc* npc) { } npc->jumpScale = 1.0f; - npc->jumpVelocity -= npc->jumpScale; - npc->pos.y += npc->jumpVelocity; + npc->jumpVel -= npc->jumpScale; + npc->pos.y += npc->jumpVel; x = npc->pos.x; y = npc->pos.y + 13; z = npc->pos.z; - testLength = length = fabsf(npc->jumpVelocity) + 16; + testLength = length = fabsf(npc->jumpVel) + 16; if (!(npc->flags & NPC_FLAG_PARTNER)) { hitID = npc_raycast_down_sides(npc->collisionChannel, &x, &y, &z, &length); @@ -577,10 +577,10 @@ void npc_try_apply_gravity(Npc* npc) { } if (hitID && length <= testLength) { - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; npc->flags |= NPC_FLAG_GROUNDED; npc->pos.y = y; - npc->currentFloor = NpcHitQueryColliderID; + npc->curFloor = NpcHitQueryColliderID; } else { npc->flags &= ~NPC_FLAG_GROUNDED; } @@ -614,7 +614,7 @@ s32 npc_try_snap_to_ground(Npc* npc, f32 velocity) { if (hitID != 0 && length <= testLength) { npc->pos.y = y; - npc->currentFloor = NpcHitQueryColliderID; + npc->curFloor = NpcHitQueryColliderID; npc->flags |= NPC_FLAG_GROUNDED; return TRUE; } @@ -649,8 +649,8 @@ void update_npcs(void) { npc->collisionChannel &= ~COLLISION_IGNORE_ENTITIES; } - npc->currentFloor = NO_COLLIDER; - npc->currentWall = NO_COLLIDER; + npc->curFloor = NO_COLLIDER; + npc->curWall = NO_COLLIDER; npc->flags &= ~(NPC_FLAG_COLLDING_FORWARD_WITH_WORLD | NPC_FLAG_COLLDING_WITH_WORLD); npc_do_world_collision(npc); @@ -664,8 +664,8 @@ void update_npcs(void) { } if ((npc->pos.y < -2000.0f) && !(npc->flags & NPC_FLAG_PARTNER)) { - npc->pos.y = playerStatus->position.y; - npc->jumpVelocity = 0.0f; + npc->pos.y = playerStatus->pos.y; + npc->jumpVel = 0.0f; npc->moveSpeed = 0.0f; npc->jumpScale = 0.0f; npc->flags &= ~NPC_FLAG_JUMPING; @@ -673,14 +673,14 @@ void update_npcs(void) { if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE)) { - if (npc->currentAnim != 0) { + if (npc->curAnim != 0) { if (npc->spriteInstanceID >= 0) { - spr_update_sprite(npc->spriteInstanceID, npc->currentAnim, npc->animationSpeed); + spr_update_sprite(npc->spriteInstanceID, npc->curAnim, npc->animationSpeed); } } } } else { - spr_update_player_sprite(PLAYER_SPRITE_AUX1, npc->currentAnim, npc->animationSpeed); + spr_update_player_sprite(PLAYER_SPRITE_AUX1, npc->curAnim, npc->animationSpeed); } if (npc->flags & NPC_FLAG_HAS_SHADOW) { @@ -707,23 +707,23 @@ void update_npcs(void) { hitLength = 1000.0f; entity_raycast_down(&x, &y, &z, &hitYaw, &hitPitch, &hitLength); set_npc_shadow_scale(shadow, hitLength, npc->collisionDiameter); - shadow->position.x = x; - shadow->position.y = y; - shadow->position.z = z; - shadow->rotation.x = hitYaw; - shadow->rotation.y = npc->renderYaw; - shadow->rotation.z = hitPitch; + shadow->pos.x = x; + shadow->pos.y = y; + shadow->pos.z = z; + shadow->rot.x = hitYaw; + shadow->rot.y = npc->renderYaw; + shadow->rot.z = hitPitch; shadow->scale.x *= npc->shadowScale; npc->flags &= ~NPC_FLAG_DIRTY_SHADOW; } } else { if (npc->flags & NPC_FLAG_DONT_UPDATE_SHADOW_Y) { - shadow->position.x = npc->pos.x; - shadow->position.z = npc->pos.z; + shadow->pos.x = npc->pos.x; + shadow->pos.z = npc->pos.z; } else { - shadow->position.x = npc->pos.x; - shadow->position.y = npc->pos.y; - shadow->position.z = npc->pos.z; + shadow->pos.x = npc->pos.x; + shadow->pos.y = npc->pos.y; + shadow->pos.z = npc->pos.z; } } } @@ -738,9 +738,9 @@ void update_npcs(void) { if (npc->spriteInstanceID < 0) { npc->spriteInstanceID++; if (npc->spriteInstanceID == -1) { - npc->spriteInstanceID = spr_load_npc_sprite(npc->currentAnim, npc->extraAnimList); + npc->spriteInstanceID = spr_load_npc_sprite(npc->curAnim, npc->extraAnimList); ASSERT(npc->spriteInstanceID >= 0); - spr_update_sprite(npc->spriteInstanceID, npc->currentAnim, npc->animationSpeed); + spr_update_sprite(npc->spriteInstanceID, npc->curAnim, npc->animationSpeed); } } } @@ -759,7 +759,7 @@ f32 npc_get_render_yaw(Npc* npc) { s32 direction; if (!(gOverrideFlags & (GLOBAL_OVERRIDES_8000 | GLOBAL_OVERRIDES_4000))) { - cameraYaw = camera->currentYaw; + cameraYaw = camera->curYaw; camRelativeYaw = get_clamped_angle_diff(cameraYaw, npc->yaw); if (camRelativeYaw < -5.0f && camRelativeYaw > -175.0f) { @@ -826,28 +826,28 @@ void appendGfx_npc(void* data) { guMtxCatF(mtx2, mtx1, mtx1); } - if (npc->rotationPivotOffsetY != 0.0f) { - guTranslateF(mtx2, 0.0f, npc->rotationPivotOffsetY, 0.0f); + if (npc->rotPivotOffsetY != 0.0f) { + guTranslateF(mtx2, 0.0f, npc->rotPivotOffsetY, 0.0f); guMtxCatF(mtx2, mtx1, mtx1); } - if (npc->rotation.y != 0.0f) { - guRotateF(mtx2, npc->rotation.y, 0.0f, 1.0f, 0.0f); + if (npc->rot.y != 0.0f) { + guRotateF(mtx2, npc->rot.y, 0.0f, 1.0f, 0.0f); guMtxCatF(mtx2, mtx1, mtx1); } - if (npc->rotation.x != 0.0f) { - guRotateF(mtx2, npc->rotation.x, 1.0f, 0.0f, 0.0f); + if (npc->rot.x != 0.0f) { + guRotateF(mtx2, npc->rot.x, 1.0f, 0.0f, 0.0f); guMtxCatF(mtx2, mtx1, mtx1); } - if (npc->rotation.z != 0.0f) { - guRotateF(mtx2, npc->rotation.z, 0.0f, 0.0f, 1.0f); + if (npc->rot.z != 0.0f) { + guRotateF(mtx2, npc->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(mtx2, mtx1, mtx1); } - if (npc->rotationPivotOffsetY != 0.0f) { - guTranslateF(mtx2, 0.0f, -npc->rotationPivotOffsetY, 0.0f); + if (npc->rotPivotOffsetY != 0.0f) { + guTranslateF(mtx2, 0.0f, -npc->rotPivotOffsetY, 0.0f); guMtxCatF(mtx2, mtx1, mtx1); } @@ -864,7 +864,7 @@ void appendGfx_npc(void* data) { } if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { - if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE) && (npc->currentAnim != 0) && (npc->spriteInstanceID >= 0)) { + if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE) && (npc->curAnim != 0) && (npc->spriteInstanceID >= 0)) { npc_draw_with_palswap(npc, renderYaw, mtx1); npc->animNotifyValue = spr_get_notify_value(npc->spriteInstanceID); } @@ -879,8 +879,8 @@ void appendGfx_npc(void* data) { mtx_ident_mirror_y(mtx2); guMtxCatF(mtx2, mtx1, mtx1); } - if ((npc->rotation.y != 0.0f) || (npc->rotation.x != 0.0f) || (npc->rotation.z != 0.0f)) { - guRotateRPYF(mtx2, npc->rotation.x, npc->rotation.y, npc->rotation.z); + if ((npc->rot.y != 0.0f) || (npc->rot.x != 0.0f) || (npc->rot.z != 0.0f)) { + guRotateRPYF(mtx2, npc->rot.x, npc->rot.y, npc->rot.z); guMtxCatF(mtx2, mtx1, mtx1); } @@ -898,7 +898,7 @@ void appendGfx_npc(void* data) { } if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { - if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE) && (npc->currentAnim != 0)) { + if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE) && (npc->curAnim != 0)) { spr_draw_npc_sprite(npc->spriteInstanceID, renderYaw, 0, 0, mtx1); } } else { @@ -911,8 +911,8 @@ void appendGfx_npc(void* data) { mtx_ident_mirror_y(mtx2); guMtxCatF(mtx2, mtx1, mtx1); - if (npc->rotation.y != 0.0f || npc->rotation.x != 0.0f || npc->rotation.z != 0.0f) { - guRotateRPYF(mtx2, npc->rotation.x, npc->rotation.y, npc->rotation.z); + if (npc->rot.y != 0.0f || npc->rot.x != 0.0f || npc->rot.z != 0.0f) { + guRotateRPYF(mtx2, npc->rot.x, npc->rot.y, npc->rot.z); guMtxCatF(mtx2, mtx1, mtx1); } @@ -928,7 +928,7 @@ void appendGfx_npc(void* data) { guMtxCatF(mtx2, mtx1, mtx1); } if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { - if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE) && (npc->currentAnim != 0)) { + if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE) && (npc->curAnim != 0)) { spr_draw_npc_sprite(npc->spriteInstanceID, renderYaw, 0, 0, mtx1); } } else { @@ -962,7 +962,7 @@ void render_npcs(void) { renderDist = 10000.0f; } - renderTaskPtr->distance = -renderDist; + renderTaskPtr->dist = -renderDist; renderTaskPtr->appendGfxArg = npc; renderTaskPtr->appendGfx = appendGfx_npc; renderTaskPtr->renderMode = npc->renderMode; @@ -980,7 +980,7 @@ void render_npcs(void) { } if (npc->flags & NPC_FLAG_MOTION_BLUR) { - renderTaskPtr->distance = -renderDist; + renderTaskPtr->dist = -renderDist; renderTaskPtr->appendGfx = appendGfx_npc_blur; renderTaskPtr->appendGfxArg = npc; renderTaskPtr->renderMode = RENDER_MODE_SURFACE_XLU_LAYER1; @@ -1063,7 +1063,7 @@ void set_npc_sprite(Npc* npc, s32 anim, AnimID* extraAnimList) { ASSERT(npc->spriteInstanceID >= 0); } - npc->currentAnim = anim; + npc->curAnim = anim; if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE)) { @@ -1157,16 +1157,16 @@ void appendGfx_npc_blur(void* data) { yaw = npc->renderYaw; guTranslateF(sp20, x, y, z); - if (npc->rotation.y != 0.0f) { - guRotateF(sp60, npc->rotation.y, 0.0f, 1.0f, 0.0f); + if (npc->rot.y != 0.0f) { + guRotateF(sp60, npc->rot.y, 0.0f, 1.0f, 0.0f); guMtxCatF(sp60, sp20, sp20); } - if (npc->rotation.x != 0.0f) { - guRotateF(sp60, npc->rotation.y, 0.0f, 1.0f, 0.0f); + if (npc->rot.x != 0.0f) { + guRotateF(sp60, npc->rot.y, 0.0f, 1.0f, 0.0f); guMtxCatF(sp60, sp20, sp20); } - if (npc->rotation.z != 0.0f) { - guRotateF(sp60, npc->rotation.y, 0.0f, 1.0f, 0.0f); + if (npc->rot.z != 0.0f) { + guRotateF(sp60, npc->rot.y, 0.0f, 1.0f, 0.0f); guMtxCatF(sp60, sp20, sp20); } @@ -1217,19 +1217,19 @@ void npc_reload_all(void) { if (npc->flags && !(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE)) { if (!(npc->flags & NPC_FLAG_PARTNER)) { - npc->spriteInstanceID = spr_load_npc_sprite(npc->currentAnim, npc->extraAnimList); + npc->spriteInstanceID = spr_load_npc_sprite(npc->curAnim, npc->extraAnimList); } else { - npc->spriteInstanceID = spr_load_npc_sprite(npc->currentAnim | SPRITE_ID_TAIL_ALLOCATE, npc->extraAnimList); + npc->spriteInstanceID = spr_load_npc_sprite(npc->curAnim | SPRITE_ID_TAIL_ALLOCATE, npc->extraAnimList); } } if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE) && (npc->palSwapType != 0)) { - npc->spritePaletteList = spr_get_npc_palettes(npc->currentAnim >> 16); + npc->spritePaletteList = spr_get_npc_palettes(npc->curAnim >> 16); npc->paletteCount = 0; while (npc->spritePaletteList[npc->paletteCount] != (PAL_PTR) -1) { npc->paletteCount++; } - npc->unk_C0 = spr_get_npc_color_variations(npc->currentAnim >> 16); + npc->unk_C0 = spr_get_npc_color_variations(npc->curAnim >> 16); } if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { if (!(npc->flags & NPC_FLAG_HAS_NO_SPRITE)) { @@ -1248,7 +1248,7 @@ void npc_reload_all(void) { void set_npc_yaw(Npc* npc, f32 yaw) { npc->yaw = yaw; - if (get_clamped_angle_diff(gCameras[gCurrentCameraID].currentYaw, yaw) >= 0.0f) { + if (get_clamped_angle_diff(gCameras[gCurrentCameraID].curYaw, yaw) >= 0.0f) { npc->yawCamOffset = 180; npc->isFacingAway = TRUE; } else { @@ -1349,13 +1349,13 @@ s32 npc_draw_palswap_mode_1(Npc* npc, s32 arg1, Matrix4f mtx) { PAL_PTR dst; if (npc->dirtyPalettes != 0) { - npc->spritePaletteList = spr_get_npc_palettes(npc->currentAnim >> 16); + npc->spritePaletteList = spr_get_npc_palettes(npc->curAnim >> 16); npc->paletteCount = 0; while ((s32)npc->spritePaletteList[npc->paletteCount] != -1) { npc->paletteCount++; } - npc->unk_C0 = spr_get_npc_color_variations(npc->currentAnim >> 16); + npc->unk_C0 = spr_get_npc_color_variations(npc->curAnim >> 16); for (i = 0; i < npc->paletteCount; i++) { dst = npc->localPaletteData[i]; src = npc->spritePaletteList[i]; @@ -1455,7 +1455,7 @@ s32 npc_draw_palswap_mode_2(Npc* npc, s32 arg1, s32 arg2, Matrix4f mtx) { if (npc->dirtyPalettes != 0) { if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { - npc->spritePaletteList = spr_get_npc_palettes(npc->currentAnim >> 16); + npc->spritePaletteList = spr_get_npc_palettes(npc->curAnim >> 16); } npc->paletteCount = 0; @@ -1585,7 +1585,7 @@ s32 npc_draw_palswap_mode_4(Npc* npc, s32 arg1, Matrix4f mtx) { if (npc->dirtyPalettes != 0) { if (!(npc->flags & NPC_FLAG_NO_ANIMS_LOADED)) { - npc->spritePaletteList = spr_get_npc_palettes(npc->currentAnim >> 16); + npc->spritePaletteList = spr_get_npc_palettes(npc->curAnim >> 16); } npc->paletteCount = 0; @@ -2015,7 +2015,7 @@ Npc* npc_find_closest_simple(f32 x, f32 y, f32 z, f32 radius) { s32 npc_find_standing_on_entity(s32 entityIndex) { s32 idx = entityIndex | COLLISION_WITH_ENTITY_BIT; - s32 y = get_entity_by_index(idx)->position.y - 10.0f; + s32 y = get_entity_by_index(idx)->pos.y - 10.0f; Npc* npc; s32 i; s32 var_v1; @@ -2048,8 +2048,8 @@ s32 npc_find_standing_on_entity(s32 entityIndex) { } } } else { - var_v1 = npc->currentFloor; - if (npc->currentFloor & COLLISION_WITH_ENTITY_BIT) { // TODO required to match (can't use var_v1) + var_v1 = npc->curFloor; + if (npc->curFloor & COLLISION_WITH_ENTITY_BIT) { // TODO required to match (can't use var_v1) if (idx == var_v1) { npc->pos = npc->pos; // TODO required to match return i; @@ -2068,7 +2068,7 @@ s32 npc_get_collider_below(Npc* npc) { f32 yaw; if (npc->flags & NPC_FLAG_PARTNER) { - y = get_shadow_by_index(npc->shadowIndex)->position.y + 13.0f; + y = get_shadow_by_index(npc->shadowIndex)->pos.y + 13.0f; } else { y = npc->pos.y + 13.0f; } @@ -2171,7 +2171,7 @@ void spawn_surface_effects(Npc* npc, SurfaceInteractMode mode) { if ((npc->flags & (NPC_FLAG_TOUCHES_GROUND | NPC_FLAG_INVISIBLE)) == NPC_FLAG_TOUCHES_GROUND) { if (npc->moveSpeed != 0.0f) { - s32 surfaceType = get_collider_flags((u16)npc->currentFloor) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; + s32 surfaceType = get_collider_flags((u16)npc->curFloor) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; switch (surfaceType) { case SURFACE_TYPE_FLOWERS: spawn_flower_surface_effects(npc, mode); @@ -2455,9 +2455,9 @@ void clear_encounter_status(void) { currentEncounter->firstStrikeType = FIRST_STRIKE_NONE; currentEncounter->hitType = 0; currentEncounter->battleTriggerCooldown = 0; - currentEncounter->currentAreaIndex = gGameStatusPtr->areaID; - currentEncounter->currentMapIndex = gGameStatusPtr->mapID; - currentEncounter->currentEntryIndex = gGameStatusPtr->entryID; + currentEncounter->curAreaIndex = gGameStatusPtr->areaID; + currentEncounter->curMapIndex = gGameStatusPtr->mapID; + currentEncounter->curEntryIndex = gGameStatusPtr->entryID; currentEncounter->npcGroupList = 0; currentEncounter->unk_08 = 0; currentEncounter->scriptedBattle = FALSE; @@ -2630,7 +2630,7 @@ void kill_enemy(Enemy* enemy) { do { if (!(enemy->flags & ENEMY_FLAG_4) - && (!(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || (enemy == encounterStatus->currentEnemy)) + && (!(enemy->flags & ENEMY_FLAG_ENABLE_HIT_SCRIPT) || (enemy == encounterStatus->curEnemy)) && !(enemy->flags & ENEMY_FLAG_PASSIVE) ) { if (!(enemy->flags & ENEMY_FLAG_FLED)) { diff --git a/src/pause/pause_partners.c b/src/pause/pause_partners.c index 55ea327e72..45f2ece65c 100644 --- a/src/pause/pause_partners.c +++ b/src/pause/pause_partners.c @@ -628,7 +628,7 @@ void pause_partners_init(MenuPanel* panel) { gPausePartnersCurrentPartnerIdx = 0; for (i = 0; i < gPausePartnersNumPartners; i++) { - if (playerData->currentPartner == gPausePartnersPartnerIDs[gPausePartnersPartnerIdx[i]]) { + if (playerData->curPartner == gPausePartnersPartnerIDs[gPausePartnersPartnerIdx[i]]) { gPausePartnersCurrentPartnerIdx = i; break; } diff --git a/src/pulse_stone.c b/src/pulse_stone.c index 2eec47b177..f7d6733c7f 100644 --- a/src/pulse_stone.c +++ b/src/pulse_stone.c @@ -70,9 +70,9 @@ void pulse_stone_notification_setup(void) { PlayerStatus* playerStatus = &gPlayerStatus; mem_clear(PulseStonePtr, sizeof(*PulseStonePtr)); - PulseStonePtr->pos.x = playerStatus->position.x; - PulseStonePtr->pos.y = playerStatus->position.y + playerStatus->colliderHeight + 8.0f; - PulseStonePtr->pos.z = playerStatus->position.z; + PulseStonePtr->pos.x = playerStatus->pos.x; + PulseStonePtr->pos.y = playerStatus->pos.y + playerStatus->colliderHeight + 8.0f; + PulseStonePtr->pos.z = playerStatus->pos.z; playerStatus->animFlags |= PA_FLAG_PULSE_STONE_VISIBLE; PulseStoneNotificationCallback = pulse_stone_notification_update; } @@ -86,7 +86,7 @@ void appendGfx_pulse_stone_icon(void) { if (playerStatus->animFlags & PA_FLAG_PULSE_STONE_VISIBLE) { guScaleF(sp18, PulseStonePtr->scale, PulseStonePtr->scale, PulseStonePtr->scale); - guRotateF(sp58, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(sp18, sp58, sp18); guTranslateF(sp58, PulseStonePtr->pos.x, PulseStonePtr->pos.y, PulseStonePtr->pos.z); guMtxCatF(sp18, sp58, sp58); @@ -153,9 +153,9 @@ void pulse_stone_notification_update(void) { PlayerStatus* playerStatus = &gPlayerStatus; PulseStonePtr->pos.y += - ((playerStatus->position.y + playerStatus->colliderHeight + 10.0f) - PulseStonePtr->pos.y) / 1.5f; - PulseStonePtr->pos.x = playerStatus->position.x; - PulseStonePtr->pos.z = playerStatus->position.z; + ((playerStatus->pos.y + playerStatus->colliderHeight + 10.0f) - PulseStonePtr->pos.y) / 1.5f; + PulseStonePtr->pos.x = playerStatus->pos.x; + PulseStonePtr->pos.z = playerStatus->pos.z; if (!should_continue_pulse_stone()) { PulseStoneNotificationCallback = NULL; diff --git a/src/rumble.c b/src/rumble.c index 765fc4f541..d813af32ab 100644 --- a/src/rumble.c +++ b/src/rumble.c @@ -32,8 +32,8 @@ void start_rumble(s32 freq, s32 nframes) { } void update_max_rumble_duration(void) { - if (rumbleButtons != gGameStatusPtr->currentButtons[0]) { - rumbleButtons = gGameStatusPtr->currentButtons[0]; + if (rumbleButtons != gGameStatusPtr->curButtons[0]) { + rumbleButtons = gGameStatusPtr->curButtons[0]; reset_max_rumble_duration(); } diff --git a/src/speech_bubble.c b/src/speech_bubble.c index 0def59631e..a56d7a7c06 100644 --- a/src/speech_bubble.c +++ b/src/speech_bubble.c @@ -40,7 +40,7 @@ void interact_speech_setup(void) { temp = SpeechBubblePtr; temp->state = 0; temp->scale = 0.4f; - SpeechBubblePtr->yaw = -gCameras[gCurrentCameraID].currentYaw; + SpeechBubblePtr->yaw = -gCameras[gCurrentCameraID].curYaw; SpeechBubblePtr->brightness = 255; } @@ -50,7 +50,7 @@ void appendGfx_speech_bubble(void) { if (gPlayerStatus.animFlags & PA_FLAG_SPEECH_PROMPT_AVAILABLE) { guScaleF(mtxTemp, SpeechBubblePtr->scale, SpeechBubblePtr->scale, SpeechBubblePtr->scale); - guRotateF(mtxTransform, SpeechBubblePtr->yaw - gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(mtxTransform, SpeechBubblePtr->yaw - gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(mtxTemp, mtxTransform, mtxTemp); guTranslateF(mtxTransform, SpeechBubblePtr->pos.x, SpeechBubblePtr->pos.y, SpeechBubblePtr->pos.z); guMtxCatF(mtxTemp, mtxTransform, mtxTransform); diff --git a/src/sprite.c b/src/sprite.c index 242b246eba..cd425c7f6a 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -437,7 +437,7 @@ void spr_draw_component(s32 drawOpts, SpriteComponent* component, SpriteAnimComp f32 rotX, rotY, rotZ; f32 inX, inY, inZ; - if (component->initialized && component->currentRaster != -1) { + if (component->initialized && component->curRaster != -1) { rotX = D_802DFEA0[0]; rotY = D_802DFEA0[1]; rotZ = D_802DFEA0[2]; @@ -446,10 +446,10 @@ void spr_draw_component(s32 drawOpts, SpriteComponent* component, SpriteAnimComp inZ = component->compPos.z + anim->compOffset.z; spr_transform_point(rotX, rotY, rotZ, inX, inY, inZ * zscale, &dx, &dy, &dz); - cacheEntry = cache[component->currentRaster]; - paletteIdx = component->currentPalette; + cacheEntry = cache[component->curRaster]; + paletteIdx = component->curPalette; if (drawOpts & DRAW_SPRITE_USE_PLAYER_RASTERS) { - cacheEntry->image = spr_get_player_raster(component->currentRaster & 0xFFF, D_802DF57C); + cacheEntry->image = spr_get_player_raster(component->curRaster & 0xFFF, D_802DF57C); } D_802DF540 = component->imgfxIdx; pal = palettes[paletteIdx]; @@ -457,9 +457,9 @@ void spr_draw_component(s32 drawOpts, SpriteComponent* component, SpriteAnimComp spr_appendGfx_component( cacheEntry, dx, dy, dz, - rotX + component->rotation.x, - rotY + component->rotation.y, - rotZ + component->rotation.z, + rotX + component->rot.x, + rotY + component->rot.y, + rotZ + component->rot.z, component->scale.x, component->scale.y, component->scale.z, @@ -528,9 +528,9 @@ void spr_component_update_commands(SpriteComponent* comp, SpriteAnimComponent* a comp->posOffset.z = 0.0f; comp->posOffset.y = 0.0f; comp->posOffset.x = 0.0f; - comp->rotation.z = 0; - comp->rotation.y = 0; - comp->rotation.x = 0; + comp->rot.z = 0; + comp->rot.y = 0; + comp->rot.x = 0; comp->scale.z = 1.0f; comp->scale.y = 1.0f; comp->scale.x = 1.0f; @@ -550,20 +550,20 @@ void spr_component_update_commands(SpriteComponent* comp, SpriteAnimComponent* a case 0x1000: cmdValue = *bufPos++ & 0xFFF; if (cmdValue != 0xFFF) { - comp->currentRaster = cmdValue; + comp->curRaster = cmdValue; } else { - comp->currentRaster = -1; + comp->curRaster = -1; } - comp->currentPalette = -1; + comp->curPalette = -1; break; // 6VVV // SetPalette -- FFF to clear case 0x6000: cmdValue = *bufPos++ & 0xFFF; if (cmdValue != 0xFFF) { - comp->currentPalette = cmdValue; + comp->curPalette = cmdValue; } else { - comp->currentPalette = -1; + comp->curPalette = -1; } break; // 8VUU @@ -653,9 +653,9 @@ void spr_component_update_commands(SpriteComponent* comp, SpriteAnimComponent* a comp->posOffset.z = posZ; } if (changedFlags & 2) { - comp->rotation.x = rotX; - comp->rotation.y = rotY; - comp->rotation.z = rotZ; + comp->rot.x = rotX; + comp->rot.y = rotY; + comp->rot.z = rotZ; } if (changedFlags & 4) { comp->scale.x = scaleX; @@ -683,12 +683,12 @@ void spr_component_update_finish(SpriteComponent* comp, SpriteComponent** compLi comp->compPos.z += listComp->compPos.z; } - if (comp->currentRaster != -1) { - cache = rasterCacheEntry[comp->currentRaster]; - if (comp->currentPalette == -1) { - comp->currentPalette = cache->palette; - if (overridePalette != 0 && comp->currentPalette == 0) { - comp->currentPalette = overridePalette; + if (comp->curRaster != -1) { + cache = rasterCacheEntry[comp->curRaster]; + if (comp->curPalette == -1) { + comp->curPalette = cache->palette; + if (overridePalette != 0 && comp->curPalette == 0) { + comp->curPalette = overridePalette; } } } @@ -728,17 +728,17 @@ void spr_init_component_anim_state(SpriteComponent* comp, SpriteAnimComponent* a comp->readPos = anim->cmdList; comp->waitTime = 0; comp->loopCounter = 0; - comp->currentRaster = -1; - comp->currentPalette = -1; + comp->curRaster = -1; + comp->curPalette = -1; comp->posOffset.x = 0.0f; comp->posOffset.y = 0.0f; comp->posOffset.z = 0.0f; comp->compPos.x = 0.0f; comp->compPos.y = 0.0f; comp->compPos.z = 0.0f; - comp->rotation.x = 0.0f; - comp->rotation.y = 0.0f; - comp->rotation.z = 0.0f; + comp->rot.x = 0.0f; + comp->rot.y = 0.0f; + comp->rot.z = 0.0f; comp->scale.x = 1.0f; comp->scale.y = 1.0f; comp->scale.z = 1.0f; @@ -810,7 +810,7 @@ void spr_init_sprites(s32 playerSpriteSet) { SpriteInstances[i].spriteIndex = 0; SpriteInstances[i].componentList = NULL; SpriteInstances[i].spriteData = NULL; - SpriteInstances[i].currentAnimID = -1; + SpriteInstances[i].curAnimID = -1; SpriteInstances[i].notifyValue = 0; } @@ -920,7 +920,7 @@ s32 spr_draw_player_sprite(s32 spriteInstanceID, s32 yaw, s32 alphaIn, PAL_PTR* } if (!(spriteInstanceID & DRAW_SPRITE_OVERRIDE_YAW)) { - yaw += (s32)-gCameras[gCurrentCamID].currentYaw; + yaw += (s32)-gCameras[gCurrentCamID].curYaw; if (yaw > 360) { yaw -= 360; } @@ -1071,7 +1071,7 @@ s32 spr_load_npc_sprite(s32 animID, u32* extraAnimList) { compList++; } SpriteInstances[listIndex].spriteIndex = spriteIndex; - SpriteInstances[listIndex].currentAnimID = -1; + SpriteInstances[listIndex].curAnimID = -1; return listIndex; } @@ -1094,9 +1094,9 @@ s32 spr_update_sprite(s32 spriteInstanceID, s32 animID, f32 timeScale) { palID = (animID >> 8) & 0xFF; spr_set_anim_timescale(timeScale); - if ((spriteInstanceID & DRAW_SPRITE_OVERRIDE_ALPHA) || ((SpriteInstances[i].currentAnimID & 0xFF) != animIndex)) { + if ((spriteInstanceID & DRAW_SPRITE_OVERRIDE_ALPHA) || ((SpriteInstances[i].curAnimID & 0xFF) != animIndex)) { spr_init_anim_state(compList, animList); - SpriteInstances[i].currentAnimID = (palID << 8) | animIndex; + SpriteInstances[i].curAnimID = (palID << 8) | animIndex; SpriteInstances[i].notifyValue = 0; } if (!(spriteInstanceID & DRAW_SPRITE_OVERRIDE_YAW)) { @@ -1108,7 +1108,7 @@ s32 spr_update_sprite(s32 spriteInstanceID, s32 animID, f32 timeScale) { s32 spr_draw_npc_sprite(s32 spriteInstanceID, s32 yaw, s32 arg2, PAL_PTR* paletteList, Matrix4f mtx) { s32 i = spriteInstanceID & 0xFF; - s32 animID = SpriteInstances[i].currentAnimID; + s32 animID = SpriteInstances[i].curAnimID; SpriteRasterCacheEntry** rasters; PAL_PTR* palettes; SpriteAnimComponent** animComponents; @@ -1135,7 +1135,7 @@ s32 spr_draw_npc_sprite(s32 spriteInstanceID, s32 yaw, s32 arg2, PAL_PTR* palett D_802DFEA0[2] = 0; if (!(spriteInstanceID & DRAW_SPRITE_OVERRIDE_YAW)) { - yaw += gCameras[gCurrentCamID].currentYaw; + yaw += gCameras[gCurrentCamID].curYaw; if (yaw > 360) { yaw -= 360; } @@ -1214,7 +1214,7 @@ s32 spr_free_sprite(s32 spriteInstanceID) { SpriteInstances[spriteInstanceID].spriteIndex = 0; SpriteInstances[spriteInstanceID].componentList = NULL; SpriteInstances[spriteInstanceID].spriteData = NULL; - SpriteInstances[spriteInstanceID].currentAnimID = -1; + SpriteInstances[spriteInstanceID].curAnimID = -1; return 0; } @@ -1272,7 +1272,7 @@ s32 spr_get_comp_position(s32 spriteIdx, s32 compListIdx, s32* outX, s32* outY, return; // bug: does not return a value } - animID = sprite->currentAnimID; + animID = sprite->curAnimID; if (animID != 255) { // following 3 lines equivalent to: // animCompList = sprite->spriteData->animListStart[animID]; diff --git a/src/sprite.h b/src/sprite.h index 05b18e3498..0f66c7c581 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -40,11 +40,11 @@ typedef struct SpriteComponent { /* 0x08 */ s16* readPos; /* 0x0C */ f32 waitTime; /* 0x10 */ s32 loopCounter; - /* 0x14 */ s32 currentRaster; - /* 0x18 */ s32 currentPalette; + /* 0x14 */ s32 curRaster; + /* 0x18 */ s32 curPalette; /* 0x1C */ Vec3f posOffset; /* 0x28 */ Vec3f compPos; - /* 0x34 */ Vec3i rotation; + /* 0x34 */ Vec3i rot; /* 0x40 */ Vec3f scale; /* 0x4C */ s32 imgfxIdx; } SpriteComponent; // size = 0x50 @@ -83,7 +83,7 @@ typedef struct SpriteInstance { /* 0x00 */ s32 spriteIndex; /* 0x04 */ SpriteComponent** componentList; /* 0x08 */ SpriteAnimData* spriteData; - /* 0x0C */ s32 currentAnimID; + /* 0x0C */ s32 curAnimID; /* 0x10 */ s32 notifyValue; } SpriteInstance; // size = 0x14 diff --git a/src/state_battle.c b/src/state_battle.c index ef85d15991..ceee4d039e 100644 --- a/src/state_battle.c +++ b/src/state_battle.c @@ -176,7 +176,7 @@ void state_step_end_battle(void) { void* mapShape; u32 sizeTemp; - partner_init_after_battle(playerData->currentPartner); + partner_init_after_battle(playerData->curPartner); load_map_script_lib(); mapShape = load_asset_by_name(wMapShapeName, &sizeTemp); decode_yay0(mapShape, &gMapShapeData); diff --git a/src/state_demo.c b/src/state_demo.c index 86f7f99f8b..72ed95d370 100644 --- a/src/state_demo.c +++ b/src/state_demo.c @@ -229,7 +229,7 @@ void state_step_demo(void) { gGameStatusPtr->mapID = mapID; gGameStatusPtr->entryID = demoSceneData->index; gGameStatusPtr->peachFlags = 0; - playerData->currentPartner = demoSceneData->partnerID; + playerData->curPartner = demoSceneData->partnerID; set_cam_viewport(0, 29, 20, -262, 177); evt_set_variable(NULL, GB_StoryProgress, demoSceneData->storyProgress); @@ -247,7 +247,7 @@ void state_step_demo(void) { gGameStatusPtr->mapID = mapID; gGameStatusPtr->entryID = demoSceneData->index; gGameStatusPtr->peachFlags = PEACH_STATUS_FLAG_IS_PEACH; - playerData->currentPartner = demoSceneData->partnerID; + playerData->curPartner = demoSceneData->partnerID; set_cam_viewport(0, 29, 20, -262, 177); evt_set_variable(NULL, GB_StoryProgress, demoSceneData->storyProgress); diff --git a/src/state_intro.c b/src/state_intro.c index f1ddd1f2fc..73875a3581 100644 --- a/src/state_intro.c +++ b/src/state_intro.c @@ -195,7 +195,7 @@ void state_step_intro(void) { playerData->partners[i].enabled = 0; } - playerData->currentPartner = PARTNER_NONE; + playerData->curPartner = PARTNER_NONE; load_map_by_IDs(gGameStatusPtr->areaID, gGameStatusPtr->mapID, 0); gGameStatusPtr->introState = INTRO_STATE_3; disable_player_input(); diff --git a/src/status_icons.c b/src/status_icons.c index 42d324c64b..4ce4a14c9d 100644 --- a/src/status_icons.c +++ b/src/status_icons.c @@ -622,7 +622,7 @@ void draw_all_status_icons(void* data) { y = icon->worldPos.y + icon->status1OffsetY; z = icon->worldPos.z; - add_vec2D_polar(&x, &z, icon->status1Radius, clamp_angle(camera->currentYaw + 90)); + add_vec2D_polar(&x, &z, icon->status1Radius, clamp_angle(camera->curYaw + 90)); get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ); elementId = icon->status1.activeElementID; hud_element_set_render_pos(elementId, screenX - 8, screenY - 8); @@ -643,7 +643,7 @@ void draw_all_status_icons(void* data) { y = icon->worldPos.y + icon->status1OffsetY; z = icon->worldPos.z; - add_vec2D_polar(&x, &z, icon->status1Radius, clamp_angle(camera->currentYaw + 90)); + add_vec2D_polar(&x, &z, icon->status1Radius, clamp_angle(camera->curYaw + 90)); get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ); elementId = icon->status1.removingElementID; hud_element_set_render_pos(elementId, screenX - 8, screenY - 8); @@ -666,7 +666,7 @@ void draw_all_status_icons(void* data) { y = icon->worldPos.y + icon->status2OffsetY + offsetY; z = icon->worldPos.z; - add_vec2D_polar(&x, &z, icon->status2Radius, clamp_angle(camera->currentYaw + 90)); + add_vec2D_polar(&x, &z, icon->status2Radius, clamp_angle(camera->curYaw + 90)); get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ); elementId = icon->status2.activeElementID; hud_element_set_render_pos(elementId, screenX - 8, screenY - 8); @@ -692,7 +692,7 @@ void draw_all_status_icons(void* data) { y = icon->worldPos.y + icon->status2OffsetY + offsetY; z = icon->worldPos.z; - add_vec2D_polar(&x, &z, icon->status2Radius, clamp_angle(camera->currentYaw + 90)); + add_vec2D_polar(&x, &z, icon->status2Radius, clamp_angle(camera->curYaw + 90)); get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ); elementId = icon->status2.removingElementID; hud_element_set_render_pos(elementId, screenX - 8, screenY - 8); @@ -717,7 +717,7 @@ void draw_all_status_icons(void* data) { y = icon->worldPos.y + icon->status3OffsetY + offsetY; z = icon->worldPos.z; - add_vec2D_polar(&x, &z, icon->status3Radius, clamp_angle(camera->currentYaw + 90)); + add_vec2D_polar(&x, &z, icon->status3Radius, clamp_angle(camera->curYaw + 90)); get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ); elementId = icon->status3.activeElementID; hud_element_set_render_pos(elementId, screenX - 8, screenY - 8); @@ -745,7 +745,7 @@ void draw_all_status_icons(void* data) { y = icon->worldPos.y + icon->status3OffsetY + offsetY; z = icon->worldPos.z; - add_vec2D_polar(&x, &z, icon->status3Radius, clamp_angle(camera->currentYaw + 90)); + add_vec2D_polar(&x, &z, icon->status3Radius, clamp_angle(camera->curYaw + 90)); get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ); elementId = icon->status3.removingElementID; hud_element_set_render_pos(elementId, screenX - 8, screenY - 8); @@ -774,7 +774,7 @@ void draw_all_status_icons(void* data) { y = icon->worldPos.y + icon->status4OffsetY + offsetY; z = icon->worldPos.z; - add_vec2D_polar(&x, &z, icon->status4Radius, clamp_angle(camera->currentYaw + 90)); + add_vec2D_polar(&x, &z, icon->status4Radius, clamp_angle(camera->curYaw + 90)); get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ); elementId = icon->status4.activeElementID; hud_element_set_render_pos(elementId, screenX - 8, screenY - 8); @@ -805,7 +805,7 @@ void draw_all_status_icons(void* data) { y = icon->worldPos.y + icon->status4OffsetY + offsetY; z = icon->worldPos.z; - add_vec2D_polar(&x, &z, icon->status4Radius, clamp_angle(camera->currentYaw + 90)); + add_vec2D_polar(&x, &z, icon->status4Radius, clamp_angle(camera->curYaw + 90)); get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ); elementId = icon->status4.removingElementID; hud_element_set_render_pos(elementId, screenX - 8, screenY - 8); diff --git a/src/trigger.c b/src/trigger.c index 209965d8bb..f144480b3e 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -25,14 +25,14 @@ void clear_trigger_data(void) { gTriggerCount = 0; collisionStatus->pushingAgainstWall = NO_COLLIDER; - collisionStatus->currentFloor = NO_COLLIDER; + collisionStatus->curFloor = NO_COLLIDER; collisionStatus->lastTouchedFloor = NO_COLLIDER; - collisionStatus->currentCeiling = NO_COLLIDER; - collisionStatus->currentInspect = NO_COLLIDER; + collisionStatus->curCeiling = NO_COLLIDER; + collisionStatus->curInspect = NO_COLLIDER; collisionStatus->unk_0C = -1; collisionStatus->unk_0E = -1; collisionStatus->unk_10 = -1; - collisionStatus->currentWall = NO_COLLIDER; + collisionStatus->curWall = NO_COLLIDER; collisionStatus->lastWallHammered = NO_COLLIDER; collisionStatus->touchingWallTrigger = 0; collisionStatus->bombetteExploded = -1; @@ -109,7 +109,7 @@ void update_triggers(void) { } if (listTrigger->flags.flags & TRIGGER_WALL_PUSH) { - if (listTrigger->location.colliderID == collisionStatus->currentWall) { + if (listTrigger->location.colliderID == collisionStatus->curWall) { func_800E06C0(1); } if (listTrigger->location.colliderID == collisionStatus->pushingAgainstWall) { @@ -120,7 +120,7 @@ void update_triggers(void) { } if (listTrigger->flags.flags & TRIGGER_FLOOR_TOUCH) { - if (listTrigger->location.colliderID != collisionStatus->currentFloor) { + if (listTrigger->location.colliderID != collisionStatus->curFloor) { continue; } } @@ -132,16 +132,16 @@ void update_triggers(void) { } if (listTrigger->flags.flags & TRIGGER_WALL_PRESS_A) { - if (listTrigger->location.colliderID == collisionStatus->currentWall) { + if (listTrigger->location.colliderID == collisionStatus->curWall) { collisionStatus->touchingWallTrigger = 1; } - if ((listTrigger->location.colliderID != collisionStatus->currentInspect) || !phys_can_player_interact()) { + if ((listTrigger->location.colliderID != collisionStatus->curInspect) || !phys_can_player_interact()) { continue; } } if (listTrigger->flags.flags & TRIGGER_WALL_TOUCH) { - if (listTrigger->location.colliderID != collisionStatus->currentWall) { + if (listTrigger->location.colliderID != collisionStatus->curWall) { continue; } } @@ -153,7 +153,7 @@ void update_triggers(void) { } if (listTrigger->flags.flags & TRIGGER_FLOOR_PRESS_A) { - if ((listTrigger->location.colliderID != collisionStatus->currentFloor) || + if ((listTrigger->location.colliderID != collisionStatus->curFloor) || !(gGameStatusPtr->pressedButtons[0] & BUTTON_A) || (gPlayerStatus.flags & PS_FLAG_INPUT_DISABLED)) { continue; } @@ -166,7 +166,7 @@ void update_triggers(void) { } if (listTrigger->flags.flags & TRIGGER_CEILING_TOUCH) { - if (listTrigger->location.colliderID != collisionStatus->currentCeiling) { + if (listTrigger->location.colliderID != collisionStatus->curCeiling) { continue; } } diff --git a/src/world/action/hammer.c b/src/world/action/hammer.c index d17e977fbe..d79fee68bb 100644 --- a/src/world/action/hammer.c +++ b/src/world/action/hammer.c @@ -75,9 +75,9 @@ void action_hammer_play_hit_fx(s32 hitID) { if (hitID < 0) { numParticles = 6; - x = playerStatus->position.x + sinTheta; - y = playerStatus->position.y; - z = playerStatus->position.z + cosTheta; + x = playerStatus->pos.x + sinTheta; + y = playerStatus->pos.y; + z = playerStatus->pos.z + cosTheta; } else { numParticles = 3; x = HammerHit->hitPos.x + sinTheta; @@ -128,7 +128,7 @@ s32 func_802B62A4_E25174(void) { // first attempt yaw = func_800E5348(); if (action_hammer_is_swinging_away(playerStatus->trueAnimation)) { - angle = clamp_angle(yaw + 90.0f - gCameras[gCurrentCameraID].currentYaw); + angle = clamp_angle(yaw + 90.0f - gCameras[gCurrentCameraID].curYaw); if (angle >= 90.0f && angle < 270.0f) { yaw += -30.0f; } else { @@ -137,9 +137,9 @@ s32 func_802B62A4_E25174(void) { } sin_cos_rad(DEG_TO_RAD(yaw), &outSinTheta, &outCosTheta); - playerX = playerStatus->position.x; - playerY = playerStatus->position.y; - playerZ = playerStatus->position.z; + playerX = playerStatus->pos.x; + playerY = playerStatus->pos.y; + playerZ = playerStatus->pos.z; for (i = 1; i < 16; i++) { x = playerX + (outSinTheta * i); @@ -158,7 +158,7 @@ s32 func_802B62A4_E25174(void) { if (i >= 16) { yaw = func_800E5348(); if (!action_hammer_is_swinging_away(playerStatus->trueAnimation)) { - angle = clamp_angle(yaw + 90.0f - gCameras[gCurrentCameraID].currentYaw); + angle = clamp_angle(yaw + 90.0f - gCameras[gCurrentCameraID].curYaw); if (angle >= 90.0f && angle < 270.0f) { yaw += 15.0f; } else { @@ -238,7 +238,7 @@ void action_update_hammer(void) { playerStatus->flags |= PS_FLAG_NO_FLIPPING; HammerHit->timer = 0; playerStatus->actionSubstate = SUBSTATE_HAMMER_0; - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; playerStatus->animNotifyValue = 0; HammerHit->hitID = func_802B62A4_E25174(); @@ -305,7 +305,7 @@ void func_802B6820_E256F0(void) { yaw = func_800E5348(); if (action_hammer_is_swinging_away(playerStatus->trueAnimation)) { - angle = clamp_angle(yaw + 90.0f - gCameras[gCurrentCameraID].currentYaw); + angle = clamp_angle(yaw + 90.0f - gCameras[gCurrentCameraID].curYaw); if (angle >= 90.0f && angle < 270.0f) { yaw += -30.0f; } else { @@ -314,9 +314,9 @@ void func_802B6820_E256F0(void) { } sin_cos_rad(DEG_TO_RAD(yaw), &outSinTheta, &outCosTheta); - playerX = playerStatus->position.x; - playerY = playerStatus->position.y; - playerZ = playerStatus->position.z; + playerX = playerStatus->pos.x; + playerY = playerStatus->pos.y; + playerZ = playerStatus->pos.z; // check collision allong 16 points in a line away from the player for (i = 1; i < 16; i++) { @@ -341,7 +341,7 @@ void func_802B6820_E256F0(void) { if (i >= 16) { yaw = func_800E5348(); if (action_hammer_is_swinging_away(playerStatus->trueAnimation) == 0) { - angle = clamp_angle(yaw + 90.0f - gCameras[gCurrentCameraID].currentYaw); + angle = clamp_angle(yaw + 90.0f - gCameras[gCurrentCameraID].curYaw); if (angle >= 90.0f && angle < 270.0f) { yaw += 15.0f; } else { @@ -392,7 +392,7 @@ void func_802B6820_E256F0(void) { if (HammerHit->hitID < 0 && gPlayerData.hammerLevel >= 2) { gCurrentHiddenPanels.tryFlipTrigger = TRUE; - gCurrentHiddenPanels.flipTriggerPosY = playerStatus->position.y; + gCurrentHiddenPanels.flipTriggerPosY = playerStatus->pos.y; } } diff --git a/src/world/action/hit_fire.c b/src/world/action/hit_fire.c index 71c92f8de0..bb0596d3c8 100644 --- a/src/world/action/hit_fire.c +++ b/src/world/action/hit_fire.c @@ -27,26 +27,26 @@ void action_update_hit_fire(void) { playerStatus->gravityIntegrator[2] = 0.8059f; playerStatus->gravityIntegrator[3] = -0.0987f; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_IGNORE_PLAYER_Y; - ReturnAngle = atan2(playerStatus->position.x, playerStatus->position.z, playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z); - playerStatus->currentSpeed = get_xz_dist_to_player(playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z) / 18.0f; + ReturnAngle = atan2(playerStatus->pos.x, playerStatus->pos.z, playerStatus->lastGoodPos.x, playerStatus->lastGoodPos.z); + playerStatus->curSpeed = get_xz_dist_to_player(playerStatus->lastGoodPos.x, playerStatus->lastGoodPos.z) / 18.0f; subtract_hp(1); open_status_bar_long(); gOverrideFlags |= GLOBAL_OVERRIDES_40; } sin_cos_rad(DEG_TO_RAD(ReturnAngle), &dx, &dy); - speed = playerStatus->currentSpeed; + speed = playerStatus->curSpeed; if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) { speed *= 0.5; } - playerStatus->position.x += speed * dx; - playerStatus->position.z -= speed * dy; + playerStatus->pos.x += speed * dx; + playerStatus->pos.z -= speed * dy; if (playerStatus->actionSubstate == SUBSTATE_FLYING) { integrate_gravity(); - playerStatus->position.y += playerStatus->gravityIntegrator[0]; + playerStatus->pos.y += playerStatus->gravityIntegrator[0]; if (playerStatus->gravityIntegrator[0] < 0.0f) { playerStatus->actionSubstate = SUBSTATE_FALLING; playerStatus->flags |= PS_FLAG_FALLING; @@ -54,7 +54,7 @@ void action_update_hit_fire(void) { } else { s32 colliderID; - playerStatus->position.y = player_check_collision_below(player_fall_distance(), &colliderID); + playerStatus->pos.y = player_check_collision_below(player_fall_distance(), &colliderID); if (colliderID >= 0) { colliderID = get_collider_flags(colliderID); //TODO surfaceType set_action_state(ACTION_STATE_LAND); diff --git a/src/world/action/hit_lava.c b/src/world/action/hit_lava.c index 3e1d7a903d..edd3c4cc9c 100644 --- a/src/world/action/hit_lava.c +++ b/src/world/action/hit_lava.c @@ -36,12 +36,12 @@ void action_update_hit_lava(void) { playerStatus->flags |= PS_FLAG_HIT_FIRE; if (playerStatus->hazardType == HAZARD_TYPE_LAVA) { playerStatus->actionSubstate = SUBSTATE_DELAY_INIT_SINK; - playerStatus->currentStateTime = 2; + playerStatus->curStateTime = 2; } else { playerStatus->actionSubstate = SUBSTATE_INIT; } - InitialPosY = playerStatus->position.y; - playerStatus->currentSpeed = 0.0f; + InitialPosY = playerStatus->pos.y; + playerStatus->curSpeed = 0.0f; LaunchVelocity = 0.0f; gCameras[CAM_DEFAULT].moveFlags |= (CAMERA_MOVE_IGNORE_PLAYER_Y | CAMERA_MOVE_FLAG_2); @@ -54,108 +54,108 @@ void action_update_hit_lava(void) { switch (playerStatus->actionSubstate) { case SUBSTATE_DELAY_INIT: - if (--playerStatus->currentStateTime == -1) { + if (--playerStatus->curStateTime == -1) { playerStatus->actionSubstate = SUBSTATE_INIT; } break; case SUBSTATE_DELAY_INIT_SINK: - if (--playerStatus->currentStateTime == -1) { + if (--playerStatus->curStateTime == -1) { playerStatus->actionSubstate = SUBSTATE_INIT; } - playerStatus->position.y -= 4.0f; + playerStatus->pos.y -= 4.0f; break; case SUBSTATE_INIT: if (playerStatus->hazardType == HAZARD_TYPE_LAVA) { - fx_smoke_burst(0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z, 1.0f, 40); + fx_smoke_burst(0, playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z, 1.0f, 40); } suggest_player_anim_always_forward(ANIM_MarioW2_TouchedLava); playerStatus->gravityIntegrator[1] = 0.0f; playerStatus->timeInAir = 0; playerStatus->peakJumpTime = 0; playerStatus->actionSubstate = SUBSTATE_LAUNCH; - playerStatus->currentStateTime = 1; + playerStatus->curStateTime = 1; playerStatus->gravityIntegrator[0] = 20.0f; playerStatus->gravityIntegrator[2] = 250.0f; playerStatus->gravityIntegrator[3] = InitialPosY; - playerStatus->jumpFromPos.x = playerStatus->position.x; - playerStatus->jumpFromPos.z = playerStatus->position.z; - playerStatus->jumpFromHeight = playerStatus->position.y; + playerStatus->jumpFromPos.x = playerStatus->pos.x; + playerStatus->jumpFromPos.z = playerStatus->pos.z; + playerStatus->jumpFromHeight = playerStatus->pos.y; playerStatus->flags |= PS_FLAG_JUMPING; break; case SUBSTATE_DELAY_LAUNCH: - if (--playerStatus->currentStateTime <= 0) { + if (--playerStatus->curStateTime <= 0) { playerStatus->actionSubstate++; } break; case SUBSTATE_LAUNCH: if (playerStatus->hazardType == HAZARD_TYPE_LAVA && (playerStatus->timeInAir % 2) == 0) { - fx_smoke_burst(0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z, 0.7f, 18); + fx_smoke_burst(0, playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z, 0.7f, 18); } - if (playerStatus->position.y < playerStatus->gravityIntegrator[3] + playerStatus->gravityIntegrator[2]) { + if (playerStatus->pos.y < playerStatus->gravityIntegrator[3] + playerStatus->gravityIntegrator[2]) { sin_cos_rad(DEG_TO_RAD(LaunchInterpPhase), &dx, &dy); LaunchVelocity = sin_rad(DEG_TO_RAD(LaunchInterpPhase)) * 16.0f; if (LaunchVelocity < -1.0f) { LaunchVelocity = -1.0f; } - playerStatus->position.y += LaunchVelocity; + playerStatus->pos.y += LaunchVelocity; LaunchInterpPhase += 3.0f; if (LaunchInterpPhase > 180.0f) { LaunchInterpPhase = 180.0f; playerStatus->actionSubstate++; } } else { - playerStatus->position.y = playerStatus->gravityIntegrator[3] + playerStatus->gravityIntegrator[2]; + playerStatus->pos.y = playerStatus->gravityIntegrator[3] + playerStatus->gravityIntegrator[2]; playerStatus->actionSubstate++; } break; case SUBSTATE_END_LAUNCH: if (playerStatus->hazardType == HAZARD_TYPE_LAVA && (playerStatus->timeInAir % 2) == 0) { - fx_smoke_burst(0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z, 0.7f, 18); + fx_smoke_burst(0, playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z, 0.7f, 18); } if (get_lava_reset_pos(&resetPosX, &resetPosY, &resetPosZ) == 0) { - resetPosX = playerStatus->position.x; - resetPosZ = playerStatus->position.z; + resetPosX = playerStatus->pos.x; + resetPosZ = playerStatus->pos.z; } - playerStatus->lastGoodPosition.x = resetPosX; - playerStatus->lastGoodPosition.z = resetPosZ; - playerStatus->jumpApexHeight = playerStatus->position.y; + playerStatus->lastGoodPos.x = resetPosX; + playerStatus->lastGoodPos.z = resetPosZ; + playerStatus->jumpApexHeight = playerStatus->pos.y; LOAD_INTEGRATOR_FALL(playerStatus->gravityIntegrator); playerStatus->actionSubstate++; break; case SUBSTATE_RETURN_INIT: - ReturnAngle = atan2(playerStatus->position.x, playerStatus->position.z, playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z); - playerStatus->currentSpeed = get_xz_dist_to_player(playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z) / 18.0f; + ReturnAngle = atan2(playerStatus->pos.x, playerStatus->pos.z, playerStatus->lastGoodPos.x, playerStatus->lastGoodPos.z); + playerStatus->curSpeed = get_xz_dist_to_player(playerStatus->lastGoodPos.x, playerStatus->lastGoodPos.z) / 18.0f; playerStatus->actionSubstate++; break; case SUBSTATE_RETURN_MOTION: - ReturnAngle = atan2(playerStatus->position.x, playerStatus->position.z, playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z); + ReturnAngle = atan2(playerStatus->pos.x, playerStatus->pos.z, playerStatus->lastGoodPos.x, playerStatus->lastGoodPos.z); returnRadians = DEG_TO_RAD(ReturnAngle); // update motion along x axis - componentSpeed = playerStatus->currentSpeed * sin_rad(returnRadians); - playerStatus->position.x += componentSpeed; + componentSpeed = playerStatus->curSpeed * sin_rad(returnRadians); + playerStatus->pos.x += componentSpeed; completeAxes = 0; if (componentSpeed >= 0.0f) { - if (playerStatus->lastGoodPosition.x <= playerStatus->position.x) { - playerStatus->position.x = playerStatus->lastGoodPosition.x; + if (playerStatus->lastGoodPos.x <= playerStatus->pos.x) { + playerStatus->pos.x = playerStatus->lastGoodPos.x; completeAxes++; } } else { - if (playerStatus->position.x <= playerStatus->lastGoodPosition.x) { - playerStatus->position.x = playerStatus->lastGoodPosition.x; + if (playerStatus->pos.x <= playerStatus->lastGoodPos.x) { + playerStatus->pos.x = playerStatus->lastGoodPos.x; completeAxes++; } } // update motion along z axis - componentSpeed = playerStatus->currentSpeed * cos_rad(returnRadians); - playerStatus->position.z -= componentSpeed; + componentSpeed = playerStatus->curSpeed * cos_rad(returnRadians); + playerStatus->pos.z -= componentSpeed; if (componentSpeed >= 0.0f) { - if (playerStatus->position.z <= playerStatus->lastGoodPosition.z) { - playerStatus->position.z = playerStatus->lastGoodPosition.z; + if (playerStatus->pos.z <= playerStatus->lastGoodPos.z) { + playerStatus->pos.z = playerStatus->lastGoodPos.z; completeAxes++; } } else { - if (playerStatus->lastGoodPosition.z <= playerStatus->position.z) { - playerStatus->position.z = playerStatus->lastGoodPosition.z; + if (playerStatus->lastGoodPos.z <= playerStatus->pos.z) { + playerStatus->pos.z = playerStatus->lastGoodPos.z; completeAxes++; } } @@ -166,9 +166,9 @@ void action_update_hit_lava(void) { break; case SUBSTATE_HOVER: if (playerStatus->hazardType == HAZARD_TYPE_LAVA && (playerStatus->timeInAir % 2) == 0) { - fx_smoke_burst(0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z, 0.7f, 18); + fx_smoke_burst(0, playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z, 0.7f, 18); } - playerStatus->position.y = player_check_collision_below(player_fall_distance(), &completeAxes); + playerStatus->pos.y = player_check_collision_below(player_fall_distance(), &completeAxes); if (completeAxes >= 0) { exec_ShakeCamX(0, 2, 1, 0.8f); start_rumble(256, 50); @@ -180,20 +180,20 @@ void action_update_hit_lava(void) { playerStatus->flags &= ~PS_FLAG_FLYING; playerStatus->hazardType = HAZARD_TYPE_NONE; playerStatus->gravityIntegrator[0] = 6.0f; - playerStatus->position.y += 6.0f; + playerStatus->pos.y += 6.0f; playerStatus->actionSubstate++; } break; case SUBSTATE_BOUNCE: playerStatus->gravityIntegrator[0] -= 1.0; - playerStatus->position.y = player_check_collision_below(playerStatus->gravityIntegrator[0], &completeAxes); + playerStatus->pos.y = player_check_collision_below(playerStatus->gravityIntegrator[0], &completeAxes); if (completeAxes >= 0) { - playerStatus->currentStateTime = 10; + playerStatus->curStateTime = 10; playerStatus->actionSubstate++; } break; case SUBSTATE_DELAY_DONE: - if (--playerStatus->currentStateTime <= 0) { + if (--playerStatus->curStateTime <= 0) { set_action_state(ACTION_STATE_LAND); playerStatus->flags &= ~PS_FLAG_SCRIPTED_FALL; gOverrideFlags &= ~GLOBAL_OVERRIDES_40; diff --git a/src/world/action/idle.c b/src/world/action/idle.c index 3b0b0cba17..2c4d4dfcd2 100644 --- a/src/world/action/idle.c +++ b/src/world/action/idle.c @@ -46,16 +46,16 @@ void action_update_idle(void) { return; } - playerStatus->currentStateTime++; + playerStatus->curStateTime++; if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) { playerStatus->flags &= ~(PS_FLAG_ACTION_STATE_CHANGED | PS_FLAG_ARMS_RAISED | PS_FLAG_AIRBORNE); wasMoving = TRUE; playerStatus->actionSubstate = SUBSTATE_IDLE_DEFAULT; - playerStatus->currentStateTime = 0; + playerStatus->curStateTime = 0; playerStatus->timeInAir = 0; playerStatus->peakJumpTime = 0; - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; playerStatus->pitch = 0.0f; if (playerStatus->animFlags & PA_FLAG_8BIT_MARIO) { @@ -84,7 +84,7 @@ void action_update_idle(void) { if (magnitude == 0.0f) { playerData->idleFrameCounter++; } else { - playerStatus->currentStateTime = 0; + playerStatus->curStateTime = 0; set_action_state(ACTION_STATE_WALK); if (magnitude != 0.0f) { playerStatus->targetYaw = angle; @@ -103,10 +103,10 @@ void action_update_idle_peach(void) { if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) { playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED; playerStatus->actionSubstate = SUBSTATE_IDLE_DEFAULT; - playerStatus->currentStateTime = 0; + playerStatus->curStateTime = 0; playerStatus->timeInAir = 0; playerStatus->peakJumpTime = 0; - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; playerStatus->flags &= ~PS_FLAG_AIRBORNE; if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) { @@ -125,27 +125,27 @@ void action_update_idle_peach(void) { case SUBSTATE_IDLE_DEFAULT: if (!(playerStatus->flags & (PS_FLAG_NO_STATIC_COLLISION | PS_FLAG_INPUT_DISABLED)) && (playerStatus->peachItemHeld == 0)) { - if (playerStatus->currentStateTime > 1800) { + if (playerStatus->curStateTime > 1800) { // begin first yawm playerStatus->actionSubstate++; suggest_player_anim_allow_backward(ANIM_Peach2_Yawn); return; } - playerStatus->currentStateTime++; + playerStatus->curStateTime++; } break; case SUBSTATE_IDLE_STRETCH: // waiting for yawn to finish if (playerStatus->animNotifyValue != 0) { playerStatus->actionSubstate++; - playerStatus->currentStateTime = 0; + playerStatus->curStateTime = 0; suggest_player_anim_allow_backward(ANIM_Peach1_Idle); } break; case SUBSTATE_DELAY_SLEEP: // delay before next yawn and sleep - playerStatus->currentStateTime++; - if (playerStatus->currentStateTime > 200) { + playerStatus->curStateTime++; + if (playerStatus->curStateTime > 200) { playerStatus->actionSubstate++; suggest_player_anim_allow_backward(ANIM_Peach2_Yawn); } @@ -166,7 +166,7 @@ void action_update_idle_peach(void) { phys_update_interact_collider(); if (magnitude != 0.0f) { - playerStatus->currentStateTime = 0; + playerStatus->curStateTime = 0; playerStatus->targetYaw = angle; set_action_state(ACTION_STATE_WALK); } diff --git a/src/world/action/jump.c b/src/world/action/jump.c index e937e6bfc2..ad8d0929e7 100644 --- a/src/world/action/jump.c +++ b/src/world/action/jump.c @@ -19,9 +19,9 @@ void initialize_jump(void) { playerStatus->peakJumpTime = 0; playerStatus->flags &= ~(PS_FLAG_ACTION_STATE_CHANGED | PS_FLAG_FLYING); playerStatus->flags |= PS_FLAG_JUMPING; - playerStatus->jumpFromPos.x = playerStatus->position.x; - playerStatus->jumpFromPos.z = playerStatus->position.z; - playerStatus->jumpFromHeight = playerStatus->position.y; + playerStatus->jumpFromPos.x = playerStatus->pos.x; + playerStatus->jumpFromPos.z = playerStatus->pos.z; + playerStatus->jumpFromHeight = playerStatus->pos.y; phys_init_integrator_for_current_state(); @@ -34,8 +34,8 @@ void initialize_jump(void) { } suggest_player_anim_allow_backward(anim); - collisionStatus->lastTouchedFloor = collisionStatus->currentFloor; - collisionStatus->currentFloor = NO_COLLIDER; + collisionStatus->lastTouchedFloor = collisionStatus->curFloor; + collisionStatus->curFloor = NO_COLLIDER; } void action_update_jump(void) { @@ -80,10 +80,10 @@ void action_update_landing_on_switch(void) { AnimID anim; if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) { - Entity* entity = get_entity_by_index(collisionStatus->currentFloor); + Entity* entity = get_entity_by_index(collisionStatus->curFloor); - JumpedOnSwitchX = entity->position.x; - JumpedOnSwitchZ = entity->position.z; + JumpedOnSwitchX = entity->pos.x; + JumpedOnSwitchZ = entity->pos.z; initialize_jump(); playerStatus->flags |= (PS_FLAG_SCRIPTED_FALL | PS_FLAG_ARMS_RAISED); disable_player_input(); @@ -161,9 +161,9 @@ void action_update_step_down(void) { playerStatus->timeInAir++; phys_update_interact_collider(); - posX = playerStatus->position.x; - posY = playerStatus->position.y; - posZ = playerStatus->position.z; + posX = playerStatus->pos.x; + posY = playerStatus->pos.y; + posZ = playerStatus->pos.z; height = playerStatus->colliderHeight; colliderID = player_raycast_below_cam_relative(playerStatus, &posX, &posY, &posZ, &height, &hitRx, &hitRz, &hitDirX, &hitDirZ); diff --git a/src/world/action/knockback.c b/src/world/action/knockback.c index 93f48fa093..0840700ae9 100644 --- a/src/world/action/knockback.c +++ b/src/world/action/knockback.c @@ -28,26 +28,26 @@ void action_update_knockback(void) { gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_IGNORE_PLAYER_Y; - ReturnAngle = atan2(playerStatus->position.x, playerStatus->position.z, playerStatus->lastGoodPosition.x, - playerStatus->lastGoodPosition.z); - playerStatus->currentSpeed = get_xz_dist_to_player(playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z) / 18.0f; + ReturnAngle = atan2(playerStatus->pos.x, playerStatus->pos.z, playerStatus->lastGoodPos.x, + playerStatus->lastGoodPos.z); + playerStatus->curSpeed = get_xz_dist_to_player(playerStatus->lastGoodPos.x, playerStatus->lastGoodPos.z) / 18.0f; } sin_cos_rad(DEG_TO_RAD(ReturnAngle), &dx, &dy); - speed = playerStatus->currentSpeed; + speed = playerStatus->curSpeed; if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) { speed *= 0.5f; } - playerStatus->position.x += speed * dx; - playerStatus->position.z -= speed * dy; + playerStatus->pos.x += speed * dx; + playerStatus->pos.z -= speed * dy; if (playerStatus->actionSubstate == SUBSTATE_FLYING) { integrate_gravity(); - playerStatus->position.y += playerStatus->gravityIntegrator[0]; + playerStatus->pos.y += playerStatus->gravityIntegrator[0]; if (playerStatus->gravityIntegrator[0] < 0.0f) { playerStatus->actionSubstate = SUBSTATE_FALLING; @@ -56,7 +56,7 @@ void action_update_knockback(void) { } else { s32 colliderID; - playerStatus->position.y = player_check_collision_below(player_fall_distance(), &colliderID); + playerStatus->pos.y = player_check_collision_below(player_fall_distance(), &colliderID); if (colliderID >= 0) { colliderID = get_collider_flags(colliderID); //TODO surfaceType diff --git a/src/world/action/land.c b/src/world/action/land.c index b75e8477df..d8871bfa34 100644 --- a/src/world/action/land.c +++ b/src/world/action/land.c @@ -33,8 +33,8 @@ void action_update_land(void) { playerStatus->actionSubstate = SUBSTATE_INIT; playerStatus->timeInAir = 0; playerStatus->peakJumpTime = 0; - playerStatus->landPos.x = playerStatus->position.x; - playerStatus->landPos.z = playerStatus->position.z; + playerStatus->landPos.x = playerStatus->pos.x; + playerStatus->landPos.z = playerStatus->pos.z; if (playerStatus->animFlags & PA_FLAG_8BIT_MARIO) { anim = ANIM_MarioW3_8bit_Still; @@ -48,7 +48,7 @@ void action_update_land(void) { sfx_play_sound_at_player(SOUND_161 | SOUND_ID_STOP, SOUND_SPACE_MODE_0); sfx_play_sound_at_player(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0); - if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) { + if (!(collisionStatus->curFloor & COLLISION_WITH_ENTITY_BIT)) { phys_adjust_cam_on_landing(); } @@ -57,7 +57,7 @@ void action_update_land(void) { camera->moveFlags &= ~CAMERA_MOVE_FLAG_4; } playerStatus->actionSubstate++; // SUBSTATE_DONE - playerStatus->currentSpeed *= 0.6f; + playerStatus->curSpeed *= 0.6f; player_input_to_move_vector(&inputMoveAngle, &inputMoveMagnitude); jumpInputCheck = check_input_jump(); @@ -95,10 +95,10 @@ void action_update_step_down_land(void) { playerStatus->actionSubstate = SUBSTATE_INIT; playerStatus->timeInAir = 0; playerStatus->peakJumpTime = 0; - playerStatus->landPos.x = playerStatus->position.x; - playerStatus->landPos.z = playerStatus->position.z; + playerStatus->landPos.x = playerStatus->pos.x; + playerStatus->landPos.z = playerStatus->pos.z; - if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) { + if (!(collisionStatus->curFloor & COLLISION_WITH_ENTITY_BIT)) { phys_adjust_cam_on_landing(); } @@ -106,7 +106,7 @@ void action_update_step_down_land(void) { } playerStatus->actionSubstate++; // SUBSTATE_DONE - playerStatus->currentSpeed *= 0.6f; + playerStatus->curSpeed *= 0.6f; player_input_to_move_vector(&inputMoveAngle, &inputMoveMagnitude); check_input_jump(); @@ -130,12 +130,12 @@ void action_update_peach_land(void) { playerStatus->timeInAir = 0; playerStatus->peakJumpTime = 0; playerStatus->flags &= ~PS_FLAG_AIRBORNE; - playerStatus->landPos.x = playerStatus->position.x; - playerStatus->landPos.z = playerStatus->position.z; + playerStatus->landPos.x = playerStatus->pos.x; + playerStatus->landPos.z = playerStatus->pos.z; sfx_play_sound_at_player(SOUND_SOFT_LAND, SOUND_SPACE_MODE_0); - if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) { + if (!(collisionStatus->curFloor & COLLISION_WITH_ENTITY_BIT)) { phys_adjust_cam_on_landing(); } @@ -143,7 +143,7 @@ void action_update_peach_land(void) { } playerStatus->actionSubstate++; // SUBSTATE_DONE - playerStatus->currentSpeed *= 0.6f; + playerStatus->curSpeed *= 0.6f; player_input_to_move_vector(&inputMoveAngle, &inputMoveMagnitude); @@ -174,17 +174,17 @@ void action_update_peach_step_down_land(void) { playerStatus->timeInAir = 0; playerStatus->peakJumpTime = 0; playerStatus->flags &= ~PS_FLAG_AIRBORNE; - playerStatus->landPos.x = playerStatus->position.x; - playerStatus->landPos.z = playerStatus->position.z; + playerStatus->landPos.x = playerStatus->pos.x; + playerStatus->landPos.z = playerStatus->pos.z; - if (!(collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT)) { + if (!(collisionStatus->curFloor & COLLISION_WITH_ENTITY_BIT)) { phys_adjust_cam_on_landing(); } collisionStatus->lastTouchedFloor = -1; } playerStatus->actionSubstate++; // SUBSTATE_DONE - playerStatus->currentSpeed *= 0.6f; + playerStatus->curSpeed *= 0.6f; player_input_to_move_vector(&inputMoveAngle, &inputMoveMagnitude); if (inputMoveMagnitude != 0.0f) { diff --git a/src/world/action/misc.c b/src/world/action/misc.c index 84bfb6fba8..e2d160ee38 100644 --- a/src/world/action/misc.c +++ b/src/world/action/misc.c @@ -13,10 +13,10 @@ void action_update_ride(void) { if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) { playerStatus->flags &= ~(PS_FLAG_ACTION_STATE_CHANGED | PS_FLAG_ARMS_RAISED | PS_FLAG_AIRBORNE); playerStatus->actionSubstate = 0; - playerStatus->currentStateTime = 0; + playerStatus->curStateTime = 0; playerStatus->timeInAir = 0; playerStatus->peakJumpTime = 0; - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; playerStatus->pitch = 0.0f; } @@ -50,10 +50,10 @@ void action_update_state_23(void) { if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) { playerStatus->flags &= ~(PS_FLAG_ACTION_STATE_CHANGED | PS_FLAG_ARMS_RAISED | PS_FLAG_AIRBORNE); playerStatus->actionSubstate = 0; - playerStatus->currentStateTime = 0; + playerStatus->curStateTime = 0; playerStatus->timeInAir = 0; playerStatus->peakJumpTime = 0; - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; playerStatus->pitch = 0.0f; D_802B6770_E27C80 = D_8010C938; } @@ -93,14 +93,14 @@ void action_update_state_23(void) { playerZOffset = playerOffsetTempVar; } - playerStatus->position.x += playerXOffset; - playerStatus->position.z -= playerZOffset; - outX = playerStatus->position.x; - outY = playerStatus->position.y; - outZ = playerStatus->position.z; + playerStatus->pos.x += playerXOffset; + playerStatus->pos.z -= playerZOffset; + outX = playerStatus->pos.x; + outY = playerStatus->pos.y; + outZ = playerStatus->pos.z; outLength = 5.0f; if (player_raycast_below_cam_relative(playerStatus, &outX, &outY, &outZ, &outLength, &hitRx, &hitRz, &hitDirX, &hitDirZ) >= 0) { - playerStatus->position.y = outY; + playerStatus->pos.y = outY; } if (gGameStatusPtr->areaID == AREA_SBK) { @@ -121,20 +121,20 @@ void action_update_launch(void) { if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) { playerStatus->flags &= ~(PS_FLAG_ACTION_STATE_CHANGED | PS_FLAG_ARMS_RAISED | PS_FLAG_AIRBORNE); playerStatus->actionSubstate = 0; - playerStatus->currentStateTime = 0; + playerStatus->curStateTime = 0; playerStatus->timeInAir = 0; playerStatus->peakJumpTime = 0; - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; playerStatus->pitch = 0.0f; if (playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) { return; } - playerStatus->currentStateTime = 5; + playerStatus->curStateTime = 5; } - playerStatus->currentStateTime--; - if (playerStatus->currentStateTime == 0) { + playerStatus->curStateTime--; + if (playerStatus->curStateTime == 0) { set_action_state(ACTION_STATE_IDLE); } } @@ -147,14 +147,14 @@ void action_update_first_strike(void) { playerStatus->actionSubstate = 0; playerStatus->timeInAir = 0; playerStatus->peakJumpTime = 0; - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; playerStatus->pitch = 0.0f; suggest_player_anim_always_forward(ANIM_Mario1_Hurt); - playerStatus->currentStateTime = 30; + playerStatus->curStateTime = 30; } - if (playerStatus->currentStateTime != 0) { - playerStatus->currentStateTime--; + if (playerStatus->curStateTime != 0) { + playerStatus->curStateTime--; } else if (!gGameStatusPtr->isBattle) { set_action_state(ACTION_STATE_IDLE); } @@ -166,9 +166,9 @@ void action_update_raise_arms(void) { if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) { playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED; playerStatus->flags |= PS_FLAG_ARMS_RAISED; - playerStatus->currentStateTime = 0; + playerStatus->curStateTime = 0; playerStatus->actionSubstate = 0; - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; playerStatus->pitch = 0.0f; suggest_player_anim_always_forward(ANIM_Mario1_UsePower); } @@ -187,9 +187,9 @@ void action_update_pushing_block(void) { f32 magnitude; playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED; - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; playerStatus->unk_60 = 0; - playerStatus->currentStateTime = 5; + playerStatus->curStateTime = 5; player_input_to_move_vector(&angle, &magnitude); if (((angle >= 45.0f) && (angle <= 135.0f)) || ((angle >= 225.0f) && (angle <= 315.0f))) { @@ -202,9 +202,9 @@ void action_update_pushing_block(void) { check_input_jump(); if (playerStatus->animFlags & PA_FLAG_ABORT_PUSHING_BLOCK) { - if (playerStatus->currentStateTime != 0) { - playerStatus->currentStateTime--; - if (playerStatus->currentStateTime == 0) { + if (playerStatus->curStateTime != 0) { + playerStatus->curStateTime--; + if (playerStatus->curStateTime == 0) { set_action_state(ACTION_STATE_IDLE); } } @@ -216,7 +216,7 @@ void action_update_talk(void) { if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) { playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED; - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; playerStatus->unk_60 = 0; if (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)) { @@ -228,12 +228,12 @@ void action_update_talk(void) { peach_set_disguise_anim(BasicPeachDisguiseAnims[playerStatus->peachDisguise].talk); } } - playerStatus->currentStateTime = 30; + playerStatus->curStateTime = 30; } if (playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) { - if (playerStatus->currentStateTime != 0) { - playerStatus->currentStateTime--; + if (playerStatus->curStateTime != 0) { + playerStatus->curStateTime--; } else if (playerStatus->peachItemHeld == 0) { if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) { suggest_player_anim_always_forward(ANIM_Peach1_Idle); diff --git a/src/world/action/slide.c b/src/world/action/slide.c index a1e2b44b7f..72c9174062 100644 --- a/src/world/action/slide.c +++ b/src/world/action/slide.c @@ -31,8 +31,8 @@ void func_802B6000_E27510(void) { playerStatus->gravityIntegrator[3] = slide->integrator[3]; playerStatus->heading = slide->heading; MaxSlideAccel = slide->maxDescendAccel; - SlideLaunchSpeed = slide->launchVelocity; - MaxSlideVelocity = slide->maxDescendVelocity; + SlideLaunchSpeed = slide->launchVel; + MaxSlideVelocity = slide->maxDescendVel; } void action_update_sliding(void) { @@ -48,7 +48,7 @@ void action_update_sliding(void) { if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) { playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED; playerStatus->actionSubstate = SUBSTATE_SLIDING; - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; playerStatus->animFlags |= PA_FLAG_INTERRUPT_USE_PARTNER; func_802B6000_E27510(); SlideAcceleration = 0.0f; @@ -60,14 +60,14 @@ void action_update_sliding(void) { sfx_play_sound_at_player(SOUND_167, SOUND_SPACE_MODE_0); gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_IGNORE_PLAYER_Y; } - speed = playerStatus->currentSpeed; - posX = playerStatus->position.x; - posY = playerStatus->position.y; - posZ = playerStatus->position.z; + speed = playerStatus->curSpeed; + posX = playerStatus->pos.x; + posY = playerStatus->pos.y; + posZ = playerStatus->pos.z; hitID = player_test_move_with_slipping(playerStatus, &posX, &posY, &posZ, speed, playerStatus->heading); - playerStatus->position.x = posX; - playerStatus->position.z = posZ; - playerStatus->position.y = posY; + playerStatus->pos.x = posX; + playerStatus->pos.z = posZ; + playerStatus->pos.y = posY; switch (playerStatus->actionSubstate) { case SUBSTATE_SLIDING: @@ -75,23 +75,23 @@ void action_update_sliding(void) { if (MaxSlideAccel <= SlideAcceleration) { SlideAcceleration = MaxSlideAccel; } - playerStatus->currentSpeed += SlideAcceleration; - if (MaxSlideVelocity <= playerStatus->currentSpeed) { - playerStatus->currentSpeed = MaxSlideVelocity; + playerStatus->curSpeed += SlideAcceleration; + if (MaxSlideVelocity <= playerStatus->curSpeed) { + playerStatus->curSpeed = MaxSlideVelocity; } - posX = playerStatus->position.x; + posX = playerStatus->pos.x; depth = 100.0f; - posZ = playerStatus->position.z; + posZ = playerStatus->pos.z; D_802B6794 = D_802B6798; - posY = playerStatus->position.y + (playerStatus->colliderHeight * 0.5f); + posY = playerStatus->pos.y + (playerStatus->colliderHeight * 0.5f); hitID = player_raycast_below_cam_relative(playerStatus, &posX, &posY, &posZ, &depth, &hitRx, &hitRy, &hitDirX, &hitDirZ); D_802B6798 = hitRy; if (hitID >= 0) { collisionStatus = &gCollisionStatus; surfaceType = get_collider_flags(hitID) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; if (surfaceType == SURFACE_TYPE_SLIDE) { - collisionStatus->currentFloor = hitID; - playerStatus->position.y = posY; + collisionStatus->curFloor = hitID; + playerStatus->pos.y = posY; D_802B6790 = hitRy + 180.0f; break; } @@ -104,49 +104,49 @@ void action_update_sliding(void) { playerStatus->actionSubstate = SUBSTATE_LAUNCH; } sin_cos_rad(DEG_TO_RAD(D_802B6790), &sinA, &cosA); - playerStatus->position.y += fabsf((sinA / cosA) * playerStatus->currentSpeed); + playerStatus->pos.y += fabsf((sinA / cosA) * playerStatus->curSpeed); snd_stop_sound(SOUND_167); break; case SUBSTATE_STOP: - posX = playerStatus->position.x; + posX = playerStatus->pos.x; depth = 50.0f; - posZ = playerStatus->position.z; - posY = playerStatus->position.y + (playerStatus->colliderHeight * 0.5f); + posZ = playerStatus->pos.z; + posY = playerStatus->pos.y + (playerStatus->colliderHeight * 0.5f); hitID = player_raycast_below_cam_relative(playerStatus, &posX, &posY, &posZ, &depth, &hitRx, &hitRy, &hitDirX, &hitDirZ); if (hitID >= 0) { - speed = playerStatus->currentSpeed / 3.0f; + speed = playerStatus->curSpeed / 3.0f; if (speed < 0.01) { - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; } - playerStatus->currentSpeed -= speed; - if (playerStatus->currentSpeed <= 0.0f) { + playerStatus->curSpeed -= speed; + if (playerStatus->curSpeed <= 0.0f) { sfx_play_sound_at_player(SOUND_DUST_OFF, SOUND_SPACE_MODE_0); suggest_player_anim_always_forward(ANIM_Mario1_DustOff); playerStatus->actionSubstate = SUBSTATE_DUST_OFF; - playerStatus->currentStateTime = 15; - playerStatus->currentSpeed = 0.0f; - playerStatus->position.y = posY; + playerStatus->curStateTime = 15; + playerStatus->curSpeed = 0.0f; + playerStatus->pos.y = posY; } break; } case SUBSTATE_LAUNCH: - playerStatus->currentSpeed += SlideLaunchSpeed; - if (playerStatus->currentSpeed <= 0.0f) { - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed += SlideLaunchSpeed; + if (playerStatus->curSpeed <= 0.0f) { + playerStatus->curSpeed = 0.0f; } playerStatus->gravityIntegrator[0] += playerStatus->gravityIntegrator[1]; - playerStatus->position.y += playerStatus->gravityIntegrator[0]; + playerStatus->pos.y += playerStatus->gravityIntegrator[0]; if (playerStatus->gravityIntegrator[0] <= 0.0f) { playerStatus->actionSubstate = SUBSTATE_FALL; LOAD_INTEGRATOR_FALL(playerStatus->gravityIntegrator); } break; case SUBSTATE_FALL: - playerStatus->currentSpeed += SlideLaunchSpeed; - if (playerStatus->currentSpeed <= 0.0f) { - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed += SlideLaunchSpeed; + if (playerStatus->curSpeed <= 0.0f) { + playerStatus->curSpeed = 0.0f; } - playerStatus->position.y = player_check_collision_below(player_fall_distance(), &hitID); + playerStatus->pos.y = player_check_collision_below(player_fall_distance(), &hitID); if (hitID >= 0) { SlideLaunchSpeed = -1; suggest_player_anim_always_forward(ANIM_MarioW2_Collapse); @@ -155,9 +155,9 @@ void action_update_sliding(void) { } break; case SUBSTATE_CRASH: - playerStatus->currentSpeed += SlideLaunchSpeed; - if (playerStatus->currentSpeed <= 0.0f) { - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed += SlideLaunchSpeed; + if (playerStatus->curSpeed <= 0.0f) { + playerStatus->curSpeed = 0.0f; } if (playerStatus->animNotifyValue != 0) { suggest_player_anim_always_forward(ANIM_Mario1_GetUp); @@ -165,34 +165,34 @@ void action_update_sliding(void) { } break; case SUBSTATE_GET_UP: - playerStatus->currentSpeed += SlideLaunchSpeed; - if (playerStatus->currentSpeed <= 0.0f) { - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed += SlideLaunchSpeed; + if (playerStatus->curSpeed <= 0.0f) { + playerStatus->curSpeed = 0.0f; } if (playerStatus->animNotifyValue != 0) { suggest_player_anim_always_forward(ANIM_Mario1_DustOff); sfx_play_sound_at_player(SOUND_DUST_OFF, SOUND_SPACE_MODE_0); - playerStatus->currentStateTime = 15; + playerStatus->curStateTime = 15; playerStatus->actionSubstate++; // SUBSTATE_DUST_OFF } break; case SUBSTATE_DUST_OFF: - playerStatus->currentSpeed += SlideLaunchSpeed; - if (playerStatus->currentSpeed <= 0.0f) { - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed += SlideLaunchSpeed; + if (playerStatus->curSpeed <= 0.0f) { + playerStatus->curSpeed = 0.0f; } - if (--playerStatus->currentStateTime == 0) { + if (--playerStatus->curStateTime == 0) { playerStatus->actionSubstate++; // SUBSTATE_DONE } break; case SUBSTATE_DONE: - speed = playerStatus->currentSpeed / 3.0f; + speed = playerStatus->curSpeed / 3.0f; if (speed < 0.01) { - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; } - playerStatus->currentSpeed -= speed; - if (playerStatus->currentSpeed <= 0.0f) { - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed -= speed; + if (playerStatus->curSpeed <= 0.0f) { + playerStatus->curSpeed = 0.0f; set_action_state(ACTION_STATE_IDLE); } break; diff --git a/src/world/action/sneaky_parasol.c b/src/world/action/sneaky_parasol.c index 9e6805edd1..39ecc3e791 100644 --- a/src/world/action/sneaky_parasol.c +++ b/src/world/action/sneaky_parasol.c @@ -11,7 +11,7 @@ typedef struct TransformationData { /* 0x04 */ s32 reverted; /* 0x08 */ s32 disguiseTime; /* 0x0C */ s32 revertTime; - /* 0x10 */ Vec3f position; + /* 0x10 */ Vec3f pos; /* 0x1C */ f32 playerRotationRate; /* 0x20 */ f32 playerYawOffset; } TransformationData; @@ -51,12 +51,12 @@ Npc* parasol_get_npc(void) { if (gGameStatusPtr->peachFlags & PEACH_STATUS_FLAG_8) { gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_8; } else { - ret = npc_find_closest(playerStatus->position.x, playerStatus->position.y, playerStatus->position.z, 100.0f); + ret = npc_find_closest(playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z, 100.0f); if (ret != 0) { - if (fabs(ret->pos.y - playerStatus->position.y) - 1.0 > 0.0) { + if (fabs(ret->pos.y - playerStatus->pos.y) - 1.0 > 0.0) { ret = 0; } else { - angle = clamp_angle(atan2(playerStatus->position.x, playerStatus->position.z, ret->pos.x, ret->pos.z)); + angle = clamp_angle(atan2(playerStatus->pos.x, playerStatus->pos.z, ret->pos.x, ret->pos.z)); if (fabs(angle - func_800E5348()) > 30.0) { ret = 0; } @@ -89,7 +89,7 @@ void action_update_parasol(void) { tempUnk_1C = &transformation->playerRotationRate; playerStatus->timeInAir = 0; playerStatus->peakJumpTime = 0; - playerStatus->currentSpeed = 0; + playerStatus->curSpeed = 0; playerStatus->pitch = 0; if (playerStatus->spriteFacingAngle >= 90 && playerStatus->spriteFacingAngle < 270) { @@ -100,13 +100,13 @@ void action_update_parasol(void) { *tempUnk_1C = phi_f4; if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) { - playerStatus->currentStateTime = 20; + playerStatus->curStateTime = 20; playerStatus->actionSubstate = SUBSTATE_DISGUISE_INIT; transformation->disguiseTime = 15; transformation->npc = parasol_get_npc(); } else { playerStatus->actionSubstate = SUBSTATE_REVERT_INIT; - playerStatus->currentStateTime = 40; + playerStatus->curStateTime = 40; transformation->reverted = 1; transformation->revertTime = 12; disguiseNpc = get_npc_by_index(PeachDisguiseNpcIndex); @@ -126,12 +126,12 @@ void action_update_parasol(void) { } else { suggest_player_anim_allow_backward(ANIM_Peach2_CantFitParasol); playerStatus->actionSubstate = SUBSTATE_BLOCKED; - playerStatus->currentStateTime = 10; + playerStatus->curStateTime = 10; transformation->disguiseTime = 0; } } case SUBSTATE_USE_PARASOL: - if (--playerStatus->currentStateTime == 0) { + if (--playerStatus->curStateTime == 0) { suggest_player_anim_allow_backward(ANIM_Peach2_PutAwayParasol); playerStatus->actionSubstate = SUBSTATE_PUT_AWAY; if (transformation->npc == NULL) { @@ -143,15 +143,15 @@ void action_update_parasol(void) { break; case SUBSTATE_PUT_AWAY: if (playerStatus->animNotifyValue != 0) { - playerStatus->currentStateTime = 12; + playerStatus->curStateTime = 12; playerStatus->flags |= PS_FLAG_ROTATION_LOCKED; playerStatus->actionSubstate++; // SUBSTATE_DISGUISE_BEGIN sfx_play_sound_at_player(SOUND_FD, SOUND_SPACE_MODE_0); } break; case SUBSTATE_DISGUISE_BEGIN: - if (--playerStatus->currentStateTime == 0) { - playerStatus->currentStateTime = 10; + if (--playerStatus->curStateTime == 0) { + playerStatus->curStateTime = 10; transformation->revertTime = 10; playerStatus->actionSubstate++; // SUBSTATE_DISGUISE_WAIT_FOR_ANGLE } @@ -160,8 +160,8 @@ void action_update_parasol(void) { case SUBSTATE_DISGUISE_WAIT_FOR_ANGLE: prevFacingAngle = playerStatus->spriteFacingAngle; parasol_update_spin(); - playerStatus->targetYaw = clamp_angle((cam->currentYaw - playerStatus->spriteFacingAngle) - 90); - if (playerStatus->currentStateTime == 0) { + playerStatus->targetYaw = clamp_angle((cam->curYaw - playerStatus->spriteFacingAngle) - 90); + if (playerStatus->curStateTime == 0) { // wait for the sprite to rotate into a position where it's tangent to the camera reachedTangentAngle = FALSE; if (transformation->playerRotationRate > 0) { @@ -176,14 +176,14 @@ void action_update_parasol(void) { } if (reachedTangentAngle) { playerStatus->actionSubstate = SUBSTATE_DISGUISE_SPIN_DOWN; - playerStatus->currentStateTime = 2; + playerStatus->curStateTime = 2; if (peach_make_disguise_npc(playerStatus->availableDisguiseType) != NULL) { playerStatus->actionSubstate = SUBSTATE_DISGUISE_MAKE_NPC; peach_sync_disguise_npc(); } } } else { - playerStatus->currentStateTime--; + playerStatus->curStateTime--; } break; case SUBSTATE_DISGUISE_MAKE_NPC: @@ -192,7 +192,7 @@ void action_update_parasol(void) { gameStatus->peachFlags |= PEACH_STATUS_FLAG_DISGUISED; playerStatus->actionSubstate++; // SUBSTATE_DISGUISE_SPIN_DOWN case SUBSTATE_DISGUISE_SPIN_DOWN: - if (--playerStatus->currentStateTime == 0) { + if (--playerStatus->curStateTime == 0) { playerStatus->actionSubstate++; // SUBSTATE_DISGUISE_FINISH_SPIN } parasol_update_spin(); @@ -202,32 +202,32 @@ void action_update_parasol(void) { transformation->playerYawOffset -= 2.35; if (transformation->playerYawOffset <= 0) { transformation->playerYawOffset = 0; - playerStatus->currentStateTime = 10; + playerStatus->curStateTime = 10; playerStatus->actionSubstate++; // SUBSTATE_DISGUISE_DONE playerStatus->spriteFacingAngle = 180; disguiseNpc = get_npc_by_index(PeachDisguiseNpcIndex); disguiseNpc->isFacingAway = TRUE; - disguiseNpc->yaw = clamp_angle((cam->currentYaw - playerStatus->spriteFacingAngle) - 90); + disguiseNpc->yaw = clamp_angle((cam->curYaw - playerStatus->spriteFacingAngle) - 90); disguiseNpc->yawCamOffset = disguiseNpc->yaw; } } else { transformation->playerYawOffset += 2.35; if (transformation->playerYawOffset >= 0) { transformation->playerYawOffset = 0; - playerStatus->currentStateTime = 10; + playerStatus->curStateTime = 10; playerStatus->spriteFacingAngle = 0; playerStatus->actionSubstate++; // SUBSTATE_DISGUISE_DONE disguiseNpc = get_npc_by_index(PeachDisguiseNpcIndex); disguiseNpc->isFacingAway = FALSE; - disguiseNpc->yaw = clamp_angle((cam->currentYaw - playerStatus->spriteFacingAngle) - 90); + disguiseNpc->yaw = clamp_angle((cam->curYaw - playerStatus->spriteFacingAngle) - 90); disguiseNpc->yawCamOffset = disguiseNpc->yaw; } } playerStatus->spriteFacingAngle = clamp_angle(playerStatus->spriteFacingAngle + transformation->playerYawOffset); - playerStatus->targetYaw = clamp_angle((cam->currentYaw - playerStatus->spriteFacingAngle) - 90); + playerStatus->targetYaw = clamp_angle((cam->curYaw - playerStatus->spriteFacingAngle) - 90); break; case SUBSTATE_DISGUISE_DONE: - if (--playerStatus->currentStateTime == 0) { + if (--playerStatus->curStateTime == 0) { set_time_freeze_mode(TIME_FREEZE_NORMAL); disguiseNpc = get_npc_by_index(PeachDisguiseNpcIndex); disguiseNpc->flags &= ~NPC_FLAG_IGNORE_CAMERA_FOR_YAW; @@ -237,17 +237,17 @@ void action_update_parasol(void) { } break; case SUBSTATE_REVERT_INIT: - if (--playerStatus->currentStateTime == 0) { + if (--playerStatus->curStateTime == 0) { playerStatus->actionSubstate++; // SUBSTATE_REVERT_WAIT_FOR_ANGLE } parasol_update_spin(); - playerStatus->targetYaw = clamp_angle(cam->currentYaw - playerStatus->spriteFacingAngle - 90); + playerStatus->targetYaw = clamp_angle(cam->curYaw - playerStatus->spriteFacingAngle - 90); break; case SUBSTATE_REVERT_WAIT_FOR_ANGLE: prevFacingAngle = playerStatus->spriteFacingAngle; parasol_update_spin(); - playerStatus->targetYaw = clamp_angle((cam->currentYaw - playerStatus->spriteFacingAngle) - 90); - if (playerStatus->currentStateTime == 0) { + playerStatus->targetYaw = clamp_angle((cam->curYaw - playerStatus->spriteFacingAngle) - 90); + if (playerStatus->curStateTime == 0) { // wait for the sprite to rotate into a position where it's tangent to the camera reachedTangentAngle = FALSE; if (transformation->playerRotationRate > 0) { @@ -261,7 +261,7 @@ void action_update_parasol(void) { } } if (reachedTangentAngle) { - playerStatus->currentStateTime = 2; + playerStatus->curStateTime = 2; playerStatus->actionSubstate++; // SUBSTATE_SPIN_DOWN gameStatus2 = gGameStatusPtr; playerStatus->animFlags &= ~PA_FLAG_INVISIBLE; @@ -272,11 +272,11 @@ void action_update_parasol(void) { playerStatus->colliderDiameter = 38; } } else { - playerStatus->currentStateTime--; + playerStatus->curStateTime--; } break; case SUBSTATE_SPIN_DOWN: - if (--playerStatus->currentStateTime == 0) { + if (--playerStatus->curStateTime == 0) { playerStatus->actionSubstate++; // SUBSTATE_FINISH_SPIN } parasol_update_spin(); @@ -286,30 +286,30 @@ void action_update_parasol(void) { transformation->playerYawOffset -= 2.35; if (transformation->playerYawOffset <= 0) { transformation->playerYawOffset = 0; - playerStatus->currentStateTime = 10; + playerStatus->curStateTime = 10; playerStatus->actionSubstate++; // SUBSTATE_REVERT_DONE playerStatus->spriteFacingAngle = 180; PrevPlayerDirection = 1; - playerStatus->currentYaw = clamp_angle((cam->currentYaw - 180) - 90); - PrevPlayerCamRelativeYaw = playerStatus->currentYaw; + playerStatus->curYaw = clamp_angle((cam->curYaw - 180) - 90); + PrevPlayerCamRelativeYaw = playerStatus->curYaw; } } else { transformation->playerYawOffset += 2.35; if (transformation->playerYawOffset >= 0) { transformation->playerYawOffset = 0; - playerStatus->currentStateTime = 10; + playerStatus->curStateTime = 10; playerStatus->spriteFacingAngle = 0; playerStatus->actionSubstate++; // SUBSTATE_REVERT_DONE PrevPlayerDirection = 0; - playerStatus->currentYaw = clamp_angle((cam->currentYaw - 0) - 90); - PrevPlayerCamRelativeYaw = playerStatus->currentYaw; + playerStatus->curYaw = clamp_angle((cam->curYaw - 0) - 90); + PrevPlayerCamRelativeYaw = playerStatus->curYaw; } } playerStatus->spriteFacingAngle = clamp_angle(playerStatus->spriteFacingAngle + transformation->playerYawOffset); - playerStatus->targetYaw = clamp_angle(cam->currentYaw - playerStatus->spriteFacingAngle - 90); + playerStatus->targetYaw = clamp_angle(cam->curYaw - playerStatus->spriteFacingAngle - 90); break; case SUBSTATE_REVERT_DONE: - if (--playerStatus->currentStateTime == 0) { + if (--playerStatus->curStateTime == 0) { set_time_freeze_mode(TIME_FREEZE_NORMAL); playerStatus->flags &= ~PS_FLAG_ROTATION_LOCKED; set_action_state(ACTION_STATE_IDLE); @@ -327,7 +327,7 @@ void action_update_parasol(void) { } break; case SUBSTATE_BLOCKED: - if (--playerStatus->currentStateTime == 0) { + if (--playerStatus->curStateTime == 0) { set_action_state(ACTION_STATE_IDLE); enable_player_static_collisions(); } @@ -337,40 +337,40 @@ void action_update_parasol(void) { if (transformation->disguiseTime > 0) { if (--transformation->disguiseTime == 10) { if (playerStatus->spriteFacingAngle >= 90 && playerStatus->spriteFacingAngle < 270) { - angle = DEG_TO_RAD(cam->currentYaw - 270); + angle = DEG_TO_RAD(cam->curYaw - 270); radius = 46; } else { - angle = DEG_TO_RAD(cam->currentYaw - 90); + angle = DEG_TO_RAD(cam->curYaw - 90); radius = 30; } - transformation->position.x = playerStatus->position.x + (radius * sin_rad(angle)); - transformation->position.z = playerStatus->position.z - (radius * cos_rad(angle)); - transformation->position.y = playerStatus->position.y - 20; + transformation->pos.x = playerStatus->pos.x + (radius * sin_rad(angle)); + transformation->pos.z = playerStatus->pos.z - (radius * cos_rad(angle)); + transformation->pos.y = playerStatus->pos.y - 20; } if (transformation->disguiseTime <= 10 && transformation->disguiseTime & 1) { f64 tempX, tempZ; fx_sparkles(FX_SPARKLES_3, - transformation->position.x - 8, - transformation->position.y + 50, - transformation->position.z, + transformation->pos.x - 8, + transformation->pos.y + 50, + transformation->pos.z, 2); /* TODO something like: - angle = DEG_TO_RAD((cam->currentYaw + playerStatus->spriteFacingAngle) - 90); - transformation->position.x += (10.0 * sin_rad(angle)); - transformation->position.z -= (10.0 * cos_rad(angle)); + angle = DEG_TO_RAD((cam->curYaw + playerStatus->spriteFacingAngle) - 90); + transformation->pos.x += (10.0 * sin_rad(angle)); + transformation->pos.z -= (10.0 * cos_rad(angle)); */ - angle = DEG_TO_RAD((cam->currentYaw + playerStatus->spriteFacingAngle) - 90); + angle = DEG_TO_RAD((cam->curYaw + playerStatus->spriteFacingAngle) - 90); - tempX = transformation->position.x; + tempX = transformation->pos.x; tempX += 10.0 * sin_rad(angle); - transformation->position.x = tempX; + transformation->pos.x = tempX; - tempZ = transformation->position.z; - transformation->position.z = tempZ - (10.0 * cos_rad(angle)); + tempZ = transformation->pos.z; + transformation->pos.z = tempZ - (10.0 * cos_rad(angle)); } } else if (transformation->disguiseTime == 0) { transformation->disguiseTime = -1; @@ -389,9 +389,9 @@ void action_update_parasol(void) { } if ((transformation->revertTime & 3) == 0) { fx_stars_shimmer(4, - playerStatus->position.x, - playerStatus->position.y, - playerStatus->position.z, + playerStatus->pos.x, + playerStatus->pos.y, + playerStatus->pos.z, 50, 50, 40, 30); } } diff --git a/src/world/action/spin.c b/src/world/action/spin.c index d223d47a54..943e8c724b 100644 --- a/src/world/action/spin.c +++ b/src/world/action/spin.c @@ -40,7 +40,7 @@ void action_update_spin(void) { playerStatus->animFlags &= ~PA_FLAG_INTERRUPT_SPIN; playerStatus->animFlags |= PA_FLAG_SPINNING; playerStatus->flags |= PS_FLAG_SPINNING; - playerStatus->currentStateTime = 0; + playerStatus->curStateTime = 0; playerStatus->actionSubstate = SUBSTATE_SPIN_0; playerSpinState->stopSoundTimer = 0; playerSpinState->hasBufferedSpin = FALSE; @@ -111,7 +111,7 @@ void action_update_spin(void) { sfx_play_sound_at_player(playerSpinState->spinSoundID, SOUND_SPACE_MODE_0); suggest_player_anim_always_forward(anim); - if ((clamp_angle(playerStatus->targetYaw - gCameras[gCurrentCameraID].currentYaw) <= 180.0f)) { + if ((clamp_angle(playerStatus->targetYaw - gCameras[gCurrentCameraID].curYaw) <= 180.0f)) { playerStatus->spinRate = playerSpinState->spinRate; } else { effectType++; @@ -132,9 +132,9 @@ void action_update_spin(void) { if (gSpinHistoryBufferPos > ARRAY_COUNT(gSpinHistoryPosX)) { gSpinHistoryBufferPos = 0; } - gSpinHistoryPosX[gSpinHistoryBufferPos] = playerStatus->position.x; - gSpinHistoryPosY[gSpinHistoryBufferPos] = playerStatus->position.y; - gSpinHistoryPosZ[gSpinHistoryBufferPos] = playerStatus->position.z; + gSpinHistoryPosX[gSpinHistoryBufferPos] = playerStatus->pos.x; + gSpinHistoryPosY[gSpinHistoryBufferPos] = playerStatus->pos.y; + gSpinHistoryPosZ[gSpinHistoryBufferPos] = playerStatus->pos.z; gSpinHistoryPosAngle[gSpinHistoryBufferPos] = playerStatus->spriteFacingAngle; gSpinHistoryBufferPos++; if (gSpinHistoryBufferPos > ARRAY_COUNT(gSpinHistoryPosX)) { @@ -166,18 +166,18 @@ void action_update_spin(void) { playerSpinState->spinDirectionMagnitude = 0.0f; } - angle = clamp_angle(playerStatus->targetYaw - gCameras[gCurrentCameraID].currentYaw); + angle = clamp_angle(playerStatus->targetYaw - gCameras[gCurrentCameraID].curYaw); playerSpinState->spinDirection.x = sin_rad(DEG_TO_RAD(angle)) * playerSpinState->spinDirectionMagnitude; playerSpinState->spinDirection.y = -cos_rad(DEG_TO_RAD(angle)) * playerSpinState->spinDirectionMagnitude; - playerStatus->currentStateTime--; - if (playerStatus->currentStateTime == 0) { + playerStatus->curStateTime--; + if (playerStatus->curStateTime == 0) { playerSpinState->stopSoundTimer = 4; set_action_state(ACTION_STATE_IDLE); playerStatus->flags &= ~PS_FLAG_SPINNING; playerStatus->animFlags &= ~PA_FLAG_SPINNING; sfx_stop_sound(playerSpinState->spinSoundID); } - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; return; } @@ -192,7 +192,7 @@ void action_update_spin(void) { } } - if (!(playerStatus->currentStateTime > playerSpinState->fullSpeedSpinTime)) { + if (!(playerStatus->curStateTime > playerSpinState->fullSpeedSpinTime)) { speedModifier = (playerSpinState->inputMagnitude) ? playerSpinState->speedScale : 0.0f; playerSpinState->spinDirectionMagnitude = playerSpinState->spinDirectionMagnitude + 0.9; @@ -200,11 +200,11 @@ void action_update_spin(void) { playerSpinState->spinDirectionMagnitude = 9.0f; } - angle = clamp_angle(playerStatus->targetYaw - gCameras[gCurrentCameraID].currentYaw); + angle = clamp_angle(playerStatus->targetYaw - gCameras[gCurrentCameraID].curYaw); playerSpinState->spinDirection.x = sin_rad(DEG_TO_RAD(angle)) * playerSpinState->spinDirectionMagnitude; playerSpinState->spinDirection.y = -cos_rad(DEG_TO_RAD(angle)) * playerSpinState->spinDirectionMagnitude; } else { - speedModifier = playerSpinState->speedScale - (playerStatus->currentStateTime - playerSpinState->fullSpeedSpinTime - 1) * playerSpinState->frictionScale; + speedModifier = playerSpinState->speedScale - (playerStatus->curStateTime - playerSpinState->fullSpeedSpinTime - 1) * playerSpinState->frictionScale; if (speedModifier < 0.1) { speedModifier = 0.1f; } @@ -219,7 +219,7 @@ void action_update_spin(void) { } } - playerStatus->currentStateTime++; + playerStatus->curStateTime++; switch (playerStatus->prevActionState) { case ACTION_STATE_IDLE: @@ -230,17 +230,17 @@ void action_update_spin(void) { playerStatus->targetYaw = angle; } } - playerStatus->currentSpeed = (magnitude != 0.0f) ? playerStatus->runSpeed * speedModifier : 0.0f; + playerStatus->curSpeed = (magnitude != 0.0f) ? playerStatus->runSpeed * speedModifier : 0.0f; break; case ACTION_STATE_WALK: case ACTION_STATE_RUN: - playerStatus->currentSpeed = playerStatus->runSpeed * speedModifier; + playerStatus->curSpeed = playerStatus->runSpeed * speedModifier; break; } if (playerStatus->actionSubstate == SUBSTATE_SPIN_0) { playerSpinState->spinCountdown--; if (playerSpinState->spinCountdown > 0) { - if (playerStatus->currentStateTime >= 2) { + if (playerStatus->curStateTime >= 2) { playerStatus->spriteFacingAngle = clamp_angle(playerStatus->spriteFacingAngle + playerStatus->spinRate); } return; @@ -254,21 +254,21 @@ void action_update_spin(void) { playerStatus->spriteFacingAngle = angle + playerStatus->spinRate; if (playerSpinState->hasBufferedSpin) { - playerStatus->currentStateTime = 2; + playerStatus->curStateTime = 2; playerStatus->actionSubstate = SUBSTATE_SPIN_2; playerStatus->flags &= ~PS_FLAG_SPINNING; suggest_player_anim_allow_backward(ANIM_Mario1_Idle); } else if (angle < playerStatus->spriteFacingAngle) { if (playerStatus->spriteFacingAngle >= 180.0f && angle < 180.0f) { playerStatus->spriteFacingAngle = 180.0f; - playerStatus->currentStateTime = 2; + playerStatus->curStateTime = 2; playerStatus->actionSubstate = SUBSTATE_SPIN_2; playerStatus->flags &= ~PS_FLAG_SPINNING; suggest_player_anim_allow_backward(ANIM_Mario1_Idle); } } else if (playerStatus->spriteFacingAngle <= 0.0f && angle < 90.0f) { playerStatus->spriteFacingAngle = 0.0f; - playerStatus->currentStateTime = 2; + playerStatus->curStateTime = 2; playerStatus->actionSubstate = SUBSTATE_SPIN_2; playerStatus->flags &= ~PS_FLAG_SPINNING; suggest_player_anim_allow_backward(ANIM_Mario1_Idle); diff --git a/src/world/action/spin_jump.c b/src/world/action/spin_jump.c index b8c1892d2b..815f060ef5 100644 --- a/src/world/action/spin_jump.c +++ b/src/world/action/spin_jump.c @@ -33,7 +33,7 @@ void action_update_spin_jump(void) { playerStatus->flags |= (PS_FLAG_JUMPING | PS_FLAG_FLYING); playerStatus->actionSubstate = SUBSTATE_SPIN; - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; RotationRate = 0.0f; playerStatus->gravityIntegrator[0] = 5.2f; suggest_player_anim_allow_backward(ANIM_Mario1_Sit); @@ -53,37 +53,37 @@ void action_update_spin_jump(void) { } if (playerStatus->gravityIntegrator[0] >= 0.0f) { playerStatus->gravityIntegrator[0] -= 0.54; - if (collisionStatus->currentCeiling < 0) { - playerStatus->position.y += playerStatus->gravityIntegrator[0]; - } else if (collisionStatus->currentCeiling & COLLISION_WITH_ENTITY_BIT) { - entity = get_entity_by_index(collisionStatus->currentCeiling); + if (collisionStatus->curCeiling < 0) { + playerStatus->pos.y += playerStatus->gravityIntegrator[0]; + } else if (collisionStatus->curCeiling & COLLISION_WITH_ENTITY_BIT) { + entity = get_entity_by_index(collisionStatus->curCeiling); if (entity != NULL) { - playerStatus->position.y = entity->position.y - (playerStatus->colliderHeight * 0.5); + playerStatus->pos.y = entity->pos.y - (playerStatus->colliderHeight * 0.5); } } } if (playerStatus->pitch == 360.0f) { if (playerStatus->gravityIntegrator[0] <= 0.0f) { - playerStatus->currentStateTime = 5; + playerStatus->curStateTime = 5; playerStatus->actionSubstate = SUBSTATE_RISE; playerStatus->gravityIntegrator[0] = 2.0f; } } - collisionStatus->currentCeiling = -1; + collisionStatus->curCeiling = -1; break; case SUBSTATE_RISE: if (playerStatus->gravityIntegrator[0] >= 0.0f) { playerStatus->gravityIntegrator[0] -= 1.4; - if (collisionStatus->currentCeiling < 0) { - playerStatus->position.y += playerStatus->gravityIntegrator[0]; + if (collisionStatus->curCeiling < 0) { + playerStatus->pos.y += playerStatus->gravityIntegrator[0]; } } - if (--playerStatus->currentStateTime <= 0) { + if (--playerStatus->curStateTime <= 0) { playerStatus->actionSubstate++; } break; case SUBSTATE_HOVER: - playerStatus->position.y = player_check_collision_below(0.0f, &belowColliderID); + playerStatus->pos.y = player_check_collision_below(0.0f, &belowColliderID); RotationRate = 45.0f; playerStatus->pitch += RotationRate; if (playerStatus->pitch >= 360.0) { @@ -98,7 +98,7 @@ void action_update_spin_jump(void) { break; case SUBSTATE_DESCEND: velocity = player_fall_distance(); - playerStatus->position.y = player_check_collision_below(velocity, &belowColliderID); + playerStatus->pos.y = player_check_collision_below(velocity, &belowColliderID); if (velocity < -100.0f) { playerStatus->gravityIntegrator[3] = 0.0f; playerStatus->gravityIntegrator[2] = 0.0f; @@ -106,9 +106,9 @@ void action_update_spin_jump(void) { playerStatus->gravityIntegrator[0] = -100.0f; } if (belowColliderID >= 0) { - if (collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT && (entityType = get_entity_type(collisionStatus->currentFloor), + if (collisionStatus->curFloor & COLLISION_WITH_ENTITY_BIT && (entityType = get_entity_type(collisionStatus->curFloor), entityType == ENTITY_TYPE_RED_SWITCH || entityType == ENTITY_TYPE_BLUE_SWITCH)) { - get_entity_by_index(collisionStatus->currentFloor)->collisionFlags |= ENTITY_COLLISION_PLAYER_TOUCH_FLOOR; + get_entity_by_index(collisionStatus->curFloor)->collisionFlags |= ENTITY_COLLISION_PLAYER_TOUCH_FLOOR; playerStatus->actionSubstate = SUBSTATE_HIT_SWITCH; playerStatus->flags &= ~PS_FLAG_FLYING; break; @@ -140,7 +140,7 @@ void action_update_spin_jump(void) { start_rumble(128, 25); panels = &gCurrentHiddenPanels; panels->tryFlipTrigger = TRUE; - panels->flipTriggerPosY = playerStatus->position.y; + panels->flipTriggerPosY = playerStatus->pos.y; playerStatus->flags |= PS_FLAG_SPECIAL_LAND; } } @@ -152,18 +152,18 @@ void action_update_spin_jump(void) { landed = TRUE; } else { if (playerStatus->gravityIntegrator[0] > 0.0f) { - playerStatus->position.y += velocity; + playerStatus->pos.y += velocity; } else { - playerStatus->position.y = player_check_collision_below(velocity, &belowColliderID); + playerStatus->pos.y = player_check_collision_below(velocity, &belowColliderID); if (playerStatus->gravityIntegrator[0] < 0.0f && belowColliderID >= 0) { playerStatus->actionSubstate++; } } - playerStatus->position.y = player_check_collision_below(0.0f, &belowColliderID); + playerStatus->pos.y = player_check_collision_below(0.0f, &belowColliderID); } break; case SUBSTATE_HOLD: - playerStatus->position.y = player_check_collision_below(0.0f, &belowColliderID); + playerStatus->pos.y = player_check_collision_below(0.0f, &belowColliderID); if (belowColliderID >= 0) { playerStatus->gravityIntegrator[0] = 0.0f; playerStatus->gravityIntegrator[1] = 0.0f; @@ -193,7 +193,7 @@ void action_update_spin_jump(void) { belowColliderID = get_collider_below_spin_jump(); if (belowColliderID >= 0) { collisionStatus->lastTouchedFloor = -1; - collisionStatus->currentFloor = belowColliderID; + collisionStatus->curFloor = belowColliderID; } } } @@ -202,9 +202,9 @@ static s32 get_collider_below_spin_jump(void) { f32 posX, posY, posZ, height; f32 hitRx, hitRz, hitDirX, hitDirZ; - posX = gPlayerStatus.position.x; - posZ = gPlayerStatus.position.z; + posX = gPlayerStatus.pos.x; + posZ = gPlayerStatus.pos.z; height = gPlayerStatus.colliderHeight; - posY = gPlayerStatus.position.y + (height * 0.5f); + posY = gPlayerStatus.pos.y + (height * 0.5f); return player_raycast_below_cam_relative(&gPlayerStatus, &posX, &posY, &posZ, &height, &hitRx, &hitRz, &hitDirX, &hitDirZ); } diff --git a/src/world/action/step_up.c b/src/world/action/step_up.c index 164464b7fc..4ddd4ff39b 100644 --- a/src/world/action/step_up.c +++ b/src/world/action/step_up.c @@ -59,13 +59,13 @@ void action_update_step_up(void) { integrate_gravity(); sin_cos_rad(DEG_TO_RAD(playerStatus->targetYaw), &sinTheta, &cosTheta); colliderID = NO_COLLIDER; - playerStatus->position.x += sinTheta * 3.0f; - playerStatus->position.z -= cosTheta * 3.0f; + playerStatus->pos.x += sinTheta * 3.0f; + playerStatus->pos.z -= cosTheta * 3.0f; if (playerStatus->gravityIntegrator[0] < 0.0f) { - playerStatus->position.y = player_check_collision_below(playerStatus->gravityIntegrator[0], &colliderID); + playerStatus->pos.y = player_check_collision_below(playerStatus->gravityIntegrator[0], &colliderID); } else { - playerStatus->position.y += playerStatus->gravityIntegrator[0]; + playerStatus->pos.y += playerStatus->gravityIntegrator[0]; } if (colliderID >= 0) { @@ -95,18 +95,18 @@ void action_update_step_up_peach(void) { if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) { playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED; suggest_player_anim_allow_backward(ANIM_Peach1_StepUp); - playerStatus->currentStateTime = 8; + playerStatus->curStateTime = 8; } - if (playerStatus->currentStateTime != 0) { - playerStatus->currentStateTime--; - if (playerStatus->currentStateTime == 4) { + if (playerStatus->curStateTime != 0) { + playerStatus->curStateTime--; + if (playerStatus->curStateTime == 4) { try_player_footstep_sounds(1); } } else { if (!(playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT)) { set_action_state(ACTION_STATE_IDLE); - } else if (playerStatus->currentSpeed >= playerStatus->runSpeed) { + } else if (playerStatus->curSpeed >= playerStatus->runSpeed) { set_action_state(ACTION_STATE_RUN); } else { set_action_state(ACTION_STATE_WALK); diff --git a/src/world/action/tornado_jump.c b/src/world/action/tornado_jump.c index 441668e9f9..9b952df0d5 100644 --- a/src/world/action/tornado_jump.c +++ b/src/world/action/tornado_jump.c @@ -34,7 +34,7 @@ void action_update_tornado_jump(void) { playerStatus->flags |= (PS_FLAG_SPINNING | PS_FLAG_FLYING | PS_FLAG_JUMPING); phys_clear_spin_history(); playerStatus->actionSubstate = SUBSTATE_ASCEND; - playerStatus->currentSpeed = 0.0f; + playerStatus->curSpeed = 0.0f; playerStatus->gravityIntegrator[0] = 16.0f; playerStatus->gravityIntegrator[1] = -7.38624f; playerStatus->gravityIntegrator[2] = 3.44694f; @@ -43,7 +43,7 @@ void action_update_tornado_jump(void) { disable_player_input(); playerStatus->flags |= PS_FLAG_SPECIAL_JUMP; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_IGNORE_PLAYER_Y; - cameraRelativeYaw = clamp_angle(playerStatus->targetYaw - gCameras[gCurrentCameraID].currentYaw); + cameraRelativeYaw = clamp_angle(playerStatus->targetYaw - gCameras[gCurrentCameraID].curYaw); if (cameraRelativeYaw <= 180.0f) { spinRate = 60.0f; } else { @@ -65,7 +65,7 @@ void action_update_tornado_jump(void) { } } if (playerStatus->gravityIntegrator[0] <= 0.0f) { - gSpinHistoryPosY[gSpinHistoryBufferPos] = playerStatus->position.y; + gSpinHistoryPosY[gSpinHistoryBufferPos] = playerStatus->pos.y; } gSpinHistoryPosAngle[gSpinHistoryBufferPos++] = playerStatus->spriteFacingAngle; @@ -77,11 +77,11 @@ void action_update_tornado_jump(void) { switch (playerStatus->actionSubstate) { case SUBSTATE_ASCEND: fallVelocity = integrate_gravity(); - playerStatus->position.y = player_check_collision_below(fallVelocity, &colliderBelow); - if (colliderBelow >= 0 && collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT ) { - entityType = get_entity_type(collisionStatus->currentFloor); + playerStatus->pos.y = player_check_collision_below(fallVelocity, &colliderBelow); + if (colliderBelow >= 0 && collisionStatus->curFloor & COLLISION_WITH_ENTITY_BIT ) { + entityType = get_entity_type(collisionStatus->curFloor); if (entityType == ENTITY_TYPE_BLUE_SWITCH || entityType == ENTITY_TYPE_RED_SWITCH) { - get_entity_by_index(collisionStatus->currentFloor)->collisionFlags |= ENTITY_COLLISION_PLAYER_TOUCH_FLOOR; + get_entity_by_index(collisionStatus->curFloor)->collisionFlags |= ENTITY_COLLISION_PLAYER_TOUCH_FLOOR; disable_player_input(); playerStatus->actionSubstate = SUBSTATE_HIT_SWITCH; break; @@ -89,7 +89,7 @@ void action_update_tornado_jump(void) { } if (fallVelocity <= 0.0f) { record_jump_apex(); - playerStatus->currentStateTime = 3; + playerStatus->curStateTime = 3; playerStatus->flags |= PS_FLAG_FALLING; playerStatus->actionSubstate++; sfx_play_sound_at_player(SOUND_TORNADO_JUMP, SOUND_SPACE_MODE_0); @@ -100,13 +100,13 @@ void action_update_tornado_jump(void) { } break; case SUBSTATE_HOVER: - if (--playerStatus->currentStateTime <= 0) { + if (--playerStatus->curStateTime <= 0) { playerStatus->actionSubstate++; } break; case SUBSTATE_DESCEND: fallVelocity = integrate_gravity(); - playerStatus->position.y = player_check_collision_below(fallVelocity, &colliderBelow); + playerStatus->pos.y = player_check_collision_below(fallVelocity, &colliderBelow); if (fallVelocity < -100.0f) { playerStatus->gravityIntegrator[3] = 0.0f; playerStatus->gravityIntegrator[2] = 0.0f; @@ -114,8 +114,8 @@ void action_update_tornado_jump(void) { playerStatus->gravityIntegrator[0] = -100.0f; } if (colliderBelow >= 0) { - if (collisionStatus->currentFloor & COLLISION_WITH_ENTITY_BIT) { - entityType = get_entity_type(collisionStatus->currentFloor); + if (collisionStatus->curFloor & COLLISION_WITH_ENTITY_BIT) { + entityType = get_entity_type(collisionStatus->curFloor); if (entityType == ENTITY_TYPE_SIMPLE_SPRING || entityType == ENTITY_TYPE_SCRIPT_SPRING) { playerStatus->flags &= ~(PS_FLAG_SPINNING | PS_FLAG_FLYING); set_action_state(ACTION_STATE_LAND); @@ -128,7 +128,7 @@ void action_update_tornado_jump(void) { start_rumble(256, 50); gCurrentHiddenPanels.tryFlipTrigger = TRUE; - gCurrentHiddenPanels.flipTriggerPosY = playerStatus->position.y; + gCurrentHiddenPanels.flipTriggerPosY = playerStatus->pos.y; playerStatus->flags |= PS_FLAG_SPECIAL_LAND; return; } @@ -146,7 +146,7 @@ void action_update_tornado_jump(void) { playerStatus->flags &= ~(PS_FLAG_SPINNING | PS_FLAG_FLYING); return; } - playerStatus->currentStateTime = 8; + playerStatus->curStateTime = 8; playerStatus->timeInAir = 0; playerStatus->actionState = ACTION_STATE_TORNADO_POUND; playerStatus->actionSubstate++; @@ -155,12 +155,12 @@ void action_update_tornado_jump(void) { start_rumble(256, 50); gCurrentHiddenPanels.tryFlipTrigger = TRUE; - gCurrentHiddenPanels.flipTriggerPosY = playerStatus->position.y; + gCurrentHiddenPanels.flipTriggerPosY = playerStatus->pos.y; playerStatus->flags |= PS_FLAG_SPECIAL_LAND; } break; case SUBSTATE_IMPACT: - if (--playerStatus->currentStateTime == 0) { + if (--playerStatus->curStateTime == 0) { playerStatus->actionSubstate++; playerStatus->flags &= ~(PS_FLAG_SPINNING | PS_FLAG_FLYING); set_action_state(ACTION_STATE_LAND); @@ -179,7 +179,7 @@ void action_update_tornado_jump(void) { colliderBelow = get_collider_below_tornado_jump(); if (colliderBelow >= 0) { collisionStatus->lastTouchedFloor = -1; - collisionStatus->currentFloor = colliderBelow; + collisionStatus->curFloor = colliderBelow; } } } @@ -188,9 +188,9 @@ static s32 get_collider_below_tornado_jump(void) { f32 posX, posY, posZ, height; f32 hitRx, hitRz, hitDirX, hitDirZ; - posX = gPlayerStatus.position.x; - posZ = gPlayerStatus.position.z; + posX = gPlayerStatus.pos.x; + posZ = gPlayerStatus.pos.z; height = gPlayerStatus.colliderHeight; - posY = gPlayerStatus.position.y + (height * 0.5f); + posY = gPlayerStatus.pos.y + (height * 0.5f); return player_raycast_below_cam_relative(&gPlayerStatus, &posX, &posY, &posZ, &height, &hitRx, &hitRz, &hitDirX, &hitDirZ); } diff --git a/src/world/action/use_munchlesia.c b/src/world/action/use_munchlesia.c index d67b5b09e2..f0cbd527b6 100644 --- a/src/world/action/use_munchlesia.c +++ b/src/world/action/use_munchlesia.c @@ -40,28 +40,28 @@ void action_update_use_munchlesia(void) { Munchlesia_LaunchYaw = playerStatus->targetYaw; break; case SUBSTATE_EJECT: - playerStatus->position.y += Munchlesia_LaunchVelocity; + playerStatus->pos.y += Munchlesia_LaunchVelocity; Munchlesia_LaunchVelocity -= Munchlesia_LaunchAccel; - add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, Munchlesia_LateralVelocity, Munchlesia_LaunchYaw); - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, Munchlesia_LateralVelocity, Munchlesia_LaunchYaw); + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; if (Munchlesia_LaunchVelocity <= 0.0f) { playerStatus->actionSubstate++; // SUBSTATE_FALL } break; case SUBSTATE_FALL: - playerStatus->position.y += Munchlesia_LaunchVelocity; + playerStatus->pos.y += Munchlesia_LaunchVelocity; Munchlesia_LaunchVelocity -= Munchlesia_LaunchAccel; - add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, Munchlesia_LateralVelocity, Munchlesia_LaunchYaw); - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, Munchlesia_LateralVelocity, Munchlesia_LaunchYaw); + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; hitPosY = player_check_collision_below(Munchlesia_LaunchVelocity, &colliderID); if (colliderID >= 0) { sfx_play_sound_at_player(SOUND_162, SOUND_SPACE_MODE_0); suggest_player_anim_always_forward(ANIM_MarioW2_Collapse); - playerStatus->position.y = hitPosY; + playerStatus->pos.y = hitPosY; D_802B62E0 = 10; playerStatus->actionSubstate++; // SUBSTATE_CRASH } @@ -70,13 +70,13 @@ void action_update_use_munchlesia(void) { if (playerStatus->animNotifyValue != 0) { suggest_player_anim_always_forward(ANIM_Mario1_GetUp); playerStatus->actionSubstate = SUBSTATE_GET_UP; - playerStatus->currentStateTime = 15; + playerStatus->curStateTime = 15; break; } break; case SUBSTATE_GET_UP: - if (playerStatus->currentStateTime != 0) { - playerStatus->currentStateTime--; + if (playerStatus->curStateTime != 0) { + playerStatus->curStateTime--; break; } enable_player_static_collisions(); diff --git a/src/world/action/use_spinning_flower.c b/src/world/action/use_spinning_flower.c index 8349f3332f..0031f079a6 100644 --- a/src/world/action/use_spinning_flower.c +++ b/src/world/action/use_spinning_flower.c @@ -30,10 +30,10 @@ static s32 get_entity_below_spinning_flower(void) { f32 posX, posY, posZ, height; f32 hitRx, hitRz, hitDirX, hitDirZ; - posX = gPlayerStatus.position.x; - posZ = gPlayerStatus.position.z; + posX = gPlayerStatus.pos.x; + posZ = gPlayerStatus.pos.z; height = gPlayerStatus.colliderHeight; - posY = gPlayerStatus.position.y + (height * 0.5); + posY = gPlayerStatus.pos.y + (height * 0.5); return player_raycast_below_cam_relative(&gPlayerStatus, &posX, &posY, &posZ, &height, &hitRx, &hitRz, &hitDirX, &hitDirZ); } @@ -55,15 +55,15 @@ void action_update_use_spinning_flower(void) { gOverrideFlags |= GLOBAL_OVERRIDES_40; func_800EF300(); playerStatus->actionSubstate = SUBSTATE_ATTRACT; - playerStatus->currentStateTime = 0; + playerStatus->curStateTime = 0; D_802B6EE4 = 0.0f; D_802B6EE8 = 0.0f; - D_802B6EF4 = playerStatus->position.y; + D_802B6EF4 = playerStatus->pos.y; D_802B6EDC = 3.0f; disable_player_static_collisions(); disable_player_input(); playerStatus->flags |= PS_FLAG_ROTATION_LOCKED; - entityID = gCollisionStatus.currentFloor; + entityID = gCollisionStatus.curFloor; TempPointer = &SpinningFlower_EntityIndex; if (entityID >= 0){ @@ -88,22 +88,22 @@ void action_update_use_spinning_flower(void) { D_802B6EE4 = 20.0f; } playerStatus->spriteFacingAngle = clamp_angle(playerStatus->spriteFacingAngle + D_802B6EE4); - if (playerStatus->currentStateTime < 10) { - playerStatus->currentStateTime++; + if (playerStatus->curStateTime < 10) { + playerStatus->curStateTime++; D_802B6EF4++; } D_802B6EE8 += 8.0f; - playerStatus->position.y = D_802B6EF4 + sin_rad(DEG_TO_RAD(clamp_angle(D_802B6EE8))) * 4.0f; + playerStatus->pos.y = D_802B6EF4 + sin_rad(DEG_TO_RAD(clamp_angle(D_802B6EE8))) * 4.0f; if (SpinningFlower_EntityIndex >= 0) { entityByIndex = get_entity_by_index(SpinningFlower_EntityIndex); - distToCenter = dist2D(entityByIndex->position.x, entityByIndex->position.z, playerStatus->position.x, playerStatus->position.z); - SpinningFlower_AngleToCenter = atan2(entityByIndex->position.x, entityByIndex->position.z, playerStatus->position.x, playerStatus->position.z); + distToCenter = dist2D(entityByIndex->pos.x, entityByIndex->pos.z, playerStatus->pos.x, playerStatus->pos.z); + SpinningFlower_AngleToCenter = atan2(entityByIndex->pos.x, entityByIndex->pos.z, playerStatus->pos.x, playerStatus->pos.z); if (distToCenter > 4.0f) { distToCenter--; } sin_cos_rad(DEG_TO_RAD(SpinningFlower_AngleToCenter), &dx, &dz); - playerStatus->position.x = entityByIndex->position.x + (dx * distToCenter); - playerStatus->position.z = entityByIndex->position.z - (dz * distToCenter); + playerStatus->pos.x = entityByIndex->pos.x + (dx * distToCenter); + playerStatus->pos.z = entityByIndex->pos.z - (dz * distToCenter); sin_cos_rad(DEG_TO_RAD(SpinningFlower_AngleToCenter - 91.0f), &dx, &dz); D_802B6ED4 = dx * D_802B6EDC; D_802B6ED8 = -dz * D_802B6EDC; @@ -115,17 +115,17 @@ void action_update_use_spinning_flower(void) { if (inputMagnitude < 0.1) { inputMagnitude = 0.1f; } - playerStatus->position.x += dx * inputMagnitude; - playerStatus->position.z -= dz * inputMagnitude; + playerStatus->pos.x += dx * inputMagnitude; + playerStatus->pos.z -= dz * inputMagnitude; } - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; entityID = get_entity_below_spinning_flower(); if (entityID < 0 || !(entityID & COLLISION_WITH_ENTITY_BIT)) { - playerStatus->currentStateTime = 20; + playerStatus->curStateTime = 20; D_802B6EE8 = 0.0f; - D_802B6EF4 = playerStatus->position.y; + D_802B6EF4 = playerStatus->pos.y; playerStatus->actionSubstate++; D_802B6EF0 = 1.6f; playerStatus->flags |= PS_FLAG_SCRIPTED_FALL; @@ -134,9 +134,9 @@ void action_update_use_spinning_flower(void) { !(playerStatus->animFlags & (PA_FLAG_USING_WATT | PA_FLAG_WATT_IN_HANDS))) { suggest_player_anim_always_forward(ANIM_Mario1_Jump); playerStatus->actionSubstate = SUBSTATE_SPIN_UP; - playerStatus->currentStateTime = 30; + playerStatus->curStateTime = 30; D_802B6EE0 = 0.0f; - gCollisionStatus.currentFloor = NO_COLLIDER; + gCollisionStatus.curFloor = NO_COLLIDER; exec_entity_commandlist(get_entity_by_index(SpinningFlower_EntityIndex)); } break; @@ -152,13 +152,13 @@ void action_update_use_spinning_flower(void) { D_802B6EF0 -= 0.72; D_802B6ED4 = dx * D_802B6EDC; D_802B6ED8 = -dz * D_802B6EDC; - playerStatus->position.x += D_802B6ED4; - playerStatus->position.z += D_802B6ED8; + playerStatus->pos.x += D_802B6ED4; + playerStatus->pos.z += D_802B6ED8; collision_lava_reset_check_additional_overlaps(); - playerStatus->position.y = player_check_collision_below(D_802B6EF0, &entityID); - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + playerStatus->pos.y = player_check_collision_below(D_802B6EF0, &entityID); + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; if (entityID >= 0) { playerStatus->flags &= ~PS_FLAG_ROTATION_LOCKED; enable_player_input(); @@ -174,26 +174,26 @@ void action_update_use_spinning_flower(void) { case SUBSTATE_SPIN_UP: if (SpinningFlower_EntityIndex >= 0) { entityByIndex = get_entity_by_index(SpinningFlower_EntityIndex); - distToCenter = dist2D(entityByIndex->position.x, entityByIndex->position.z, playerStatus->position.x, playerStatus->position.z); - SpinningFlower_AngleToCenter = atan2(entityByIndex->position.x, entityByIndex->position.z, playerStatus->position.x, playerStatus->position.z); + distToCenter = dist2D(entityByIndex->pos.x, entityByIndex->pos.z, playerStatus->pos.x, playerStatus->pos.z); + SpinningFlower_AngleToCenter = atan2(entityByIndex->pos.x, entityByIndex->pos.z, playerStatus->pos.x, playerStatus->pos.z); if (distToCenter > 4.0f) { distToCenter -= 1.0f; } sin_cos_rad(DEG_TO_RAD(SpinningFlower_AngleToCenter), &dx, &dz); - playerStatus->position.x = entityByIndex->position.x + (dx * distToCenter); - playerStatus->position.z = entityByIndex->position.z - (dz * distToCenter); + playerStatus->pos.x = entityByIndex->pos.x + (dx * distToCenter); + playerStatus->pos.z = entityByIndex->pos.z - (dz * distToCenter); sin_cos_rad(DEG_TO_RAD(SpinningFlower_AngleToCenter - 91.0f), &dx, &dz); D_802B6ED4 = dx * D_802B6EDC; D_802B6ED8 = -dz * D_802B6EDC; } D_802B6EE8 += 8.0f; - playerStatus->position.y = D_802B6EF4 + sin_rad(DEG_TO_RAD(clamp_angle(D_802B6EE8))) * 4.0f; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - if (playerStatus->currentStateTime != 0) { - playerStatus->currentStateTime--; + playerStatus->pos.y = D_802B6EF4 + sin_rad(DEG_TO_RAD(clamp_angle(D_802B6EE8))) * 4.0f; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + if (playerStatus->curStateTime != 0) { + playerStatus->curStateTime--; D_802B6EE4 += 2.0f; if (D_802B6EE4 >= 45.0f) { D_802B6EE4 = 45.0f; @@ -202,7 +202,7 @@ void action_update_use_spinning_flower(void) { break; } playerStatus->actionSubstate++; // SUBSTATE_ASCEND_A - playerStatus->currentStateTime = 30; + playerStatus->curStateTime = 30; phys_adjust_cam_on_landing(); break; case SUBSTATE_ASCEND_A: @@ -217,47 +217,47 @@ void action_update_use_spinning_flower(void) { } ascentVelocity = sin_rad(DEG_TO_RAD(D_802B6EE0)) * 4.0f; - playerStatus->position.y += ascentVelocity; - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; - distToCenter = fabsf(dist2D(D_802BCE34, D_802BCE32, playerStatus->position.x, playerStatus->position.z)); + playerStatus->pos.y += ascentVelocity; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; + distToCenter = fabsf(dist2D(D_802BCE34, D_802BCE32, playerStatus->pos.x, playerStatus->pos.z)); if (distToCenter > 40.0f) { - if (D_802BCE30 + 30 < playerStatus->position.y) { + if (D_802BCE30 + 30 < playerStatus->pos.y) { playerStatus->actionSubstate++; // SUBSTATE_ASCEND_B - inputAngle = atan2(playerStatus->position.x, playerStatus->position.z, D_802BCE34, D_802BCE32); + inputAngle = atan2(playerStatus->pos.x, playerStatus->pos.z, D_802BCE34, D_802BCE32); sin_cos_rad(DEG_TO_RAD(inputAngle), &dx, &dz); - playerStatus->currentStateTime = 64; + playerStatus->curStateTime = 64; SpinningFlower_AngleToCenter = inputAngle; D_802B6ED4 = (dx * distToCenter) * 0.015625; D_802B6ED8 = (-dz * distToCenter) * 0.015625; } break; } - if (playerStatus->currentStateTime == 0) { + if (playerStatus->curStateTime == 0) { playerStatus->actionSubstate = SUBSTATE_BOOST; - playerStatus->currentStateTime = 20; + playerStatus->curStateTime = 20; } else { - playerStatus->currentStateTime--; + playerStatus->curStateTime--; } break; case SUBSTATE_ASCEND_B: playerStatus->spriteFacingAngle = clamp_angle(playerStatus->spriteFacingAngle + D_802B6EE4); - if (playerStatus->currentStateTime != 0) { - playerStatus->currentStateTime--; + if (playerStatus->curStateTime != 0) { + playerStatus->curStateTime--; if (D_802B6EE0-- < 0.0f) { D_802B6EE0 = 0.0f; } ascentVelocity = 2.0f * sin_rad(DEG_TO_RAD(D_802B6EE0)); - playerStatus->position.x += D_802B6ED4; - playerStatus->position.y += ascentVelocity; - playerStatus->position.z += D_802B6ED8; + playerStatus->pos.x += D_802B6ED4; + playerStatus->pos.y += ascentVelocity; + playerStatus->pos.z += D_802B6ED8; } else { playerStatus->actionSubstate = SUBSTATE_FINISH; } - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; break; case SUBSTATE_BOOST: D_802B6EE4 += 1.0f; @@ -270,9 +270,9 @@ void action_update_use_spinning_flower(void) { D_802B6EE0 = 45.0f; } ascentVelocity = sin_rad(DEG_TO_RAD(D_802B6EE0)) * 3.0f; - playerStatus->position.y += ascentVelocity; - if (playerStatus->currentStateTime != 0) { - playerStatus->currentStateTime--; + playerStatus->pos.y += ascentVelocity; + if (playerStatus->curStateTime != 0) { + playerStatus->curStateTime--; break; } case SUBSTATE_FINISH: diff --git a/src/world/action/use_tweester.c b/src/world/action/use_tweester.c index ef05989596..250bc287c3 100644 --- a/src/world/action/use_tweester.c +++ b/src/world/action/use_tweester.c @@ -25,10 +25,10 @@ void action_update_use_tweester(void) { suggest_player_anim_allow_backward(ANIM_MarioW2_FlailArms); playerStatus->actionSubstate = SUBSTATE_LAUNCH; mem_clear(PlayerTweesterPhysicsPtr, sizeof(*PlayerTweesterPhysicsPtr)); - PlayerTweesterPhysicsPtr->radius = fabsf(dist2D(playerStatus->position.x, playerStatus->position.z, entity->position.x, entity->position.z)); - PlayerTweesterPhysicsPtr->angle = atan2(entity->position.x, entity->position.z, playerStatus->position.x, playerStatus->position.z); - PlayerTweesterPhysicsPtr->angularVelocity = 6.0f; - PlayerTweesterPhysicsPtr->liftoffVelocityPhase = 50.0f; + PlayerTweesterPhysicsPtr->radius = fabsf(dist2D(playerStatus->pos.x, playerStatus->pos.z, entity->pos.x, entity->pos.z)); + PlayerTweesterPhysicsPtr->angle = atan2(entity->pos.x, entity->pos.z, playerStatus->pos.x, playerStatus->pos.z); + PlayerTweesterPhysicsPtr->angularVel = 6.0f; + PlayerTweesterPhysicsPtr->liftoffVelPhase = 50.0f; PlayerTweesterPhysicsPtr->countdown = 120; sfx_play_sound_at_player(SOUND_TWEESTER_LAUNCH, SOUND_SPACE_MODE_0); } @@ -37,10 +37,10 @@ void action_update_use_tweester(void) { case SUBSTATE_LAUNCH: sin_cos_rad(DEG_TO_RAD(PlayerTweesterPhysicsPtr->angle), &sinAngle, &cosAngle); - playerStatus->position.x = entity->position.x + (sinAngle * PlayerTweesterPhysicsPtr->radius); - playerStatus->position.z = entity->position.z - (cosAngle * PlayerTweesterPhysicsPtr->radius); + playerStatus->pos.x = entity->pos.x + (sinAngle * PlayerTweesterPhysicsPtr->radius); + playerStatus->pos.z = entity->pos.z - (cosAngle * PlayerTweesterPhysicsPtr->radius); - PlayerTweesterPhysicsPtr->angle = clamp_angle(PlayerTweesterPhysicsPtr->angle - PlayerTweesterPhysicsPtr->angularVelocity); + PlayerTweesterPhysicsPtr->angle = clamp_angle(PlayerTweesterPhysicsPtr->angle - PlayerTweesterPhysicsPtr->angularVel); if (PlayerTweesterPhysicsPtr->radius > 20.0f) { PlayerTweesterPhysicsPtr->radius--; @@ -48,17 +48,17 @@ void action_update_use_tweester(void) { PlayerTweesterPhysicsPtr->radius++; } - liftoffVelocity = sin_rad(DEG_TO_RAD(PlayerTweesterPhysicsPtr->liftoffVelocityPhase)) * 3.0f; - PlayerTweesterPhysicsPtr->liftoffVelocityPhase += 3.0f; - if (PlayerTweesterPhysicsPtr->liftoffVelocityPhase > 150.0f) { - PlayerTweesterPhysicsPtr->liftoffVelocityPhase = 150.0f; + liftoffVelocity = sin_rad(DEG_TO_RAD(PlayerTweesterPhysicsPtr->liftoffVelPhase)) * 3.0f; + PlayerTweesterPhysicsPtr->liftoffVelPhase += 3.0f; + if (PlayerTweesterPhysicsPtr->liftoffVelPhase > 150.0f) { + PlayerTweesterPhysicsPtr->liftoffVelPhase = 150.0f; } - playerStatus->position.y += liftoffVelocity; + playerStatus->pos.y += liftoffVelocity; playerStatus->spriteFacingAngle = clamp_angle(360.0f - PlayerTweesterPhysicsPtr->angle); - PlayerTweesterPhysicsPtr->angularVelocity += 0.6; - if (PlayerTweesterPhysicsPtr->angularVelocity > 40.0f) { - PlayerTweesterPhysicsPtr->angularVelocity = 40.0f; + PlayerTweesterPhysicsPtr->angularVel += 0.6; + if (PlayerTweesterPhysicsPtr->angularVel > 40.0f) { + PlayerTweesterPhysicsPtr->angularVel = 40.0f; } if (--PlayerTweesterPhysicsPtr->countdown == 0) { playerStatus->actionSubstate++; // SUBSTATE_DONE diff --git a/src/world/action/walk.c b/src/world/action/walk.c index fd7eb47c51..b3f3e58cee 100644 --- a/src/world/action/walk.c +++ b/src/world/action/walk.c @@ -49,7 +49,7 @@ void action_update_walk(void) { changedAnim = TRUE; if (!(playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT)) { - playerStatus->currentSpeed = playerStatus->walkSpeed; + playerStatus->curSpeed = playerStatus->walkSpeed; } if (playerStatus->animFlags & PA_FLAG_8BIT_MARIO) { @@ -135,7 +135,7 @@ void action_update_run(void) { phi_s3 = 1; if (!(playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT)) { - playerStatus->currentSpeed = playerStatus->runSpeed; + playerStatus->curSpeed = playerStatus->runSpeed; } if (playerStatus->animFlags & PA_FLAG_8BIT_MARIO) { anim = ANIM_MarioW3_8bit_Run; @@ -162,7 +162,7 @@ void action_update_run(void) { runSpeedModifier = 1.5f; } - playerStatus->currentSpeed = playerStatus->runSpeed * runSpeedModifier; + playerStatus->curSpeed = playerStatus->runSpeed * runSpeedModifier; player_input_to_move_vector(&moveX, &moveY); phys_update_interact_collider(); if (check_input_jump() == FALSE) { @@ -226,7 +226,7 @@ static void action_update_walk_peach(void) { playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED; playerStatus->unk_60 = 0; if (!(playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT)) { - playerStatus->currentSpeed = playerStatus->walkSpeed; + playerStatus->curSpeed = playerStatus->walkSpeed; } func_802B6550_E23C30(); } @@ -263,7 +263,7 @@ static void action_update_run_peach(void) { playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED; playerStatus->unk_60 = 0; if (!(playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT)) { - playerStatus->currentSpeed = playerStatus->runSpeed; + playerStatus->curSpeed = playerStatus->runSpeed; } if (!(playerStatus->animFlags & PA_FLAG_INVISIBLE)) { @@ -288,7 +288,7 @@ static void action_update_run_peach(void) { return; } - playerStatus->currentSpeed = playerStatus->runSpeed; + playerStatus->curSpeed = playerStatus->runSpeed; player_input_to_move_vector(&moveX, &moveY); phys_update_interact_collider(); if (moveY == 0.0f) { diff --git a/src/world/area_arn/arn_08/arn_08_3_well.c b/src/world/area_arn/arn_08/arn_08_3_well.c index 12b19b270b..5c35b771dc 100644 --- a/src/world/area_arn/arn_08/arn_08_3_well.c +++ b/src/world/area_arn/arn_08/arn_08_3_well.c @@ -12,7 +12,7 @@ API_CALLABLE(N(AwaitPlayerFallDist)) { } fallSpeed = player_fall_distance(); - playerStatus->position.y = player_check_collision_below(fallSpeed, &colliderID); + playerStatus->pos.y = player_check_collision_below(fallSpeed, &colliderID); script->functionTemp[0] += fabsf(fallSpeed); if (script->functionTemp[0] > 50) { @@ -23,7 +23,7 @@ API_CALLABLE(N(AwaitPlayerFallDist)) { } API_CALLABLE(N(AwaitPlayerJumpDown)) { - if (gPlayerStatus.position.y < -10.0f) { + if (gPlayerStatus.pos.y < -10.0f) { return ApiStatus_DONE2; } else { return ApiStatus_BLOCK; diff --git a/src/world/area_arn/arn_08/arn_08_5_demo.c b/src/world/area_arn/arn_08/arn_08_5_demo.c index 520ab147da..268f855e0c 100644 --- a/src/world/area_arn/arn_08/arn_08_5_demo.c +++ b/src/world/area_arn/arn_08/arn_08_5_demo.c @@ -106,11 +106,11 @@ API_CALLABLE(N(func_802400F4_BF4894)) { script->functionTemp[0] = 0; } - if (!(playerStatus->position.y > -10.0f)) { + if (!(playerStatus->pos.y > -10.0f)) { f32 temp_f20 = player_fall_distance(); s32 colliderID; - playerStatus->position.y = player_check_collision_below(temp_f20, &colliderID); + playerStatus->pos.y = player_check_collision_below(temp_f20, &colliderID); script->functionTemp[0] += fabsf(temp_f20); return (script->functionTemp[0] > 50) * ApiStatus_DONE2; @@ -140,11 +140,11 @@ API_CALLABLE(N(SetupDemoScene)) { break; case 3: { partner_clear_player_tracking(wPartnerNpc); - partner_set_goal_pos(playerStatus->position.x, playerStatus->position.z); + partner_set_goal_pos(playerStatus->pos.x, playerStatus->pos.z); func_800EF3D4(0); set_npc_yaw(wPartnerNpc, 90.0f); playerStatus->targetYaw = 90.0f; - playerStatus->currentYaw = 90.0f; + playerStatus->curYaw = 90.0f; playerStatus->spriteFacingAngle = 0.0f; return ApiStatus_DONE2; } diff --git a/src/world/area_dgb/dgb_05/dgb_05_3_hole.c b/src/world/area_dgb/dgb_05/dgb_05_3_hole.c index 7345cd2929..406005660d 100644 --- a/src/world/area_dgb/dgb_05/dgb_05_3_hole.c +++ b/src/world/area_dgb/dgb_05/dgb_05_3_hole.c @@ -1,14 +1,14 @@ #include "dgb_05.h" API_CALLABLE(N(AwaitFallInHole)) { - if (gPlayerStatus.position.y >= -210.0f) { + if (gPlayerStatus.pos.y >= -210.0f) { return ApiStatus_BLOCK; } return ApiStatus_DONE2; } API_CALLABLE(N(AwaitFallDownHole)) { - if (gPlayerStatus.position.y > -270.0f) { + if (gPlayerStatus.pos.y > -270.0f) { return ApiStatus_BLOCK; } return ApiStatus_DONE2; diff --git a/src/world/area_dgb/dgb_10/dgb_10_3_hole.c b/src/world/area_dgb/dgb_10/dgb_10_3_hole.c index 4f1d04ae07..ae7ad919e4 100644 --- a/src/world/area_dgb/dgb_10/dgb_10_3_hole.c +++ b/src/world/area_dgb/dgb_10/dgb_10_3_hole.c @@ -7,13 +7,13 @@ API_CALLABLE(N(AwaitFallInHole)) { PlayerStatus* playerStatus = &gPlayerStatus; s32 entry; - if (playerStatus->position.y >= 0.0f) { + if (playerStatus->pos.y >= 0.0f) { return ApiStatus_BLOCK; } - if (playerStatus->position.x < 440.0f) { + if (playerStatus->pos.x < 440.0f) { entry = dgb_11_ENTRY_3; - } else if (playerStatus->position.z < -170.0f) { + } else if (playerStatus->pos.z < -170.0f) { entry = dgb_11_ENTRY_2; } else { entry = dgb_11_ENTRY_1; @@ -24,7 +24,7 @@ API_CALLABLE(N(AwaitFallInHole)) { } API_CALLABLE(N(AwaitFallDownHole)) { - if (gPlayerStatus.position.y > -60.0f) { + if (gPlayerStatus.pos.y > -60.0f) { return ApiStatus_BLOCK; } return ApiStatus_DONE2; diff --git a/src/world/area_dgb/dgb_18/dgb_18_3_npc.c b/src/world/area_dgb/dgb_18/dgb_18_3_npc.c index e9ec422b21..4bb0acbb3e 100644 --- a/src/world/area_dgb/dgb_18/dgb_18_3_npc.c +++ b/src/world/area_dgb/dgb_18/dgb_18_3_npc.c @@ -19,14 +19,14 @@ API_CALLABLE(N(UnusedChasePlayer)) { posX = npc->pos.x; posZ = npc->pos.z; npc->moveSpeed = 3.7f; - npc->yaw = atan2(posX, posZ, playerStatus->position.x, playerStatus->position.z); + npc->yaw = atan2(posX, posZ, playerStatus->pos.x, playerStatus->pos.z); script->functionTemp[1] = 0; npc->duration = 15; } if (script->functionTemp[1] == 0) { if (npc->duration == 0) { - npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); npc->duration = 15; } npc->duration--; diff --git a/src/world/area_dro/dro_01/npc_hint_dryite.c b/src/world/area_dro/dro_01/npc_hint_dryite.c index 75976b1078..825ea03d90 100644 --- a/src/world/area_dro/dro_01/npc_hint_dryite.c +++ b/src/world/area_dro/dro_01/npc_hint_dryite.c @@ -13,7 +13,7 @@ API_CALLABLE(N(GetFloorCollider)) { Bytecode* args = script->ptrReadPos; s32 outVar = *args++; - evt_set_variable(script, outVar, gCollisionStatus.currentFloor); + evt_set_variable(script, outVar, gCollisionStatus.curFloor); return ApiStatus_DONE2; } @@ -75,7 +75,7 @@ void N(red_tree_orbit_listener)(PlayerOrbitState* orbit, s32 event) { if (orbit->numRotations >= 6) { // wait to be near NPC with at least 6 full rotations complete f32 angle1 = atan2(125.0f, -42.0f, 152.0f, -61.0f); - f32 angle2 = atan2(125.0f, -42.0f, playerStatus->position.x, playerStatus->position.z); + f32 angle2 = atan2(125.0f, -42.0f, playerStatus->pos.x, playerStatus->pos.z); f32 deltaAngle = get_clamped_angle_diff(angle1, angle2); if (fabsf(deltaAngle) < 30.0f) { start_script(&N(EVS_Scene_TreeOrbitReaction), EVT_PRIORITY_1, 0); diff --git a/src/world/area_dro/dro_01/npc_hint_dryite_companion.c b/src/world/area_dro/dro_01/npc_hint_dryite_companion.c index e754272e27..d8310cecb8 100644 --- a/src/world/area_dro/dro_01/npc_hint_dryite_companion.c +++ b/src/world/area_dro/dro_01/npc_hint_dryite_companion.c @@ -7,7 +7,7 @@ API_CALLABLE(N(GetRunToPos)) { f32 npcAngle; f32 angle; - angle = atan2(183.0f, -75.0f, playerStatus->position.x, playerStatus->position.z); + angle = atan2(183.0f, -75.0f, playerStatus->pos.x, playerStatus->pos.z); npcAngle = atan2(183.0f, -75.0f, npc->pos.x, npc->pos.z); angle = get_clamped_angle_diff(npcAngle, angle); rand = rand_int(10) + 30; diff --git a/src/world/area_dro/dro_01/npc_shop_owner.c b/src/world/area_dro/dro_01/npc_shop_owner.c index c71eaa8da9..d162c6e973 100644 --- a/src/world/area_dro/dro_01/npc_shop_owner.c +++ b/src/world/area_dro/dro_01/npc_shop_owner.c @@ -9,7 +9,7 @@ API_CALLABLE(N(AwaitPlayerApproachShop)) { f32 var4 = evt_get_variable(script, *args++); f32 temp_f0 = (var4 - var2) / (var3 - var1); - if (playerStatus->position.z < ((temp_f0 * playerStatus->position.x) + (var2 - (temp_f0 * var1)))) { + if (playerStatus->pos.z < ((temp_f0 * playerStatus->pos.x) + (var2 - (temp_f0 * var1)))) { script->varTable[0] = 0; return ApiStatus_DONE2; } diff --git a/src/world/area_dro/dro_02/npc_merlee.c b/src/world/area_dro/dro_02/npc_merlee.c index 95400cfd69..3a627a0e0f 100644 --- a/src/world/area_dro/dro_02/npc_merlee.c +++ b/src/world/area_dro/dro_02/npc_merlee.c @@ -291,7 +291,7 @@ void N(GetCardOrientation)(s32 index, f32* outX, f32* outY, f32* outZ, f32* outA Matrix4f mtxTemp; Matrix4f mtxParent; - guPositionF(mtxParent, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, SPRITE_WORLD_SCALE_F, + guPositionF(mtxParent, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, SPRITE_WORLD_SCALE_F, evt_get_variable(N(CreatorScript), RITUAL_VAR_POS_X), evt_get_variable(N(CreatorScript), RITUAL_VAR_POS_Y), evt_get_variable(N(CreatorScript), RITUAL_VAR_POS_Z)); @@ -361,7 +361,7 @@ void N(card_worker_update)(void) { N(RitualCards)[1].pos.x += -10.0f; N(RitualCards)[2].pos.y += -10.0f; if (N(RitualStateTime) == 18) { - gPlayerStatus.position.y = NPC_DISPOSE_POS_Y; + gPlayerStatus.pos.y = NPC_DISPOSE_POS_Y; } if (N(RitualStateTime) == 20) { evt_set_variable(N(CreatorScript), RITUAL_VAR_STATE, RITUAL_STATE_2); @@ -567,7 +567,7 @@ void N(card_worker_render)(void) { Matrix4f mtx; u32 temp_s1; - guPositionF(mtx, 0.0f, -gCameras[gCurrentCameraID].currentYaw, 0.0f, SPRITE_WORLD_SCALE_F, + guPositionF(mtx, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, SPRITE_WORLD_SCALE_F, evt_get_variable(N(CreatorScript), RITUAL_VAR_POS_X), evt_get_variable(N(CreatorScript), RITUAL_VAR_POS_Y), evt_get_variable(N(CreatorScript), RITUAL_VAR_POS_Z)); diff --git a/src/world/area_end/end_01/end_01_4_opera_float.c b/src/world/area_end/end_01/end_01_4_opera_float.c index 54afad1a65..5be398f5ea 100644 --- a/src/world/area_end/end_01/end_01_4_opera_float.c +++ b/src/world/area_end/end_01/end_01_4_opera_float.c @@ -38,7 +38,7 @@ API_CALLABLE(N(UpdateStarSpiritRotation)) { script->functionTemp[0] = 0; } npc = script->functionTempPtr[2]; - npc->rotation.y = update_lerp(EASING_QUADRATIC_OUT, 810.0f, 0.0f, script->functionTemp[0], 45); + npc->rot.y = update_lerp(EASING_QUADRATIC_OUT, 810.0f, 0.0f, script->functionTemp[0], 45); npc->alpha = update_lerp(EASING_QUADRATIC_OUT, 0.0f, 255.0f, script->functionTemp[0], 45); script->functionTemp[0]++; diff --git a/src/world/area_flo/common/ItemChoice_FlowerGuard.inc.c b/src/world/area_flo/common/ItemChoice_FlowerGuard.inc.c index 4443fc697e..af966ff89b 100644 --- a/src/world/area_flo/common/ItemChoice_FlowerGuard.inc.c +++ b/src/world/area_flo/common/ItemChoice_FlowerGuard.inc.c @@ -8,9 +8,9 @@ API_CALLABLE(N(FlowerGuard_SetItemEntityPosition)) { s32 z = evt_get_variable(script, *args++); ItemEntity* item = get_item_entity(itemIdx); - item->position.x = x; - item->position.y = y; - item->position.z = z; + item->pos.x = x; + item->pos.y = y; + item->pos.z = z; return ApiStatus_DONE2; } diff --git a/src/world/area_flo/flo_00/flo_00_5_beanstalk.c b/src/world/area_flo/flo_00/flo_00_5_beanstalk.c index 806d89e43b..ddb04fa53f 100644 --- a/src/world/area_flo/flo_00/flo_00_5_beanstalk.c +++ b/src/world/area_flo/flo_00/flo_00_5_beanstalk.c @@ -22,10 +22,10 @@ API_CALLABLE(N(PlayerRideBeanstalk)) { f32 clamped = clamp_angle(angle - temp); temp = sin_deg(clamped); - gPlayerStatus.position.x = BEANSTALK_BASE_X + (dist * temp); - gPlayerStatus.position.y = evt_get_variable(NULL, script->varTable[10]) + evt_get_variable(NULL, script->varTable[3]); + gPlayerStatus.pos.x = BEANSTALK_BASE_X + (dist * temp); + gPlayerStatus.pos.y = evt_get_variable(NULL, script->varTable[10]) + evt_get_variable(NULL, script->varTable[3]); temp = cos_deg(clamped); - gPlayerStatus.position.z = BEANSTALK_BASE_Z - (dist * temp); + gPlayerStatus.pos.z = BEANSTALK_BASE_Z - (dist * temp); return ApiStatus_DONE2; } diff --git a/src/world/area_flo/flo_03/flo_03_3_npc.c b/src/world/area_flo/flo_03/flo_03_3_npc.c index 1fda7c2f2b..f8660ceb38 100644 --- a/src/world/area_flo/flo_03/flo_03_3_npc.c +++ b/src/world/area_flo/flo_03/flo_03_3_npc.c @@ -70,7 +70,7 @@ API_CALLABLE(N(HideBehindTree)) { f64 dist; // get a point 46 units away from the tree on the side opposite the player - yaw = clamp_angle(atan2(-210.0f, -183.0f, gPlayerStatus.position.x, gPlayerStatus.position.z) + 180.0f); + yaw = clamp_angle(atan2(-210.0f, -183.0f, gPlayerStatus.pos.x, gPlayerStatus.pos.z) + 180.0f); posX = -210.0f; posZ = -183.0f; add_vec2D_polar(&posX, &posZ, 46.0f, yaw); @@ -100,18 +100,18 @@ API_CALLABLE(N(HideBehindTree)) { add_vec2D_polar(&posX, &posZ, 46.0f, yaw); } } - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_RUN]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_RUN]; npc->yaw = atan2(npc->pos.x, npc->pos.z, posX, posZ); npc_move_heading(npc, 2.0f, npc->yaw); } else if (dist > 0.2) { npc->yaw = atan2(npc->pos.x, npc->pos.z, posX, posZ); npc->pos.x = posX; npc->pos.z = posZ; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; } else { npc->pos.x = posX; npc->pos.z = posZ; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; } return ApiStatus_BLOCK; } diff --git a/src/world/area_flo/flo_14/flo_14_3_bubbles.c b/src/world/area_flo/flo_14/flo_14_3_bubbles.c index 1ed17d6693..0da973723b 100644 --- a/src/world/area_flo/flo_14/flo_14_3_bubbles.c +++ b/src/world/area_flo/flo_14/flo_14_3_bubbles.c @@ -42,7 +42,7 @@ EvtScript N(EVS_TetherParterToPlayer) = { }; API_CALLABLE(N(SavePartnerFlags)) { - if (gPlayerData.currentPartner == PARTNER_NONE) { + if (gPlayerData.curPartner == PARTNER_NONE) { script->varTable[14] = FALSE; return ApiStatus_DONE2; } diff --git a/src/world/area_flo/flo_19/flo_19_5_beanstalk.c b/src/world/area_flo/flo_19/flo_19_5_beanstalk.c index 33153b221f..836041ae20 100644 --- a/src/world/area_flo/flo_19/flo_19_5_beanstalk.c +++ b/src/world/area_flo/flo_19/flo_19_5_beanstalk.c @@ -20,10 +20,10 @@ API_CALLABLE(N(PlayerRideBeanstalk)) { f32 clamped = clamp_angle(angle - temp); temp = sin_deg(clamped); - gPlayerStatus.position.x = (dist * temp) + 0.0f; - gPlayerStatus.position.y = evt_get_variable(NULL, script->varTable[10]) + evt_get_variable(NULL, script->varTable[3]); + gPlayerStatus.pos.x = (dist * temp) + 0.0f; + gPlayerStatus.pos.y = evt_get_variable(NULL, script->varTable[10]) + evt_get_variable(NULL, script->varTable[3]); temp = cos_deg(clamped); - gPlayerStatus.position.z = 0.0f - (dist * temp); + gPlayerStatus.pos.z = 0.0f - (dist * temp); return ApiStatus_DONE2; } diff --git a/src/world/area_hos/common/FallingStars.inc.c b/src/world/area_hos/common/FallingStars.inc.c index fb16f3fdaf..e3da7d51fb 100644 --- a/src/world/area_hos/common/FallingStars.inc.c +++ b/src/world/area_hos/common/FallingStars.inc.c @@ -18,7 +18,7 @@ ApiStatus N(UnkEffect0FFunc2)(Evt* script, s32 isInitialCall) { ApiStatus N(UnkEffect0FFunc)(Evt* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; - f32 yaw = gCameras[CAM_DEFAULT].currentYaw / 180.0f * PI; + f32 yaw = gCameras[CAM_DEFAULT].curYaw / 180.0f * PI; f32 yawPlus = yaw + (PI_D / 2); f32 yawMinus = yaw - (PI_D / 2); f32 temp_f30; @@ -32,15 +32,15 @@ ApiStatus N(UnkEffect0FFunc)(Evt* script, s32 isInitialCall) { f32 var5; f32 var6; - temp_f30 = playerStatus->position.x + (rand3 * sin_rad(yaw)); + temp_f30 = playerStatus->pos.x + (rand3 * sin_rad(yaw)); var1 = temp_f30 + (rand1 * sin_rad(yawPlus)); - var2 = playerStatus->position.y + 200.0f; - var3 = playerStatus->position.z - (rand3 * cos_rad(yaw)); + var2 = playerStatus->pos.y + 200.0f; + var3 = playerStatus->pos.z - (rand3 * cos_rad(yaw)); var3 = var3 - (rand1 * cos_rad(yawPlus)); - var4 = playerStatus->position.x + (rand3 * sin_rad(yaw)); + var4 = playerStatus->pos.x + (rand3 * sin_rad(yaw)); var4 = var4 + (rand2 * sin_rad(yawMinus)); - var5 = playerStatus->position.y; - var6 = playerStatus->position.z - (rand3 * cos_rad(yaw)); + var5 = playerStatus->pos.y; + var6 = playerStatus->pos.z - (rand3 * cos_rad(yaw)); var6 = var6 - (rand2 * cos_rad(yawMinus)); fx_star(0, var1, var2, var3, var4, var5, var6, rand_int(10) + 10); return ApiStatus_DONE2; @@ -49,7 +49,7 @@ ApiStatus N(UnkEffect0FFunc)(Evt* script, s32 isInitialCall) { ApiStatus N(UnkEffect0FFunc3)(Evt* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; - f32 yaw = gCameras[CAM_DEFAULT].currentYaw / 180.0f * PI; + f32 yaw = gCameras[CAM_DEFAULT].curYaw / 180.0f * PI; f32 yawPlus = yaw + (PI_D / 2); f32 yawMinus = yaw - (PI_D / 2); f32 temp_f30; @@ -63,19 +63,19 @@ ApiStatus N(UnkEffect0FFunc3)(Evt* script, s32 isInitialCall) { f32 var5; f32 var6; - if ((playerStatus->position.y >= 250.0f)) { + if ((playerStatus->pos.y >= 250.0f)) { return ApiStatus_DONE2; } - temp_f30 = playerStatus->position.x - (rand3 * sin_rad(yaw)); + temp_f30 = playerStatus->pos.x - (rand3 * sin_rad(yaw)); var1 = temp_f30 + (rand1 * sin_rad(yawPlus)); - var2 = playerStatus->position.y + 200.0f; - var3 = playerStatus->position.z + (rand3 * cos_rad(yaw)); + var2 = playerStatus->pos.y + 200.0f; + var3 = playerStatus->pos.z + (rand3 * cos_rad(yaw)); var3 = var3 - (rand1 * cos_rad(yawPlus)); - var4 = playerStatus->position.x - (rand3 * sin_rad(yaw)); + var4 = playerStatus->pos.x - (rand3 * sin_rad(yaw)); var4 = var4 + (rand2 * sin_rad(yawMinus)); - var5 = playerStatus->position.y; - var6 = playerStatus->position.z + (rand3 * cos_rad(yaw)); + var5 = playerStatus->pos.y; + var6 = playerStatus->pos.z + (rand3 * cos_rad(yaw)); var6 = var6 - (rand2 * cos_rad(yawMinus)); fx_star(1, var1, var2, var3, var4, var5, var6, rand_int(10) + 10); return ApiStatus_DONE2; @@ -83,7 +83,7 @@ ApiStatus N(UnkEffect0FFunc3)(Evt* script, s32 isInitialCall) { ApiStatus N(UnkEffect0FFunc4)(Evt* script, s32 isInitialCall) { PlayerStatus* playerStatus = &gPlayerStatus; - f32 yaw = gCameras[CAM_DEFAULT].currentYaw / 180.0f * PI; + f32 yaw = gCameras[CAM_DEFAULT].curYaw / 180.0f * PI; f32 yawPlus = yaw + (PI_D / 2); f32 yawMinus = yaw - (PI_D / 2); f32 temp_f30; @@ -97,22 +97,22 @@ ApiStatus N(UnkEffect0FFunc4)(Evt* script, s32 isInitialCall) { f32 var5; f32 var6; - if ((playerStatus->position.z < 200.0f)) { + if ((playerStatus->pos.z < 200.0f)) { return ApiStatus_DONE2; } - temp_f30 = playerStatus->position.x - (rand3 * sin_rad(yaw)); + temp_f30 = playerStatus->pos.x - (rand3 * sin_rad(yaw)); var1 = temp_f30 + (rand1 * sin_rad(yawPlus)); - var2 = playerStatus->position.y + 200.0f; - var3 = playerStatus->position.z + (rand3 * cos_rad(yaw)); + var2 = playerStatus->pos.y + 200.0f; + var3 = playerStatus->pos.z + (rand3 * cos_rad(yaw)); var3 = var3 - (rand1 * cos_rad(yawPlus)); script->varTable[1] = var1; script->varTable[2] = var2; script->varTable[3] = var3; - var4 = playerStatus->position.x - (rand3 * sin_rad(yaw)); + var4 = playerStatus->pos.x - (rand3 * sin_rad(yaw)); var4 = var4 + (rand2 * sin_rad(yawMinus)); - var5 = playerStatus->position.y; - var6 = playerStatus->position.z + (rand3 * cos_rad(yaw)); + var5 = playerStatus->pos.y; + var6 = playerStatus->pos.z + (rand3 * cos_rad(yaw)); var6 = var6 - (rand2 * cos_rad(yawMinus)); fx_star(2, var1, var2, var3, var4, var5, var6, rand_int(4) + 10); return ApiStatus_DONE2; diff --git a/src/world/area_hos/hos_00/hos_00_4_npc.c b/src/world/area_hos/hos_00/hos_00_4_npc.c index 016b344912..38654fbc4b 100644 --- a/src/world/area_hos/hos_00/hos_00_4_npc.c +++ b/src/world/area_hos/hos_00/hos_00_4_npc.c @@ -82,7 +82,7 @@ EvtScript N(EVS_NpcInit_FlyingMagikoopa) = { }; API_CALLABLE(N(SetCurrentPartner)) { - gPlayerData.currentPartner = evt_get_variable(script, *script->ptrReadPos); + gPlayerData.curPartner = evt_get_variable(script, *script->ptrReadPos); return ApiStatus_DONE2; } diff --git a/src/world/area_hos/hos_00/hos_00_6_scenes.c b/src/world/area_hos/hos_00/hos_00_6_scenes.c index c326ae443b..a63625c386 100644 --- a/src/world/area_hos/hos_00/hos_00_6_scenes.c +++ b/src/world/area_hos/hos_00/hos_00_6_scenes.c @@ -78,7 +78,7 @@ API_CALLABLE(N(HavePartyFaceTwink)) { Npc* npc = get_npc_unsafe(NPC_Twink); partner->yaw = atan2(partner->pos.x, partner->pos.z, npc->pos.x, npc->pos.z); - gPlayerStatus.targetYaw = atan2(gPlayerStatus.position.x, gPlayerStatus.position.z, npc->pos.x, npc->pos.z); + gPlayerStatus.targetYaw = atan2(gPlayerStatus.pos.x, gPlayerStatus.pos.z, npc->pos.x, npc->pos.z); npc->yaw = atan2(N(LastTwinkPosX), N(LastTwinkPosZ), npc->pos.x, npc->pos.z); N(LastTwinkPosX) = npc->pos.x; N(LastTwinkPosZ) = npc->pos.z; diff --git a/src/world/area_hos/hos_00/hos_00_7_shade_gfx.c b/src/world/area_hos/hos_00/hos_00_7_shade_gfx.c index bbbab55cd1..246f684651 100644 --- a/src/world/area_hos/hos_00/hos_00_7_shade_gfx.c +++ b/src/world/area_hos/hos_00/hos_00_7_shade_gfx.c @@ -1,7 +1,7 @@ #include "hos_00.h" void N(setup_gfx_background_shade)(void) { - s32 alpha = update_lerp(EASING_LINEAR, 0.0f, 216.0f, gPlayerStatus.position.x - 200.0f, 500); + s32 alpha = update_lerp(EASING_LINEAR, 0.0f, 216.0f, gPlayerStatus.pos.x - 200.0f, 500); if (alpha < 0) { alpha = 0; diff --git a/src/world/area_hos/hos_05/hos_05_5_intro.c b/src/world/area_hos/hos_05/hos_05_5_intro.c index dcb6753071..edbe311217 100644 --- a/src/world/area_hos/hos_05/hos_05_5_intro.c +++ b/src/world/area_hos/hos_05/hos_05_5_intro.c @@ -1818,7 +1818,7 @@ s32 N(D_8024ACBC_A34EFC) = 0x00010019; API_CALLABLE(N(ForceStarRodAlwaysFaceCamera)) { Npc* npc = resolve_npc(script, NPC_StarRod); - npc->yaw = npc->renderYaw = 180.0f - gCameras[gCurrentCameraID].currentYaw; + npc->yaw = npc->renderYaw = 180.0f - gCameras[gCurrentCameraID].curYaw; return ApiStatus_BLOCK; } diff --git a/src/world/area_hos/hos_05/hos_05_8_star_ship.c b/src/world/area_hos/hos_05/hos_05_8_star_ship.c index de48a0344e..584a15f270 100644 --- a/src/world/area_hos/hos_05/hos_05_8_star_ship.c +++ b/src/world/area_hos/hos_05/hos_05_8_star_ship.c @@ -9,8 +9,8 @@ API_CALLABLE(N(SwingCameraPitchUpward)) { script->functionTemp[0] = 40; } script->functionTemp[0]--; - if (camera->currentController != NULL) { - camera->currentController->viewPitch -= 1.0 - ((f32) (40 - script->functionTemp[0]) * 0.01); + if (camera->curController != NULL) { + camera->curController->viewPitch -= 1.0 - ((f32) (40 - script->functionTemp[0]) * 0.01); } else if (camera->prevController != NULL) { camera->prevController->viewPitch -= 1.0 - ((f32) (40 - script->functionTemp[0]) * 0.01); } diff --git a/src/world/area_hos/hos_06/hos_06_5_merluvlee.c b/src/world/area_hos/hos_06/hos_06_5_merluvlee.c index 0a27c28019..a2bfa2b5d3 100644 --- a/src/world/area_hos/hos_06/hos_06_5_merluvlee.c +++ b/src/world/area_hos/hos_06/hos_06_5_merluvlee.c @@ -528,7 +528,7 @@ API_CALLABLE(N(func_80241CCC_A3B1AC)) { temp_f24 = script->functionTemp[0] * 10; for (i = 0; i < ARRAY_COUNT(effects); i++) { - guRotateF(sp28, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp28, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp68, i * 120, 0.0f, 0.0f, 1.0f); guMtxCatF(sp68, sp28, sp28); tx = temp_f30 * sin_deg(temp_f24); diff --git a/src/world/area_hos/hos_10/hos_10_7_ending.c b/src/world/area_hos/hos_10/hos_10_7_ending.c index 4f0d08a764..cd54e79477 100644 --- a/src/world/area_hos/hos_10/hos_10_7_ending.c +++ b/src/world/area_hos/hos_10/hos_10_7_ending.c @@ -17,9 +17,9 @@ API_CALLABLE(N(NpcOrbitPlayerPos)) { npc = get_npc_unsafe(script->functionTemp[1]); switch (script->functionTemp[0]) { case 0: - npc->pos.x = playerStatus->position.x; - npc->pos.y = playerStatus->position.y; - npc->pos.z = playerStatus->position.z; + npc->pos.x = playerStatus->pos.x; + npc->pos.y = playerStatus->pos.y; + npc->pos.z = playerStatus->pos.z; npc->moveToPos.x = script->functionTemp[3] * 3; npc->moveToPos.y = 3.0f; add_vec2D_polar(&npc->pos.x, &npc->pos.z, 70.0f, npc->moveToPos.x + (script->functionTemp[2] * 51) + 153.0f); @@ -32,9 +32,9 @@ API_CALLABLE(N(NpcOrbitPlayerPos)) { } break; case 1: - npc->pos.x = playerStatus->position.x; - npc->pos.y = playerStatus->position.y; - npc->pos.z = playerStatus->position.z; + npc->pos.x = playerStatus->pos.x; + npc->pos.y = playerStatus->pos.y; + npc->pos.z = playerStatus->pos.z; npc->moveToPos.x = script->functionTemp[3] * 3; npc->moveToPos.y = 3.0f; add_vec2D_polar( @@ -88,7 +88,7 @@ API_CALLABLE(N(SetHaloAlpha)) { } API_CALLABLE(N(ClearCurrentPartner)) { - gPlayerData.currentPartner = PARTNER_NONE; + gPlayerData.curPartner = PARTNER_NONE; return ApiStatus_DONE2; } diff --git a/src/world/area_isk/isk_02/isk_02_3_ambush.c b/src/world/area_isk/isk_02/isk_02_3_ambush.c index b61705d8de..0db6580b69 100644 --- a/src/world/area_isk/isk_02/isk_02_3_ambush.c +++ b/src/world/area_isk/isk_02/isk_02_3_ambush.c @@ -9,7 +9,7 @@ API_CALLABLE(N(AwaitPlayerMummyAmbush)) { f32 x = evt_get_variable(script, *args++); f32 y = evt_get_variable(script, *args++); - if (dist2D(x, y, gPlayerStatus.position.x, gPlayerStatus.position.z) > 250.0f) { + if (dist2D(x, y, gPlayerStatus.pos.x, gPlayerStatus.pos.z) > 250.0f) { script->varTable[0] = FALSE; } else { script->varTable[0] = TRUE; diff --git a/src/world/area_isk/isk_04/isk_04_6_demo.c b/src/world/area_isk/isk_04/isk_04_6_demo.c index ea67a01b28..52bf404bc7 100644 --- a/src/world/area_isk/isk_04/isk_04_6_demo.c +++ b/src/world/area_isk/isk_04/isk_04_6_demo.c @@ -122,14 +122,14 @@ API_CALLABLE(N(SetupDemoScene)) { N(DemoInitState)++; return ApiStatus_BLOCK; case 3: - wPartnerNpc->pos.x = playerStatus->position.x - 30.0f; - wPartnerNpc->pos.z = playerStatus->position.z + 30.0f; + wPartnerNpc->pos.x = playerStatus->pos.x - 30.0f; + wPartnerNpc->pos.z = playerStatus->pos.z + 30.0f; partner_clear_player_tracking(wPartnerNpc); - partner_set_goal_pos(playerStatus->position.x, playerStatus->position.z); + partner_set_goal_pos(playerStatus->pos.x, playerStatus->pos.z); func_800EF3D4(0); set_npc_yaw(wPartnerNpc, 90.0f); playerStatus->targetYaw = 90.0f; - playerStatus->currentYaw = 90.0f; + playerStatus->curYaw = 90.0f; playerStatus->spriteFacingAngle = 0.0f; return ApiStatus_DONE2; } diff --git a/src/world/area_isk/isk_05/isk_05_3_npc.c b/src/world/area_isk/isk_05/isk_05_3_npc.c index 7d3d8df3b6..568816c312 100644 --- a/src/world/area_isk/isk_05/isk_05_3_npc.c +++ b/src/world/area_isk/isk_05/isk_05_3_npc.c @@ -50,7 +50,7 @@ void N(func_80241610_97F0E0)(void) { gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE); guTranslateF(transformMtx, ambush->pos.x, ambush->pos.y, ambush->pos.z); - guRotateF(tempMtx, ambush->rot.y + gCameras[gCurrentCameraID].currentYaw + ambush->renderYaw, 0.0f, 1.0f, 0.0f); + guRotateF(tempMtx, ambush->rot.y + gCameras[gCurrentCameraID].curYaw + ambush->renderYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(tempMtx, transformMtx, transformMtx); guRotateF(tempMtx, ambush->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(tempMtx, transformMtx, transformMtx); diff --git a/src/world/area_isk/isk_07/isk_07_6_switch.c b/src/world/area_isk/isk_07/isk_07_6_switch.c index fcf3eb9296..dc0949ad5c 100644 --- a/src/world/area_isk/isk_07/isk_07_6_switch.c +++ b/src/world/area_isk/isk_07/isk_07_6_switch.c @@ -3,7 +3,7 @@ extern EvtScript N(EVS_OnTouch_StairSwitch); API_CALLABLE(N(WaitForPlayerTouchingGround)) { - if (gCollisionStatus.currentFloor == COLLIDER_o2022) { + if (gCollisionStatus.curFloor == COLLIDER_o2022) { return ApiStatus_BLOCK; } else { return ApiStatus_DONE2; diff --git a/src/world/area_isk/isk_09/isk_09_5_switch.c b/src/world/area_isk/isk_09/isk_09_5_switch.c index 6a6698c38e..39c59432a4 100644 --- a/src/world/area_isk/isk_09/isk_09_5_switch.c +++ b/src/world/area_isk/isk_09/isk_09_5_switch.c @@ -8,7 +8,7 @@ extern EvtScript N(EVS_OnTouch_RedSwitch); API_CALLABLE(N(WaitForPlayerTouchingGround)) { Bytecode* args = script->ptrReadPos; s32 colliderID = evt_get_variable(script, *args++); - if (gCollisionStatus.currentFloor != colliderID) { + if (gCollisionStatus.curFloor != colliderID) { return ApiStatus_DONE2; } else { return ApiStatus_BLOCK; diff --git a/src/world/area_isk/isk_10/isk_10_2_entity.c b/src/world/area_isk/isk_10/isk_10_2_entity.c index a62199b734..2383a7b139 100644 --- a/src/world/area_isk/isk_10/isk_10_2_entity.c +++ b/src/world/area_isk/isk_10/isk_10_2_entity.c @@ -8,10 +8,10 @@ API_CALLABLE(N(MonitorPlayerLastFloor)) { s32 level = -1; - if (gPlayerStatus.lastGoodPosition.y > -600.0) { + if (gPlayerStatus.lastGoodPos.y > -600.0) { level = 0; } - if (gPlayerStatus.lastGoodPosition.y < -770.0) { + if (gPlayerStatus.lastGoodPos.y < -770.0) { level = 1; } if (level >= 0) { diff --git a/src/world/area_isk/isk_13/isk_13_3_npc.c b/src/world/area_isk/isk_13/isk_13_3_npc.c index 052d4d4101..cc3bad8b3d 100644 --- a/src/world/area_isk/isk_13/isk_13_3_npc.c +++ b/src/world/area_isk/isk_13/isk_13_3_npc.c @@ -50,7 +50,7 @@ void N(func_80241610_990DF0)(void) { gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE); guTranslateF(transformMtx, ambush->pos.x, ambush->pos.y, ambush->pos.z); - guRotateF(tempMtx, ambush->rot.y + gCameras[gCurrentCameraID].currentYaw + ambush->renderYaw, 0.0f, 1.0f, 0.0f); + guRotateF(tempMtx, ambush->rot.y + gCameras[gCurrentCameraID].curYaw + ambush->renderYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(tempMtx, transformMtx, transformMtx); guRotateF(tempMtx, ambush->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(tempMtx, transformMtx, transformMtx); diff --git a/src/world/area_isk/isk_14/isk_14_3_npc.c b/src/world/area_isk/isk_14/isk_14_3_npc.c index 45aec9c2e6..1d3c2817da 100644 --- a/src/world/area_isk/isk_14/isk_14_3_npc.c +++ b/src/world/area_isk/isk_14/isk_14_3_npc.c @@ -50,7 +50,7 @@ void N(func_80241610_993D40)(void) { gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE); guTranslateF(transformMtx, ambush->pos.x, ambush->pos.y, ambush->pos.z); - guRotateF(tempMtx, ambush->rot.y + gCameras[gCurrentCameraID].currentYaw + ambush->renderYaw, 0.0f, 1.0f, 0.0f); + guRotateF(tempMtx, ambush->rot.y + gCameras[gCurrentCameraID].curYaw + ambush->renderYaw, 0.0f, 1.0f, 0.0f); guMtxCatF(tempMtx, transformMtx, transformMtx); guRotateF(tempMtx, ambush->rot.z, 0.0f, 0.0f, 1.0f); guMtxCatF(tempMtx, transformMtx, transformMtx); diff --git a/src/world/area_iwa/iwa_00/iwa_00_4_slide.c b/src/world/area_iwa/iwa_00/iwa_00_4_slide.c index c7486e9043..b3d91fe8fd 100644 --- a/src/world/area_iwa/iwa_00/iwa_00_4_slide.c +++ b/src/world/area_iwa/iwa_00/iwa_00_4_slide.c @@ -3,8 +3,8 @@ SlideParams N(SlideData) = { .heading = 270.0f, .maxDescendAccel = 0.4f, - .launchVelocity = -0.05f, - .maxDescendVelocity = 20.0f, + .launchVel = -0.05f, + .maxDescendVel = 20.0f, .integrator = { 0.0, 0.0, 0.0, 0.0 }, }; diff --git a/src/world/area_iwa/iwa_01/iwa_01_5_slide.c b/src/world/area_iwa/iwa_01/iwa_01_5_slide.c index eb031727e7..e1e78358b2 100644 --- a/src/world/area_iwa/iwa_01/iwa_01_5_slide.c +++ b/src/world/area_iwa/iwa_01/iwa_01_5_slide.c @@ -9,16 +9,16 @@ API_CALLABLE(N(SetPlayerSliding)) { SlideParams N(SlideData1) = { .heading = 90.0f, .maxDescendAccel = 0.5f, - .launchVelocity = -0.5f, - .maxDescendVelocity = 16.0f, + .launchVel = -0.5f, + .maxDescendVel = 16.0f, .integrator = { 0.0, 0.0, 0.0, 0.0 }, }; SlideParams N(SlideData2) = { .heading = 270.0f, .maxDescendAccel = 0.5f, - .launchVelocity = -0.18f, - .maxDescendVelocity = 18.0f, + .launchVel = -0.18f, + .maxDescendVel = 18.0f, .integrator = { 10.9716, -0.34, 0.003, -0.012 }, }; diff --git a/src/world/area_iwa/iwa_03/iwa_03_2_entity.c b/src/world/area_iwa/iwa_03/iwa_03_2_entity.c index 3d37d573d4..5f567986ad 100644 --- a/src/world/area_iwa/iwa_03/iwa_03_2_entity.c +++ b/src/world/area_iwa/iwa_03/iwa_03_2_entity.c @@ -8,10 +8,10 @@ MAP_RODATA_PAD(1,entity); API_CALLABLE(N(MonitorPlayerAltitude)) { s32 result = -1; - if (gPlayerStatus.lastGoodPosition.y > 200.0) { + if (gPlayerStatus.lastGoodPos.y > 200.0) { result = 0; } - if (gPlayerStatus.lastGoodPosition.y < 40.0) { + if (gPlayerStatus.lastGoodPos.y < 40.0) { result = 1; } if (result >= 0) { diff --git a/src/world/area_iwa/iwa_03/iwa_03_4_slide.c b/src/world/area_iwa/iwa_03/iwa_03_4_slide.c index 0a3d6a42cc..43d9e82242 100644 --- a/src/world/area_iwa/iwa_03/iwa_03_4_slide.c +++ b/src/world/area_iwa/iwa_03/iwa_03_4_slide.c @@ -3,8 +3,8 @@ SlideParams N(SlideData) = { .heading = 89.0f, .maxDescendAccel = 0.41f, - .launchVelocity = -0.25f, - .maxDescendVelocity = 16.0f, + .launchVel = -0.25f, + .maxDescendVel = 16.0f, .integrator = { 9.612, -0.452, 0.003, -0.023 }, }; diff --git a/src/world/area_iwa/iwa_04/iwa_04_3_entity.c b/src/world/area_iwa/iwa_04/iwa_04_3_entity.c index b7870d07a1..a7eb660e7a 100644 --- a/src/world/area_iwa/iwa_04/iwa_04_3_entity.c +++ b/src/world/area_iwa/iwa_04/iwa_04_3_entity.c @@ -4,10 +4,10 @@ API_CALLABLE(N(MonitorPlayerAltitude)) { s32 status = -1; - if (gPlayerStatus.lastGoodPosition.y > -100.0) { + if (gPlayerStatus.lastGoodPos.y > -100.0) { status = 0; } - if (gPlayerStatus.lastGoodPosition.y < -240.0) { + if (gPlayerStatus.lastGoodPos.y < -240.0) { status = 1; } if (status >= 0) { diff --git a/src/world/area_jan/jan_00/jan_00_2_npc.c b/src/world/area_jan/jan_00/jan_00_2_npc.c index e6ed85bc11..4d32755c86 100644 --- a/src/world/area_jan/jan_00/jan_00_2_npc.c +++ b/src/world/area_jan/jan_00/jan_00_2_npc.c @@ -115,9 +115,9 @@ API_CALLABLE(N(func_80240CF8_B21238)) { switch (script->functionTemp[0]) { case 0: - gPlayerStatus.position.x = x; - gPlayerStatus.position.y = y; - gPlayerStatus.position.z = z; + gPlayerStatus.pos.x = x; + gPlayerStatus.pos.y = y; + gPlayerStatus.pos.z = z; npc0->colliderPos.x = npc0->pos.x; npc0->colliderPos.y = npc0->pos.y; npc0->colliderPos.z = npc0->pos.z; @@ -176,7 +176,7 @@ API_CALLABLE(N(func_80240F14_B21454)) { switch (script->functionTemp[2]) { case 0: - npc->currentAnim = 0xB60001; + npc->curAnim = 0xB60001; npc->yaw -= 1.0f; npc->pos.x -= 3.0f; script->functionTemp[1]--; diff --git a/src/world/area_jan/jan_02/jan_02_2_main.c b/src/world/area_jan/jan_02/jan_02_2_main.c index 01cdc3c2d9..bbbe16216a 100644 --- a/src/world/area_jan/jan_02/jan_02_2_main.c +++ b/src/world/area_jan/jan_02/jan_02_2_main.c @@ -11,7 +11,7 @@ API_CALLABLE(N(ClearTrackVols)) { } API_CALLABLE(N(ManageBigPalmTreeVisibility)) { - u16 currentFloor = gCollisionStatus.currentFloor; + u16 currentFloor = gCollisionStatus.curFloor; if (N(PrevPalmTreeVisibility) != 0) { if (currentFloor == COLLIDER_o327 || currentFloor == COLLIDER_o330) { diff --git a/src/world/area_jan/jan_03/jan_03_5_entity.c b/src/world/area_jan/jan_03/jan_03_5_entity.c index 7be0e03e9f..106e1a9cb9 100644 --- a/src/world/area_jan/jan_03/jan_03_5_entity.c +++ b/src/world/area_jan/jan_03/jan_03_5_entity.c @@ -11,11 +11,11 @@ EvtScript N(EVS_GotoMap_tik_08_4) = { API_CALLABLE(N(GiveInitialSpringBoost)) { - f32 x = gPlayerStatus.currentSpeed * 5.0f * sin_deg(gPlayerStatus.targetYaw); - f32 z = gPlayerStatus.currentSpeed * 5.0f * -cos_deg(gPlayerStatus.targetYaw); + f32 x = gPlayerStatus.curSpeed * 5.0f * sin_deg(gPlayerStatus.targetYaw); + f32 z = gPlayerStatus.curSpeed * 5.0f * -cos_deg(gPlayerStatus.targetYaw); - script->varTable[0] = gPlayerStatus.position.x + x; - script->varTable[1] = gPlayerStatus.position.z + z; + script->varTable[0] = gPlayerStatus.pos.x + x; + script->varTable[1] = gPlayerStatus.pos.z + z; return ApiStatus_DONE2; } diff --git a/src/world/area_jan/jan_04/jan_04_10_demo.c b/src/world/area_jan/jan_04/jan_04_10_demo.c index 5f427616f3..894ab90e21 100644 --- a/src/world/area_jan/jan_04/jan_04_10_demo.c +++ b/src/world/area_jan/jan_04/jan_04_10_demo.c @@ -111,9 +111,9 @@ API_CALLABLE(N(SetupDemoScene)) { N(DemoInitState)++; newScript = start_script(rideScriptSrc, EVT_PRIORITY_0, EVT_FLAG_RUN_IMMEDIATELY); - newScript->varTable[1] = playerStatus->position.x - 10.0f; - newScript->varTable[2] = playerStatus->position.y; - newScript->varTable[3] = playerStatus->position.z; + newScript->varTable[1] = playerStatus->pos.x - 10.0f; + newScript->varTable[2] = playerStatus->pos.y; + newScript->varTable[3] = playerStatus->pos.z; newScript->varTable[12] = 1; D_8024A290 = newScript; } @@ -125,7 +125,7 @@ API_CALLABLE(N(SetupDemoScene)) { case 3: wPartnerNpc->yaw = 270.0f; playerStatus->targetYaw = 270.0f; - playerStatus->currentYaw = 270.0f; + playerStatus->curYaw = 270.0f; playerStatus->spriteFacingAngle = 180.0f; D_8024A290->functionTemp[1] = 1; return ApiStatus_DONE2; diff --git a/src/world/area_jan/jan_04/jan_04_8_treasure.c b/src/world/area_jan/jan_04/jan_04_8_treasure.c index c976b0c8f0..a4528b456a 100644 --- a/src/world/area_jan/jan_04/jan_04_8_treasure.c +++ b/src/world/area_jan/jan_04/jan_04_8_treasure.c @@ -16,7 +16,7 @@ API_CALLABLE(N(AnimateFlyingChestRotScale)) { entity->scale.x = (60 - script->functionTemp[1]) / 60.0f; entity->scale.y = (60 - script->functionTemp[1]) / 60.0f; entity->scale.z = (60 - script->functionTemp[1]) / 60.0f; - entity->rotation.y = (1.0f - cos_rad(entity->scale.y * PI)) * 990.0 * 0.25f; + entity->rot.y = (1.0f - cos_rad(entity->scale.y * PI)) * 990.0 * 0.25f; script->functionTemp[1]--; if (script->functionTemp[1] == -1) { @@ -31,8 +31,8 @@ API_CALLABLE(N(AnimateFallingChestRot)) { if (isInitialCall) { script->functionTemp[0] = -30; } - entity->rotation.x = script->functionTemp[0]; - entity->rotation.z = script->functionTemp[0]; + entity->rot.x = script->functionTemp[0]; + entity->rot.z = script->functionTemp[0]; script->functionTemp[0]++; if (script->functionTemp[0] == 1) { diff --git a/src/world/area_jan/jan_22/jan_22_5_zipline.c b/src/world/area_jan/jan_22/jan_22_5_zipline.c index d2daa32ad3..97283af32e 100644 --- a/src/world/area_jan/jan_22/jan_22_5_zipline.c +++ b/src/world/area_jan/jan_22/jan_22_5_zipline.c @@ -40,13 +40,13 @@ API_CALLABLE(N(Zipline_UpdatePlayerPos)) { if (mode == 0) { Npc* partner = get_npc_safe(NPC_PARTNER); - gPlayerStatus.position.x = (script->varTable[2] + script->varTable[5]); - gPlayerStatus.position.y = (script->varTable[3] + script->varTable[6]); - gPlayerStatus.position.z = (script->varTable[4] + script->varTable[7]); + gPlayerStatus.pos.x = (script->varTable[2] + script->varTable[5]); + gPlayerStatus.pos.y = (script->varTable[3] + script->varTable[6]); + gPlayerStatus.pos.z = (script->varTable[4] + script->varTable[7]); gPlayerStatus.targetYaw = atan2(array[0], array[2], array[3], array[5]); - partner->pos.x = gPlayerStatus.position.x; - partner->pos.y = gPlayerStatus.position.y - 10.0f; - partner->pos.z = gPlayerStatus.position.z - 5.0f; + partner->pos.x = gPlayerStatus.pos.x; + partner->pos.y = gPlayerStatus.pos.y - 10.0f; + partner->pos.z = gPlayerStatus.pos.z - 5.0f; } return ApiStatus_DONE2; } @@ -61,8 +61,8 @@ API_CALLABLE(N(Zipline_CheckInputForJumpOff)) { s32 bx2 = posB + 17; script->varTable[8] = -1; - if (((gPlayerStatus.position.x < ax1) || (ax2 < gPlayerStatus.position.x)) - && ((gPlayerStatus.position.x < bx1) || (bx2 < gPlayerStatus.position.x))) { + if (((gPlayerStatus.pos.x < ax1) || (ax2 < gPlayerStatus.pos.x)) + && ((gPlayerStatus.pos.x < bx1) || (bx2 < gPlayerStatus.pos.x))) { script->varTable[8] = gGameStatusPtr->pressedButtons[0] & BUTTON_A; } return ApiStatus_DONE2; diff --git a/src/world/area_kgr/kgr_01/kgr_01_2_wiggle.c b/src/world/area_kgr/kgr_01/kgr_01_2_wiggle.c index 9e0a870e63..6c412e1a4a 100644 --- a/src/world/area_kgr/kgr_01/kgr_01_2_wiggle.c +++ b/src/world/area_kgr/kgr_01/kgr_01_2_wiggle.c @@ -23,8 +23,8 @@ void N(add_tongue_deformation)(Vtx* src, Vtx* dest, s32 numVertices, s32 time) { // base y-offset goes from 0-5 based on radial distance to player, // with 0 at the closest and 5 when distance squared > 1000. // this creates the depression of the tongue where the player is standing. - dx = vd->ob[0] - player->position.x; - dz = vd->ob[2] - player->position.z; + dx = vd->ob[0] - player->pos.x; + dz = vd->ob[2] - player->pos.z; offset = ((dx * dx) + (dz * dz)) / 100; if (offset > 10) { offset = 10; diff --git a/src/world/area_kkj/common/ApproachPlayer100Units.inc.c b/src/world/area_kkj/common/ApproachPlayer100Units.inc.c index 0164d0305b..5721fb39cf 100644 --- a/src/world/area_kkj/common/ApproachPlayer100Units.inc.c +++ b/src/world/area_kkj/common/ApproachPlayer100Units.inc.c @@ -18,15 +18,15 @@ ApiStatus N(ApproachPlayer100Units)(Evt* script, s32 isInitialCall) { return ApiStatus_DONE2; } - if (dist2D(playerStatus->position.x, playerStatus->position.z, npc->pos.x, npc->pos.z) < 100.0f) { + if (dist2D(playerStatus->pos.x, playerStatus->pos.z, npc->pos.x, npc->pos.z) < 100.0f) { isCloseToPlayer = FALSE; } else { isCloseToPlayer = TRUE; } - angle = clamp_angle(atan2(playerStatus->position.x, playerStatus->position.z, npc->pos.x, npc->pos.z)); - posX = playerStatus->position.x + (sin_deg(angle) * 100.0f); - posZ = playerStatus->position.z - (cos_deg(angle) * 100.0f); + angle = clamp_angle(atan2(playerStatus->pos.x, playerStatus->pos.z, npc->pos.x, npc->pos.z)); + posX = playerStatus->pos.x + (sin_deg(angle) * 100.0f); + posZ = playerStatus->pos.z - (cos_deg(angle) * 100.0f); evt_set_variable(script, outVar1, isCloseToPlayer); evt_set_variable(script, outVar2, posX); evt_set_variable(script, outVar3, posZ); diff --git a/src/world/area_kkj/common/ApproachPlayer50Units.inc.c b/src/world/area_kkj/common/ApproachPlayer50Units.inc.c index c7efac7fdb..8f1f79894e 100644 --- a/src/world/area_kkj/common/ApproachPlayer50Units.inc.c +++ b/src/world/area_kkj/common/ApproachPlayer50Units.inc.c @@ -19,15 +19,15 @@ API_CALLABLE(N(ApproachPlayer50Units)) { return ApiStatus_DONE2; } - if (dist2D(playerStatus->position.x, playerStatus->position.z, npc->pos.x, npc->pos.z) < 50.0f) { + if (dist2D(playerStatus->pos.x, playerStatus->pos.z, npc->pos.x, npc->pos.z) < 50.0f) { phi_s4 = FALSE; } else { phi_s4 = TRUE; } - angle = clamp_angle(atan2(playerStatus->position.x, playerStatus->position.z, npc->pos.x, npc->pos.z)); - x = playerStatus->position.x + (sin_deg(angle) * 50.0f); - z = playerStatus->position.z - (cos_deg(angle) * 50.0f); + angle = clamp_angle(atan2(playerStatus->pos.x, playerStatus->pos.z, npc->pos.x, npc->pos.z)); + x = playerStatus->pos.x + (sin_deg(angle) * 50.0f); + z = playerStatus->pos.z - (cos_deg(angle) * 50.0f); evt_set_variable(script, outVar1, phi_s4); evt_set_variable(script, outVar2, x); evt_set_variable(script, outVar3, z); diff --git a/src/world/area_kkj/common/RestoreFromPeachState.inc.c b/src/world/area_kkj/common/RestoreFromPeachState.inc.c index 41b505c39f..38a7e58e5e 100644 --- a/src/world/area_kkj/common/RestoreFromPeachState.inc.c +++ b/src/world/area_kkj/common/RestoreFromPeachState.inc.c @@ -2,6 +2,6 @@ API_CALLABLE(N(RestoreFromPeachState)) { gGameStatusPtr->peachFlags &= ~PEACH_STATUS_FLAG_IS_PEACH; - gPlayerData.currentPartner = script->varTable[0]; + gPlayerData.curPartner = script->varTable[0]; return ApiStatus_DONE2; } diff --git a/src/world/area_kkj/common/Searchlights.inc.c b/src/world/area_kkj/common/Searchlights.inc.c index 35d10b9200..5b09e8ecaa 100644 --- a/src/world/area_kkj/common/Searchlights.inc.c +++ b/src/world/area_kkj/common/Searchlights.inc.c @@ -19,8 +19,8 @@ API_CALLABLE(N(UnkPhysicsFunc)) { s32 channel; add_vec2D_polar(&x, &z, r, npc->yaw); - xDist = dist2D(x, 0.0f, playerStatus->position.x, 0.0f); - zDist = dist2D(0.0f, z, 0.0f, playerStatus->position.z); + xDist = dist2D(x, 0.0f, playerStatus->pos.x, 0.0f); + zDist = dist2D(0.0f, z, 0.0f, playerStatus->pos.z); if (npc->yaw == 90.0 || npc->yaw == 270.0) { if (xDist <= inDist1 && zDist <= inDist2) { @@ -41,11 +41,11 @@ API_CALLABLE(N(UnkPhysicsFunc)) { y = npc->pos.y; z = npc->pos.z; // required to match, has to be r - r = dist2D(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + r = dist2D(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); channel = COLLISION_IGNORE_ENTITIES | COLLISION_CHANNEL_20000 | COLLISION_CHANNEL_10000 | COLLISION_CHANNEL_8000; if (npc_test_move_taller_with_slipping(channel, &x, &y, &z, r, - atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z), + atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z), npc->collisionDiameter, npc->collisionHeight)) { outVal = FALSE; @@ -101,7 +101,7 @@ API_CALLABLE(N(UpdateSearchlight)) { z = npc->pos.z; add_vec2D_polar(&x, &z, radius, npc->yaw); - if (dist2D(x, z, playerStatus->position.x, playerStatus->position.z) <= offsetDist) { + if (dist2D(x, z, playerStatus->pos.x, playerStatus->pos.z) <= offsetDist) { outVal |= 1; } @@ -112,7 +112,7 @@ API_CALLABLE(N(UpdateSearchlight)) { z = npc->pos.z; add_vec2D_polar(&x, &z, extraRadius, npc->yaw); - if (dist2D(x, z, playerStatus->position.x, playerStatus->position.z) <= extraOffsetDist) { + if (dist2D(x, z, playerStatus->pos.x, playerStatus->pos.z) <= extraOffsetDist) { outVal |= 0x10; } @@ -122,9 +122,9 @@ API_CALLABLE(N(UpdateSearchlight)) { y = npc->pos.y; z = npc->pos.z; - dist = dist2D(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + dist = dist2D(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); if (npc_test_move_taller_with_slipping(0, &x, &y, &z, dist, - atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z), + atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z), npc->collisionDiameter, npc->collisionHeight)) { outVal = 0; } diff --git a/src/world/area_kkj/kkj_00/kkj_00_2_main.c b/src/world/area_kkj/kkj_00/kkj_00_2_main.c index 553574f6da..bb79ab91c6 100644 --- a/src/world/area_kkj/kkj_00/kkj_00_2_main.c +++ b/src/world/area_kkj/kkj_00/kkj_00_2_main.c @@ -103,16 +103,16 @@ EvtScript N(D_80241460_ABC6F0) = { SlideParams N(SlideData1) = { .heading = 358.5f, .maxDescendAccel = 0.5f, - .launchVelocity = 20.0f, - .maxDescendVelocity = 0.0f, + .launchVel = 20.0f, + .maxDescendVel = 0.0f, .integrator = { 0.0, 0.0, 0.0, 0.0 }, }; SlideParams N(SlideData2) = { .heading = 1.5f, .maxDescendAccel = 0.5f, - .launchVelocity = 20.0f, - .maxDescendVelocity = 0.0f, + .launchVel = 20.0f, + .maxDescendVel = 0.0f, .integrator = { 0.0, 0.0, 0.0, 0.0 }, }; diff --git a/src/world/area_kkj/kkj_13/kkj_13_5_intro_scenes.c b/src/world/area_kkj/kkj_13/kkj_13_5_intro_scenes.c index 89ebed653f..2e595127c9 100644 --- a/src/world/area_kkj/kkj_13/kkj_13_5_intro_scenes.c +++ b/src/world/area_kkj/kkj_13/kkj_13_5_intro_scenes.c @@ -129,7 +129,7 @@ API_CALLABLE(N(ShatterWindow)) { effect = fx_ice_shard(type, posX, posY, -150.0f, ((i & 3) * 0.4) + 1.0, ((i & 3) * 4) + 30); effect->data.iceShard->animFrame = 0; effect->data.iceShard->animRate = (rand_int(10) * 0.2) + 0.1; - effect->data.iceShard->rotation = 35 * i; + effect->data.iceShard->rot = 35 * i; effect->data.iceShard->angularVel = rand_int(10) - 5; effect->data.iceShard->vel.x = x; effect->data.iceShard->vel.y = y; diff --git a/src/world/area_kkj/kkj_15/kkj_15_3_rotating_wall.c b/src/world/area_kkj/kkj_15/kkj_15_3_rotating_wall.c index bed5b092fa..0938ddb3eb 100644 --- a/src/world/area_kkj/kkj_15/kkj_15_3_rotating_wall.c +++ b/src/world/area_kkj/kkj_15/kkj_15_3_rotating_wall.c @@ -10,8 +10,8 @@ API_CALLABLE(N(UpdateRotatingPartyPositions)) { mag = dist2D(50.0f, -200.0f, script->varTable[7], script->varTable[8]); angle = atan2(50.0f, -200.0f, script->varTable[7], script->varTable[8]); angle = clamp_angle(angle - var); - gPlayerStatus.position.x = 50.0f + mag * sin_deg(angle); - gPlayerStatus.position.z = -200.0f - mag * cos_deg(angle); + gPlayerStatus.pos.x = 50.0f + mag * sin_deg(angle); + gPlayerStatus.pos.z = -200.0f - mag * cos_deg(angle); mag = dist2D(50.0f, -200.0f, script->varTable[9], script->varTable[10]); angle = atan2(50.0f, -200.0f, script->varTable[9], script->varTable[10]); diff --git a/src/world/area_kkj/kkj_27/kkj_27_3_rotating_wall.c b/src/world/area_kkj/kkj_27/kkj_27_3_rotating_wall.c index 8f895165a2..77445f26f7 100644 --- a/src/world/area_kkj/kkj_27/kkj_27_3_rotating_wall.c +++ b/src/world/area_kkj/kkj_27/kkj_27_3_rotating_wall.c @@ -11,8 +11,8 @@ API_CALLABLE(N(UpdateRotatingPlayerPosition)) { mag = dist2D(-250.0f, 0.0f, script->varTable[9], script->varTable[10]); angle = atan2(-250.0f, 0.0f, script->varTable[9], script->varTable[10]); angle = clamp_angle(angle - var); - gPlayerStatus.position.x = -250.0f + mag * sin_deg(angle); - gPlayerStatus.position.z = 0.0f - mag * cos_deg(angle); + gPlayerStatus.pos.x = -250.0f + mag * sin_deg(angle); + gPlayerStatus.pos.z = 0.0f - mag * cos_deg(angle); return ApiStatus_DONE2; } diff --git a/src/world/area_kmr/kmr_02/kmr_02_5_entity.c b/src/world/area_kmr/kmr_02/kmr_02_5_entity.c index 437f7dead0..5f23df81dd 100644 --- a/src/world/area_kmr/kmr_02/kmr_02_5_entity.c +++ b/src/world/area_kmr/kmr_02/kmr_02_5_entity.c @@ -39,7 +39,7 @@ API_CALLABLE(N(AnimateBlockScale)) { entity->scale.x = (60 - script->functionTemp[1]) / 60.0f; entity->scale.y = (60 - script->functionTemp[1]) / 60.0f; entity->scale.z = (60 - script->functionTemp[1]) / 60.0f; - entity->rotation.y = (1.0f - cos_rad(entity->scale.y * PI)) * 990.0 * 0.5f; + entity->rot.y = (1.0f - cos_rad(entity->scale.y * PI)) * 990.0 * 0.5f; script->functionTemp[1]--; if (script->functionTemp[1] == -1) { diff --git a/src/world/area_kmr/kmr_03/kmr_03_4_entity.c b/src/world/area_kmr/kmr_03/kmr_03_4_entity.c index 6bb96197b2..a4bf8b412f 100644 --- a/src/world/area_kmr/kmr_03/kmr_03_4_entity.c +++ b/src/world/area_kmr/kmr_03/kmr_03_4_entity.c @@ -21,11 +21,11 @@ EvtScript N(EVS_OnSmashBlock2) = { API_CALLABLE(func_80240358_8C82E8) { PlayerStatus* playerStatus = &gPlayerStatus; - f32 xDelta = playerStatus->currentSpeed * 5.0f * sin_deg(playerStatus->targetYaw); - f32 zDelta = playerStatus->currentSpeed * 5.0f * -cos_deg(playerStatus->targetYaw); + f32 xDelta = playerStatus->curSpeed * 5.0f * sin_deg(playerStatus->targetYaw); + f32 zDelta = playerStatus->curSpeed * 5.0f * -cos_deg(playerStatus->targetYaw); - script->varTable[0] = playerStatus->position.x + xDelta; - script->varTable[1] = playerStatus->position.z + zDelta; + script->varTable[0] = playerStatus->pos.x + xDelta; + script->varTable[1] = playerStatus->pos.z + zDelta; return ApiStatus_DONE2; } diff --git a/src/world/area_kmr/kmr_06/kmr_06_5_sticker_sign.c b/src/world/area_kmr/kmr_06/kmr_06_5_sticker_sign.c index 403cf07dcf..0528709781 100644 --- a/src/world/area_kmr/kmr_06/kmr_06_5_sticker_sign.c +++ b/src/world/area_kmr/kmr_06/kmr_06_5_sticker_sign.c @@ -65,7 +65,7 @@ void N(worker_render_sticker)(void) { renderTaskPtr->renderMode = RENDER_MODE_ALPHATEST; renderTaskPtr->appendGfxArg = 0; renderTaskPtr->appendGfx = &N(appendGfx_sticker); - renderTaskPtr->distance = 0; + renderTaskPtr->dist = 0; queue_render_task(renderTaskPtr); } diff --git a/src/world/area_kmr/kmr_10/kmr_10_4_entity.c b/src/world/area_kmr/kmr_10/kmr_10_4_entity.c index 842c1ce6f0..9d02ef9d36 100644 --- a/src/world/area_kmr/kmr_10/kmr_10_4_entity.c +++ b/src/world/area_kmr/kmr_10/kmr_10_4_entity.c @@ -13,9 +13,9 @@ API_CALLABLE(N(SetSpringPosition)) { s32 z = evt_get_variable(script, *args++); Entity* entity = get_entity_by_index(entityIndex); - entity->position.x = x; - entity->position.y = y; - entity->position.z = z; + entity->pos.x = x; + entity->pos.y = y; + entity->pos.z = z; return ApiStatus_DONE2; } diff --git a/src/world/area_kmr/kmr_11/kmr_11_5_entity.c b/src/world/area_kmr/kmr_11/kmr_11_5_entity.c index e869910cc3..0bf3bbfa64 100644 --- a/src/world/area_kmr/kmr_11/kmr_11_5_entity.c +++ b/src/world/area_kmr/kmr_11/kmr_11_5_entity.c @@ -5,9 +5,9 @@ API_CALLABLE(N(SetBlueSwitchPosition)) { Entity* entity = get_entity_by_index(script->varTable[10]); - entity->position.x = script->varTable[0]; - entity->position.y = script->varTable[1]; - entity->position.z = script->varTable[2]; + entity->pos.x = script->varTable[0]; + entity->pos.y = script->varTable[1]; + entity->pos.z = script->varTable[2]; return ApiStatus_DONE2; } diff --git a/src/world/area_kmr/kmr_20/kmr_20_13_records.c b/src/world/area_kmr/kmr_20/kmr_20_13_records.c index 59f8ceec1d..d7a2a63a9f 100644 --- a/src/world/area_kmr/kmr_20/kmr_20_13_records.c +++ b/src/world/area_kmr/kmr_20/kmr_20_13_records.c @@ -157,7 +157,7 @@ void N(appendGfx_records)(void* data) { case RECORDS_STATE_IDLE: records->alpha = 255; records->lastAlpha = records->alpha; - if (gGameStatusPtr->currentButtons[0] & (BUTTON_A | BUTTON_B)) { + if (gGameStatusPtr->curButtons[0] & (BUTTON_A | BUTTON_B)) { records->state = RECORDS_STATE_BEGIN_FADE_OUT; } if (records->state != RECORDS_STATE_BEGIN_FADE_OUT) { @@ -185,7 +185,7 @@ void N(worker_draw_game_records)(void) { rt.renderMode = RENDER_MODE_2D; rt.appendGfxArg = NULL; rt.appendGfx = N(appendGfx_records); - rt.distance = 0; + rt.dist = 0; queue_render_task(&rt); } diff --git a/src/world/area_kmr/kmr_23/kmr_23_2_npc.c b/src/world/area_kmr/kmr_23/kmr_23_2_npc.c index 6acbc6377a..a5bb27125c 100644 --- a/src/world/area_kmr/kmr_23/kmr_23_2_npc.c +++ b/src/world/area_kmr/kmr_23/kmr_23_2_npc.c @@ -100,13 +100,13 @@ API_CALLABLE(N(CreateEndChapterData)) { npc->pos.x = data->pos.x; npc->pos.y = data->pos.y; npc->pos.z = data->pos.z + 10.0f; - npc->rotation.y = data->yaw; + npc->rot.y = data->yaw; backFacing = FALSE; if (!evt_get_variable(script, MF_Unk_0B)) { if ((data->yaw > 90.0f) && (data->yaw < 270.0f)) { backFacing = TRUE; } - npc->currentAnim = N(StarSpiritAnimations)[data->chapter][backFacing]; + npc->curAnim = N(StarSpiritAnimations)[data->chapter][backFacing]; } if (data->spiritCardEffect != NULL) { diff --git a/src/world/area_kpa/kpa_03/kpa_03_4_entity.c b/src/world/area_kpa/kpa_03/kpa_03_4_entity.c index 2f2c7e5fb3..d81ac64281 100644 --- a/src/world/area_kpa/kpa_03/kpa_03_4_entity.c +++ b/src/world/area_kpa/kpa_03/kpa_03_4_entity.c @@ -4,10 +4,10 @@ API_CALLABLE(N(MonitorPlayerAltitude)) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->lastGoodPosition.y >= 0) { + if (playerStatus->lastGoodPos.y >= 0) { evt_set_variable(script, MV_PlayerHeightLevel, 0); } - if (playerStatus->lastGoodPosition.y <= -280) { + if (playerStatus->lastGoodPos.y <= -280) { evt_set_variable(script, MV_PlayerHeightLevel, 1); } return ApiStatus_BLOCK; diff --git a/src/world/area_kpa/kpa_08/kpa_08_3_entity.c b/src/world/area_kpa/kpa_08/kpa_08_3_entity.c index da4e066bd7..dc5e5569f8 100644 --- a/src/world/area_kpa/kpa_08/kpa_08_3_entity.c +++ b/src/world/area_kpa/kpa_08/kpa_08_3_entity.c @@ -9,8 +9,8 @@ API_CALLABLE(N(ElevatePlayer)) { s32 yOffset = evt_get_variable(script, *args++); PlayerStatus* playerStatus = &gPlayerStatus; - if (floor == gCollisionStatus.currentFloor) { - playerStatus->position.y = script->varTable[0] + yOffset; + if (floor == gCollisionStatus.curFloor) { + playerStatus->pos.y = script->varTable[0] + yOffset; } return ApiStatus_DONE2; } diff --git a/src/world/area_kpa/kpa_09/kpa_09_3_entity.c b/src/world/area_kpa/kpa_09/kpa_09_3_entity.c index 0f2b74b672..fb3483b979 100644 --- a/src/world/area_kpa/kpa_09/kpa_09_3_entity.c +++ b/src/world/area_kpa/kpa_09/kpa_09_3_entity.c @@ -9,8 +9,8 @@ API_CALLABLE(N(ElevatePlayer)) { s32 yOffset = evt_get_variable(script, *args++); PlayerStatus* playerStatus = &gPlayerStatus; - if (floor == gCollisionStatus.currentFloor) { - playerStatus->position.y = script->varTable[0] + yOffset; + if (floor == gCollisionStatus.curFloor) { + playerStatus->pos.y = script->varTable[0] + yOffset; } return ApiStatus_DONE2; } diff --git a/src/world/area_kpa/kpa_12/kpa_12_3_platforms.c b/src/world/area_kpa/kpa_12/kpa_12_3_platforms.c index 1beb11e177..0bba5ca39e 100644 --- a/src/world/area_kpa/kpa_12/kpa_12_3_platforms.c +++ b/src/world/area_kpa/kpa_12/kpa_12_3_platforms.c @@ -14,14 +14,14 @@ API_CALLABLE(N(AddPlatformPushVelocity)) { s32 floor = evt_get_variable(script, *args++); PlayerStatus* playerStatus = &gPlayerStatus; - if (gCollisionStatus.currentFloor == floor || gCollisionStatus.lastTouchedFloor == floor) { - playerStatus->pushVelocity.x = velocity; + if (gCollisionStatus.curFloor == floor || gCollisionStatus.lastTouchedFloor == floor) { + playerStatus->pushVel.x = velocity; } - if (gPlayerData.currentPartner != PARTNER_NONE) { + if (gPlayerData.curPartner != PARTNER_NONE) { Npc* partner = get_npc_unsafe(NPC_PARTNER); - if (partner->currentFloor == floor) { + if (partner->curFloor == floor) { partner->pos.x += velocity; } } diff --git a/src/world/area_kpa/kpa_13/kpa_13_4_platforms.c b/src/world/area_kpa/kpa_13/kpa_13_4_platforms.c index 20aa337b64..faee285728 100644 --- a/src/world/area_kpa/kpa_13/kpa_13_4_platforms.c +++ b/src/world/area_kpa/kpa_13/kpa_13_4_platforms.c @@ -14,14 +14,14 @@ API_CALLABLE(N(AddPlatformPushVelocity)) { s32 floor = evt_get_variable(script, *args++); PlayerStatus* playerStatus = &gPlayerStatus; - if (gCollisionStatus.currentFloor == floor || gCollisionStatus.lastTouchedFloor == floor) { - playerStatus->pushVelocity.x = velocity; + if (gCollisionStatus.curFloor == floor || gCollisionStatus.lastTouchedFloor == floor) { + playerStatus->pushVel.x = velocity; } - if (gPlayerData.currentPartner != PARTNER_NONE) { + if (gPlayerData.curPartner != PARTNER_NONE) { Npc* partner = get_npc_unsafe(NPC_PARTNER); - if (partner->currentFloor == floor) { + if (partner->curFloor == floor) { partner->pos.x += velocity; } } diff --git a/src/world/area_kpa/kpa_133/kpa_133_3_entity.c b/src/world/area_kpa/kpa_133/kpa_133_3_entity.c index 6132a03210..ebaf166721 100644 --- a/src/world/area_kpa/kpa_133/kpa_133_3_entity.c +++ b/src/world/area_kpa/kpa_133/kpa_133_3_entity.c @@ -10,9 +10,9 @@ API_CALLABLE(N(SetSpringRotation)) { Bytecode* args = script->ptrReadPos; Entity* entity = get_entity_by_index(evt_get_variable(NULL, MV_SpringEntityID)); - entity->rotation.x = evt_get_variable(script, *args++); - entity->rotation.y = evt_get_variable(script, *args++); - entity->rotation.z = evt_get_variable(script, *args++); + entity->rot.x = evt_get_variable(script, *args++); + entity->rot.y = evt_get_variable(script, *args++); + entity->rot.z = evt_get_variable(script, *args++); return ApiStatus_DONE2; } @@ -20,9 +20,9 @@ API_CALLABLE(N(SetSpringPosition)) { Bytecode* args = script->ptrReadPos; Entity* entity = get_entity_by_index(evt_get_variable(NULL, MV_SpringEntityID)); - entity->position.x = evt_get_variable(script, *args++); - entity->position.y = evt_get_variable(script, *args++); - entity->position.z = evt_get_variable(script, *args++); + entity->pos.x = evt_get_variable(script, *args++); + entity->pos.y = evt_get_variable(script, *args++); + entity->pos.z = evt_get_variable(script, *args++); return ApiStatus_DONE2; } diff --git a/src/world/area_kpa/kpa_134/kpa_134_3_chains.c b/src/world/area_kpa/kpa_134/kpa_134_3_chains.c index 65c9a0c4dd..5f41f7a324 100644 --- a/src/world/area_kpa/kpa_134/kpa_134_3_chains.c +++ b/src/world/area_kpa/kpa_134/kpa_134_3_chains.c @@ -60,22 +60,22 @@ API_CALLABLE(N(DetectLowerChainGrab)) { return ApiStatus_BLOCK; } - if (fabs(playerStatus->position.x - 50.0f) > 14.0) { + if (fabs(playerStatus->pos.x - 50.0f) > 14.0) { return ApiStatus_BLOCK; } - if (fabs(playerStatus->position.y - 150.0f) > 14.0) { + if (fabs(playerStatus->pos.y - 150.0f) > 14.0) { return ApiStatus_BLOCK; } - if (fabs(playerStatus->position.z - -34.0f) > 14.0) { + if (fabs(playerStatus->pos.z - -34.0f) > 14.0) { return ApiStatus_BLOCK; } - playerStatus->position.x = 50.0f; - playerStatus->position.y = 150.0f; - playerStatus->position.z = -34.0f; - playerStatus->currentSpeed = 0.0f; + playerStatus->pos.x = 50.0f; + playerStatus->pos.y = 150.0f; + playerStatus->pos.z = -34.0f; + playerStatus->curSpeed = 0.0f; return ApiStatus_DONE2; } @@ -307,22 +307,22 @@ API_CALLABLE(N(DetectUpperChainGrab)) { return ApiStatus_BLOCK; } - if (fabs(playerStatus->position.x - 680.0f) > 14.0) { + if (fabs(playerStatus->pos.x - 680.0f) > 14.0) { return ApiStatus_BLOCK; } - if (fabs(playerStatus->position.y - 275.0f) > 14.0) { + if (fabs(playerStatus->pos.y - 275.0f) > 14.0) { return ApiStatus_BLOCK; } - if (fabs(playerStatus->position.z - -35.0f) > 14.0) { + if (fabs(playerStatus->pos.z - -35.0f) > 14.0) { return ApiStatus_BLOCK; } - playerStatus->position.x = 680.0f; - playerStatus->position.y = 275.0f; - playerStatus->position.z = -35.0f; - playerStatus->currentSpeed = 0.0f; + playerStatus->pos.x = 680.0f; + playerStatus->pos.y = 275.0f; + playerStatus->pos.z = -35.0f; + playerStatus->curSpeed = 0.0f; return ApiStatus_DONE2; } diff --git a/src/world/area_kpa/kpa_134/kpa_134_6_entity.c b/src/world/area_kpa/kpa_134/kpa_134_6_entity.c index 275093c320..1bc6a7c841 100644 --- a/src/world/area_kpa/kpa_134/kpa_134_6_entity.c +++ b/src/world/area_kpa/kpa_134/kpa_134_6_entity.c @@ -4,9 +4,9 @@ API_CALLABLE(N(UnusedSetEntityPosition)) { Entity* entity = get_entity_by_index(script->varTable[10]); - entity->position.x = script->varTable[0]; - entity->position.y = script->varTable[1]; - entity->position.z = script->varTable[2]; + entity->pos.x = script->varTable[0]; + entity->pos.y = script->varTable[1]; + entity->pos.z = script->varTable[2]; return ApiStatus_DONE2; } diff --git a/src/world/area_kpa/kpa_14/kpa_14_4_platforms.c b/src/world/area_kpa/kpa_14/kpa_14_4_platforms.c index 00e6823da3..57c4e85bc4 100644 --- a/src/world/area_kpa/kpa_14/kpa_14_4_platforms.c +++ b/src/world/area_kpa/kpa_14/kpa_14_4_platforms.c @@ -16,18 +16,18 @@ API_CALLABLE(N(AddPlatformPushVelocity)) { s32 temp_a0 = evt_get_variable(script, *args++); PlayerStatus* playerStatus = &gPlayerStatus; - if (gCollisionStatus.currentFloor == floor || gCollisionStatus.lastTouchedFloor == floor) { + if (gCollisionStatus.curFloor == floor || gCollisionStatus.lastTouchedFloor == floor) { if (playerStatus->actionState != ACTION_STATE_TORNADO_JUMP && playerStatus->actionState != ACTION_STATE_SPIN_JUMP && temp_a0 == 0) { - playerStatus->pushVelocity.x = velX; + playerStatus->pushVel.x = velX; } } - if (gPlayerData.currentPartner != PARTNER_NONE) { + if (gPlayerData.curPartner != PARTNER_NONE) { Npc* partner = get_npc_unsafe(NPC_PARTNER); - if (partner->currentFloor == floor) { + if (partner->curFloor == floor) { partner->pos.x += velX; } } diff --git a/src/world/area_kpa/kpa_53/kpa_53_3_npc.c b/src/world/area_kpa/kpa_53/kpa_53_3_npc.c index 540430f797..bd3b68b2a0 100644 --- a/src/world/area_kpa/kpa_53/kpa_53_3_npc.c +++ b/src/world/area_kpa/kpa_53/kpa_53_3_npc.c @@ -14,15 +14,15 @@ API_CALLABLE(N(UpdateFollowerPosition)) { return ApiStatus_DONE2; } - npc->pos.x = (s32)(((s32)playerStatus->position.x - 700) * 0.85) + 765; - if (playerStatus->currentSpeed == 0.0f) { + npc->pos.x = (s32)(((s32)playerStatus->pos.x - 700) * 0.85) + 765; + if (playerStatus->curSpeed == 0.0f) { animID = ANIM_Peach1_Idle; - } else if (playerStatus->currentSpeed < 2.0f) { + } else if (playerStatus->curSpeed < 2.0f) { animID = ANIM_Peach1_Walk; } else { animID = ANIM_Peach1_Run; } - npc->currentAnim = animID; + npc->curAnim = animID; evt_set_variable(script, outVar, playerStatus->targetYaw); return ApiStatus_DONE2; } diff --git a/src/world/area_kpa/kpa_63/kpa_63_4_scenes.c b/src/world/area_kpa/kpa_63/kpa_63_4_scenes.c index 369afd6086..9eb35bc341 100644 --- a/src/world/area_kpa/kpa_63/kpa_63_4_scenes.c +++ b/src/world/area_kpa/kpa_63/kpa_63_4_scenes.c @@ -28,9 +28,9 @@ API_CALLABLE(N(SetPassengerPos)) { switch (script->functionTemp[0]) { case 0: - gPlayerStatus.position.x = x; - gPlayerStatus.position.y = y; - gPlayerStatus.position.z = z; + gPlayerStatus.pos.x = x; + gPlayerStatus.pos.y = y; + gPlayerStatus.pos.z = z; break; case 1: partner = get_npc_safe(NPC_PARTNER); diff --git a/src/world/area_kzn/common/LavaGlowLighting.inc.c b/src/world/area_kzn/common/LavaGlowLighting.inc.c index d445dafbfd..d256cbdc43 100644 --- a/src/world/area_kzn/common/LavaGlowLighting.inc.c +++ b/src/world/area_kzn/common/LavaGlowLighting.inc.c @@ -56,7 +56,7 @@ API_CALLABLE(N(ApplyLavaGlowLighting)) { if (evt_get_float_variable(NULL, MV_GlowIntensity) <= 0.0f) { return ApiStatus_DONE2; } - deltaX = -75.0f - playerStatus->position.x; + deltaX = -75.0f - playerStatus->pos.x; if (deltaX < 0.0f) { deltaX = -deltaX; } diff --git a/src/world/area_kzn/kzn_02/kzn_02_2_platforms.c b/src/world/area_kzn/kzn_02/kzn_02_2_platforms.c index ec6c663807..464ec5c142 100644 --- a/src/world/area_kzn/kzn_02/kzn_02_2_platforms.c +++ b/src/world/area_kzn/kzn_02/kzn_02_2_platforms.c @@ -20,7 +20,7 @@ API_CALLABLE(N(GetCurrentFloor)) { Bytecode* args = script->ptrReadPos; s32 outVar = *args++; - evt_set_variable(script, outVar, gCollisionStatus.currentFloor); + evt_set_variable(script, outVar, gCollisionStatus.curFloor); return ApiStatus_DONE2; } @@ -41,13 +41,13 @@ API_CALLABLE(N(AddPushVelocity)) { CollisionStatus* collisionStatus= &gCollisionStatus; Npc* partner; - if ((collisionStatus->currentFloor == floorA) || (collisionStatus->lastTouchedFloor == floorA) - || (collisionStatus->currentFloor == floorB) || (collisionStatus->lastTouchedFloor == floorB)) { - playerStatus->pushVelocity.x = velX; + if ((collisionStatus->curFloor == floorA) || (collisionStatus->lastTouchedFloor == floorA) + || (collisionStatus->curFloor == floorB) || (collisionStatus->lastTouchedFloor == floorB)) { + playerStatus->pushVel.x = velX; } - if (gPlayerData.currentPartner != PARTNER_NONE){ + if (gPlayerData.curPartner != PARTNER_NONE){ partner = get_npc_unsafe(NPC_PARTNER); - if ((partner->currentFloor == floorA) || (partner->currentFloor == floorB)) { + if ((partner->curFloor == floorA) || (partner->curFloor == floorB)) { partner->pos.x += velX; } } diff --git a/src/world/area_kzn/kzn_02/kzn_02_4_demo.c b/src/world/area_kzn/kzn_02/kzn_02_4_demo.c index cf9f094976..32334a375c 100644 --- a/src/world/area_kzn/kzn_02/kzn_02_4_demo.c +++ b/src/world/area_kzn/kzn_02/kzn_02_4_demo.c @@ -64,11 +64,11 @@ API_CALLABLE(N(SetupDemoScene)) { break; case 3: partner_clear_player_tracking(wPartnerNpc); - partner_set_goal_pos(playerStatus->position.x, playerStatus->position.z); + partner_set_goal_pos(playerStatus->pos.x, playerStatus->pos.z); func_800EF3D4(0); set_npc_yaw(wPartnerNpc, 90.0f); playerStatus->targetYaw = 90.0f; - playerStatus->currentYaw = 90.0f; + playerStatus->curYaw = 90.0f; playerStatus->spriteFacingAngle = 0.0f; return ApiStatus_DONE2; } diff --git a/src/world/area_kzn/kzn_03/kzn_03_3_entity.c b/src/world/area_kzn/kzn_03/kzn_03_3_entity.c index 7674027485..cfcfb0b019 100644 --- a/src/world/area_kzn/kzn_03/kzn_03_3_entity.c +++ b/src/world/area_kzn/kzn_03/kzn_03_3_entity.c @@ -7,10 +7,10 @@ API_CALLABLE(N(IsPlayerOnFirstCliff)) { s32 result = -1; - if (gPlayerStatus.lastGoodPosition.y > 800.0) { + if (gPlayerStatus.lastGoodPos.y > 800.0) { result = 0; } - if (gPlayerStatus.lastGoodPosition.y < 680.0) { + if (gPlayerStatus.lastGoodPos.y < 680.0) { result = 1; } if (result >= 0) { diff --git a/src/world/area_kzn/kzn_03/kzn_03_4_ziplines.c b/src/world/area_kzn/kzn_03/kzn_03_4_ziplines.c index 28b00047f5..54f34a570e 100644 --- a/src/world/area_kzn/kzn_03/kzn_03_4_ziplines.c +++ b/src/world/area_kzn/kzn_03/kzn_03_4_ziplines.c @@ -39,13 +39,13 @@ API_CALLABLE(N(Zipline_UpdatePlayerPos)) { script->varTable[7] = (dz / 1000.0f) * script->varTable[0]; if (temp_v0 == 0) { Npc* partner = get_npc_safe(NPC_PARTNER); - gPlayerStatus.position.x = script->varTable[2] + script->varTable[5]; - gPlayerStatus.position.y = script->varTable[3] + script->varTable[6]; - gPlayerStatus.position.z = script->varTable[4] + script->varTable[7]; + gPlayerStatus.pos.x = script->varTable[2] + script->varTable[5]; + gPlayerStatus.pos.y = script->varTable[3] + script->varTable[6]; + gPlayerStatus.pos.z = script->varTable[4] + script->varTable[7]; gPlayerStatus.targetYaw = atan2(array[0], array[2], array[3], array[5]); - partner->pos.x = gPlayerStatus.position.x; - partner->pos.y = gPlayerStatus.position.y - 10.0f; - partner->pos.z = gPlayerStatus.position.z - 5.0f; + partner->pos.x = gPlayerStatus.pos.x; + partner->pos.y = gPlayerStatus.pos.y - 10.0f; + partner->pos.z = gPlayerStatus.pos.z - 5.0f; } return ApiStatus_DONE2; } diff --git a/src/world/area_kzn/kzn_04/kzn_04_3_npc.c b/src/world/area_kzn/kzn_04/kzn_04_3_npc.c index b3ad169bab..403c06ea99 100644 --- a/src/world/area_kzn/kzn_04/kzn_04_3_npc.c +++ b/src/world/area_kzn/kzn_04/kzn_04_3_npc.c @@ -71,7 +71,7 @@ EvtScript N(EVS_FireBar_Defeated) = { FireBarAISettings N(AISettings_FireBar_01) = { .centerPos = { -280, 500, -30 }, - .rotationRate = 8, + .rotRate = 8, .firstNpc = NPC_FireBar_1A, .npcCount = 4, .callback = N(FireBarAI_Callback), @@ -79,7 +79,7 @@ FireBarAISettings N(AISettings_FireBar_01) = { FireBarAISettings N(AISettings_FireBar_02) = { .centerPos = { 0, 500, 40 }, - .rotationRate = -8, + .rotRate = -8, .firstNpc = NPC_FireBar_2A, .npcCount = 4, .callback = N(FireBarAI_Callback), @@ -87,7 +87,7 @@ FireBarAISettings N(AISettings_FireBar_02) = { FireBarAISettings N(AISettings_FireBar_03) = { .centerPos = { 280, 500, -30 }, - .rotationRate = 8, + .rotRate = 8, .firstNpc = NPC_FireBar_3A, .npcCount = 4, .callback = N(FireBarAI_Callback), diff --git a/src/world/area_kzn/kzn_08/kzn_08_4_extra.c b/src/world/area_kzn/kzn_08/kzn_08_4_extra.c index 19f7f52ea9..f755dcfb05 100644 --- a/src/world/area_kzn/kzn_08/kzn_08_4_extra.c +++ b/src/world/area_kzn/kzn_08/kzn_08_4_extra.c @@ -15,7 +15,7 @@ API_CALLABLE(N(func_80243EE0_C75360)) { } set_screen_overlay_center_worldpos(SCREEN_LAYER_BACK, 1, - playerStatus->position.x, playerStatus->position.y + 8.0f, playerStatus->position.z); + playerStatus->pos.x, playerStatus->pos.y + 8.0f, playerStatus->pos.z); get_model_fog_color_parameters(&primR, &primG, &primB, &primA, &fogR, &fogG, &fogB, &fogStart, &fogEnd); @@ -33,7 +33,7 @@ API_CALLABLE(N(func_80243EE0_C75360)) { } if (gPartnerStatus.partnerActionState != PARTNER_ACTION_NONE) { - if (playerData->currentPartner == PARTNER_WATT) { + if (playerData->curPartner == PARTNER_WATT) { if (!script->functionTemp[1]) { script->functionTemp[1] = TRUE; sfx_play_sound(SOUND_WATT_REPEL_DARKNESS); @@ -43,7 +43,7 @@ API_CALLABLE(N(func_80243EE0_C75360)) { script->functionTemp[0] = 90; } } - } else if (playerData->currentPartner == PARTNER_WATT) { + } else if (playerData->curPartner == PARTNER_WATT) { if (script->functionTemp[1]) { script->functionTemp[1] = FALSE; if (script->functionTemp[0] < 255) { diff --git a/src/world/area_kzn/kzn_09/kzn_09_3_zipline.c b/src/world/area_kzn/kzn_09/kzn_09_3_zipline.c index 610609b126..9920cfce24 100644 --- a/src/world/area_kzn/kzn_09/kzn_09_3_zipline.c +++ b/src/world/area_kzn/kzn_09/kzn_09_3_zipline.c @@ -38,13 +38,13 @@ API_CALLABLE(N(Zipline_UpdatePlayerPos)) { script->varTable[7] = (dz / 1000.0f) * script->varTable[0]; if (temp_v0 == 0) { Npc* partner = get_npc_safe(NPC_PARTNER); - gPlayerStatus.position.x = script->varTable[2] + script->varTable[5]; - gPlayerStatus.position.y = script->varTable[3] + script->varTable[6]; - gPlayerStatus.position.z = script->varTable[4] + script->varTable[7]; + gPlayerStatus.pos.x = script->varTable[2] + script->varTable[5]; + gPlayerStatus.pos.y = script->varTable[3] + script->varTable[6]; + gPlayerStatus.pos.z = script->varTable[4] + script->varTable[7]; gPlayerStatus.targetYaw = atan2(array[0], array[2], array[3], array[5]); - partner->pos.x = gPlayerStatus.position.x; - partner->pos.y = gPlayerStatus.position.y - 10.0f; - partner->pos.z = gPlayerStatus.position.z - 5.0f; + partner->pos.x = gPlayerStatus.pos.x; + partner->pos.y = gPlayerStatus.pos.y - 10.0f; + partner->pos.z = gPlayerStatus.pos.z - 5.0f; } return ApiStatus_DONE2; } diff --git a/src/world/area_kzn/kzn_11/kzn_11_2_platforms.c b/src/world/area_kzn/kzn_11/kzn_11_2_platforms.c index 59d9dd93fe..3f0a7ca650 100644 --- a/src/world/area_kzn/kzn_11/kzn_11_2_platforms.c +++ b/src/world/area_kzn/kzn_11/kzn_11_2_platforms.c @@ -9,13 +9,13 @@ API_CALLABLE(N(AddPushVelocity)) { CollisionStatus* collisionStatus= &gCollisionStatus; Npc* partner; - if ((collisionStatus->currentFloor == floorA) || (collisionStatus->lastTouchedFloor == floorA) - || (collisionStatus->currentFloor == floorB) || (collisionStatus->lastTouchedFloor == floorB)) { - playerStatus->pushVelocity.x = velX; + if ((collisionStatus->curFloor == floorA) || (collisionStatus->lastTouchedFloor == floorA) + || (collisionStatus->curFloor == floorB) || (collisionStatus->lastTouchedFloor == floorB)) { + playerStatus->pushVel.x = velX; } - if (gPlayerData.currentPartner != PARTNER_NONE){ + if (gPlayerData.curPartner != PARTNER_NONE){ partner = get_npc_unsafe(NPC_PARTNER); - if ((partner->currentFloor == floorA) || (partner->currentFloor == floorB)) { + if ((partner->curFloor == floorA) || (partner->curFloor == floorB)) { partner->pos.x += velX; } } @@ -26,7 +26,7 @@ API_CALLABLE(N(GetCurrentFloor)) { Bytecode* args = script->ptrReadPos; s32 outVar = *args++; - evt_set_variable(script, outVar, gCollisionStatus.currentFloor); + evt_set_variable(script, outVar, gCollisionStatus.curFloor); return ApiStatus_DONE2; } diff --git a/src/world/area_kzn/kzn_11/kzn_11_3_npc.c b/src/world/area_kzn/kzn_11/kzn_11_3_npc.c index a383f4b2b4..89bc69b3cd 100644 --- a/src/world/area_kzn/kzn_11/kzn_11_3_npc.c +++ b/src/world/area_kzn/kzn_11/kzn_11_3_npc.c @@ -72,7 +72,7 @@ EvtScript N(EVS_FireBar_Defeated) = { FireBarAISettings N(AISettings_FireBar_01) = { .centerPos = { -300, 20, 15 }, - .rotationRate = 8, + .rotRate = 8, .firstNpc = NPC_FireBar_1A, .npcCount = 4, .callback = N(FireBarAI_Callback), @@ -80,7 +80,7 @@ FireBarAISettings N(AISettings_FireBar_01) = { FireBarAISettings N(AISettings_FireBar_02) = { .centerPos = { 0, 20, 15 }, - .rotationRate = -8, + .rotRate = -8, .firstNpc = NPC_FireBar_2A, .npcCount = 4, .callback = N(FireBarAI_Callback), @@ -88,7 +88,7 @@ FireBarAISettings N(AISettings_FireBar_02) = { FireBarAISettings N(AISettings_FireBar_03) = { .centerPos = { 325, 20, 15 }, - .rotationRate = -8, + .rotRate = -8, .firstNpc = NPC_FireBar_3A, .npcCount = 4, .callback = N(FireBarAI_Callback), diff --git a/src/world/area_kzn/kzn_20/kzn_20_3_npc.c b/src/world/area_kzn/kzn_20/kzn_20_3_npc.c index 73ad42efd1..1d56585b05 100644 --- a/src/world/area_kzn/kzn_20/kzn_20_3_npc.c +++ b/src/world/area_kzn/kzn_20/kzn_20_3_npc.c @@ -364,7 +364,7 @@ API_CALLABLE(N(GetFloorCollider)) { Bytecode* args = script->ptrReadPos; s32 outVar = *args++; - evt_set_variable(script, outVar, gCollisionStatus.currentFloor); + evt_set_variable(script, outVar, gCollisionStatus.curFloor); return ApiStatus_DONE2; } diff --git a/src/world/area_kzn/kzn_22/kzn_22_2_main.c b/src/world/area_kzn/kzn_22/kzn_22_2_main.c index 9ad55e09d3..f59f3d839a 100644 --- a/src/world/area_kzn/kzn_22/kzn_22_2_main.c +++ b/src/world/area_kzn/kzn_22/kzn_22_2_main.c @@ -68,7 +68,7 @@ API_CALLABLE(N(GetFloorCollider1)) { Bytecode* args = script->ptrReadPos; s32 outVar = *args++; - evt_set_variable(script, outVar, gCollisionStatus.currentFloor); + evt_set_variable(script, outVar, gCollisionStatus.curFloor); return ApiStatus_DONE2; } diff --git a/src/world/area_kzn/kzn_22/kzn_22_4_npc.c b/src/world/area_kzn/kzn_22/kzn_22_4_npc.c index fbeaeaf96a..bc84fa73bc 100644 --- a/src/world/area_kzn/kzn_22/kzn_22_4_npc.c +++ b/src/world/area_kzn/kzn_22/kzn_22_4_npc.c @@ -5,7 +5,7 @@ API_CALLABLE(N(GetFloorCollider2)) { Bytecode* args = script->ptrReadPos; s32 outVar = *args++; - evt_set_variable(script, outVar, gCollisionStatus.currentFloor); + evt_set_variable(script, outVar, gCollisionStatus.curFloor); return ApiStatus_DONE2; } diff --git a/src/world/area_kzn/kzn_23/kzn_23_3_npc.c b/src/world/area_kzn/kzn_23/kzn_23_3_npc.c index 202869500d..837a4178cb 100644 --- a/src/world/area_kzn/kzn_23/kzn_23_3_npc.c +++ b/src/world/area_kzn/kzn_23/kzn_23_3_npc.c @@ -11,9 +11,9 @@ API_CALLABLE(N(SetChestPosition)) { f32 z = evt_get_variable(script, *args++); Entity* entity = get_entity_by_index(entityIndex); - entity->position.x = x; - entity->position.y = y; - entity->position.z = z; + entity->pos.x = x; + entity->pos.y = y; + entity->pos.z = z; return ApiStatus_DONE2; } @@ -21,9 +21,9 @@ API_CALLABLE(N(GetChestPosition)) { Bytecode* args = script->ptrReadPos; Entity* entity = get_entity_by_index(evt_get_variable(script, *args++)); - evt_set_variable(script, *args++, entity->position.x); - evt_set_variable(script, *args++, entity->position.y); - evt_set_variable(script, *args++, entity->position.z); + evt_set_variable(script, *args++, entity->pos.x); + evt_set_variable(script, *args++, entity->pos.y); + evt_set_variable(script, *args++, entity->pos.z); return ApiStatus_DONE2; } @@ -59,7 +59,7 @@ API_CALLABLE(N(AnimateChestSize)) { entity->scale.y = script->functionTemp[1] / 60.0f; entity->scale.z = script->functionTemp[1] / 60.0f; - entity->rotation.y = (1.0f - cos_rad(entity->scale.y * PI)) * 990.0 / 2.0; + entity->rot.y = (1.0f - cos_rad(entity->scale.y * PI)) * 990.0 / 2.0; script->functionTemp[1]--; if (~script->functionTemp[1] == 0) { //TODO remove ~ optimization diff --git a/src/world/area_mac/mac_01/npc/post_office.inc.c b/src/world/area_mac/mac_01/npc/post_office.inc.c index be51277c8f..059803f6df 100644 --- a/src/world/area_mac/mac_01/npc/post_office.inc.c +++ b/src/world/area_mac/mac_01/npc/post_office.inc.c @@ -213,7 +213,7 @@ API_CALLABLE(N(func_8024522C_805AAC)) { } API_CALLABLE(N(func_80245440_805CC0)) { - if (gPlayerData.currentPartner == script->varTable[10]) { + if (gPlayerData.curPartner == script->varTable[10]) { script->varTable[1] = 0; return ApiStatus_DONE2; } diff --git a/src/world/area_mac/mac_01/npc/read_fortune.inc.c b/src/world/area_mac/mac_01/npc/read_fortune.inc.c index 4738d45745..945a45f77d 100644 --- a/src/world/area_mac/mac_01/npc/read_fortune.inc.c +++ b/src/world/area_mac/mac_01/npc/read_fortune.inc.c @@ -100,7 +100,7 @@ API_CALLABLE(N(func_802443E0_804C60)) { temp_f24 = script->functionTemp[0] * 10; for (i = 0; i < ARRAY_COUNT(effects); i++) { - guRotateF(sp28, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(sp28, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f); guRotateF(sp68, i * 120, 0.0f, 0.0f, 1.0f); guMtxCatF(sp68, sp28, sp28); tx = temp_f30 * sin_deg(temp_f24); diff --git a/src/world/area_mac/mac_01/npc/rowf_and_rhuff.inc.c b/src/world/area_mac/mac_01/npc/rowf_and_rhuff.inc.c index 447c4910de..62d02920e5 100644 --- a/src/world/area_mac/mac_01/npc/rowf_and_rhuff.inc.c +++ b/src/world/area_mac/mac_01/npc/rowf_and_rhuff.inc.c @@ -27,10 +27,10 @@ API_CALLABLE(N(RhuffUnravelUpdate)) { script->varTable[5] = script->varTable[3] + (s32) ((initialPosX * sinTheta) + (initialPosY * cosTheta)); if (rugRotAngle == 0) { - npc->currentAnim = ANIM_Rowf_Idle; + npc->curAnim = ANIM_Rowf_Idle; enemy->flags &= ~ENEMY_FLAG_CANT_INTERACT; } else { - npc->currentAnim = ANIM_Rowf_Walk; + npc->curAnim = ANIM_Rowf_Walk; enemy->flags |= ENEMY_FLAG_CANT_INTERACT; } @@ -41,7 +41,7 @@ API_CALLABLE(N(RhuffUnravelUpdate)) { } if (rugRippleAmt != 0) { - npc->currentAnim = ANIM_Rowf_Think; + npc->curAnim = ANIM_Rowf_Think; } return ApiStatus_DONE2; } diff --git a/src/world/area_mac/mac_04/mac_04_8_entity.c b/src/world/area_mac/mac_04/mac_04_8_entity.c index 39579f7493..9908e272dd 100644 --- a/src/world/area_mac/mac_04/mac_04_8_entity.c +++ b/src/world/area_mac/mac_04/mac_04_8_entity.c @@ -27,13 +27,13 @@ void N(render_shrunk_player)(void) { s32 screenX, screenY, screenZ; get_screen_coords(gCurrentCamID, - gPlayerStatus.position.x, gPlayerStatus.position.y, gPlayerStatus.position.z, + gPlayerStatus.pos.x, gPlayerStatus.pos.y, gPlayerStatus.pos.z, &screenX, &screenY, &screenZ); renderTask.appendGfxArg = &gPlayerStatus; renderTask.appendGfx = N(appendGfx_shrunk_player); renderTask.renderMode = gPlayerStatus.renderMode; - renderTask.distance = screenZ; + renderTask.dist = screenZ; queue_render_task(&renderTask); } @@ -47,7 +47,7 @@ void N(appendGfx_shrunk_player)(void* data) { guRotateF(transformMtx, playerStatus->spriteFacingAngle, 0.0f, 1.0f, 0.0f); guScaleF(tempMtx, shrinkScale * SPRITE_WORLD_SCALE_D, shrinkScale * SPRITE_WORLD_SCALE_D, shrinkScale * SPRITE_WORLD_SCALE_D); guMtxCatF(transformMtx, tempMtx, transformMtx); - guTranslateF(tempMtx, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z); + guTranslateF(tempMtx, playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z); guMtxCatF(transformMtx, tempMtx, transformMtx); playerStatus->animNotifyValue = spr_update_player_sprite(PLAYER_SPRITE_MAIN, playerStatus->trueAnimation, 1.0f); spr_draw_player_sprite(PLAYER_SPRITE_MAIN, 0, 0, NULL, transformMtx); diff --git a/src/world/area_mac/mac_05/mac_05_4_npc.c b/src/world/area_mac/mac_05/mac_05_4_npc.c index b8c49eb661..d3969119da 100644 --- a/src/world/area_mac/mac_05/mac_05_4_npc.c +++ b/src/world/area_mac/mac_05/mac_05_4_npc.c @@ -211,9 +211,9 @@ API_CALLABLE(N(func_80242C78_854DE8)) { switch (script->functionTemp[0]) { case 0: - gPlayerStatus.position.x = x; - gPlayerStatus.position.y = y; - gPlayerStatus.position.z = z; + gPlayerStatus.pos.x = x; + gPlayerStatus.pos.y = y; + gPlayerStatus.pos.z = z; npc0->colliderPos.x = npc0->pos.x; npc0->colliderPos.y = npc0->pos.y; npc0->colliderPos.z = npc0->pos.z; @@ -267,7 +267,7 @@ API_CALLABLE(N(func_80242E84_854FF4)) { switch (script->functionTemp[2]) { case 0: - npc->currentAnim = ANIM_Kolorado_Idle; + npc->curAnim = ANIM_Kolorado_Idle; npc->yaw -= 1.0f; npc->pos.x += 3.0f; script->functionTemp[1]--; @@ -1219,9 +1219,9 @@ API_CALLABLE(N(func_80243254_8553C4)) { return ApiStatus_DONE2; } - theta = clamp_angle(atan2(playerStatus->position.x, playerStatus->position.z, npc->pos.x, npc->pos.z)); - x = playerStatus->position.x + (sin_deg(theta) * 40.0f); - z = playerStatus->position.z - (cos_deg(theta) * 40.0f); + theta = clamp_angle(atan2(playerStatus->pos.x, playerStatus->pos.z, npc->pos.x, npc->pos.z)); + x = playerStatus->pos.x + (sin_deg(theta) * 40.0f); + z = playerStatus->pos.z - (cos_deg(theta) * 40.0f); evt_set_variable(script, outVar0, x); evt_set_variable(script, outVar1, z); return ApiStatus_DONE2; diff --git a/src/world/area_mac/mac_06/mac_06_3_npc.c b/src/world/area_mac/mac_06/mac_06_3_npc.c index 804f5040ad..262b1fad48 100644 --- a/src/world/area_mac/mac_06/mac_06_3_npc.c +++ b/src/world/area_mac/mac_06/mac_06_3_npc.c @@ -59,9 +59,9 @@ API_CALLABLE(N(func_80240E80_8659C0)) { switch (script->functionTemp[0]) { case 0: - gPlayerStatus.position.x = x; - gPlayerStatus.position.y = y + D_80243434_867F74; - gPlayerStatus.position.z = z; + gPlayerStatus.pos.x = x; + gPlayerStatus.pos.y = y + D_80243434_867F74; + gPlayerStatus.pos.z = z; whale->colliderPos.x = whale->pos.x; whale->colliderPos.y = whale->pos.y; whale->colliderPos.z = whale->pos.z; @@ -112,7 +112,7 @@ API_CALLABLE(N(func_80241098_865BD8)) { break; case 10: - npc->currentAnim = ANIM_Kolorado_Shout; + npc->curAnim = ANIM_Kolorado_Shout; D_80243434_867F74 = 0.0f; D_80243438_867F78 = 5.0f; D_8024343C_867F7C = 11; @@ -128,7 +128,7 @@ API_CALLABLE(N(func_80241098_865BD8)) { } else { D_80243438_867F78 -= 2.0f; } - if (npc->currentAnim == ANIM_Kolorado_Idle) { + if (npc->curAnim == ANIM_Kolorado_Idle) { D_80243438_867F78 = 4.0f; D_8024343C_867F7C++; } diff --git a/src/world/area_mgm/mgm_00/mgm_00_3_scoreboard.c b/src/world/area_mgm/mgm_00/mgm_00_3_scoreboard.c index 27f28c7a95..399c7a91b7 100644 --- a/src/world/area_mgm/mgm_00/mgm_00_3_scoreboard.c +++ b/src/world/area_mgm/mgm_00/mgm_00_3_scoreboard.c @@ -124,7 +124,7 @@ void N(animate_and_draw_record)(void* renderData) { case RECORD_STATE_VISIBLE: data->alpha = 255; data->curAlpha = 255; - if (gGameStatusPtr->currentButtons[0] & (BUTTON_A | BUTTON_B)) { + if (gGameStatusPtr->curButtons[0] & (BUTTON_A | BUTTON_B)) { data->state = RECORD_START_HIDE; } if (data->state != RECORD_START_HIDE) { @@ -153,7 +153,7 @@ void N(work_draw_record)(void) { task.renderMode = RENDER_MODE_2D; task.appendGfxArg = 0; task.appendGfx = &N(animate_and_draw_record); - task.distance = 0; + task.dist = 0; queue_render_task(&task); } diff --git a/src/world/area_mgm/mgm_01/mgm_01_1_main.c b/src/world/area_mgm/mgm_01/mgm_01_1_main.c index fc165ae60f..5aa3c1b68a 100644 --- a/src/world/area_mgm/mgm_01/mgm_01_1_main.c +++ b/src/world/area_mgm/mgm_01/mgm_01_1_main.c @@ -5,14 +5,14 @@ API_CALLABLE(N(GetSpotlightPos)) { f32 spotLightPosX, spotLightPosZ; f32 lightBeamRotX, lightBeamRotZ; - spotLightPosX = gPlayerStatusPtr->position.x; + spotLightPosX = gPlayerStatusPtr->pos.x; if (spotLightPosX < -95.0) { spotLightPosX = -95.0; } if (spotLightPosX > 95.0) { spotLightPosX = 95.0; } - spotLightPosZ = gPlayerStatusPtr->position.z; + spotLightPosZ = gPlayerStatusPtr->pos.z; if (spotLightPosZ < -80.0) { spotLightPosZ = -80.0; } @@ -29,9 +29,9 @@ API_CALLABLE(N(GetSpotlightPos)) { evt_set_float_variable(script, LVar3, lightBeamRotZ); shading = gSpriteShadingProfile; - shading->sources[0].pos.x = gPlayerStatusPtr->position.x * 0.8; + shading->sources[0].pos.x = gPlayerStatusPtr->pos.x * 0.8; shading->sources[0].pos.y = 80.0f; - shading->sources[0].pos.z = gPlayerStatusPtr->position.z + 50.0f; + shading->sources[0].pos.z = gPlayerStatusPtr->pos.z + 50.0f; return ApiStatus_DONE2; } diff --git a/src/world/area_mgm/mgm_01/mgm_01_2_npc.c b/src/world/area_mgm/mgm_01/mgm_01_2_npc.c index 9f70878044..972c092cc9 100644 --- a/src/world/area_mgm/mgm_01/mgm_01_2_npc.c +++ b/src/world/area_mgm/mgm_01/mgm_01_2_npc.c @@ -56,7 +56,7 @@ typedef struct JumpGameData { /* 0x000 */ s32 workerID; /* 0x004 */ s32 hudElemID; /* 0x008 */ s32 unk_08; // unused -- likely hudElemID for an unused/removed hud element - /* 0x00C */ s32 currentScore; + /* 0x00C */ s32 curScore; /* 0x010 */ s32 targetScore; /* 0x014 */ s32 scoreWindowPosX; /* 0x018 */ s32 scoreWindowPosY; // unused -- posY is hard-coded while drawing the box @@ -122,31 +122,31 @@ void N(appendGfx_score_display) (void* renderData) { hudElemID = data->hudElemID; hud_element_set_render_pos(hudElemID, data->scoreWindowPosX + 15, 39); hud_element_draw_clipped(hudElemID); - if (data->currentScore > data->targetScore) { - data->currentScore = data->targetScore; - } else if (data->currentScore < data->targetScore) { - diff = data->targetScore - data->currentScore; + if (data->curScore > data->targetScore) { + data->curScore = data->targetScore; + } else if (data->curScore < data->targetScore) { + diff = data->targetScore - data->curScore; if (diff > 100) { - data->currentScore += 40; + data->curScore += 40; } else if (diff > 75) { - data->currentScore += 35; + data->curScore += 35; } else if (diff > 50) { - data->currentScore += 30; + data->curScore += 30; } else if (diff > 30) { - data->currentScore += 20; + data->curScore += 20; } else if (diff > 20) { - data->currentScore += 10; + data->curScore += 10; } else if (diff > 10) { - data->currentScore += 5; + data->curScore += 5; } else if (diff > 5) { - data->currentScore += 2; + data->curScore += 2; } else { - data->currentScore++; + data->curScore++; } sfx_play_sound_with_params(SOUND_211, 0, 0x40, 0x32); } - draw_number(data->currentScore, data->scoreWindowPosX + 63, 32, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_WHITE, 255, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT); + draw_number(data->curScore, data->scoreWindowPosX + 63, 32, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_WHITE, 255, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT); } } @@ -156,7 +156,7 @@ void N(worker_draw_score)(void) { task.renderMode = RENDER_MODE_2D; task.appendGfxArg = 0; task.appendGfx = &mgm_01_appendGfx_score_display; - task.distance = 0; + task.dist = 0; queue_render_task(&task); } @@ -377,21 +377,21 @@ API_CALLABLE(N(UpdateRecords)) { JumpGameData* data = (JumpGameData*)get_enemy(SCOREKEEPER_ENEMY_IDX)->varTable[JUMP_DATA_VAR_IDX]; PlayerData* player = &gPlayerData; - player->jumpGameTotal += data->currentScore; + player->jumpGameTotal += data->curScore; if (player->jumpGameTotal > 99999) { player->jumpGameTotal = 99999; } - if (player->jumpGameRecord < data->currentScore) { - player->jumpGameRecord = data->currentScore; + if (player->jumpGameRecord < data->curScore) { + player->jumpGameRecord = data->curScore; } - set_message_value(data->currentScore, 0); + set_message_value(data->curScore, 0); return ApiStatus_DONE2; } API_CALLABLE(N(GiveCoinReward)) { JumpGameData* data = (JumpGameData*)get_enemy(SCOREKEEPER_ENEMY_IDX)->varTable[JUMP_DATA_VAR_IDX]; - s32 coinsLeft = data->currentScore; + s32 coinsLeft = data->curScore; s32 increment; if (coinsLeft > 100) { @@ -410,12 +410,12 @@ API_CALLABLE(N(GiveCoinReward)) { increment = 1; } - data->currentScore -= increment; + data->curScore -= increment; add_coins(increment); - data->targetScore = data->currentScore; + data->targetScore = data->curScore; sfx_play_sound(SOUND_211); - if (data->currentScore > 0) { + if (data->curScore > 0) { return ApiStatus_BLOCK; } else { return ApiStatus_DONE2; @@ -424,8 +424,8 @@ API_CALLABLE(N(GiveCoinReward)) { API_CALLABLE(N(DoubleScore)) { JumpGameData* data = (JumpGameData*)get_enemy(SCOREKEEPER_ENEMY_IDX)->varTable[JUMP_DATA_VAR_IDX]; - s32 score = 2 * data->currentScore; - data->currentScore = score; + s32 score = 2 * data->curScore; + data->curScore = score; data->targetScore = score; return ApiStatus_DONE2; @@ -608,7 +608,7 @@ API_CALLABLE(N(InitializePanels)) { JumpGameData* data = get_enemy(SCOREKEEPER_ENEMY_IDX)->varTablePtr[JUMP_DATA_VAR_IDX]; s32 i; - data->currentScore = 0; + data->curScore = 0; data->targetScore = 0; for (i = 0; i < ARRAY_COUNT(data->panels); i++) { diff --git a/src/world/area_mgm/mgm_02/mgm_02_2_npc.c b/src/world/area_mgm/mgm_02/mgm_02_2_npc.c index 793de94889..69065222c1 100644 --- a/src/world/area_mgm/mgm_02/mgm_02_2_npc.c +++ b/src/world/area_mgm/mgm_02/mgm_02_2_npc.c @@ -106,7 +106,7 @@ typedef struct SmashGameData { /* 0x014 */ s32 windowA_posX; /* 0x018 */ s32 windowB_posX; /* 0x01C */ s32 signpostEntity; - /* 0x020 */ s32 currentScore; + /* 0x020 */ s32 curScore; /* 0x024 */ s32 mashProgress; /* 0x028 */ SmashGameStunFlags stunFlags; /* 0x02C */ SmashGameBoxData box[NUM_BOXES]; @@ -197,7 +197,7 @@ void N(worker_draw_score)(void) { task.renderMode = RENDER_MODE_2D; task.appendGfxArg = 0; task.appendGfx = &N(appendGfx_score_display); - task.distance = 0; + task.dist = 0; queue_render_task(&task); } @@ -304,7 +304,7 @@ API_CALLABLE(N(SetBoxContents)) { SmashGameData* data = get_enemy(SCOREKEEPER_ENEMY_IDX)->varTablePtr[SMASH_DATA_VAR_IDX]; data->found = 0; data->timeLeft = PLAY_TIME + 10; - data->currentScore = 0; + data->curScore = 0; data->mashProgress = 0; data->stunFlags = 0; @@ -455,11 +455,11 @@ API_CALLABLE(N(RunMinigame)) { case BOX_STATE_FUZZY_IDLE: data->box[i].stateTimer--; if (data->box[i].stateTimer <= 0) { - npc->currentAnim = ANIM_Fuzzy_Walk; + npc->curAnim = ANIM_Fuzzy_Walk; data->box[i].state = BOX_STATE_FUZZY_POPUP; sfx_play_sound_at_position(enemy->varTable[8], SOUND_SPACE_MODE_0 | SOUND_PARAM_MOST_QUIET, npc->pos.x, npc->pos.y, npc->pos.z); get_model_center_and_size(data->box[i].modelID, ¢erX, ¢erY, ¢erZ, &sizeX, &sizeY, &sizeZ); - npc->jumpVelocity = 10.5f; + npc->jumpVel = 10.5f; npc->pos.x = centerX; npc->jumpScale = 1.5f; npc->pos.y = centerY - 12.5; @@ -470,14 +470,14 @@ API_CALLABLE(N(RunMinigame)) { break; case BOX_STATE_FUZZY_POPUP: data->box[i].stateTimer++; - npc->pos.y += npc->jumpVelocity; - npc->jumpVelocity -= npc->jumpScale; + npc->pos.y += npc->jumpVel; + npc->jumpVel -= npc->jumpScale; if ((npc->moveToPos.y + 20.0f) < npc->pos.y) { enable_npc_shadow(npc); } else { disable_npc_shadow(npc); } - if ((npc->jumpVelocity < 0.0) && (npc->pos.y <= npc->moveToPos.y)) { + if ((npc->jumpVel < 0.0) && (npc->pos.y <= npc->moveToPos.y)) { data->box[i].state = BOX_STATE_FUZZY_IDLE; data->box[i].stateTimer = rand_int(330) + 90; npc->pos.y = NPC_DISPOSE_POS_Y; @@ -501,13 +501,13 @@ API_CALLABLE(N(RunMinigame)) { sfx_play_sound(enemy->varTable[8]); data->box[i].state = BOX_STATE_FUZZY_ATTACH; gPlayerStatusPtr->anim = ANIM_Mario1_TiredStill; - npc->currentAnim = ANIM_Fuzzy_Run; + npc->curAnim = ANIM_Fuzzy_Run; get_model_center_and_size(data->box[i].modelID, ¢erX, ¢erY, ¢erZ, &sizeX, &sizeY, &sizeZ); npc->pos.x = centerX; npc->pos.y = centerY; npc->pos.z = centerZ + 2.0; - npc->moveToPos.y = gPlayerStatusPtr->position.y + 35.0f; - npc->jumpVelocity = 10.5f; + npc->moveToPos.y = gPlayerStatusPtr->pos.y + 35.0f; + npc->jumpVel = 10.5f; npc->jumpScale = 1.5f; data->box[i].stateTimer = 0; @@ -515,9 +515,9 @@ API_CALLABLE(N(RunMinigame)) { enemy->varTable[1] = npc->pos.x * 10.0f; enemy->varTable[2] = npc->pos.y * 10.0f; enemy->varTable[3] = npc->pos.z * 10.0f; - enemy->varTable[4] = gPlayerStatusPtr->position.x * 10.0f; - enemy->varTable[5] = (gPlayerStatusPtr->position.y + 28.0f) * 10.0f; - enemy->varTable[6] = (gPlayerStatusPtr->position.z + 2.0f) * 10.0f; + enemy->varTable[4] = gPlayerStatusPtr->pos.x * 10.0f; + enemy->varTable[5] = (gPlayerStatusPtr->pos.y + 28.0f) * 10.0f; + enemy->varTable[6] = (gPlayerStatusPtr->pos.z + 2.0f) * 10.0f; enemy->varTable[7] = 0; break; case BOX_STATE_FUZZY_ATTACH: @@ -528,12 +528,12 @@ API_CALLABLE(N(RunMinigame)) { gPlayerStatusPtr->anim = ANIM_Mario1_TiredStill; npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = ANIM_Fuzzy_Stunned; + npc->curAnim = ANIM_Fuzzy_Stunned; gPlayerStatusPtr->anim = ANIM_Mario1_PanicRun; data->mashProgress = 0; - npc->pos.x = gPlayerStatusPtr->position.x; - npc->pos.y = gPlayerStatusPtr->position.y + 28.0; - npc->pos.z = gPlayerStatusPtr->position.z + 2.0; + npc->pos.x = gPlayerStatusPtr->pos.x; + npc->pos.y = gPlayerStatusPtr->pos.y + 28.0; + npc->pos.z = gPlayerStatusPtr->pos.z + 2.0; hud_element_set_script(data->hudElemID_AButton, &HES_MashAButton); hud_element_set_alpha(data->hudElemID_AButton, 255); hud_element_set_alpha(data->hudElemID_Meter, 255); @@ -554,7 +554,7 @@ API_CALLABLE(N(RunMinigame)) { hud_element_set_script(data->hudElemID_AButton, &HES_AButton); hud_element_set_alpha(data->hudElemID_AButton, 160); hud_element_set_alpha(data->hudElemID_Meter, 160); - npc->currentAnim = ANIM_Fuzzy_Hurt; + npc->curAnim = ANIM_Fuzzy_Hurt; npc->pos.y += 3.0; } break; @@ -586,7 +586,7 @@ API_CALLABLE(N(RunMinigame)) { data->box[i].state = BOX_STATE_BOMB_POPUP; sfx_play_sound_at_position(enemy->varTable[8], 0x100000, npc->pos.x, npc->pos.y, npc->pos.z); get_model_center_and_size(data->box[i].modelID, ¢erX, ¢erY, ¢erZ, &sizeX, &sizeY, &sizeZ); - npc->jumpVelocity = 10.5f; + npc->jumpVel = 10.5f; npc->pos.x = centerX; npc->jumpScale = 1.5f; npc->pos.y = centerY - 12.5; @@ -597,14 +597,14 @@ API_CALLABLE(N(RunMinigame)) { break; case BOX_STATE_BOMB_POPUP: data->box[i].stateTimer++; - npc->pos.y += npc->jumpVelocity; - npc->jumpVelocity -= npc->jumpScale; + npc->pos.y += npc->jumpVel; + npc->jumpVel -= npc->jumpScale; if ((npc->moveToPos.y + 20.0f) < npc->pos.y) { enable_npc_shadow(npc); } else { disable_npc_shadow(npc); } - if ((npc->jumpVelocity < 0.0) && (npc->pos.y <= npc->moveToPos.y)) { + if ((npc->jumpVel < 0.0) && (npc->pos.y <= npc->moveToPos.y)) { data->box[i].state = BOX_STATE_BOMB_IDLE; data->box[i].stateTimer = rand_int(330) + 90; npc->pos.y = NPC_DISPOSE_POS_Y; @@ -619,7 +619,7 @@ API_CALLABLE(N(RunMinigame)) { case BOX_STATE_BOMB_HIT: enable_npc_shadow(npc); npc->duration = 15; - npc->currentAnim = ANIM_Bobomb_WalkLit; + npc->curAnim = ANIM_Bobomb_WalkLit; data->stunFlags |= (STUN_FLAG_STUNNED | STUN_FLAG_CHANGED); data->box[i].state = BOX_STATE_BOMB_ATTACK; get_model_center_and_size(data->box[i].modelID, ¢erX, ¢erY, ¢erZ, &sizeX, &sizeY, &sizeZ); @@ -627,7 +627,7 @@ API_CALLABLE(N(RunMinigame)) { npc->pos.y = centerY - 10.0f; npc->pos.z = centerZ + 8.0; fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, 0.0f, 10, &writeback); - if (npc->pos.x > gPlayerStatusPtr->position.x) { + if (npc->pos.x > gPlayerStatusPtr->pos.x) { npc->yaw = 270.0f; gPlayerStatusPtr->targetYaw = 95.0f; } else { @@ -690,7 +690,7 @@ API_CALLABLE(N(RunMinigame)) { data->box[i].state = BOX_STATE_PEACH_POPUP; sfx_play_sound_at_position(SOUND_214, SOUND_PARAM_MORE_QUIET | SOUND_SPACE_MODE_0, npc->pos.x, npc->pos.y, npc->pos.z); get_model_center_and_size(data->box[i].modelID, ¢erX, ¢erY, ¢erZ, &sizeX, &sizeY, &sizeZ); - npc->jumpVelocity = 10.0f; + npc->jumpVel = 10.0f; npc->pos.y = npc->moveToPos.y; npc->jumpScale = 1.1f; data->box[i].stateTimer = 0; @@ -708,8 +708,8 @@ API_CALLABLE(N(RunMinigame)) { break; case BOX_STATE_PEACH_POPUP: data->box[i].stateTimer++; - npc->pos.y += npc->jumpVelocity; - npc->jumpVelocity -= npc->jumpScale; + npc->pos.y += npc->jumpVel; + npc->jumpVel -= npc->jumpScale; model = get_model_from_list_index(get_model_list_index_from_tree_index(data->box[i].peachPanelModelID)); if (!(model->flags & MODEL_FLAG_HAS_TRANSFORM)) { guTranslateF(model->userTransformMtx, npc->pos.x, npc->pos.y, npc->pos.z); @@ -723,7 +723,7 @@ API_CALLABLE(N(RunMinigame)) { } else { disable_npc_shadow(npc); } - if ((npc->jumpVelocity < 0.0) && (npc->pos.y <= npc->moveToPos.y)) { + if ((npc->jumpVel < 0.0) && (npc->pos.y <= npc->moveToPos.y)) { data->box[i].state = BOX_STATE_PEACH_IDLE; data->box[i].stateTimer = rand_int(330) + 90; disable_npc_shadow(npc); @@ -855,22 +855,22 @@ API_CALLABLE(N(UpdateRecords)) { seconds = data->timeLeft / FRAME_RATE; deciseconds = ((f32)(data->timeLeft % FRAME_RATE) * 10.0) / FRAME_RATE; - data->currentScore = (seconds * 10) + deciseconds; - playerData->smashGameTotal += data->currentScore; + data->curScore = (seconds * 10) + deciseconds; + playerData->smashGameTotal += data->curScore; if (playerData->smashGameTotal > 99999) { playerData->smashGameTotal = 99999; } - if (playerData->smashGameRecord < data->currentScore) { - playerData->smashGameRecord = data->currentScore; + if (playerData->smashGameRecord < data->curScore) { + playerData->smashGameRecord = data->curScore; } set_message_value(seconds, 0); set_message_value(deciseconds, 1); - set_message_value(data->currentScore, 2); + set_message_value(data->curScore, 2); - outScore = data->currentScore; - if (data->currentScore == 0 && data->found == NUM_PANELS) { + outScore = data->curScore; + if (data->curScore == 0 && data->found == NUM_PANELS) { outScore = -1; } evt_set_variable(script, LVar0, outScore); @@ -880,7 +880,7 @@ API_CALLABLE(N(UpdateRecords)) { API_CALLABLE(N(GiveCoinReward)) { SmashGameData* data = get_enemy(SCOREKEEPER_ENEMY_IDX)->varTablePtr[SMASH_DATA_VAR_IDX]; - s32 coinsLeft = data->currentScore; + s32 coinsLeft = data->curScore; s32 increment; if (coinsLeft > 100) { @@ -899,11 +899,11 @@ API_CALLABLE(N(GiveCoinReward)) { increment = 1; } - data->currentScore -= increment; + data->curScore -= increment; add_coins(increment); sfx_play_sound(SOUND_211); - return (data->currentScore > 0) ? ApiStatus_BLOCK : ApiStatus_DONE2; + return (data->curScore > 0) ? ApiStatus_BLOCK : ApiStatus_DONE2; } API_CALLABLE(N(CleanupGame)) { @@ -951,7 +951,7 @@ API_CALLABLE(N(CleanupGame)) { if (data->box[i].state != BOX_STATE_FUZZY_END) { data->box[i].state = BOX_STATE_FUZZY_END; fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, 0.0f, 30, &writeback); - npc->currentAnim = ANIM_Fuzzy_Sleep; + npc->curAnim = ANIM_Fuzzy_Sleep; enable_npc_shadow(npc); } break; @@ -960,7 +960,7 @@ API_CALLABLE(N(CleanupGame)) { if (data->box[i].state != BOX_STATE_BOMB_END) { data->box[i].state = BOX_STATE_BOMB_END; fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, 0.0f, 30, &writeback); - npc->currentAnim = ANIM_Bobomb_Dizzy; + npc->curAnim = ANIM_Bobomb_Dizzy; enable_npc_shadow(npc); } break; diff --git a/src/world/area_mim/mim_10/mim_10_4_npc.c b/src/world/area_mim/mim_10/mim_10_4_npc.c index bb316ec5da..6930978372 100644 --- a/src/world/area_mim/mim_10/mim_10_4_npc.c +++ b/src/world/area_mim/mim_10/mim_10_4_npc.c @@ -2,7 +2,7 @@ #include "sprite/player.h" API_CALLABLE(N(AwaitPlayerApproachForest)) { - if (gPlayerStatus.position.x < 100.0f) { + if (gPlayerStatus.pos.x < 100.0f) { return ApiStatus_BLOCK; } else { return ApiStatus_DONE2; diff --git a/src/world/area_nok/nok_01/nok_01_4_npc.c b/src/world/area_nok/nok_01/nok_01_4_npc.c index 63aba7c35a..34914ce4ff 100644 --- a/src/world/area_nok/nok_01/nok_01_4_npc.c +++ b/src/world/area_nok/nok_01/nok_01_4_npc.c @@ -93,7 +93,7 @@ API_CALLABLE(N(IsNpcFacingRight)) { s32 npcID = evt_get_variable(script, *args++); s32 outVar = *args++; Npc* npc = get_npc_safe(npcID); - f32 angle = clamp_angle((npc->yaw + 180.0f) - gCameras[gCurrentCameraID].currentYaw); + f32 angle = clamp_angle((npc->yaw + 180.0f) - gCameras[gCurrentCameraID].curYaw); s32 outVal; outVal = FALSE; diff --git a/src/world/area_nok/nok_02/nok_02_7_demo.c b/src/world/area_nok/nok_02/nok_02_7_demo.c index c2bd404179..9392639b01 100644 --- a/src/world/area_nok/nok_02/nok_02_7_demo.c +++ b/src/world/area_nok/nok_02/nok_02_7_demo.c @@ -164,11 +164,11 @@ API_CALLABLE(N(SetupDemoScene)) { break; case 3: partner_clear_player_tracking(wPartnerNpc); - partner_set_goal_pos(playerStatus->position.x, playerStatus->position.z); + partner_set_goal_pos(playerStatus->pos.x, playerStatus->pos.z); func_800EF3D4(0); set_npc_yaw(wPartnerNpc, 90.0f); playerStatus->targetYaw = 90.0f; - playerStatus->currentYaw = 90.0f; + playerStatus->curYaw = 90.0f; playerStatus->spriteFacingAngle = 0.0f; return ApiStatus_DONE2; } diff --git a/src/world/area_nok/nok_02/npcs_crisis.inc.c b/src/world/area_nok/nok_02/npcs_crisis.inc.c index b6d8909a33..15617a2f8e 100644 --- a/src/world/area_nok/nok_02/npcs_crisis.inc.c +++ b/src/world/area_nok/nok_02/npcs_crisis.inc.c @@ -21,7 +21,7 @@ API_CALLABLE(N(IsPlayerOrKoopaNearby)) { s32 outVal = FALSE; f32 xDiff, zDiff; - if (playerStatus->currentSpeed >= 4.0f) { + if (playerStatus->curSpeed >= 4.0f) { script->varTable[2]++; if (script->varTable[2] > 2) { script->varTable[2] = 2; @@ -31,8 +31,8 @@ API_CALLABLE(N(IsPlayerOrKoopaNearby)) { } do { - xDiff = fuzzyNpc->pos.x - playerStatus->position.x; - zDiff = fuzzyNpc->pos.z - playerStatus->position.z; + xDiff = fuzzyNpc->pos.x - playerStatus->pos.x; + zDiff = fuzzyNpc->pos.z - playerStatus->pos.z; if ((SQ(xDiff) + SQ(zDiff) < SQ(80.0f)) && (script->varTable[2] >= 2)) { do { outVal = TRUE; @@ -53,7 +53,7 @@ API_CALLABLE(N(IsPlayerOrKoopaNearby)) { API_CALLABLE(N(IsPlayerWalking)) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->currentSpeed >= 4.0f) { + if (playerStatus->curSpeed >= 4.0f) { script->varTable[2]++; if (script->varTable[2] > 2) { script->varTable[2] = 2; @@ -66,7 +66,7 @@ API_CALLABLE(N(IsPlayerWalking)) { if (script->varTable[2] >= 2) { script->varTable[0] = FALSE; } - if (playerStatus->currentSpeed == 0.0f) { + if (playerStatus->curSpeed == 0.0f) { script->varTable[0] = FALSE; } @@ -93,8 +93,8 @@ API_CALLABLE(N(ChooseSafeJumpLocation)) { xDiff = x - -150.0f; zDiff = z - 250.0f; if (SQ(xDiff) + SQ(zDiff) < SQ(150.0f)) { - xDiff = x - playerStatus->position.x; - zDiff = z - playerStatus->position.z; + xDiff = x - playerStatus->pos.x; + zDiff = z - playerStatus->pos.z; if (SQ(xDiff) + SQ(zDiff) > SQ(80.0f)) { xDiff = x - koopaNpc->pos.x; zDiff = z - koopaNpc->pos.z; @@ -140,8 +140,8 @@ API_CALLABLE(N(ChooseLocationNotNearPlayer)) { xDiff = x - -150.0f; zDiff = z - 250.0f; if (SQ(xDiff) + SQ(zDiff) < SQ(150.0f)) { - xDiff = x - playerStatus->position.x; - zDiff = z - playerStatus->position.z; + xDiff = x - playerStatus->pos.x; + zDiff = z - playerStatus->pos.z; if (SQ(xDiff) + SQ(zDiff) > SQ(80.0f)) { break; } diff --git a/src/world/area_nok/nok_04/nok_04_4_npc.c b/src/world/area_nok/nok_04/nok_04_4_npc.c index ab0cb73a33..8ecbcd7421 100644 --- a/src/world/area_nok/nok_04/nok_04_4_npc.c +++ b/src/world/area_nok/nok_04/nok_04_4_npc.c @@ -8,11 +8,11 @@ typedef struct FuzzyThread { /* 0x00 */ Vec3f anchorPos; /* 0x0C */ f32 targetLength; - /* 0x10 */ f32 currentLength; + /* 0x10 */ f32 curLength; /* 0x14 */ f32 overshootVel; /* 0x18 */ f32 targetAngle; /* 0x1C */ f32 overshootAngleVel; - /* 0x20 */ f32 currentAngle; + /* 0x20 */ f32 curAngle; /* 0x24 */ Vec3f endPoint; /* 0x30 */ f32 duration; /* 0x34 */ f32 time; @@ -136,13 +136,13 @@ API_CALLABLE(N(SetThreadTargetLengthAngle)) { N(ThreadData).time = 0.0f; if (0.0f < N(ThreadData).duration) { - N(ThreadData).lengthStep = (N(ThreadData).targetLength - N(ThreadData).currentLength) / N(ThreadData).duration; - N(ThreadData).angleStep = (N(ThreadData).targetAngle - N(ThreadData).currentAngle) / N(ThreadData).duration; + N(ThreadData).lengthStep = (N(ThreadData).targetLength - N(ThreadData).curLength) / N(ThreadData).duration; + N(ThreadData).angleStep = (N(ThreadData).targetAngle - N(ThreadData).curAngle) / N(ThreadData).duration; } if (N(ThreadData).duration < 0.0f) { - N(ThreadData).currentLength = N(ThreadData).targetLength; - N(ThreadData).currentAngle = N(ThreadData).targetAngle; + N(ThreadData).curLength = N(ThreadData).targetLength; + N(ThreadData).curAngle = N(ThreadData).targetAngle; N(ThreadData).duration = 0.0f; } @@ -153,11 +153,11 @@ API_CALLABLE(N(InitThreadData)) { N(ThreadData).anchorPos.x = 0; N(ThreadData).anchorPos.y = 0; N(ThreadData).anchorPos.z = 0; - N(ThreadData).currentLength = 0; + N(ThreadData).curLength = 0; N(ThreadData).targetLength = 0; N(ThreadData).overshootVel = 0; N(ThreadData).targetAngle = 0; - N(ThreadData).currentAngle = 0; + N(ThreadData).curAngle = 0; N(ThreadData).overshootAngleVel = 0; N(ThreadData).frontNpc = NULL; N(ThreadData).backNpc = NULL; @@ -271,24 +271,24 @@ void N(build_gfx_thread)(void) { N(ThreadData).overshootVel += 0.2; if (N(ThreadData).duration != 0.0f) { // thread extension/retraction - N(ThreadData).currentLength += N(ThreadData).lengthStep; - if (N(ThreadData).currentLength > N(ThreadData).targetLength) { - N(ThreadData).overshootVel += (N(ThreadData).targetLength - N(ThreadData).currentLength) * 0.5f; + N(ThreadData).curLength += N(ThreadData).lengthStep; + if (N(ThreadData).curLength > N(ThreadData).targetLength) { + N(ThreadData).overshootVel += (N(ThreadData).targetLength - N(ThreadData).curLength) * 0.5f; } N(ThreadData).time += 1.0f; - N(ThreadData).overshootAngleVel = (N(ThreadData).overshootAngleVel + (N(ThreadData).targetAngle - N(ThreadData).currentAngle) / 10.0f) * 0.92; - N(ThreadData).currentAngle += N(ThreadData).angleStep; + N(ThreadData).overshootAngleVel = (N(ThreadData).overshootAngleVel + (N(ThreadData).targetAngle - N(ThreadData).curAngle) / 10.0f) * 0.92; + N(ThreadData).curAngle += N(ThreadData).angleStep; if (N(ThreadData).duration <= N(ThreadData).time) { N(ThreadData).duration = 0.0f; } } else { // thread overshoot - N(ThreadData).currentLength += N(ThreadData).overshootVel; - if (N(ThreadData).targetLength < N(ThreadData).currentLength) { - N(ThreadData).overshootVel += (N(ThreadData).targetLength - N(ThreadData).currentLength) * 0.5f; + N(ThreadData).curLength += N(ThreadData).overshootVel; + if (N(ThreadData).targetLength < N(ThreadData).curLength) { + N(ThreadData).overshootVel += (N(ThreadData).targetLength - N(ThreadData).curLength) * 0.5f; } - N(ThreadData).overshootAngleVel = (N(ThreadData).overshootAngleVel + (N(ThreadData).targetAngle - N(ThreadData).currentAngle) / 10.0f) * 0.92; - N(ThreadData).currentAngle += N(ThreadData).overshootAngleVel; + N(ThreadData).overshootAngleVel = (N(ThreadData).overshootAngleVel + (N(ThreadData).targetAngle - N(ThreadData).curAngle) / 10.0f) * 0.92; + N(ThreadData).curAngle += N(ThreadData).overshootAngleVel; } N(ThreadData).overshootVel *= 0.5; @@ -296,19 +296,19 @@ void N(build_gfx_thread)(void) { guTranslate(&gDisplayContext->matrixStack[gMatrixListPos], N(ThreadData).anchorPos.x, N(ThreadData).anchorPos.y, N(ThreadData).anchorPos.z); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - segAngle = N(ThreadData).currentAngle; - segLength = -N(ThreadData).currentLength; - x += -segLength * sin_rad(N(ThreadData).currentAngle * 0 / 180.0f * PI); - y += segLength * cos_rad(N(ThreadData).currentAngle * 0 / 180.0f * PI); + segAngle = N(ThreadData).curAngle; + segLength = -N(ThreadData).curLength; + x += -segLength * sin_rad(N(ThreadData).curAngle * 0 / 180.0f * PI); + y += segLength * cos_rad(N(ThreadData).curAngle * 0 / 180.0f * PI); guPosition(&gDisplayContext->matrixStack[gMatrixListPos], 0.0f, 0.0f, segAngle, 1.0f, 0.0f, segLength, 0.0f); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); for (i = 1; i < NUM_THREAD_SEGMENTS; i++) { - segAngle = N(ThreadData).currentAngle; - segLength = -N(ThreadData).currentLength; - x += -segLength * sin_rad(N(ThreadData).currentAngle * i / 180.0f * PI); - y += segLength * cos_rad(N(ThreadData).currentAngle * i / 180.0f * PI); + segAngle = N(ThreadData).curAngle; + segLength = -N(ThreadData).curLength; + x += -segLength * sin_rad(N(ThreadData).curAngle * i / 180.0f * PI); + y += segLength * cos_rad(N(ThreadData).curAngle * i / 180.0f * PI); gSPVertex(gMainGfxPos++, N(ThreadSegmentVertices), 2, 0); guPosition(&gDisplayContext->matrixStack[gMatrixListPos], 0.0f, 0.0f, segAngle, 1.0f, 0.0f, segLength, 0.0f); gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); diff --git a/src/world/area_nok/nok_12/nok_12_2_main.c b/src/world/area_nok/nok_12/nok_12_2_main.c index a94bd3a718..46b5a0bd82 100644 --- a/src/world/area_nok/nok_12/nok_12_2_main.c +++ b/src/world/area_nok/nok_12/nok_12_2_main.c @@ -13,8 +13,8 @@ API_CALLABLE(N(UpdateEnounterStages)) { s32 stage = stageWithoutBridge; s32 i; - if (xMin <= playerStatus->position.x && playerStatus->position.x <= xMax && - zMin <= playerStatus->position.z && playerStatus->position.z <= zMax) + if (xMin <= playerStatus->pos.x && playerStatus->pos.x <= xMax && + zMin <= playerStatus->pos.z && playerStatus->pos.z <= zMax) { stage = stageWithBridge; } diff --git a/src/world/area_nok/nok_12/nok_12_7_demo.c b/src/world/area_nok/nok_12/nok_12_7_demo.c index be0bc466c6..7139a7cc32 100644 --- a/src/world/area_nok/nok_12/nok_12_7_demo.c +++ b/src/world/area_nok/nok_12/nok_12_7_demo.c @@ -145,11 +145,11 @@ API_CALLABLE(N(SetupDemoScene1)) { break; case 3: partner_clear_player_tracking(wPartnerNpc); - partner_set_goal_pos(playerStatus->position.x, playerStatus->position.z); + partner_set_goal_pos(playerStatus->pos.x, playerStatus->pos.z); func_800EF3D4(0); set_npc_yaw(wPartnerNpc, 90.0f); playerStatus->targetYaw = 90.0f; - playerStatus->currentYaw = 90.0f; + playerStatus->curYaw = 90.0f; playerStatus->spriteFacingAngle = 0.0f; return ApiStatus_DONE2; } @@ -182,11 +182,11 @@ API_CALLABLE(N(SetupDemoScene2)) { break; case 3: partner_clear_player_tracking(wPartnerNpc); - partner_set_goal_pos(playerStatus->position.x, playerStatus->position.z); + partner_set_goal_pos(playerStatus->pos.x, playerStatus->pos.z); func_800EF3D4(0); set_npc_yaw(wPartnerNpc, 90.0f); playerStatus->targetYaw = 90.0f; - playerStatus->currentYaw = 90.0f; + playerStatus->curYaw = 90.0f; playerStatus->spriteFacingAngle = 0.0f; return ApiStatus_DONE2; } diff --git a/src/world/area_nok/nok_13/nok_13_5.c b/src/world/area_nok/nok_13/nok_13_5.c index 6728c35027..1e996c3b73 100644 --- a/src/world/area_nok/nok_13/nok_13_5.c +++ b/src/world/area_nok/nok_13/nok_13_5.c @@ -6,7 +6,7 @@ API_CALLABLE(N(GetAngleToPlayer)) { Bytecode* args = script->ptrReadPos; s32 outVar = *args++; - evt_set_variable(script, outVar, atan2(-364.0f, -135.0f, gPlayerStatus.position.x, gPlayerStatus.position.z)); + evt_set_variable(script, outVar, atan2(-364.0f, -135.0f, gPlayerStatus.pos.x, gPlayerStatus.pos.z)); return ApiStatus_DONE2; } diff --git a/src/world/area_nok/nok_14/nok_14_2_main.c b/src/world/area_nok/nok_14/nok_14_2_main.c index b0294c00ae..c04424e045 100644 --- a/src/world/area_nok/nok_14/nok_14_2_main.c +++ b/src/world/area_nok/nok_14/nok_14_2_main.c @@ -13,8 +13,8 @@ API_CALLABLE(N(UpdateEnounterStages)) { s32 stage = stageWithoutBridge; s32 i; - if (xMin <= playerStatus->position.x && playerStatus->position.x <= xMax && - zMin <= playerStatus->position.z && playerStatus->position.z <= zMax) + if (xMin <= playerStatus->pos.x && playerStatus->pos.x <= xMax && + zMin <= playerStatus->pos.z && playerStatus->pos.z <= zMax) { stage = stageWithBridge; } diff --git a/src/world/area_obk/common/RockingChair.inc.c b/src/world/area_obk/common/RockingChair.inc.c index 6daa6e753b..b56b972b2e 100644 --- a/src/world/area_obk/common/RockingChair.inc.c +++ b/src/world/area_obk/common/RockingChair.inc.c @@ -14,7 +14,7 @@ typedef struct RockingChairPhysics { /* 0x00 */ f32 angleDelta; /* 0x04 */ f32 angularAccel; - /* 0x08 */ f32 rotationAngle; + /* 0x08 */ f32 rotAngle; /* 0x0C */ f32 verticalOffset; /* 0x10 */ f32 angleB; /* 0x14 */ f32 angleA; @@ -42,7 +42,7 @@ API_CALLABLE(N(UpdateRockingChair)) { script->functionTempPtr[1] = physics; physics->angleDelta = 0; physics->verticalOffset = 0; - physics->rotationAngle = 0; + physics->rotAngle = 0; physics->angleB = 0; physics->angleA = 0; physics->angularAccel = 0.1f; @@ -55,49 +55,49 @@ API_CALLABLE(N(UpdateRockingChair)) { physics = script->functionTempPtr[1]; switch (script->functionTemp[0]) { case CHAIR_STATE_INITIAL: - if (collisionStatus->currentFloor == COLLIDER_i3) { + if (collisionStatus->curFloor == COLLIDER_i3) { script->functionTemp[0] = CHAIR_STATE_PLAYER_TOUCHING; } - if (collisionStatus->currentFloor == COLLIDER_i2) { + if (collisionStatus->curFloor == COLLIDER_i2) { script->functionTemp[0] = CHAIR_STATE_PLAYER_TOUCHING; } physics->angleDelta = 0.0f; physics->verticalOffset = 0.0f; physics->angleB = 0.0f; physics->angleA = 0.0f; - physics->rotationAngle = 0.0f; + physics->rotAngle = 0.0f; physics->angularAccel = 0.1f; physics->mass = 3.0f; physics->equilibriumAngle = 20.0f; break; case CHAIR_STATE_PLAYER_TOUCHING: //TODO odd match - currentFloor = collisionStatus->currentFloor; - if (currentFloor != COLLIDER_i3 && collisionStatus->currentFloor != COLLIDER_i2) { + currentFloor = collisionStatus->curFloor; + if (currentFloor != COLLIDER_i3 && collisionStatus->curFloor != COLLIDER_i2) { script->functionTemp[3] = 120; // settle time script->functionTemp[0] = CHAIR_STATE_PLAYER_NOT_TOUCHING; } - if (fabsf(physics->rotationAngle) < 5.0f) { - physics->angularAccel = fabsf(ROCKING_CHAIR_CENTER_X - playerStatus->position.x) / 200.0f; + if (fabsf(physics->rotAngle) < 5.0f) { + physics->angularAccel = fabsf(ROCKING_CHAIR_CENTER_X - playerStatus->pos.x) / 200.0f; } else { physics->angularAccel = 0.1f; } - if (playerStatus->position.x <= ROCKING_CHAIR_CENTER_X) { + if (playerStatus->pos.x <= ROCKING_CHAIR_CENTER_X) { physics->angleB += physics->angularAccel; - physics->equilibriumAngle = SQ(fabsf(ROCKING_CHAIR_CENTER_X - playerStatus->position.x)) / 50.0f; + physics->equilibriumAngle = SQ(fabsf(ROCKING_CHAIR_CENTER_X - playerStatus->pos.x)) / 50.0f; if (physics->equilibriumAngle > 15.0f) { physics->equilibriumAngle = 15.0f; } - if (physics->rotationAngle > physics->equilibriumAngle) { + if (physics->rotAngle > physics->equilibriumAngle) { physics->angleA += physics->angularAccel * physics->mass; } } else { physics->angleA += physics->angularAccel; - physics->equilibriumAngle = -SQ(-fabsf(ROCKING_CHAIR_CENTER_X - playerStatus->position.x) * 0.5f) / 50.0f; + physics->equilibriumAngle = -SQ(-fabsf(ROCKING_CHAIR_CENTER_X - playerStatus->pos.x) * 0.5f) / 50.0f; if (physics->equilibriumAngle < -5.0f) { physics->equilibriumAngle = -5.0f; } - if (physics->rotationAngle < physics->equilibriumAngle) { + if (physics->rotAngle < physics->equilibriumAngle) { physics->angleB += physics->angularAccel * physics->mass; } } @@ -114,13 +114,13 @@ API_CALLABLE(N(UpdateRockingChair)) { } } physics->angleDelta = physics->angleB - physics->angleA; - physics->rotationAngle += physics->angleDelta; + physics->rotAngle += physics->angleDelta; break; case CHAIR_STATE_PLAYER_NOT_TOUCHING: - if (collisionStatus->currentFloor == COLLIDER_i3) { + if (collisionStatus->curFloor == COLLIDER_i3) { script->functionTemp[0] = CHAIR_STATE_PLAYER_TOUCHING; } - if (collisionStatus->currentFloor == COLLIDER_i2) { + if (collisionStatus->curFloor == COLLIDER_i2) { script->functionTemp[0] = CHAIR_STATE_PLAYER_TOUCHING; } @@ -128,7 +128,7 @@ API_CALLABLE(N(UpdateRockingChair)) { physics->equilibriumAngle = 0; physics->angleB += physics->angularAccel; - if (physics->rotationAngle > physics->equilibriumAngle) { + if (physics->rotAngle > physics->equilibriumAngle) { physics->angleA += physics->angularAccel * physics->mass; } if ((physics->angleB > 100.0) && ( physics->angleA > 100.0)) { @@ -148,17 +148,17 @@ API_CALLABLE(N(UpdateRockingChair)) { physics->angleA = zero; physics->angleB = zero; physics->angleDelta = zero; - physics->rotationAngle = zero; + physics->rotAngle = zero; } else { script->functionTemp[3]--; } physics->angleDelta = physics->angleB - physics->angleA; - physics->rotationAngle += physics->angleDelta; + physics->rotAngle += physics->angleDelta; break; } // play creak sound once per cycle - if (physics->rotationAngle <= -7.0f) { + if (physics->rotAngle <= -7.0f) { if (script->functionTemp[2] != -1) { get_collider_center(COLLIDER_i3, ¢erX, ¢erY, ¢erZ); sfx_play_sound_at_position(SOUND_CREAKY_ROCKING_CHAIR, SOUND_SPACE_MODE_0, centerX, centerY, centerZ); @@ -168,12 +168,12 @@ API_CALLABLE(N(UpdateRockingChair)) { script->functionTemp[2] = 0; } - physics->verticalOffset = SQ(physics->rotationAngle) / 90.0f; + physics->verticalOffset = SQ(physics->rotAngle) / 90.0f; model = get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_i3)); model->flags |= (MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM); guTranslateF(model->userTransformMtx, 0.0f, physics->verticalOffset, 0.0f); - guRotateF(tempMtx, physics->rotationAngle, 0.0f, 0.0f, 1.0f); + guRotateF(tempMtx, physics->rotAngle, 0.0f, 0.0f, 1.0f); guMtxCatF(model->userTransformMtx, tempMtx, model->userTransformMtx); update_collider_transform(COLLIDER_i3); update_collider_transform(COLLIDER_i2); @@ -181,13 +181,13 @@ API_CALLABLE(N(UpdateRockingChair)) { model = get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_i2)); model->flags |= (MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM); guTranslateF(model->userTransformMtx, 0.0f, physics->verticalOffset, 0.0f); - guRotateF(tempMtx, physics->rotationAngle, 0.0f, 0.0f, 1.0f); + guRotateF(tempMtx, physics->rotAngle, 0.0f, 0.0f, 1.0f); guMtxCatF(model->userTransformMtx, tempMtx, model->userTransformMtx); model = get_model_from_list_index(get_model_list_index_from_tree_index(MODEL_i1)); model->flags |= (MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM); guTranslateF(model->userTransformMtx, 0.0f, physics->verticalOffset, 0.0f); - guRotateF(tempMtx, physics->rotationAngle, 0.0f, 0.0f, 1.0f); + guRotateF(tempMtx, physics->rotAngle, 0.0f, 0.0f, 1.0f); guMtxCatF(model->userTransformMtx, tempMtx, model->userTransformMtx); update_collider_transform(COLLIDER_i1); diff --git a/src/world/area_obk/obk_01/obk_01_3_chandelier.c b/src/world/area_obk/obk_01/obk_01_3_chandelier.c index 7b93fd9f0a..ebd25150d9 100644 --- a/src/world/area_obk/obk_01/obk_01_3_chandelier.c +++ b/src/world/area_obk/obk_01/obk_01_3_chandelier.c @@ -261,9 +261,9 @@ API_CALLABLE(N(UpdateChandelier)) { } if (chandelier->flags & CHANDELIER_FLAG_TETHER_PLAYER) { - playerStatus->position.x = (-sin_deg(chandelier->swingAngle) * (chandelier->dropDistance - 300.0f)) + 445.0f; - playerStatus->position.y = ((cos_deg(chandelier->swingAngle) * (chandelier->dropDistance - 300.0f)) - 135.0f) + 300.0f; - playerStatus->position.z = 279.0f; + playerStatus->pos.x = (-sin_deg(chandelier->swingAngle) * (chandelier->dropDistance - 300.0f)) + 445.0f; + playerStatus->pos.y = ((cos_deg(chandelier->swingAngle) * (chandelier->dropDistance - 300.0f)) - 135.0f) + 300.0f; + playerStatus->pos.z = 279.0f; } return ApiStatus_BLOCK; } diff --git a/src/world/area_obk/obk_04/obk_04_5_hole.c b/src/world/area_obk/obk_04/obk_04_5_hole.c index f811f422c9..2ae64f9dbb 100644 --- a/src/world/area_obk/obk_04/obk_04_5_hole.c +++ b/src/world/area_obk/obk_04/obk_04_5_hole.c @@ -1,7 +1,7 @@ #include "obk_04.h" API_CALLABLE(N(AwaitPlayerEnterHole)) { - if (gPlayerStatus.position.y < -50.0f) { + if (gPlayerStatus.pos.y < -50.0f) { return ApiStatus_DONE2; } return ApiStatus_BLOCK; diff --git a/src/world/area_obk/obk_04/obk_04_6_game.c b/src/world/area_obk/obk_04/obk_04_6_game.c index 356b795244..e0b4d7f11e 100644 --- a/src/world/area_obk/obk_04/obk_04_6_game.c +++ b/src/world/area_obk/obk_04/obk_04_6_game.c @@ -96,7 +96,7 @@ API_CALLABLE(N(UpgradeBootsToSuper)) { API_CALLABLE(N(GetPlayerPosOutsideKeepAwayRing)) { PlayerStatus* playerStatus = &gPlayerStatus; Npc npc; - f32 dist = dist2D(playerStatus->position.x, playerStatus->position.z, 0.0f, 0.0f); + f32 dist = dist2D(playerStatus->pos.x, playerStatus->pos.z, 0.0f, 0.0f); f32 yaw; s32 gt, lt; @@ -113,7 +113,7 @@ API_CALLABLE(N(GetPlayerPosOutsideKeepAwayRing)) { } if (gt | lt) { - yaw = atan2(playerStatus->position.x, playerStatus->position.z, 0.0f, 0.0f) + 180.0f; + yaw = atan2(playerStatus->pos.x, playerStatus->pos.z, 0.0f, 0.0f) + 180.0f; npc.pos.x = 0.0f; npc.pos.y = 0.0f; npc.pos.z = 0.0f; @@ -123,9 +123,9 @@ API_CALLABLE(N(GetPlayerPosOutsideKeepAwayRing)) { script->varTable[2] = npc.pos.z; script->varTable[3] = 1; } else { - script->varTable[0] = playerStatus->position.x; - script->varTable[1] = playerStatus->position.y; - script->varTable[2] = playerStatus->position.z; + script->varTable[0] = playerStatus->pos.x; + script->varTable[1] = playerStatus->pos.y; + script->varTable[2] = playerStatus->pos.z; script->varTable[3] = 0; } return ApiStatus_DONE2; diff --git a/src/world/area_obk/obk_05/obk_05_2_main.c b/src/world/area_obk/obk_05/obk_05_2_main.c index 35f54aeb88..a594a24c4b 100644 --- a/src/world/area_obk/obk_05/obk_05_2_main.c +++ b/src/world/area_obk/obk_05/obk_05_2_main.c @@ -48,7 +48,7 @@ EvtScript N(EVS_TexPan_Fog) = { #include "world/common/todo/SetCamera0MoveFlag1.inc.c" API_CALLABLE(N(RetroJar_AwaitPlayerEntry)) { - if (gCollisionStatus.currentFloor == COLLIDER_o420) { + if (gCollisionStatus.curFloor == COLLIDER_o420) { return ApiStatus_DONE2; } else { return ApiStatus_BLOCK; diff --git a/src/world/area_obk/obk_05/obk_05_4_hole.c b/src/world/area_obk/obk_05/obk_05_4_hole.c index 724f031be0..d7b7da49de 100644 --- a/src/world/area_obk/obk_05/obk_05_4_hole.c +++ b/src/world/area_obk/obk_05/obk_05_4_hole.c @@ -1,7 +1,7 @@ #include "obk_05.h" API_CALLABLE(N(AwaitPlayerEnterHole)) { - if (gPlayerStatus.position.y < -50.0f) { + if (gPlayerStatus.pos.y < -50.0f) { return ApiStatus_DONE2; } else { return ApiStatus_BLOCK; diff --git a/src/world/area_obk/obk_07/obk_07_6_phonograph.c b/src/world/area_obk/obk_07/obk_07_6_phonograph.c index f5974f4dac..f11f220672 100644 --- a/src/world/area_obk/obk_07/obk_07_6_phonograph.c +++ b/src/world/area_obk/obk_07/obk_07_6_phonograph.c @@ -547,7 +547,7 @@ API_CALLABLE(N(UpdateGuardBooPos)) { if (data->state == PHONOGRAPH_HUD_STATE_DESTROYED) { // return to guard position speed = 2.0f; - npc->currentAnim = ANIM_Boo_Run; + npc->curAnim = ANIM_Boo_Run; if (dist2D(x, z, guardPosX, booPosZ) < speed) { npc->pos.x = guardPosX; npc->pos.z = booPosZ; @@ -590,13 +590,13 @@ API_CALLABLE(N(UpdateGuardBooPos)) { } if (data->meterFillAmount > 7000) { - npc->currentAnim = ANIM_Boo_Wave; + npc->curAnim = ANIM_Boo_Wave; } else if (data->meterFillAmount > 5000) { - npc->currentAnim = ANIM_Boo_Run; + npc->curAnim = ANIM_Boo_Run; } else if (data->meterFillAmount > 3000) { - npc->currentAnim = ANIM_Boo_Walk; + npc->curAnim = ANIM_Boo_Walk; } else { - npc->currentAnim = ANIM_Boo_Idle; + npc->curAnim = ANIM_Boo_Idle; } return ApiStatus_DONE2; diff --git a/src/world/area_obk/obk_08/obk_08_6_game.c b/src/world/area_obk/obk_08/obk_08_6_game.c index 33a897ee0f..11fdc49a46 100644 --- a/src/world/area_obk/obk_08/obk_08_6_game.c +++ b/src/world/area_obk/obk_08/obk_08_6_game.c @@ -70,7 +70,7 @@ API_CALLABLE(N(func_80241300_BD4B70)) { API_CALLABLE(N(GetPlayerPosOutsideKeepAwayRing)) { PlayerStatus* playerStatus = &gPlayerStatus; Npc npc; - f32 dist = dist2D(playerStatus->position.x, playerStatus->position.z, 0.0f, 0.0f); + f32 dist = dist2D(playerStatus->pos.x, playerStatus->pos.z, 0.0f, 0.0f); f32 yaw; s32 gt; s32 lt; @@ -88,7 +88,7 @@ API_CALLABLE(N(GetPlayerPosOutsideKeepAwayRing)) { } if ((gt | lt) != 0) { - yaw = atan2(playerStatus->position.x, playerStatus->position.z, 0.0f, 0.0f) + 180.0f; + yaw = atan2(playerStatus->pos.x, playerStatus->pos.z, 0.0f, 0.0f) + 180.0f; npc.pos.x = 0.0f; npc.pos.y = 0.0f; npc.pos.z = 0.0f; @@ -98,9 +98,9 @@ API_CALLABLE(N(GetPlayerPosOutsideKeepAwayRing)) { script->varTable[2] = npc.pos.z; script->varTable[3] = 1; } else { - script->varTable[0] = playerStatus->position.x; - script->varTable[1] = playerStatus->position.y; - script->varTable[2] = playerStatus->position.z; + script->varTable[0] = playerStatus->pos.x; + script->varTable[1] = playerStatus->pos.y; + script->varTable[2] = playerStatus->pos.z; script->varTable[3] = 0; } return ApiStatus_DONE2; diff --git a/src/world/area_obk/obk_09/obk_09_4_npc.c b/src/world/area_obk/obk_09/obk_09_4_npc.c index bc04ef19ea..289c6d0d4a 100644 --- a/src/world/area_obk/obk_09/obk_09_4_npc.c +++ b/src/world/area_obk/obk_09/obk_09_4_npc.c @@ -42,9 +42,9 @@ API_CALLABLE(N(ImprisonedCardUpdate)) { card->rot.y = clamp_angle(card->rot.y + 6.6f); effect->data.spiritCard->yaw = card->rot.y; - shadow->position.x = card->pos.x; - shadow->position.y = card->pos.y - 40.0f; - shadow->position.z = card->pos.z; + shadow->pos.x = card->pos.x; + shadow->pos.y = card->pos.y - 40.0f; + shadow->pos.z = card->pos.z; return ApiStatus_BLOCK; } diff --git a/src/world/area_omo/omo_02/omo_02_5_barricade.c b/src/world/area_omo/omo_02/omo_02_5_barricade.c index bcd740fc45..7e6a22a718 100644 --- a/src/world/area_omo/omo_02/omo_02_5_barricade.c +++ b/src/world/area_omo/omo_02/omo_02_5_barricade.c @@ -19,9 +19,9 @@ typedef struct BarricadePart { /* 0x04 */ Vec3f pos; /* 0x10 */ Vec3f origin; /* 0x1C */ Vec3f rot; - /* 0x28 */ Vec3f angularVelocity; - /* 0x34 */ f32 verticalVelocity; - /* 0x38 */ f32 planarVelocity; + /* 0x28 */ Vec3f angularVel; + /* 0x34 */ f32 verticalVel; + /* 0x38 */ f32 planarVel; /* 0x3C */ f32 velocityAngle; /* 0x40 */ s32 modelID; /* 0x44 */ s32 colliderID; @@ -101,11 +101,11 @@ API_CALLABLE(N(AnimateBarricadeParts)) { part->origin.x = part->pos.x; part->origin.y = part->pos.y; part->origin.z = part->pos.z; - part->angularVelocity.x = rand_int(20) - 10; - part->angularVelocity.y = rand_int(20) - 10; - part->angularVelocity.z = rand_int(20) - 10; - part->verticalVelocity = (rand_int(40) + 100.0f) / 10.0f; - part->planarVelocity = (rand_int(30) + 60.0f) / 10.0f; + part->angularVel.x = rand_int(20) - 10; + part->angularVel.y = rand_int(20) - 10; + part->angularVel.z = rand_int(20) - 10; + part->verticalVel = (rand_int(40) + 100.0f) / 10.0f; + part->planarVel = (rand_int(30) + 60.0f) / 10.0f; part->velocityAngle = ((rand_int(100) % 2) * 180.0f) + 90.0f; N(DetermineSphericalSize)(model->modelNode->displayData->displayList, &part->radius); @@ -122,17 +122,17 @@ API_CALLABLE(N(AnimateBarricadeParts)) { model = get_model_from_list_index(get_model_list_index_from_tree_index(part->modelID)); switch (part->state) { case BARRICADE_STATE_FLYING: - add_vec2D_polar(&part->pos.x, &part->pos.z, part->planarVelocity, part->velocityAngle); - part->verticalVelocity -= 0.8f; - part->pos.y += part->verticalVelocity; - if (part->verticalVelocity <= 0.0f && part->pos.y < part->radius) { + add_vec2D_polar(&part->pos.x, &part->pos.z, part->planarVel, part->velocityAngle); + part->verticalVel -= 0.8f; + part->pos.y += part->verticalVel; + if (part->verticalVel <= 0.0f && part->pos.y < part->radius) { part->pos.y = part->radius; - part->verticalVelocity *= -0.7f; - if (part->verticalVelocity < 1.0f) { + part->verticalVel *= -0.7f; + if (part->verticalVel < 1.0f) { part->state = BARRICADE_STATE_CLEANUP; - part->angularVelocity.x = 0.0f; - part->angularVelocity.y = 0.0f; - part->angularVelocity.z = 0.0f; + part->angularVel.x = 0.0f; + part->angularVel.y = 0.0f; + part->angularVel.z = 0.0f; } if (i & 1) { exec_ShakeCam1(0, 0, 1); @@ -156,9 +156,9 @@ API_CALLABLE(N(AnimateBarricadeParts)) { model->flags |= MODEL_FLAG_MATRIX_DIRTY | MODEL_FLAG_HAS_TRANSFORM; guTranslateF(mtxTransform, part->pos.x - part->origin.x, part->pos.y - part->origin.y, part->pos.z - part->origin.z); - part->rot.x += part->angularVelocity.x; - part->rot.y += part->angularVelocity.y; - part->rot.z += part->angularVelocity.z; + part->rot.x += part->angularVel.x; + part->rot.y += part->angularVel.y; + part->rot.z += part->angularVel.z; part->rot.x = clamp_angle(part->rot.x); part->rot.y = clamp_angle(part->rot.y); part->rot.z = clamp_angle(part->rot.z); diff --git a/src/world/area_omo/omo_04/omo_04_4_entity.c b/src/world/area_omo/omo_04/omo_04_4_entity.c index 95d4089f23..090371198a 100644 --- a/src/world/area_omo/omo_04/omo_04_4_entity.c +++ b/src/world/area_omo/omo_04/omo_04_4_entity.c @@ -113,10 +113,10 @@ EvtScript N(EVS_StarBoxLaunch7) = { }; API_CALLABLE(N(func_802402F4_DAD6F4)) { - f32 playerVx = gPlayerStatus.currentSpeed * 5.0f * sin_deg(gPlayerStatus.targetYaw); - f32 playerVz = gPlayerStatus.currentSpeed * 5.0f * -cos_deg(gPlayerStatus.targetYaw); - script->varTable[0] = (gPlayerStatus.position.x + playerVx); - script->varTable[1] = (gPlayerStatus.position.z + playerVz); + f32 playerVx = gPlayerStatus.curSpeed * 5.0f * sin_deg(gPlayerStatus.targetYaw); + f32 playerVz = gPlayerStatus.curSpeed * 5.0f * -cos_deg(gPlayerStatus.targetYaw); + script->varTable[0] = (gPlayerStatus.pos.x + playerVx); + script->varTable[1] = (gPlayerStatus.pos.z + playerVz); return ApiStatus_DONE2; } diff --git a/src/world/area_omo/omo_09/omo_09_3_conveyors.c b/src/world/area_omo/omo_09/omo_09_3_conveyors.c index 3853d45152..73d84a0d57 100644 --- a/src/world/area_omo/omo_09/omo_09_3_conveyors.c +++ b/src/world/area_omo/omo_09/omo_09_3_conveyors.c @@ -24,7 +24,7 @@ s32 N(ShouldPauseConveyor)(void) { } if (gPartnerStatus.partnerActionState != PARTNER_ACTION_NONE && - (playerData->currentPartner == PARTNER_GOOMBARIO || playerData->currentPartner == PARTNER_SUSHIE)) + (playerData->curPartner == PARTNER_GOOMBARIO || playerData->curPartner == PARTNER_SUSHIE)) { return TRUE; } @@ -59,9 +59,9 @@ API_CALLABLE(N(AddConveyorPush)) { one = 1; if (partnerStatus->actingPartner == PARTNER_BOW) { if (partnerStatus->partnerActionState != PARTNER_ACTION_NONE && playerStatus->alpha1 == 128) { - x = playerStatus->position.x; - y = playerStatus->position.y; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y; + z = playerStatus->pos.z; outLength = 1000.0f; hit = player_raycast_below_cam_relative(playerStatus, &x, &y, &z, &outLength, @@ -70,8 +70,8 @@ API_CALLABLE(N(AddConveyorPush)) { for (i = 0; i < ARRAY_COUNT(N(ConveyorColliders)); i++) { if (hit == N(ConveyorColliders)[i]) { - playerStatus->pushVelocity.x = N(ConveyorPushVels)[i][0]; - playerStatus->pushVelocity.z = N(ConveyorPushVels)[i][one]; // TODO needed to match + playerStatus->pushVel.x = N(ConveyorPushVels)[i][0]; + playerStatus->pushVel.z = N(ConveyorPushVels)[i][one]; // TODO needed to match } } script->varTable[0] = 1; @@ -83,14 +83,14 @@ API_CALLABLE(N(AddConveyorPush)) { partnerStatus->partnerActionState == PARTNER_ACTION_NONE) { for (i = 0; i < ARRAY_COUNT(N(ConveyorColliders)); i++) { - if (gCollisionStatus.currentFloor == N(ConveyorColliders)[i] || + if (gCollisionStatus.curFloor == N(ConveyorColliders)[i] || gCollisionStatus.lastTouchedFloor == N(ConveyorColliders)[i]) { - playerStatus->pushVelocity.x = N(ConveyorPushVels)[i][0]; - playerStatus->pushVelocity.z = N(ConveyorPushVels)[i][one]; // TODO needed to match + playerStatus->pushVel.x = N(ConveyorPushVels)[i][0]; + playerStatus->pushVel.z = N(ConveyorPushVels)[i][one]; // TODO needed to match } - if (partner->currentFloor == N(ConveyorColliders)[i] && + if (partner->curFloor == N(ConveyorColliders)[i] && ((partnerStatus->actingPartner != PARTNER_KOOPER) || (partnerStatus->partnerActionState == PARTNER_ACTION_NONE))) { diff --git a/src/world/area_omo/omo_09/omo_09_4_slot_machine.c b/src/world/area_omo/omo_09/omo_09_4_slot_machine.c index 0738c10a6d..14e5d933dc 100644 --- a/src/world/area_omo/omo_09/omo_09_4_slot_machine.c +++ b/src/world/area_omo/omo_09/omo_09_4_slot_machine.c @@ -800,12 +800,12 @@ API_CALLABLE(N(UpdateSlotMachineBlockShadows)) { scale = 1000.0f; entity_raycast_down(&x, &y, &z, &rotX, &rotZ, &scale); set_standard_shadow_scale(shadow, scale); - shadow->position.x = x; - shadow->position.y = y; - shadow->position.z = z; - shadow->rotation.x = rotX; - shadow->rotation.y = 0.0f; - shadow->rotation.z = rotZ; + shadow->pos.x = x; + shadow->pos.y = y; + shadow->pos.z = z; + shadow->rot.x = rotX; + shadow->rot.y = 0.0f; + shadow->rot.z = rotZ; shadow->scale.x *= 1.3f; shadow->scale.z *= 1.3f; } diff --git a/src/world/area_omo/omo_09/omo_09_5_gizmos.c b/src/world/area_omo/omo_09/omo_09_5_gizmos.c index 109e4d0d4c..490202b087 100644 --- a/src/world/area_omo/omo_09/omo_09_5_gizmos.c +++ b/src/world/area_omo/omo_09/omo_09_5_gizmos.c @@ -90,7 +90,7 @@ MovingBlock N(MovingBlockPlatforms)[] = { }; API_CALLABLE(N(AwaitPlayerNearPlatforms)) { - if (gPlayerStatus.position.x < 850.0f) { + if (gPlayerStatus.pos.x < 850.0f) { return ApiStatus_BLOCK; } return ApiStatus_DONE2; diff --git a/src/world/area_omo/omo_11/omo_11_3_gizmos.c b/src/world/area_omo/omo_11/omo_11_3_gizmos.c index ea89e20ec1..9f40d8de9e 100644 --- a/src/world/area_omo/omo_11/omo_11_3_gizmos.c +++ b/src/world/area_omo/omo_11/omo_11_3_gizmos.c @@ -92,12 +92,12 @@ API_CALLABLE(N(UpdatePlatformShadows)) { scale = 1000.0f; entity_raycast_down(&x, &y, &z, &rotX, &rotZ, &scale); set_standard_shadow_scale(shadow, scale); - shadow->rotation.y = 0.0f; - shadow->position.x = x; - shadow->position.y = y; - shadow->position.z = z; - shadow->rotation.x = rotX; - shadow->rotation.z = rotZ; + shadow->rot.y = 0.0f; + shadow->pos.x = x; + shadow->pos.y = y; + shadow->pos.z = z; + shadow->rot.x = rotX; + shadow->rot.z = rotZ; shadow->scale.x *= 3.0f; shadow->scale.z *= 3.0f; } @@ -182,14 +182,14 @@ API_CALLABLE(N(UpdateRotatingPlatforms)) { guMtxCatF(loopModel->userTransformMtx, sp60, loopModel->userTransformMtx); update_collider_transform(N(RotatingPlatformColliders)[i]); guMtxXFMF(loopModel->userTransformMtx, 0.0f, 0.0f, 0.0f, &ox, &oy, &oz); - if (gCollisionStatus.currentFloor == N(RotatingPlatformColliders)[i] || + if (gCollisionStatus.curFloor == N(RotatingPlatformColliders)[i] || gCollisionStatus.lastTouchedFloor == N(RotatingPlatformColliders)[i]) { - playerStatus->pushVelocity.x = ox - it->lastRelativePos.x; - playerStatus->pushVelocity.y = oy - it->lastRelativePos.y; - playerStatus->pushVelocity.z = oz - it->lastRelativePos.z; + playerStatus->pushVel.x = ox - it->lastRelativePos.x; + playerStatus->pushVel.y = oy - it->lastRelativePos.y; + playerStatus->pushVel.z = oz - it->lastRelativePos.z; } - if (partner->currentFloor == N(RotatingPlatformColliders)[i]) { + if (partner->curFloor == N(RotatingPlatformColliders)[i]) { partner->pos.x += ox - it->lastRelativePos.x; partner->pos.y += oy - it->lastRelativePos.y; partner->pos.z += oz - it->lastRelativePos.z; @@ -209,11 +209,11 @@ API_CALLABLE(N(UpdateRotatingPlatforms)) { isPounding = FALSE; for (i = 0; i < ARRAY_COUNT(N(RotatingPlatformColliders)); i++) { - if (gCollisionStatus.currentFloor == N(RotatingPlatformColliders)[i]) { + if (gCollisionStatus.curFloor == N(RotatingPlatformColliders)[i]) { if (playerStatus->flags & PS_FLAG_NO_STATIC_COLLISION) { - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; } if (playerStatus->actionState == ACTION_STATE_SPIN_POUND || playerStatus->actionState == ACTION_STATE_TORNADO_POUND) diff --git a/src/world/area_omo/omo_13/omo_13_4_npc.c b/src/world/area_omo/omo_13/omo_13_4_npc.c index 762933c9be..43d61a979a 100644 --- a/src/world/area_omo/omo_13/omo_13_4_npc.c +++ b/src/world/area_omo/omo_13/omo_13_4_npc.c @@ -100,11 +100,11 @@ API_CALLABLE(N(UpdateAntiGuyPosition)) { f32 theta; f32 x, y, z; - dist2D(110.0f, -45.0f, playerStatus->position.x, playerStatus->position.z); - theta = clamp_angle(atan2(110.0f, -45.0f, playerStatus->position.x, playerStatus->position.z)); + dist2D(110.0f, -45.0f, playerStatus->pos.x, playerStatus->pos.z); + theta = clamp_angle(atan2(110.0f, -45.0f, playerStatus->pos.x, playerStatus->pos.z)); x = 110.0f + (sin_deg(theta) * 30.0f); if (script->varTable[11] != 0) { - y = playerStatus->position.y * 0.7f; + y = playerStatus->pos.y * 0.7f; } else { y = npc->pos.y; } @@ -115,8 +115,8 @@ API_CALLABLE(N(UpdateAntiGuyPosition)) { } if (npc->pos.x != x || npc->pos.y != y || npc->pos.z != z) { - if (npc->currentAnim != ANIM_ShyGuy_Black_Anim02 && script->varTable[10]++ >= 6) { - npc->currentAnim = ANIM_ShyGuy_Black_Anim02; + if (npc->curAnim != ANIM_ShyGuy_Black_Anim02 && script->varTable[10]++ >= 6) { + npc->curAnim = ANIM_ShyGuy_Black_Anim02; script->varTable[10] = 0; } npc->pos.x = x; @@ -125,10 +125,10 @@ API_CALLABLE(N(UpdateAntiGuyPosition)) { npc->colliderPos.y = npc->pos.y; npc->colliderPos.z = npc->pos.z; npc->flags |= NPC_FLAG_DIRTY_SHADOW; - } else if (npc->currentAnim != ANIM_ShyGuy_Black_Anim01) { - npc->currentAnim = ANIM_ShyGuy_Black_Anim01; + } else if (npc->curAnim != ANIM_ShyGuy_Black_Anim01) { + npc->curAnim = ANIM_ShyGuy_Black_Anim01; } - npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); return ApiStatus_DONE2; } diff --git a/src/world/area_omo/omo_14/omo_14_3_npc.c b/src/world/area_omo/omo_14/omo_14_3_npc.c index deb1ed06dc..6f7716152c 100644 --- a/src/world/area_omo/omo_14/omo_14_3_npc.c +++ b/src/world/area_omo/omo_14/omo_14_3_npc.c @@ -5,9 +5,9 @@ API_CALLABLE(N(SurroundPlayer)) { PlayerStatus* playerStatus = &gPlayerStatus; Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID); - f32 goalPosX = playerStatus->position.x + + f32 goalPosX = playerStatus->pos.x + ((playerStatus->colliderDiameter + npc->collisionDiameter) * 0.5f * sin_deg((npc->npcID * 360.0f) / 10.0f)); - f32 goalPosZ = playerStatus->position.z - + f32 goalPosZ = playerStatus->pos.z - ((playerStatus->colliderDiameter + npc->collisionDiameter) * 0.5f * cos_deg((npc->npcID * 360.0f) / 10.0f)); f32 dist = dist2D(npc->pos.x, npc->pos.z, goalPosX, goalPosZ); @@ -23,19 +23,19 @@ API_CALLABLE(N(SurroundPlayer)) { } npc_move_heading(npc, npc->moveSpeed, npc->yaw); } else { - npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); } - if (script->varTableF[11] == playerStatus->position.x && script->varTableF[13] == playerStatus->position.z) { + if (script->varTableF[11] == playerStatus->pos.x && script->varTableF[13] == playerStatus->pos.z) { if (dist < 20.0f) { script->varTable[14]++; } else { script->varTable[14] = 0; } } - script->varTableF[11] = playerStatus->position.x; - script->varTableF[12] = playerStatus->position.y; - script->varTableF[13] = playerStatus->position.z; + script->varTableF[11] = playerStatus->pos.x; + script->varTableF[12] = playerStatus->pos.y; + script->varTableF[13] = playerStatus->pos.z; return ApiStatus_DONE2; } diff --git a/src/world/area_osr/osr_03/osr_03_5_interlude.c b/src/world/area_osr/osr_03/osr_03_5_interlude.c index 4fee9410ec..32bcf0d35b 100644 --- a/src/world/area_osr/osr_03/osr_03_5_interlude.c +++ b/src/world/area_osr/osr_03/osr_03_5_interlude.c @@ -3,17 +3,17 @@ API_CALLABLE(N(SetPlayerAsPeach)) { gGameStatusPtr->peachFlags |= PEACH_STATUS_FLAG_IS_PEACH; - script->varTable[0] = gPlayerData.currentPartner; - gPlayerData.currentPartner = PARTNER_TWINK; + script->varTable[0] = gPlayerData.curPartner; + gPlayerData.curPartner = PARTNER_TWINK; return ApiStatus_DONE2; } API_CALLABLE(N(GetKammyFlightEmitterPos)) { Npc* npc = get_npc_unsafe(NPC_Kammy); - script->varTable[0] = npc->pos.x + (sin_deg(npc->yaw + gCameras[CAM_DEFAULT].currentYaw + 180.0f) * 20.0f); + script->varTable[0] = npc->pos.x + (sin_deg(npc->yaw + gCameras[CAM_DEFAULT].curYaw + 180.0f) * 20.0f); script->varTable[1] = npc->pos.y + 18.0f; - script->varTable[2] = npc->pos.z - (cos_deg(npc->yaw + gCameras[CAM_DEFAULT].currentYaw + 180.0f) * 20.0f); + script->varTable[2] = npc->pos.z - (cos_deg(npc->yaw + gCameras[CAM_DEFAULT].curYaw + 180.0f) * 20.0f); return ApiStatus_DONE2; } diff --git a/src/world/area_pra/common/Reflection.inc.c b/src/world/area_pra/common/Reflection.inc.c index bb497517b6..7f792ad3f1 100644 --- a/src/world/area_pra/common/Reflection.inc.c +++ b/src/world/area_pra/common/Reflection.inc.c @@ -83,7 +83,7 @@ void N(worker_reflect_player_wall)(void) { entityModel = get_entity_model(get_shadow_by_index(playerStatus->shadowID)->entityModelID); entityModel->flags |= ENTITY_MODEL_FLAG_REFLECT; - get_screen_coords(gCurrentCamID, playerStatus->position.x, playerStatus->position.y, -playerStatus->position.z, + get_screen_coords(gCurrentCamID, playerStatus->pos.x, playerStatus->pos.y, -playerStatus->pos.z, &screenX, &screenY, &screenZ); anim = N(reflection_unk_resolve_anim)(playerStatus->trueAnimation); @@ -113,13 +113,13 @@ void N(worker_reflect_player_wall)(void) { renderTaskPtr->renderMode = renderMode; renderTaskPtr->appendGfxArg = playerStatus; renderTaskPtr->appendGfx = (void(*))N(appendGfx_reflect_player_wall); - renderTaskPtr->distance = -screenZ; + renderTaskPtr->dist = -screenZ; queue_render_task(renderTaskPtr); } } void N(appendGfx_reflect_player_wall)(PlayerStatus* playerStatus) { - f32 yaw = -gCameras[gCurrentCamID].currentYaw; + f32 yaw = -gCameras[gCurrentCamID].curYaw; Matrix4f main; Matrix4f translation; Matrix4f rotation; @@ -134,7 +134,7 @@ void N(appendGfx_reflect_player_wall)(PlayerStatus* playerStatus) { guMtxCatF(main, rotation, main); guScaleF(scale, SPRITE_WORLD_SCALE_F, SPRITE_WORLD_SCALE_F, SPRITE_WORLD_SCALE_F); guMtxCatF(main, scale, main); - guTranslateF(translation, playerStatus->position.x, playerStatus->position.y, -playerStatus->position.z - 3.0f); + guTranslateF(translation, playerStatus->pos.x, playerStatus->pos.y, -playerStatus->pos.z - 3.0f); guMtxCatF(main, translation, main); spr_draw_player_sprite(PLAYER_SPRITE_AUX2, 0, 0, NULL, main); } @@ -164,7 +164,7 @@ void N(worker_reflect_player_floor)(void) { if (playerStatus->flags & PS_FLAG_HAS_REFLECTION) { entityModel = get_entity_model(get_shadow_by_index(playerStatus->shadowID)->entityModelID); - get_screen_coords(gCurrentCamID, playerStatus->position.x, -playerStatus->position.y, playerStatus->position.z, + get_screen_coords(gCurrentCamID, playerStatus->pos.x, -playerStatus->pos.y, playerStatus->pos.z, &screenX, &screenY, &screenZ); spr_update_player_sprite(PLAYER_SPRITE_AUX1, playerStatus->trueAnimation, 1.0f); @@ -187,7 +187,7 @@ void N(worker_reflect_player_floor)(void) { renderTaskPtr->renderMode = renderMode; renderTaskPtr->appendGfxArg = playerStatus; - renderTaskPtr->distance = -screenZ; + renderTaskPtr->dist = -screenZ; renderTaskPtr->appendGfx = (void (*)(void*)) ( !(playerStatus->flags & PS_FLAG_SPINNING) ? N(appendGfx_reflect_player_floor_basic) @@ -198,7 +198,7 @@ void N(worker_reflect_player_floor)(void) { } void N(appendGfx_reflect_player_floor_basic)(PlayerStatus* playerStatus) { - f32 yaw = -gCameras[gCurrentCamID].currentYaw; + f32 yaw = -gCameras[gCurrentCamID].curYaw; Matrix4f main; Matrix4f translation; Matrix4f rotation; @@ -214,7 +214,7 @@ void N(appendGfx_reflect_player_floor_basic)(PlayerStatus* playerStatus) { guMtxCatF(main, rotation, main); guScaleF(scale, SPRITE_WORLD_SCALE_F, -SPRITE_WORLD_SCALE_F, SPRITE_WORLD_SCALE_F); guMtxCatF(main, scale, main); - guTranslateF(translation, playerStatus->position.x, -playerStatus->position.y, playerStatus->position.z); + guTranslateF(translation, playerStatus->pos.x, -playerStatus->pos.y, playerStatus->pos.z); guMtxCatF(main, translation, main); if (playerStatus->spriteFacingAngle >= 90.0f && playerStatus->spriteFacingAngle < 270.0f) { @@ -244,7 +244,7 @@ void N(appendGfx_reflect_player_floor_fancy)(PlayerStatus* playerStatus) { s32 spriteIdx; for (i = 0; i < 2; i++) { - yaw = -gCameras[gCurrentCamID].currentYaw; + yaw = -gCameras[gCurrentCamID].curYaw; if (i == 0) { if ((playerStatus->spriteFacingAngle > 90.0f) && (playerStatus->spriteFacingAngle <= 180.0f)) { @@ -270,21 +270,21 @@ void N(appendGfx_reflect_player_floor_fancy)(PlayerStatus* playerStatus) { guRotateF(rotation, yaw, 0.0f, -1.0f, 0.0f); guRotateF(mtx, clamp_angle(playerStatus->pitch), 0.0f, 0.0f, 1.0f); guMtxCatF(rotation, mtx, mtx); - px = playerStatus->position.x; - py = playerStatus->position.y; - pz = playerStatus->position.z; + px = playerStatus->pos.x; + py = playerStatus->pos.y; + pz = playerStatus->pos.z; } else { // Spinning blur animation blurAngle = phys_get_spin_history(i, &x, &y, &z); if (y == 0x80000000) { - py = playerStatus->position.y; + py = playerStatus->pos.y; } else { py = y; } - px = playerStatus->position.x; - pz = playerStatus->position.z; + px = playerStatus->pos.x; + pz = playerStatus->pos.z; set_player_imgfx_comp(PLAYER_SPRITE_AUX1, -1, IMGFX_SET_ALPHA, 0, 0, 0, 64, 0); guRotateF(mtx, yaw, 0.0f, -1.0f, 0.0f); guRotateF(rotation, yaw, 0.0f, -1.0f, 0.0f); diff --git a/src/world/area_pra/pra_02/pra_02_4_entity.c b/src/world/area_pra/pra_02/pra_02_4_entity.c index 2d882b0f7b..d3db0f2e59 100644 --- a/src/world/area_pra/pra_02/pra_02_4_entity.c +++ b/src/world/area_pra/pra_02/pra_02_4_entity.c @@ -68,9 +68,9 @@ API_CALLABLE(N(UpdatePadlockPosition)) { } entity = get_entity_by_index(entityIdx); - entity->position.x = x; - entity->position.y = y + offset; - entity->position.z = z; + entity->pos.x = x; + entity->pos.y = y + offset; + entity->pos.z = z; return ApiStatus_DONE2; } diff --git a/src/world/area_pra/pra_03/pra_03_3_entity.c b/src/world/area_pra/pra_03/pra_03_3_entity.c index 9ee73d8dee..b33e0d39bb 100644 --- a/src/world/area_pra/pra_03/pra_03_3_entity.c +++ b/src/world/area_pra/pra_03/pra_03_3_entity.c @@ -28,10 +28,10 @@ API_CALLABLE(N(GetTargetPosXForSpring_Floor0)) { API_CALLABLE(N(MonitorPlayerFloor)) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->lastGoodPosition.y == 0) { + if (playerStatus->lastGoodPos.y == 0) { evt_set_variable(script, MV_PlayerFloor, 0); } - if (playerStatus->lastGoodPosition.y == -200) { + if (playerStatus->lastGoodPos.y == -200) { evt_set_variable(script, MV_PlayerFloor, 1); } return ApiStatus_BLOCK; diff --git a/src/world/area_pra/pra_04/pra_04_3_entity.c b/src/world/area_pra/pra_04/pra_04_3_entity.c index 314cdbc8f5..28d8d57d74 100644 --- a/src/world/area_pra/pra_04/pra_04_3_entity.c +++ b/src/world/area_pra/pra_04/pra_04_3_entity.c @@ -28,10 +28,10 @@ API_CALLABLE(N(GetTargetPosXForSpring_Floor0)) { API_CALLABLE(N(MonitorPlayerFloor)) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->lastGoodPosition.y == 0) { + if (playerStatus->lastGoodPos.y == 0) { evt_set_variable(script, MV_PlayerFloor, 0); } - if (playerStatus->lastGoodPosition.y == -200) { + if (playerStatus->lastGoodPos.y == -200) { evt_set_variable(script, MV_PlayerFloor, 1); } return ApiStatus_BLOCK; diff --git a/src/world/area_pra/pra_09/pra_09_3_npc.c b/src/world/area_pra/pra_09/pra_09_3_npc.c index f16ff51af5..99a472893b 100644 --- a/src/world/area_pra/pra_09/pra_09_3_npc.c +++ b/src/world/area_pra/pra_09/pra_09_3_npc.c @@ -66,21 +66,21 @@ API_CALLABLE(N(ImposterFallFromCeiling)) { npc->pos.x = script->varTable[1]; npc->pos.y = script->varTable[2]; npc->pos.z = script->varTable[3]; - npc->jumpVelocity = 0.0f; - npc->currentAnim = ANIM_WorldBombette_Aftermath; + npc->jumpVel = 0.0f; + npc->curAnim = ANIM_WorldBombette_Aftermath; npc->jumpScale = 0.8f; } - npc->rotation.z -= 39.0f; - npc->rotation.x -= 33.0f; - npc->pos.y -= npc->jumpVelocity; - npc->jumpVelocity += npc->jumpScale; + npc->rot.z -= 39.0f; + npc->rot.x -= 33.0f; + npc->pos.y -= npc->jumpVel; + npc->jumpVel += npc->jumpScale; if (npc->pos.y <= 0.0f) { npc->pos.y = 0.0f; - npc->rotation.z = 0.0f; - npc->rotation.x = 0.0f; - npc->jumpVelocity = 0.0f; + npc->rot.z = 0.0f; + npc->rot.x = 0.0f; + npc->jumpVel = 0.0f; npc->jumpScale = 0.0f; - npc->currentAnim = ANIM_WorldBombette_Idle; + npc->curAnim = ANIM_WorldBombette_Idle; return ApiStatus_DONE2; } return ApiStatus_BLOCK; diff --git a/src/world/area_pra/pra_13/pra_13_3_npc.c b/src/world/area_pra/pra_13/pra_13_3_npc.c index bf893c622f..e319227f9b 100644 --- a/src/world/area_pra/pra_13/pra_13_3_npc.c +++ b/src/world/area_pra/pra_13/pra_13_3_npc.c @@ -43,7 +43,7 @@ void N(worker_draw_fake_player)(void) { get_screen_coords(gCurrentCamID, npc->pos.x, npc->pos.y, -npc->pos.z, &x, &y, &z); rtPtr->renderMode = npc->renderMode; - rtPtr->distance = -z; + rtPtr->dist = -z; rtPtr->appendGfxArg = npc; rtPtr->appendGfx = N(appendGfx_fake_player); queue_render_task(rtPtr); @@ -55,12 +55,12 @@ void N(appendGfx_fake_player)(void* data) { Matrix4f mtxTransform, mtxTranslate, sp98, mtxScale; npc_get_render_yaw(npc); - guRotateF(mtxTransform, npc->renderYaw + gCameras[gCurrentCamID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(mtxTransform, npc->renderYaw + gCameras[gCurrentCamID].curYaw, 0.0f, 1.0f, 0.0f); guScaleF(mtxScale, SPRITE_WORLD_SCALE_F, SPRITE_WORLD_SCALE_F, SPRITE_WORLD_SCALE_F); guMtxCatF(mtxTransform, mtxScale, mtxTransform); guTranslateF(mtxTranslate, npc->pos.x, npc->pos.y, npc->pos.z); guMtxCatF(mtxTransform, mtxTranslate, mtxTransform); - spr_update_player_sprite(PLAYER_SPRITE_AUX2, npc->currentAnim, 1.0f); + spr_update_player_sprite(PLAYER_SPRITE_AUX2, npc->curAnim, 1.0f); spr_draw_player_sprite(PLAYER_SPRITE_AUX2, 0, 0, 0, mtxTransform); } diff --git a/src/world/area_pra/pra_19/pra_19_3_npc.c b/src/world/area_pra/pra_19/pra_19_3_npc.c index 7c82aa539f..cf5403dfd7 100644 --- a/src/world/area_pra/pra_19/pra_19_3_npc.c +++ b/src/world/area_pra/pra_19/pra_19_3_npc.c @@ -98,7 +98,7 @@ void N(worker_draw_example_player)(void) { get_screen_coords(gCurrentCamID, npc->pos.x, npc->pos.y, -npc->pos.z, &x, &y, &z); rtPtr->renderMode = npc->renderMode; - rtPtr->distance = -z; + rtPtr->dist = -z; rtPtr->appendGfxArg = npc; rtPtr->appendGfx = N(appendGfx_example_player); queue_render_task(rtPtr); @@ -110,12 +110,12 @@ void N(appendGfx_example_player)(void* data) { Matrix4f mtxTransform, mtxTranslate, mtxScale; npc_get_render_yaw(npc); - guRotateF(mtxTransform, npc->renderYaw + gCameras[gCurrentCamID].currentYaw, 0.0f, 1.0f, 0.0f); + guRotateF(mtxTransform, npc->renderYaw + gCameras[gCurrentCamID].curYaw, 0.0f, 1.0f, 0.0f); guScaleF(mtxScale, SPRITE_WORLD_SCALE_F, SPRITE_WORLD_SCALE_F, SPRITE_WORLD_SCALE_F); guMtxCatF(mtxTransform, mtxScale, mtxTransform); guTranslateF(mtxTranslate, npc->pos.x, npc->pos.y, npc->pos.z); guMtxCatF(mtxTransform, mtxTranslate, mtxTransform); - spr_update_player_sprite(PLAYER_SPRITE_AUX2, npc->currentAnim, 1.0f); + spr_update_player_sprite(PLAYER_SPRITE_AUX2, npc->curAnim, 1.0f); spr_draw_player_sprite(PLAYER_SPRITE_AUX2, 0, 0, 0, mtxTransform); } @@ -140,7 +140,7 @@ API_CALLABLE(N(AwaitImposterHitPlayer)) { Npc* npc2 = get_npc_unsafe(NPC_FakeLuigi); Npc* npc3 = get_npc_unsafe(NPC_FakeKoopaKoot); Npc* npc4 = get_npc_unsafe(NPC_FakeKolorado); - f32 playerX = gPlayerStatus.position.x; + f32 playerX = gPlayerStatus.pos.x; if (npc0->pos.x < playerX) { return ApiStatus_DONE2; diff --git a/src/world/area_pra/pra_21/pra_21_3_entity.c b/src/world/area_pra/pra_21/pra_21_3_entity.c index a1a9e6cec3..1b5e108427 100644 --- a/src/world/area_pra/pra_21/pra_21_3_entity.c +++ b/src/world/area_pra/pra_21/pra_21_3_entity.c @@ -16,10 +16,10 @@ API_CALLABLE(N(GetTargetPosXForSpring)) { API_CALLABLE(N(MonitorPlayerFloor)) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->lastGoodPosition.y == 0) { + if (playerStatus->lastGoodPos.y == 0) { evt_set_variable(script, MV_PlayerFloor, 0); } - if (playerStatus->lastGoodPosition.y == -200) { + if (playerStatus->lastGoodPos.y == -200) { evt_set_variable(script, MV_PlayerFloor, 1); } return ApiStatus_BLOCK; diff --git a/src/world/area_pra/pra_22/pra_22_2_main.c b/src/world/area_pra/pra_22/pra_22_2_main.c index 10032d91b8..5fae9d306b 100644 --- a/src/world/area_pra/pra_22/pra_22_2_main.c +++ b/src/world/area_pra/pra_22/pra_22_2_main.c @@ -7,18 +7,18 @@ API_CALLABLE(N(PreventFalling)) { PlayerStatus* playerStatus = &gPlayerStatus; f32 x, y, z, hitDepth; - playerStatus->position.x = script->varTable[0]; - x = playerStatus->position.x; - y = playerStatus->position.y + 10.0f; - z = playerStatus->position.z; + playerStatus->pos.x = script->varTable[0]; + x = playerStatus->pos.x; + y = playerStatus->pos.y + 10.0f; + z = playerStatus->pos.z; hitDepth = 300.0f; npc_raycast_down_around(0, &x, &y, &z, &hitDepth, 270.0f, playerStatus->colliderDiameter); - playerStatus->position.x = x; - playerStatus->position.z = z; + playerStatus->pos.x = x; + playerStatus->pos.z = z; script->varTable[10] = FALSE; - if (playerStatus->position.y != y) { - playerStatus->position.y = 0.0f; + if (playerStatus->pos.y != y) { + playerStatus->pos.y = 0.0f; script->varTable[3]++; if (script->varTable[3] >= 30) { // player may now fall diff --git a/src/world/area_pra/pra_22/pra_22_3_entity.c b/src/world/area_pra/pra_22/pra_22_3_entity.c index 15bf28cf2a..dc83aaf772 100644 --- a/src/world/area_pra/pra_22/pra_22_3_entity.c +++ b/src/world/area_pra/pra_22/pra_22_3_entity.c @@ -16,10 +16,10 @@ API_CALLABLE(N(GetTargetPosXForSpring)) { API_CALLABLE(N(MonitorPlayerFloor)) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->lastGoodPosition.y == 0) { + if (playerStatus->lastGoodPos.y == 0) { evt_set_variable(script, MV_PlayerFloor, 0); } - if (playerStatus->lastGoodPosition.y == -200) { + if (playerStatus->lastGoodPos.y == -200) { evt_set_variable(script, MV_PlayerFloor, 1); } return ApiStatus_BLOCK; diff --git a/src/world/area_pra/pra_31/pra_31_2_npc.c b/src/world/area_pra/pra_31/pra_31_2_npc.c index 8cd98366d2..5e9f3da355 100644 --- a/src/world/area_pra/pra_31/pra_31_2_npc.c +++ b/src/world/area_pra/pra_31/pra_31_2_npc.c @@ -9,7 +9,7 @@ MAP_STATIC_PAD(1,key_item); API_CALLABLE(N(GetAngleToPlayer)) { Npc* npc = get_npc_safe(script->owner2.npcID); - script->varTable[0] = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatus.position.x, gPlayerStatus.position.z)); + script->varTable[0] = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatus.pos.x, gPlayerStatus.pos.z)); return ApiStatus_DONE2; } diff --git a/src/world/area_pra/pra_31/pra_31_4_puzzle.c b/src/world/area_pra/pra_31/pra_31_4_puzzle.c index d6807ed3b5..431c2612c7 100644 --- a/src/world/area_pra/pra_31/pra_31_4_puzzle.c +++ b/src/world/area_pra/pra_31/pra_31_4_puzzle.c @@ -9,8 +9,8 @@ typedef struct DinoData { /* 0x00 */ s16 ci; // cell i index /* 0x02 */ s16 cj; // cell j index - /* 0x04 */ f32 currentPosX; - /* 0x08 */ f32 currentPosZ; + /* 0x04 */ f32 corPosX; + /* 0x08 */ f32 curPosZ; /* 0x0C */ f32 goalPosX; /* 0x10 */ f32 goalPosZ; /* 0x14 */ f32 angle; @@ -73,8 +73,8 @@ API_CALLABLE(N(EVS_ManagePuzzle)) { dino->cj = N(InitialConfigurationAfter)[j][1]; dino->angle = N(InitialConfigurationAfter)[j][2]; } - dino->currentPosX = dino->goalPosX = (dino->ci * DINO_CELL_SIZE) + DINO_CELL_SIZE; - dino->currentPosZ = dino->goalPosZ = (dino->cj * DINO_CELL_SIZE) + DINO_CELL_SIZE + DINO_CELL_SIZE / 2; + dino->corPosX = dino->goalPosX = (dino->ci * DINO_CELL_SIZE) + DINO_CELL_SIZE; + dino->curPosZ = dino->goalPosZ = (dino->cj * DINO_CELL_SIZE) + DINO_CELL_SIZE + DINO_CELL_SIZE / 2; puzzle->cells[dino->cj][dino->ci] = CELL_DINO; } evt_set_variable(script, MV_DinoYaw_01, 270); @@ -85,17 +85,17 @@ API_CALLABLE(N(EVS_ManagePuzzle)) { puzzle = (DinoPuzzleData*) evt_get_variable(script, MV_PuzzleDataPtr); dino = &puzzle->dinos[0]; for (j = 0; j < DINO_COUNT; j++, dino++) { - if (dino->currentPosX < dino->goalPosX) { - dino->currentPosX += (f32) DINO_CELL_SIZE / PUSH_TIME; + if (dino->corPosX < dino->goalPosX) { + dino->corPosX += (f32) DINO_CELL_SIZE / PUSH_TIME; } - if (dino->currentPosX > dino->goalPosX) { - dino->currentPosX -= (f32) DINO_CELL_SIZE / PUSH_TIME; + if (dino->corPosX > dino->goalPosX) { + dino->corPosX -= (f32) DINO_CELL_SIZE / PUSH_TIME; } - if (dino->currentPosZ < dino->goalPosZ) { - dino->currentPosZ += (f32) DINO_CELL_SIZE / PUSH_TIME; + if (dino->curPosZ < dino->goalPosZ) { + dino->curPosZ += (f32) DINO_CELL_SIZE / PUSH_TIME; } - if (dino->currentPosZ > dino->goalPosZ) { - dino->currentPosZ -= (f32) DINO_CELL_SIZE / PUSH_TIME; + if (dino->curPosZ > dino->goalPosZ) { + dino->curPosZ -= (f32) DINO_CELL_SIZE / PUSH_TIME; } } @@ -248,23 +248,23 @@ API_CALLABLE(N(GetPlayerPushLerpValues)) { switch ((s32)dino->angle) { case 0: - script->varTable[3] = playerStatus->position.z; - script->varTable[4] = playerStatus->position.z + DINO_CELL_SIZE; + script->varTable[3] = playerStatus->pos.z; + script->varTable[4] = playerStatus->pos.z + DINO_CELL_SIZE; script->varTable[5] = 1; break; case 90: - script->varTable[3] = playerStatus->position.x; - script->varTable[4] = playerStatus->position.x + DINO_CELL_SIZE; + script->varTable[3] = playerStatus->pos.x; + script->varTable[4] = playerStatus->pos.x + DINO_CELL_SIZE; script->varTable[5] = 0; break; case 180: - script->varTable[3] = playerStatus->position.z; - script->varTable[4] = playerStatus->position.z - DINO_CELL_SIZE; + script->varTable[3] = playerStatus->pos.z; + script->varTable[4] = playerStatus->pos.z - DINO_CELL_SIZE; script->varTable[5] = 1; break; case 270: - script->varTable[3] = playerStatus->position.x; - script->varTable[4] = playerStatus->position.x - DINO_CELL_SIZE; + script->varTable[3] = playerStatus->pos.x; + script->varTable[4] = playerStatus->pos.x - DINO_CELL_SIZE; script->varTable[5] = 0; break; } @@ -279,8 +279,8 @@ API_CALLABLE(N(GetDinoStatuePosRot)) { DinoPuzzleData* puzzle = (DinoPuzzleData*) evt_get_variable(script, MV_PuzzleDataPtr); DinoData* dino = &puzzle->dinos[idx]; - evt_set_float_variable(script, LVar0, dino->currentPosX); - evt_set_float_variable(script, LVar1, -dino->currentPosZ); + evt_set_float_variable(script, LVar0, dino->corPosX); + evt_set_float_variable(script, LVar1, -dino->curPosZ); evt_set_float_variable(script, LVar2, clamp_angle(dino->angle + 90.0)); return ApiStatus_DONE2; } @@ -291,8 +291,8 @@ API_CALLABLE(N(GetDinoNpcPosRot)) { DinoPuzzleData* puzzle = (DinoPuzzleData*) evt_get_variable(script, MV_PuzzleDataPtr); DinoData* dino = &puzzle->dinos[idx]; - evt_set_float_variable(script, LVar0, dino->currentPosX); - evt_set_float_variable(script, LVar1, dino->currentPosZ); + evt_set_float_variable(script, LVar0, dino->corPosX); + evt_set_float_variable(script, LVar1, dino->curPosZ); evt_set_float_variable(script, LVar2, clamp_angle(dino->angle)); return ApiStatus_DONE2; } diff --git a/src/world/area_pra/pra_33/pra_33_3_entity.c b/src/world/area_pra/pra_33/pra_33_3_entity.c index 3400dd52c7..f253a3b3d3 100644 --- a/src/world/area_pra/pra_33/pra_33_3_entity.c +++ b/src/world/area_pra/pra_33/pra_33_3_entity.c @@ -3,7 +3,7 @@ API_CALLABLE(N(CheckPlayerOnDais)) { script->varTable[10] = 0; - if (gCollisionStatus.currentFloor == COLLIDER_o1045) { + if (gCollisionStatus.curFloor == COLLIDER_o1045) { script->varTable[10] = 1; } if (gCollisionStatus.lastTouchedFloor == COLLIDER_o1045) { @@ -13,8 +13,8 @@ API_CALLABLE(N(CheckPlayerOnDais)) { } API_CALLABLE(N(GetDaisRelativePlayerPos)) { - script->varTable[6] = dist2D(200.0f, 0.0f, gPlayerStatus.position.x, gPlayerStatus.position.z); - script->varTable[7] = atan2(200.0f, 0.0f, gPlayerStatus.position.x, gPlayerStatus.position.z); + script->varTable[6] = dist2D(200.0f, 0.0f, gPlayerStatus.pos.x, gPlayerStatus.pos.z); + script->varTable[7] = atan2(200.0f, 0.0f, gPlayerStatus.pos.x, gPlayerStatus.pos.z); script->varTable[7] = clamp_angle(script->varTable[7]); return ApiStatus_DONE2; } @@ -23,8 +23,8 @@ API_CALLABLE(N(UpdateDaisPlayerPos)) { f32 sinTheta, cosTheta; sin_cos_deg(script->varTable[7], &sinTheta, &cosTheta); - gPlayerStatus.position.x = (script->varTable[6] * sinTheta) + 200.0f; - gPlayerStatus.position.z = (script->varTable[6] * -cosTheta) + 0.0f; + gPlayerStatus.pos.x = (script->varTable[6] * sinTheta) + 200.0f; + gPlayerStatus.pos.z = (script->varTable[6] * -cosTheta) + 0.0f; return ApiStatus_DONE2; } diff --git a/src/world/area_sam/sam_03/sam_03_3_npc1.c b/src/world/area_sam/sam_03/sam_03_3_npc1.c index 552d517e1a..4ef0e26343 100644 --- a/src/world/area_sam/sam_03/sam_03_3_npc1.c +++ b/src/world/area_sam/sam_03/sam_03_3_npc1.c @@ -5,7 +5,7 @@ API_CALLABLE(N(GetAngleToPlayer)) { Npc* npc = get_npc_unsafe(NPC_JrTroopa); - script->varTable[0] = atan2(npc->pos.x, npc->pos.z, gPlayerStatus.position.x, gPlayerStatus.position.z); + script->varTable[0] = atan2(npc->pos.x, npc->pos.z, gPlayerStatus.pos.x, gPlayerStatus.pos.z); return ApiStatus_DONE2; } diff --git a/src/world/area_sam/sam_07/sam_07_4_frozen_pit.c b/src/world/area_sam/sam_07/sam_07_4_frozen_pit.c index 72e4565d35..5bf8d55b8a 100644 --- a/src/world/area_sam/sam_07/sam_07_4_frozen_pit.c +++ b/src/world/area_sam/sam_07/sam_07_4_frozen_pit.c @@ -21,7 +21,7 @@ typedef struct IceShard { /* 0x10 */ Vec3f initialPos; /* 0x1C */ Vec3f rot; /* 0x28 */ Vec3f rotVel; - /* 0x34 */ f32 velocityY; + /* 0x34 */ f32 velY; /* 0x38 */ f32 moveSpeed; /* 0x3C */ f32 moveAngle; /* 0x40 */ Matrix4f transformMatrix; @@ -57,7 +57,7 @@ API_CALLABLE(N(AnimateIceShattering)) { it->rotVel.x = rand_int(20) - 10; it->rotVel.y = rand_int(20) - 10; it->rotVel.z = rand_int(20) - 10; - it->velocityY = rand_int(5) + 5.0f; + it->velY = rand_int(5) + 5.0f; it->moveSpeed = rand_int(3) + 1.0f; it->moveAngle = rand_int(360); @@ -74,10 +74,10 @@ API_CALLABLE(N(AnimateIceShattering)) { model = get_model_from_list_index(get_model_list_index_from_tree_index(N(IceShardModels)[i])); if (it->state == 0) { add_vec2D_polar(&it->pos.x, &it->pos.z, it->moveSpeed, it->moveAngle); - it->velocityY -= 1.0f; - it->pos.y += it->velocityY; - if (it->velocityY < 0.0f) { - if (it->pos.y < playerStatus->position.y - 150.0f) { + it->velY -= 1.0f; + it->pos.y += it->velY; + if (it->velY < 0.0f) { + if (it->pos.y < playerStatus->pos.y - 150.0f) { // this shard is done, stop moving and increment the 'done' counter script->functionTemp[1]++; it->state = 101; @@ -125,7 +125,7 @@ API_CALLABLE(N(AwaitPlayerNotPoundingFloor)) { s32 floor1 = evt_get_variable(script, *args++); s32 floor2 = evt_get_variable(script, *args++); - if (gCollisionStatus.currentFloor == floor1 || gCollisionStatus.currentFloor == floor2) { + if (gCollisionStatus.curFloor == floor1 || gCollisionStatus.curFloor == floor2) { if (playerStatus->actionState == ACTION_STATE_SPIN_POUND || playerStatus->actionState == ACTION_STATE_TORNADO_POUND) { diff --git a/src/world/area_sam/sam_10/sam_10_4_stairs.c b/src/world/area_sam/sam_10/sam_10_4_stairs.c index 623885dd11..e708f7fe3f 100644 --- a/src/world/area_sam/sam_10/sam_10_4_stairs.c +++ b/src/world/area_sam/sam_10/sam_10_4_stairs.c @@ -35,10 +35,10 @@ Vec2i N(StaircaseStepsData)[] = { }; API_CALLABLE(N(GetCamPointsNearPlayer)) { - script->varTable[0] = gPlayerStatus.position.x + (sin_deg(310.0f) * 100.0f); - script->varTable[1] = gPlayerStatus.position.z - (cos_deg(310.0f) * 100.0f); - script->varTable[2] = gPlayerStatus.position.x + (sin_deg(130.0f) * 100.0f); - script->varTable[3] = gPlayerStatus.position.z - (cos_deg(130.0f) * 100.0f); + script->varTable[0] = gPlayerStatus.pos.x + (sin_deg(310.0f) * 100.0f); + script->varTable[1] = gPlayerStatus.pos.z - (cos_deg(310.0f) * 100.0f); + script->varTable[2] = gPlayerStatus.pos.x + (sin_deg(130.0f) * 100.0f); + script->varTable[3] = gPlayerStatus.pos.z - (cos_deg(130.0f) * 100.0f); return ApiStatus_DONE2; } diff --git a/src/world/area_sam/sam_11/sam_11_4_entity.c b/src/world/area_sam/sam_11/sam_11_4_entity.c index 9e109a9c06..008db34743 100644 --- a/src/world/area_sam/sam_11/sam_11_4_entity.c +++ b/src/world/area_sam/sam_11/sam_11_4_entity.c @@ -80,16 +80,16 @@ API_CALLABLE(N(MovePlayerAlongRoofSlide)) { script->functionTemp[1] += 4; xComp = (script->functionTemp[1] / 10) * sin_deg(playerStatus->targetYaw); zComp = (script->functionTemp[1] / 10) * -cos_deg(playerStatus->targetYaw); - x = playerStatus->position.x + xComp; - y = playerStatus->position.y + playerStatus->colliderHeight * 0.5f; - z = playerStatus->position.z + zComp; + x = playerStatus->pos.x + xComp; + y = playerStatus->pos.y + playerStatus->colliderHeight * 0.5f; + z = playerStatus->pos.z + zComp; hitDepth = 500.0f; if (npc_raycast_down_sides(0, &x, &y, &z, &hitDepth)) { if (hitDepth < 100.0f) { - playerStatus->position.x = x; - playerStatus->position.y = y; - playerStatus->position.z = z; + playerStatus->pos.x = x; + playerStatus->pos.y = y; + playerStatus->pos.z = z; return ApiStatus_BLOCK; } } @@ -108,10 +108,10 @@ API_CALLABLE(N(IsPlayerInputDisabled)) { API_CALLABLE(N(MonitorCurrenFloor)) { PlayerStatus* playerStatus = &gPlayerStatus; - if (playerStatus->lastGoodPosition.y == 385) { + if (playerStatus->lastGoodPos.y == 385) { evt_set_variable(script, MV_CurrentFloor, 0); } - if (playerStatus->lastGoodPosition.y == 150) { + if (playerStatus->lastGoodPos.y == 150) { evt_set_variable(script, MV_CurrentFloor, 1); } return ApiStatus_BLOCK; diff --git a/src/world/area_sam/sam_11/sam_11_5_npc.c b/src/world/area_sam/sam_11/sam_11_5_npc.c index 9e268433d0..092a269fcf 100644 --- a/src/world/area_sam/sam_11/sam_11_5_npc.c +++ b/src/world/area_sam/sam_11/sam_11_5_npc.c @@ -35,23 +35,23 @@ API_CALLABLE(N(UpdateSentryPosition)) { f32 var_f2; if (*posZ == npc->pos.z) { - if(npc->currentAnim != ANIM_Penguin_Idle) { - npc->currentAnim = ANIM_Penguin_Idle; + if(npc->curAnim != ANIM_Penguin_Idle) { + npc->curAnim = ANIM_Penguin_Idle; } } if (*posZ != npc->pos.z) { - if (npc->currentAnim != ANIM_Penguin_Walk) { - npc->currentAnim = ANIM_Penguin_Walk; + if (npc->curAnim != ANIM_Penguin_Walk) { + npc->curAnim = ANIM_Penguin_Walk; } } *posZ = npc->pos.z; - if (!(dist2D(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z) < 30.0f) && - !(dist2D(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z) > 130.0f)) + if (!(dist2D(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z) < 30.0f) && + !(dist2D(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z) > 130.0f)) { - playerX = var_f2 = playerStatus->position.z; + playerX = var_f2 = playerStatus->pos.z; if (playerX > 50.0f) { var_f2 = 50.0f; } diff --git a/src/world/area_sam/sam_11/sam_11_6_pond.c b/src/world/area_sam/sam_11/sam_11_6_pond.c index 82f212b75a..cb9506f166 100644 --- a/src/world/area_sam/sam_11/sam_11_6_pond.c +++ b/src/world/area_sam/sam_11/sam_11_6_pond.c @@ -29,7 +29,7 @@ API_CALLABLE(N(SpawnIceShards)) { a5 = 4.0f; effect->data.iceShard->animFrame = 0.0f; effect->data.iceShard->animRate = (rand_int(10) * 0.2) + 0.1; - effect->data.iceShard->rotation = i * 35; + effect->data.iceShard->rot = i * 35; effect->data.iceShard->angularVel = rand_int(10) - 5; effect->data.iceShard->vel.x = t1; effect->data.iceShard->vel.y = a5; @@ -41,7 +41,7 @@ API_CALLABLE(N(SpawnIceShards)) { API_CALLABLE(N(func_80241FB0_D3C580)) { script->varTable[10] = 0; - if (gCollisionStatus.currentFloor == COLLIDER_suimen) { + if (gCollisionStatus.curFloor == COLLIDER_suimen) { script->varTable[10] = 1; } if (gCollisionStatus.lastTouchedFloor == COLLIDER_suimen) { @@ -52,15 +52,15 @@ API_CALLABLE(N(func_80241FB0_D3C580)) { API_CALLABLE(N(SetDraggingPlayerPosY)) { PlayerStatus* playerStatus = &gPlayerStatus; - f32 x = playerStatus->position.x; - f32 y = playerStatus->position.y + 10.0f; - f32 z = playerStatus->position.z; + f32 x = playerStatus->pos.x; + f32 y = playerStatus->pos.y + 10.0f; + f32 z = playerStatus->pos.z; f32 hitDepth = 40.0f; npc_raycast_down_sides(0, &x, &y, &z, &hitDepth); - playerStatus->position.x = x; - playerStatus->position.y = y; - playerStatus->position.z = z; + playerStatus->pos.x = x; + playerStatus->pos.y = y; + playerStatus->pos.z = z; return ApiStatus_DONE2; } diff --git a/src/world/area_sam/sam_12/sam_12_4_scenes.c b/src/world/area_sam/sam_12/sam_12_4_scenes.c index 95413a8b14..17bb0f13fb 100644 --- a/src/world/area_sam/sam_12/sam_12_4_scenes.c +++ b/src/world/area_sam/sam_12/sam_12_4_scenes.c @@ -17,9 +17,9 @@ API_CALLABLE(N(SetItemPositionF)) { s32 z = evt_get_float_variable(script, *args++); ItemEntity* item = get_item_entity(idx); - item->position.x = x; - item->position.y = y; - item->position.z = z; + item->pos.x = x; + item->pos.y = y; + item->pos.z = z; return ApiStatus_DONE2; } @@ -37,9 +37,9 @@ API_CALLABLE(N(SpawnSleepBubble)) { fx_sleep_bubble( 0, - gPlayerStatus.position.x + x, - gPlayerStatus.position.y + ((gPlayerStatus.colliderHeight * 2) / 3) + y, - gPlayerStatus.position.z + z, + gPlayerStatus.pos.x + x, + gPlayerStatus.pos.y + ((gPlayerStatus.colliderHeight * 2) / 3) + y, + gPlayerStatus.pos.z + z, (gPlayerStatus.colliderHeight / 3) + t, temp_f26, &effect diff --git a/src/world/area_tik/common/DripVolumes.inc.c b/src/world/area_tik/common/DripVolumes.inc.c index 53ec20bf3d..b8af0a53ff 100644 --- a/src/world/area_tik/common/DripVolumes.inc.c +++ b/src/world/area_tik/common/DripVolumes.inc.c @@ -18,9 +18,9 @@ API_CALLABLE(N(CheckDripCollisionWithNPC)) { s32 i; script->varTable[2] = 0; - xDiff = playerStatus->position.x - model->center.x; - zDiff = playerStatus->position.z - model->center.z; - yVal = playerStatus->position.y + playerStatus->colliderHeight - 1.5f - model->center.y; + xDiff = playerStatus->pos.x - model->center.x; + zDiff = playerStatus->pos.z - model->center.z; + yVal = playerStatus->pos.y + playerStatus->colliderHeight - 1.5f - model->center.y; sqrtTemp = sqrtf(SQ(xDiff) + SQ(zDiff)); if (yVal > 0.0f && yVal < playerStatus->colliderHeight && sqrtTemp < playerStatus->colliderDiameter * 0.5f) { diff --git a/src/world/area_tik/tik_03/tik_03_4_platforms.c b/src/world/area_tik/tik_03/tik_03_4_platforms.c index 80f3283746..c597f656fd 100644 --- a/src/world/area_tik/tik_03/tik_03_4_platforms.c +++ b/src/world/area_tik/tik_03/tik_03_4_platforms.c @@ -12,7 +12,7 @@ API_CALLABLE(N(PausePlatformsDuringPound)) { u32 i; for (i = 0; i < ARRAY_COUNT(N(PlatformColliders)); i++) { - if (gCollisionStatus.currentFloor != N(PlatformColliders)[i]) { + if (gCollisionStatus.curFloor != N(PlatformColliders)[i]) { continue; } if ((player->actionState == ACTION_STATE_SPIN_POUND) || (player->actionState == ACTION_STATE_TORNADO_POUND)) { diff --git a/src/world/area_tik/tik_03/tik_03_6_demo.c b/src/world/area_tik/tik_03/tik_03_6_demo.c index c454b14942..7bf270895c 100644 --- a/src/world/area_tik/tik_03/tik_03_6_demo.c +++ b/src/world/area_tik/tik_03/tik_03_6_demo.c @@ -65,11 +65,11 @@ API_CALLABLE(N(SetupDemoScene)) { break; case 3: partner_clear_player_tracking(wPartnerNpc); - partner_set_goal_pos(player->position.x, player->position.z); + partner_set_goal_pos(player->pos.x, player->pos.z); func_800EF3D4(0); wPartnerNpc->yaw = 270.0f; gPlayerStatus.targetYaw = 270.0f; - gPlayerStatus.currentYaw = 270.0f; + gPlayerStatus.curYaw = 270.0f; gPlayerStatus.spriteFacingAngle = 180.0f; return ApiStatus_DONE2; } diff --git a/src/world/area_tik/tik_04/tik_04_4_platforms.c b/src/world/area_tik/tik_04/tik_04_4_platforms.c index f62bdf5ce9..a4f998fe67 100644 --- a/src/world/area_tik/tik_04/tik_04_4_platforms.c +++ b/src/world/area_tik/tik_04/tik_04_4_platforms.c @@ -26,12 +26,12 @@ API_CALLABLE(N(UpdatePlatformShadows)) { hitLength = 1000.0f; entity_raycast_down(&x, &y, &z, &hitYaw, &hitPitch, &hitLength); set_standard_shadow_scale(shadow, hitLength); - shadow->position.x = x; - shadow->position.y = y; - shadow->position.z = z; - shadow->rotation.x = hitYaw; - shadow->rotation.y = 0.0f; - shadow->rotation.z = hitPitch; + shadow->pos.x = x; + shadow->pos.y = y; + shadow->pos.z = z; + shadow->rot.x = hitYaw; + shadow->rot.y = 0.0f; + shadow->rot.z = hitPitch; shadow->scale.x *= 4.5f; shadow->scale.z *= 4.5f; @@ -43,12 +43,12 @@ API_CALLABLE(N(UpdatePlatformShadows)) { hitLength = 1000.0f; entity_raycast_down(&x, &y, &z, &hitYaw, &hitPitch, &hitLength); set_standard_shadow_scale(shadow, hitLength); - shadow->position.x = x; - shadow->position.y = y; - shadow->position.z = z; - shadow->rotation.x = hitYaw; - shadow->rotation.y = 0.0f; - shadow->rotation.z = hitPitch; + shadow->pos.x = x; + shadow->pos.y = y; + shadow->pos.z = z; + shadow->rot.x = hitYaw; + shadow->rot.y = 0.0f; + shadow->rot.z = hitPitch; shadow->scale.x *= 4.5f; shadow->scale.z *= 4.5f; @@ -59,14 +59,14 @@ API_CALLABLE(N(GetFloorCollider)) { Bytecode* args = script->ptrReadPos; s32 outVar = *args++; - evt_set_variable(script, outVar, gCollisionStatus.currentFloor); + evt_set_variable(script, outVar, gCollisionStatus.curFloor); return ApiStatus_DONE2; } API_CALLABLE(N(PausePlatformsDuringPound)) { PlayerStatus* player = &gPlayerStatus; - if (gCollisionStatus.currentFloor == COLLIDER_erb1 || gCollisionStatus.currentFloor == COLLIDER_erb2) { + if (gCollisionStatus.curFloor == COLLIDER_erb1 || gCollisionStatus.curFloor == COLLIDER_erb2) { if (player->actionState == ACTION_STATE_SPIN_POUND || player->actionState == ACTION_STATE_TORNADO_POUND) { return ApiStatus_BLOCK; } diff --git a/src/world/area_tik/tik_07/tik_07_5_platforms.c b/src/world/area_tik/tik_07/tik_07_5_platforms.c index df2b904b4e..2f700c46da 100644 --- a/src/world/area_tik/tik_07/tik_07_5_platforms.c +++ b/src/world/area_tik/tik_07/tik_07_5_platforms.c @@ -12,7 +12,7 @@ API_CALLABLE(N(PausePlatformsDuringPound)) { u32 i; for (i = 0; i < ARRAY_COUNT(N(PlatformColliders)); i++) { - if (gCollisionStatus.currentFloor != N(PlatformColliders)[i]) { + if (gCollisionStatus.curFloor != N(PlatformColliders)[i]) { continue; } if ((player->actionState == ACTION_STATE_SPIN_POUND) || (player->actionState == ACTION_STATE_TORNADO_POUND)) { diff --git a/src/world/area_trd/trd_03/trd_03_4_puzzle.c b/src/world/area_trd/trd_03/trd_03_4_puzzle.c index 82ddb40626..ed18e51bdc 100644 --- a/src/world/area_trd/trd_03/trd_03_4_puzzle.c +++ b/src/world/area_trd/trd_03/trd_03_4_puzzle.c @@ -9,10 +9,10 @@ API_CALLABLE(N(GetLeftRightPoints)) { s32 switchPosZ = evt_get_variable(script, *args++); f32 dist = evt_get_variable(script, *args++); - script->varTable[0] = switchPosX + (sin_deg(gCameras[CAM_DEFAULT].currentYaw + 270.0f + dist) * 100.0f); - script->varTable[1] = switchPosZ - (cos_deg(gCameras[CAM_DEFAULT].currentYaw + 270.0f + dist) * 100.0f); - script->varTable[2] = switchPosX + (sin_deg(gCameras[CAM_DEFAULT].currentYaw + 90.0f + dist) * 100.0f); - script->varTable[3] = switchPosZ - (cos_deg(gCameras[CAM_DEFAULT].currentYaw + 90.0f + dist) * 100.0f); + script->varTable[0] = switchPosX + (sin_deg(gCameras[CAM_DEFAULT].curYaw + 270.0f + dist) * 100.0f); + script->varTable[1] = switchPosZ - (cos_deg(gCameras[CAM_DEFAULT].curYaw + 270.0f + dist) * 100.0f); + script->varTable[2] = switchPosX + (sin_deg(gCameras[CAM_DEFAULT].curYaw + 90.0f + dist) * 100.0f); + script->varTable[3] = switchPosZ - (cos_deg(gCameras[CAM_DEFAULT].curYaw + 90.0f + dist) * 100.0f); return ApiStatus_DONE2; } diff --git a/src/world/area_trd/trd_05/trd_05_3_trap.c b/src/world/area_trd/trd_05/trd_05_3_trap.c index 56af2fd428..a4ab841948 100644 --- a/src/world/area_trd/trd_05/trd_05_3_trap.c +++ b/src/world/area_trd/trd_05/trd_05_3_trap.c @@ -78,9 +78,9 @@ void N(appendGfx_FallingSprite)(void) { API_CALLABLE(N(InitializeFallingSprite)) { FallingSprite* falling = &N(Falling); - falling->pos.x = gPlayerStatus.position.x; - falling->pos.y = gPlayerStatus.position.y + (gPlayerStatus.colliderHeight * SPRITE_WORLD_SCALE_D * 0.5); - falling->pos.z = gPlayerStatus.position.z; + falling->pos.x = gPlayerStatus.pos.x; + falling->pos.y = gPlayerStatus.pos.y + (gPlayerStatus.colliderHeight * SPRITE_WORLD_SCALE_D * 0.5); + falling->pos.z = gPlayerStatus.pos.z; falling->rot.x = 0.0f; falling->rot.y = 0.0f; falling->rot.z = 0.0f; diff --git a/src/world/area_trd/trd_06/trd_06_2_falling.c b/src/world/area_trd/trd_06/trd_06_2_falling.c index 05d1530144..17ce24fd8d 100644 --- a/src/world/area_trd/trd_06/trd_06_2_falling.c +++ b/src/world/area_trd/trd_06/trd_06_2_falling.c @@ -85,9 +85,9 @@ API_CALLABLE(N(InitializeFallingSprite)) { falling->playerSpriteID = 1; falling->width = gPlayerStatus.colliderHeight; falling->height = gPlayerStatus.colliderDiameter; - falling->pos.x = gPlayerStatus.position.x; - falling->pos.y = gPlayerStatus.position.y + (falling->height * SPRITE_WORLD_SCALE_D * 0.5); - falling->pos.z = gPlayerStatus.position.z; + falling->pos.x = gPlayerStatus.pos.x; + falling->pos.y = gPlayerStatus.pos.y + (falling->height * SPRITE_WORLD_SCALE_D * 0.5); + falling->pos.z = gPlayerStatus.pos.z; falling->rot.x = 0.0f; falling->rot.y = 0.0f; falling->rot.z = 0.0f; diff --git a/src/world/area_trd/trd_07/trd_07_3_magic_doors.c b/src/world/area_trd/trd_07/trd_07_3_magic_doors.c index 14c9989f8b..795a4cc272 100644 --- a/src/world/area_trd/trd_07/trd_07_3_magic_doors.c +++ b/src/world/area_trd/trd_07/trd_07_3_magic_doors.c @@ -7,10 +7,10 @@ API_CALLABLE(N(GetPointsWithCamRelativeOffset)) { f32 posZ = evt_get_float_variable(script, *args++); f32 angle = evt_get_float_variable(script, *args++); - script->varTable[0] = EVT_FLOAT_TO_FIXED(posX + (sin_deg(clamp_angle(gCameras[CAM_DEFAULT].currentYaw + angle + 270.0f)) * 1000.0f)); - script->varTable[1] = EVT_FLOAT_TO_FIXED(posZ - (cos_deg(clamp_angle(gCameras[CAM_DEFAULT].currentYaw + angle + 270.0f)) * 1000.0f)); - script->varTable[2] = EVT_FLOAT_TO_FIXED(posX + (sin_deg(clamp_angle(gCameras[CAM_DEFAULT].currentYaw + angle + 90.0f)) * 1000.0f)); - script->varTable[3] = EVT_FLOAT_TO_FIXED(posZ - (cos_deg(clamp_angle(gCameras[CAM_DEFAULT].currentYaw + angle + 90.0f)) * 1000.0f)); + script->varTable[0] = EVT_FLOAT_TO_FIXED(posX + (sin_deg(clamp_angle(gCameras[CAM_DEFAULT].curYaw + angle + 270.0f)) * 1000.0f)); + script->varTable[1] = EVT_FLOAT_TO_FIXED(posZ - (cos_deg(clamp_angle(gCameras[CAM_DEFAULT].curYaw + angle + 270.0f)) * 1000.0f)); + script->varTable[2] = EVT_FLOAT_TO_FIXED(posX + (sin_deg(clamp_angle(gCameras[CAM_DEFAULT].curYaw + angle + 90.0f)) * 1000.0f)); + script->varTable[3] = EVT_FLOAT_TO_FIXED(posZ - (cos_deg(clamp_angle(gCameras[CAM_DEFAULT].curYaw + angle + 90.0f)) * 1000.0f)); return ApiStatus_DONE2; } diff --git a/src/world/area_trd/trd_08/trd_08_3_npc.c b/src/world/area_trd/trd_08/trd_08_3_npc.c index 53c9b789ea..045dd6b17a 100644 --- a/src/world/area_trd/trd_08/trd_08_3_npc.c +++ b/src/world/area_trd/trd_08/trd_08_3_npc.c @@ -62,7 +62,7 @@ EvtScript N(EVS_FireBar_Defeated) = { FireBarAISettings N(AISettings_FireBar_01) = { .centerPos = { -100, 0, 40 }, - .rotationRate = 8, + .rotRate = 8, .firstNpc = NPC_FireBar_1A, .npcCount = 4, .callback = N(FireBarAI_Callback), @@ -70,7 +70,7 @@ FireBarAISettings N(AISettings_FireBar_01) = { FireBarAISettings N(AISettings_FireBar_02) = { .centerPos = { 300, 0, -35 }, - .rotationRate = -8, + .rotRate = -8, .firstNpc = NPC_FireBar_2A, .npcCount = 4, .callback = N(FireBarAI_Callback), diff --git a/src/world/area_trd/trd_09/trd_09_4_demo.c b/src/world/area_trd/trd_09/trd_09_4_demo.c index 22600beb54..342ecd9e81 100644 --- a/src/world/area_trd/trd_09/trd_09_4_demo.c +++ b/src/world/area_trd/trd_09/trd_09_4_demo.c @@ -90,14 +90,14 @@ API_CALLABLE(N(SetupDemoScene)) { N(DemoInitState)++; break; case 3: - wPartnerNpc->pos.x = playerStatus->position.x - 30.0f; - wPartnerNpc->pos.z = playerStatus->position.z + 30.0f; + wPartnerNpc->pos.x = playerStatus->pos.x - 30.0f; + wPartnerNpc->pos.z = playerStatus->pos.z + 30.0f; partner_clear_player_tracking(wPartnerNpc); - partner_set_goal_pos(playerStatus->position.x, playerStatus->position.z); + partner_set_goal_pos(playerStatus->pos.x, playerStatus->pos.z); func_800EF3D4(0); set_npc_yaw(wPartnerNpc, 90.0f); playerStatus->targetYaw = 90.0f; - playerStatus->currentYaw = 90.0f; + playerStatus->curYaw = 90.0f; playerStatus->spriteFacingAngle = 0.0f; return ApiStatus_DONE2; } diff --git a/src/world/area_trd/trd_10/trd_10_2_npc.c b/src/world/area_trd/trd_10/trd_10_2_npc.c index 4cfc35f42a..f00317a5cb 100644 --- a/src/world/area_trd/trd_10/trd_10_2_npc.c +++ b/src/world/area_trd/trd_10/trd_10_2_npc.c @@ -3,7 +3,7 @@ extern EvtScript N(EVS_BossDefeated); API_CALLABLE(N(IsPartnerBombette)) { - if (gPlayerData.currentPartner == PARTNER_BOMBETTE) { + if (gPlayerData.curPartner == PARTNER_BOMBETTE) { script->varTable[0] = TRUE; } else { script->varTable[0] = FALSE; diff --git a/src/world/area_tst/tst_04/tst_04_1_main.c b/src/world/area_tst/tst_04/tst_04_1_main.c index 6dc3143ac6..a2850371f4 100644 --- a/src/world/area_tst/tst_04/tst_04_1_main.c +++ b/src/world/area_tst/tst_04/tst_04_1_main.c @@ -9,7 +9,7 @@ extern NpcGroupList N(DefaultNPCs); API_CALLABLE(N(PushGoompaTest)) { Npc* npc = get_npc_safe(NPC_Goompa); - if (npc != NULL && npc->currentFloor == COLLIDER_o3) { + if (npc != NULL && npc->curFloor == COLLIDER_o3) { f32 sinTheta; f32 cosTheta; f32 xTemp; diff --git a/src/world/area_tst/tst_04/tst_04_3_reflection.c b/src/world/area_tst/tst_04/tst_04_3_reflection.c index 0c24f09577..693f7bc0b3 100644 --- a/src/world/area_tst/tst_04/tst_04_3_reflection.c +++ b/src/world/area_tst/tst_04/tst_04_3_reflection.c @@ -27,20 +27,20 @@ void N(worker_render_player_reflection)(void) { entityModel = get_entity_model(get_shadow_by_index(playerStatus->shadowID)->entityModelID); entityModel->flags |= ENTITY_MODEL_FLAG_REFLECT; - get_screen_coords(gCurrentCamID, playerStatus->position.x, playerStatus->position.y, -playerStatus->position.z, + get_screen_coords(gCurrentCamID, playerStatus->pos.x, playerStatus->pos.y, -playerStatus->pos.z, &screenX, &screenY, &screenZ); renderTaskPtr->renderMode = playerStatus->renderMode; renderTaskPtr->appendGfxArg = playerStatus; renderTaskPtr->appendGfx = &N(appendGfx_test_player_reflection); - renderTaskPtr->distance = -screenZ; + renderTaskPtr->dist = -screenZ; queue_render_task(renderTaskPtr); } } void N(appendGfx_test_player_reflection)(void* data) { PlayerStatus* playerStatus = data; - f32 yaw = -gCameras[gCurrentCamID].currentYaw; + f32 yaw = -gCameras[gCurrentCamID].curYaw; Matrix4f main; Matrix4f translation; Matrix4f rotation; @@ -55,7 +55,7 @@ void N(appendGfx_test_player_reflection)(void* data) { guMtxCatF(main, rotation, main); guScaleF(scale, SPRITE_WORLD_SCALE_F, SPRITE_WORLD_SCALE_F, SPRITE_WORLD_SCALE_F); guMtxCatF(main, scale, main); - guTranslateF(translation, playerStatus->position.x, playerStatus->position.y, -playerStatus->position.z); + guTranslateF(translation, playerStatus->pos.x, playerStatus->pos.y, -playerStatus->pos.z); guMtxCatF(main, translation, main); spr_update_player_sprite(PLAYER_SPRITE_AUX1, playerStatus->trueAnimation, 1.0f); spr_draw_player_sprite(PLAYER_SPRITE_AUX1, 0, 0, NULL, main); diff --git a/src/world/area_tst/tst_11/tst_11_2_extra.c b/src/world/area_tst/tst_11/tst_11_2_extra.c index 6fc2f63025..11a4c87c9c 100644 --- a/src/world/area_tst/tst_11/tst_11_2_extra.c +++ b/src/world/area_tst/tst_11/tst_11_2_extra.c @@ -25,20 +25,20 @@ void N(test_reflection_worker_render_wall)(void) { entityModel = get_entity_model(get_shadow_by_index(playerStatus->shadowID)->entityModelID); entityModel->flags |= ENTITY_MODEL_FLAG_REFLECT; - get_screen_coords(gCurrentCamID, playerStatus->position.x, playerStatus->position.y, -playerStatus->position.z, + get_screen_coords(gCurrentCamID, playerStatus->pos.x, playerStatus->pos.y, -playerStatus->pos.z, &screenX, &screenY, &screenZ); renderTaskPtr->renderMode = playerStatus->renderMode; renderTaskPtr->appendGfxArg = playerStatus; renderTaskPtr->appendGfx = &N(appendGfx_test_reflection_wall); - renderTaskPtr->distance = -screenZ; + renderTaskPtr->dist = -screenZ; queue_render_task(renderTaskPtr); } } void N(appendGfx_test_reflection_wall)(void* data) { PlayerStatus* playerStatus = data; - f32 yaw = -gCameras[gCurrentCamID].currentYaw; + f32 yaw = -gCameras[gCurrentCamID].curYaw; Matrix4f main; Matrix4f translation; Matrix4f rotation; @@ -53,7 +53,7 @@ void N(appendGfx_test_reflection_wall)(void* data) { guMtxCatF(main, rotation, main); guScaleF(scale, SPRITE_WORLD_SCALE_F, SPRITE_WORLD_SCALE_F, SPRITE_WORLD_SCALE_F); guMtxCatF(main, scale, main); - guTranslateF(translation, playerStatus->position.x, playerStatus->position.y, -playerStatus->position.z); + guTranslateF(translation, playerStatus->pos.x, playerStatus->pos.y, -playerStatus->pos.z); guMtxCatF(main, translation, main); // draw sprite is handled differently in final version spr_update_player_sprite(PLAYER_SPRITE_AUX1, playerStatus->trueAnimation ^ SPRITE_ID_BACK_FACING, 1.0f); @@ -76,20 +76,20 @@ void N(test_reflection_worker_render_floor)(void) { entityModel = get_entity_model(get_shadow_by_index(playerStatus->shadowID)->entityModelID); entityModel->flags |= ENTITY_MODEL_FLAG_REFLECT; - get_screen_coords(gCurrentCamID, playerStatus->position.x, -playerStatus->position.y, playerStatus->position.z, + get_screen_coords(gCurrentCamID, playerStatus->pos.x, -playerStatus->pos.y, playerStatus->pos.z, &screenX, &screenY, &screenZ); renderTaskPtr->renderMode = playerStatus->renderMode; renderTaskPtr->appendGfxArg = playerStatus; renderTaskPtr->appendGfx = &N(appendGfx_test_reflection_floor); - renderTaskPtr->distance = -screenZ; + renderTaskPtr->dist = -screenZ; queue_render_task(renderTaskPtr); } } void N(appendGfx_test_reflection_floor)(void* data) { PlayerStatus* playerStatus = data; - f32 yaw = -gCameras[gCurrentCamID].currentYaw; + f32 yaw = -gCameras[gCurrentCamID].curYaw; s32 trueAnimation; Matrix4f sp20; Matrix4f sp60; @@ -105,7 +105,7 @@ void N(appendGfx_test_reflection_floor)(void* data) { guMtxCatF(sp20, spA0, sp20); guScaleF(spE0, SPRITE_WORLD_SCALE_D, -SPRITE_WORLD_SCALE_D, SPRITE_WORLD_SCALE_D); guMtxCatF(sp20, spE0, sp20); - guTranslateF(sp60, playerStatus->position.x, -playerStatus->position.y, playerStatus->position.z); + guTranslateF(sp60, playerStatus->pos.x, -playerStatus->pos.y, playerStatus->pos.z); guMtxCatF(sp20, sp60, sp20); spr_draw_player_sprite(PLAYER_SPRITE_AUX1, 0, 0, 0, sp20); guRotateF(spA0, yaw, 0.0f, -1.0f, 0.0f); @@ -117,7 +117,7 @@ void N(appendGfx_test_reflection_floor)(void* data) { guMtxCatF(sp20, spA0, sp20); guScaleF(spE0, SPRITE_WORLD_SCALE_D, SPRITE_WORLD_SCALE_D, SPRITE_WORLD_SCALE_D); guMtxCatF(sp20, spE0, sp20); - guTranslateF(sp60, playerStatus->position.x, playerStatus->position.y, 0.0f); + guTranslateF(sp60, playerStatus->pos.x, playerStatus->pos.y, 0.0f); guMtxCatF(sp20, sp60, sp20); trueAnimation = playerStatus->trueAnimation; set_player_imgfx_all(trueAnimation, IMGFX_SET_ALPHA, 255, 255, 255, 20, 0); diff --git a/src/world/area_tst/tst_13/tst_13_1_main.c b/src/world/area_tst/tst_13/tst_13_1_main.c index 53d43eada6..11d839b6c2 100644 --- a/src/world/area_tst/tst_13/tst_13_1_main.c +++ b/src/world/area_tst/tst_13/tst_13_1_main.c @@ -287,7 +287,7 @@ void N(build_gfx_floor)(void) { f32 x, y, z; N(BuildGfxCallCount)++; - guTranslateF(sp10, gPlayerStatus.position.x, 0.0f, gPlayerStatus.position.z); + guTranslateF(sp10, gPlayerStatus.pos.x, 0.0f, gPlayerStatus.pos.z); x = (sin_rad(N(BuildGfxCallCount) / 50.0f) * 0.5) + 0.5; y = SQ(cos_rad(N(BuildGfxCallCount) / 50.0f)) + 0.1; diff --git a/src/world/common/atomic/BetaFloorPanels.inc.c b/src/world/common/atomic/BetaFloorPanels.inc.c index fb3d785bc4..63694d3eb1 100644 --- a/src/world/common/atomic/BetaFloorPanels.inc.c +++ b/src/world/common/atomic/BetaFloorPanels.inc.c @@ -11,7 +11,7 @@ extern EvtScript N(EVS_BetaPanel_PoundNearby); API_CALLABLE(N(CheckShouldBreakFloor)) { PlayerStatus* playerStatus = &gPlayerStatus; s32* array = script->array; - f32 distance = dist2D(playerStatus->position.x, playerStatus->position.z, array[2], array[3]); + f32 distance = dist2D(playerStatus->pos.x, playerStatus->pos.z, array[2], array[3]); script->varTable[0] = 1; if ((playerStatus->actionState != ACTION_STATE_SPIN_POUND) @@ -28,7 +28,7 @@ API_CALLABLE(N(CheckShouldBreakFloor)) { API_CALLABLE(N(CheckShouldFlipFloor)) { PlayerStatus* playerStatus = &gPlayerStatus; f32 distance = dist2D( - playerStatus->position.x, playerStatus->position.z, + playerStatus->pos.x, playerStatus->pos.z, script->array[2], script->array[4]); script->varTable[0] = 0; diff --git a/src/world/common/atomic/CreateDarkness.inc.c b/src/world/common/atomic/CreateDarkness.inc.c index 211732bc25..779da10a83 100644 --- a/src/world/common/atomic/CreateDarkness.inc.c +++ b/src/world/common/atomic/CreateDarkness.inc.c @@ -9,10 +9,10 @@ API_CALLABLE(N(DarkRoomUpdate)) { script->functionTemp[1] = FALSE; } - set_screen_overlay_center_worldpos(SCREEN_LAYER_BACK, 1, playerStatus->position.x, playerStatus->position.y + 8.0f, playerStatus->position.z); + set_screen_overlay_center_worldpos(SCREEN_LAYER_BACK, 1, playerStatus->pos.x, playerStatus->pos.y + 8.0f, playerStatus->pos.z); if (gPartnerStatus.partnerActionState != PARTNER_ACTION_NONE) { - if (playerData->currentPartner == PARTNER_WATT) { + if (playerData->curPartner == PARTNER_WATT) { if (!script->functionTemp[1]) { script->functionTemp[1] = TRUE; sfx_play_sound(SOUND_WATT_REPEL_DARKNESS); @@ -22,7 +22,7 @@ API_CALLABLE(N(DarkRoomUpdate)) { script->functionTemp[0] = 90; } } - } else if (playerData->currentPartner == PARTNER_WATT) { + } else if (playerData->curPartner == PARTNER_WATT) { if (script->functionTemp[1]) { script->functionTemp[1] = FALSE; if (script->functionTemp[0] < 255) { diff --git a/src/world/common/atomic/MonitorMusicProximityTrigger.inc.c b/src/world/common/atomic/MonitorMusicProximityTrigger.inc.c index d11869b090..83cfbe0065 100644 --- a/src/world/common/atomic/MonitorMusicProximityTrigger.inc.c +++ b/src/world/common/atomic/MonitorMusicProximityTrigger.inc.c @@ -28,7 +28,7 @@ API_CALLABLE(N(MonitorMusicProximityTrigger)) { cond = TRUE; } } else { - dist = dist2D(gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z, trigger->pos.x, trigger->pos.z); + dist = dist2D(gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z, trigger->pos.x, trigger->pos.z); switch (script->functionTemp[1]) { case MUSIC_PROXIMITY_FAR: diff --git a/src/world/common/atomic/PushBlockGravity.inc.c b/src/world/common/atomic/PushBlockGravity.inc.c index 254ba05d3f..b2f0288a94 100644 --- a/src/world/common/atomic/PushBlockGravity.inc.c +++ b/src/world/common/atomic/PushBlockGravity.inc.c @@ -10,13 +10,13 @@ f32 N(PushBlockFallCurve)[] = { s32 N(push_block_handle_fall)(Entity* block, Evt* source) { - block->position.y = source->varTable[0] - (N(PushBlockFallCurve)[source->functionTemp[0]] * BLOCK_GRID_SIZE); + block->pos.y = source->varTable[0] - (N(PushBlockFallCurve)[source->functionTemp[0]] * BLOCK_GRID_SIZE); if (source->functionTemp[0] == 0) { - sfx_play_sound_at_position(SOUND_1DA, SOUND_SPACE_MODE_0, block->position.x, block->position.y, block->position.z); + sfx_play_sound_at_position(SOUND_1DA, SOUND_SPACE_MODE_0, block->pos.x, block->pos.y, block->pos.z); } if ((source->functionTemp[0] > 4) && (source->functionTemp[0] & 1)) { - fx_smoke_burst(1, block->position.x, block->position.y, block->position.z, 1.0f, 20); + fx_smoke_burst(1, block->pos.x, block->pos.y, block->pos.z, 1.0f, 20); } do { diff --git a/src/world/common/atomic/ToadHouse.inc.c b/src/world/common/atomic/ToadHouse.inc.c index 8a8ce3a282..77e4b6ea06 100644 --- a/src/world/common/atomic/ToadHouse.inc.c +++ b/src/world/common/atomic/ToadHouse.inc.c @@ -43,7 +43,7 @@ API_CALLABLE(N(ToadHouse_AwaitScriptComplete)) { } API_CALLABLE(N(ToadHouse_PartnerSuspendAbilityScript)) { - if (gPlayerData.currentPartner == PARTNER_NONE) { + if (gPlayerData.curPartner == PARTNER_NONE) { return ApiStatus_DONE2; } partner_suspend_ability_script(); @@ -87,7 +87,7 @@ API_CALLABLE(N(ToadHouse_PutPartnerAway)) { Bytecode* args = script->ptrReadPos; Bytecode saveToVar = *args++; - evt_set_variable(script, saveToVar, gPlayerData.currentPartner); + evt_set_variable(script, saveToVar, gPlayerData.curPartner); switch_to_partner(PARTNER_NONE); return ApiStatus_DONE2; } diff --git a/src/world/common/atomic/WhaleAnim.inc.c b/src/world/common/atomic/WhaleAnim.inc.c index 076694b49c..19d9059978 100644 --- a/src/world/common/atomic/WhaleAnim.inc.c +++ b/src/world/common/atomic/WhaleAnim.inc.c @@ -30,10 +30,10 @@ API_CALLABLE(N(UnkAngleFunc001)) { } y = npc->pos.y; - if (npc->currentAnim == ANIM_Kolorado_Still || - npc->currentAnim == ANIM_Kolorado_Walk || - npc->currentAnim == ANIM_Kolorado_Talk || - npc->currentAnim == ANIM_Kolorado_HurtStill) + if (npc->curAnim == ANIM_Kolorado_Still || + npc->curAnim == ANIM_Kolorado_Walk || + npc->curAnim == ANIM_Kolorado_Talk || + npc->curAnim == ANIM_Kolorado_HurtStill) { y += 2.0f * sin_deg(N(unkAngle1)); } @@ -54,7 +54,7 @@ void N(unkVtxFunc001)(Vtx* firstVertex, Vtx* copiedVertices, s32 numVertices, s3 s32 offset; wagPhase = *wagPhasePtr; - switch (get_npc_safe(NPC_Whale)->currentAnim) { + switch (get_npc_safe(NPC_Whale)->curAnim) { case ANIM_Kolorado_Still: case ANIM_Kolorado_Yell: case ANIM_Kolorado_IdleSad: diff --git a/src/world/common/complete/KnockDownPlayer.inc.c b/src/world/common/complete/KnockDownPlayer.inc.c index e39f8e7251..9262b72413 100644 --- a/src/world/common/complete/KnockDownPlayer.inc.c +++ b/src/world/common/complete/KnockDownPlayer.inc.c @@ -64,9 +64,9 @@ ApiStatus N(KnockdownCreate)(Evt* script) { data->rasterIndex = rasterIndex; data->width = gPlayerStatus.colliderHeight; data->height = gPlayerStatus.colliderDiameter; - data->pos.x = gPlayerStatus.position.x; - data->pos.y = gPlayerStatus.position.y; - data->pos.z = gPlayerStatus.position.z; + data->pos.x = gPlayerStatus.pos.x; + data->pos.y = gPlayerStatus.pos.y; + data->pos.z = gPlayerStatus.pos.z; data->rot.x = 0.0f; data->rot.y = 0.0f; data->rot.z = 0.0f; diff --git a/src/world/common/complete/LetterDelivery.inc.c b/src/world/common/complete/LetterDelivery.inc.c index 8e0f38776e..a825c4d8d5 100644 --- a/src/world/common/complete/LetterDelivery.inc.c +++ b/src/world/common/complete/LetterDelivery.inc.c @@ -37,7 +37,7 @@ API_CALLABLE(N(LetterDelivery_CalcLetterPos)) { s32 varZ = *args++; f32 z = evt_get_variable(script, varZ); Npc* partner = get_npc_unsafe(NPC_PARTNER); - f32 currentCamYaw = clamp_angle(gCameras[gCurrentCameraID].currentYaw + 180.0f); + f32 currentCamYaw = clamp_angle(gCameras[gCurrentCameraID].curYaw + 180.0f); add_vec2D_polar(&x, &z, 15.0f, partner->yaw); add_vec2D_polar(&x, &z, 10.0f, currentCamYaw); @@ -52,15 +52,15 @@ API_CALLABLE(N(LetterDelivery_CalcLetterPos)) { API_CALLABLE(N(LetterDelivery_SaveNpcAnim)) { Npc* npc = get_npc_unsafe(script->varTable[2]); - N(LetterDelivery_SavedNpcAnim) = npc->currentAnim; - npc->currentAnim = script->varTable[4]; + N(LetterDelivery_SavedNpcAnim) = npc->curAnim; + npc->curAnim = script->varTable[4]; return ApiStatus_DONE2; } API_CALLABLE(N(LetterDelivery_RestoreNpcAnim)) { Npc* npc = get_npc_unsafe(script->varTable[2]); - npc->currentAnim = N(LetterDelivery_SavedNpcAnim); + npc->curAnim = N(LetterDelivery_SavedNpcAnim); return ApiStatus_DONE2; } diff --git a/src/world/common/complete/Quizmo.inc.c b/src/world/common/complete/Quizmo.inc.c index dc42c9ae23..4f3613a2f3 100644 --- a/src/world/common/complete/Quizmo.inc.c +++ b/src/world/common/complete/Quizmo.inc.c @@ -225,7 +225,7 @@ void N(Quizmo_NPC_OnRender)(Npc* npc) { Camera* camera = &gCameras[gCurrentCamID]; if (npc->blur.quizmo->flags & 1) { - clamp_angle(-camera->currentYaw); + clamp_angle(-camera->curYaw); } } @@ -467,7 +467,7 @@ API_CALLABLE(N(Quizmo_AddViewRelativeOffset)) { Bytecode ourVarX = *args++; Bytecode outVarZ = *args++; - s32 cameraYaw = gCameras[gCurrentCameraID].currentYaw; + s32 cameraYaw = gCameras[gCurrentCameraID].curYaw; s32 outX = evt_get_variable(script, QUIZ_ARRAY_ORIGIN_X) - (z * cos_deg(cameraYaw)); s32 outZ = evt_get_variable(script, QUIZ_ARRAY_ORIGIN_Z) - (z * sin_deg(cameraYaw)); diff --git a/src/world/common/enemy/ai/AvoidPlayerAI.inc.c b/src/world/common/enemy/ai/AvoidPlayerAI.inc.c index 999be36816..3fc90e44de 100644 --- a/src/world/common/enemy/ai/AvoidPlayerAI.inc.c +++ b/src/world/common/enemy/ai/AvoidPlayerAI.inc.c @@ -25,12 +25,12 @@ void N(AvoidPlayerAI_ChaseInit)(Evt* script, MobileAISettings* npcAISettings, En f32 posZCCW; npc->duration = npcAISettings->chaseUpdateInterval / 2 + rand_int(npcAISettings->chaseUpdateInterval / 2 + 1); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_CHASE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_CHASE]; npc->moveSpeed = npcAISettings->chaseSpeed; detectedPlayer = FALSE; - yawFwd = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, - gPlayerStatusPtr->position.z) + 180.0f); + yawFwd = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, + gPlayerStatusPtr->pos.z) + 180.0f); deltaYaw = get_clamped_angle_diff(npc->yaw, yawFwd); if (npcAISettings->chaseTurnRate < fabsf(deltaYaw)) { yawFwd = npc->yaw; @@ -47,7 +47,7 @@ void N(AvoidPlayerAI_ChaseInit)(Evt* script, MobileAISettings* npcAISettings, En posYFwd = npc->pos.y; posZFwd = npc->pos.z; - yawFwd = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) + 180.0f); + yawFwd = clamp_angle(atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z) + 180.0f); distFwd = 0.0f; distCW = 0.0f; distCCW = 0.0f; @@ -78,7 +78,7 @@ void N(AvoidPlayerAI_ChaseInit)(Evt* script, MobileAISettings* npcAISettings, En } // unused - distToPlayer = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + distToPlayer = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); if ((distFwd < npc->moveSpeed * 1.5) && (distCW < npc->moveSpeed * 1.5) && (distCCW < npc->moveSpeed * 1.5) && (basic_ai_check_player_dist(territory, enemy, npcAISettings->alertRadius, npcAISettings->alertOffsetDist, 0))) { @@ -114,7 +114,7 @@ void N(AvoidPlayerAI_ChaseInit)(Evt* script, MobileAISettings* npcAISettings, En } if (detectedPlayer) { npc->duration = 10; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; } script->AI_TEMP_STATE = AI_STATE_CHASE; } @@ -126,11 +126,11 @@ void N(AvoidPlayerAI_Chase)(Evt* script, MobileAISettings* npcAISettings, EnemyD if (!basic_ai_check_player_dist(territory, enemy, npcAISettings->chaseRadius, npcAISettings->chaseOffsetDist, 1)) { fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteTemp); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->duration = 25; script->AI_TEMP_STATE = AI_STATE_LOSE_PLAYER; } else { - if (npc->currentAnim != enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]) { + if (npc->curAnim != enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]) { if (npc->moveSpeed < 4.0) { spawn_surface_effects(npc, SURFACE_INTERACT_WALK); } else { @@ -184,7 +184,7 @@ API_CALLABLE(N(AvoidPlayerAI_Main)) { if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) { script->functionTemp[0] = AI_STATE_WANDER_INIT; npc->duration = 0; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; if (!enemy->territory->wander.isFlying) { npc->flags |= NPC_FLAG_GRAVITY; diff --git a/src/world/common/enemy/ai/BulletBillAI.inc.c b/src/world/common/enemy/ai/BulletBillAI.inc.c index 9a33e409f7..a15c96aa39 100644 --- a/src/world/common/enemy/ai/BulletBillAI.inc.c +++ b/src/world/common/enemy/ai/BulletBillAI.inc.c @@ -68,7 +68,7 @@ API_CALLABLE(N(BulletBillAI_Main)) { npc->pos.x = NPC_DISPOSE_POS_X; npc->pos.y = NPC_DISPOSE_POS_Y; npc->pos.z = NPC_DISPOSE_POS_Z; - npc->rotation.y = 0.0f; + npc->rot.y = 0.0f; npc->duration = 0; npc->flags |= NPC_FLAG_INVISIBLE; npc->flags &= ~NPC_FLAG_DONT_UPDATE_SHADOW_Y; @@ -88,21 +88,21 @@ API_CALLABLE(N(BulletBillAI_Main)) { npc->pos.z = blasterNpc->pos.z + 1.0; npc->yaw = blasterNpc->yaw; npc->moveSpeed = aiSettings->chaseSpeed; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_RUN]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_RUN]; add_vec2D_polar(&npc->pos.x, &npc->pos.z, 25.0f, npc->yaw); if (npc->yaw < 180.0f) { npc->renderYaw = 180.0f; } else { npc->renderYaw = 0.0f; } - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_CHASE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_CHASE]; npc->duration = 300; npc->flags |= (NPC_FLAG_DIRTY_SHADOW | NPC_FLAG_DONT_UPDATE_SHADOW_Y); enable_npc_shadow(npc); script->AI_TEMP_STATE = AI_STATE_BULLET_FIRED; // fallthrough case AI_STATE_BULLET_FIRED: - deltaY = (npc->pos.y - gPlayerStatusPtr->position.y); + deltaY = (npc->pos.y - gPlayerStatusPtr->pos.y); if ((deltaY > 190.0) || (deltaY < -120.0)) { done = TRUE; break; @@ -122,7 +122,7 @@ API_CALLABLE(N(BulletBillAI_Main)) { } if (hitDetected) { - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_HIT]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_HIT]; ai_enemy_play_sound(npc, SOUND_B0000018, 0); fx_ring_blast(0, npc->pos.x, npc->pos.y + 5.0f, npc->pos.z + 1.0f, 0.05f, 20); fx_smoke_burst(0, npc->pos.x, npc->pos.y + 5.0f, npc->pos.z + 0.0f, 1.2f, 25); @@ -162,18 +162,18 @@ API_CALLABLE(N(BillBlasterAI_Main)) { if (isInitialCall) { script->AI_TEMP_STATE = AI_STATE_BLASTER_INIT; npc->duration = 30; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; enemy->flags |= ENEMY_FLAG_ACTIVE_WHILE_OFFSCREEN; disable_npc_shadow(npc); } - deltaY = npc->pos.y - gPlayerStatusPtr->position.y; + deltaY = npc->pos.y - gPlayerStatusPtr->pos.y; if ((deltaY > 190.0) || (deltaY < -80.0)) { return ApiStatus_BLOCK; } if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) { - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; if (enemy->aiSuspendTime != 0) { return ApiStatus_BLOCK; } @@ -195,7 +195,7 @@ API_CALLABLE(N(BillBlasterAI_Main)) { bulletEnemy->VAR_PROJECTILE_HITBOX_STATE = PROJECTILE_HITBOX_STATE_INIT; bulletEnemy->AI_VAR_BULLET_BLASTER = enemy->npcID; bulletEnemy->AI_VAR_BULLET_RANGE = enemy->AI_VAR_BLASTER_RANGE; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; npc->duration = 10; script->AI_TEMP_STATE = AI_STATE_BLASTER_FIRE; } else { @@ -208,7 +208,7 @@ API_CALLABLE(N(BillBlasterAI_Main)) { if (npc->duration > 0) { break; } - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; bulletEnemy = get_enemy(enemy->AI_VAR_BLASTER_BULLET); bulletEnemy->VAR_PROJECTILE_HITBOX_STATE = PROJECTILE_HITBOX_STATE_PRE; ai_enemy_play_sound(npc, SOUND_328, SOUND_PARAM_MORE_QUIET); diff --git a/src/world/common/enemy/ai/CleftAI.inc.c b/src/world/common/enemy/ai/CleftAI.inc.c index 2869258450..e48d053e9c 100644 --- a/src/world/common/enemy/ai/CleftAI.inc.c +++ b/src/world/common/enemy/ai/CleftAI.inc.c @@ -33,18 +33,18 @@ s32 N(CleftAI_CanSeePlayer)(Evt* script, MobileAISettings* aiSettings, EnemyDete if (ai_check_player_dist(enemy, 0, aiSettings->alertRadius, aiSettings->alertOffsetDist)) { seesPlayer = TRUE; } - if (clamp_angle(get_clamped_angle_diff(camera->currentYaw, npc->yaw)) < 180.0) { + if (clamp_angle(get_clamped_angle_diff(camera->curYaw, npc->yaw)) < 180.0) { angle = 90.0f; } else { angle = 270.0f; } - playerX = gPlayerStatusPtr->position.x; - playerZ = gPlayerStatusPtr->position.z; + playerX = gPlayerStatusPtr->pos.x; + playerZ = gPlayerStatusPtr->pos.z; if (fabsf(get_clamped_angle_diff(angle, atan2(npc->pos.x, npc->pos.z, playerX, playerZ))) > 75.0) { seesPlayer = FALSE; } - if (fabsf(npc->pos.y - gPlayerStatusPtr->position.y) >= 40.0f) { + if (fabsf(npc->pos.y - gPlayerStatusPtr->pos.y) >= 40.0f) { seesPlayer = FALSE; } if (gPartnerStatus.actingPartner == PARTNER_BOW) { @@ -62,7 +62,7 @@ void N(CleftAI_HidingInit)(Evt* script, MobileAISettings* aiSettings, EnemyDetec npc->collisionDiameter = 24; script->functionTemp[1] = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[8]; + npc->curAnim = enemy->animList[8]; script->AI_TEMP_STATE = AI_STATE_CLEFT_HIDING; } @@ -74,7 +74,7 @@ void N(CleftAI_Hiding)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVol if (script->functionTemp[1] <= 0) { script->functionTemp[1] = aiSettings->playerSearchInterval; if (basic_ai_check_player_dist(volume, enemy, aiSettings->alertRadius * 0.85, aiSettings->alertOffsetDist, FALSE)) { - npc->currentAnim = enemy->animList[9]; + npc->curAnim = enemy->animList[9]; fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteTemp); ai_enemy_play_sound(npc, SOUND_2F4, SOUND_PARAM_MORE_QUIET); npc->duration = 12; @@ -91,9 +91,9 @@ void N(CleftAI_PreAmbush)(Evt* script, MobileAISettings* aiSettings, EnemyDetect npc->duration--; if (npc->duration <= 0) { - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); enable_npc_shadow(npc); - npc->currentAnim = enemy->animList[10]; + npc->curAnim = enemy->animList[10]; npc->duration = 8; script->AI_TEMP_STATE = AI_STATE_CLEFT_AMBUSH; } @@ -104,7 +104,7 @@ void N(CleftAI_Ambush)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVol npc->duration--; if (npc->duration <= 0) { - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); npc->collisionHeight = 26; npc->collisionDiameter = 24; script->AI_TEMP_STATE = AI_STATE_CLEFT_FIND_PLAYER_INIT; @@ -116,7 +116,7 @@ void N(CleftAI_FindPlayerInit)(Evt* script, MobileAISettings* aiSettings, EnemyD Npc* npc = get_npc_unsafe(enemy->npcID); npc->yaw = clamp_angle(npc->yaw + rand_int(180) - 90.0f); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; script->functionTemp[1] = rand_int(1000) % 2 + 2; script->AI_TEMP_STATE = AI_STATE_CLEFT_FIND_PLAYER; } @@ -127,7 +127,7 @@ void N(CleftAI_FindPlayer)(Evt* script, MobileAISettings* aiSettings, EnemyDetec EffectInstance* var; if (basic_ai_check_player_dist(volume, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 0)) { - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); script->AI_TEMP_STATE = AI_STATE_CLEFT_CHASE_INIT; } else { npc->duration--; @@ -150,7 +150,7 @@ void N(CleftAI_RevUpInit)(Evt* script, MobileAISettings* aiSettings, EnemyDetect Npc* npc = get_npc_unsafe(enemy->npcID); npc->duration = enemy->varTable[10]; - npc->currentAnim = enemy->animList[13]; + npc->curAnim = enemy->animList[13]; script->AI_TEMP_STATE = AI_STATE_CLEFT_REV_UP; } @@ -158,7 +158,7 @@ void N(CleftAI_RevUp)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolu Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); if (npc->duration % 3 == 0) { fx_walking_dust(2, npc->pos.x, npc->pos.y, npc->pos.z + 2.0f, 0, 0); } @@ -170,8 +170,8 @@ void N(CleftAI_RevUp)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolu enemy->unk_10.z = npc->pos.z; enemy->hitboxIsActive = TRUE; npc->moveSpeed = aiSettings->chaseSpeed; - npc->duration = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, - gPlayerStatusPtr->position.z) / npc->moveSpeed + 0.9; + npc->duration = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, + gPlayerStatusPtr->pos.z) / npc->moveSpeed + 0.9; if (npc->duration < 15) { npc->duration = 15; } @@ -220,7 +220,7 @@ void N(CleftAI_LosePlayer)(Evt* script, MobileAISettings* aiSettings, EnemyDetec npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -235,7 +235,7 @@ void N(CleftAI_ReturnHome)(Evt* script, MobileAISettings* aiSettings, EnemyDetec Npc* npc = get_npc_unsafe(enemy->npcID); if (basic_ai_check_player_dist(volume, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 0)) { - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); script->AI_TEMP_STATE = AI_STATE_CLEFT_CHASE_INIT; } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z) <= npc->moveSpeed) { npc->duration = 10; @@ -256,7 +256,7 @@ void N(CleftAI_DisguiseInit)(Evt* script, MobileAISettings* aiSettings, EnemyDet if (npc->turnAroundYawAdjustment == 0 && npc->duration <= 0) { npc->duration = 8; - npc->currentAnim = enemy->animList[11]; + npc->curAnim = enemy->animList[11]; script->AI_TEMP_STATE = AI_STATE_CLEFT_DISGUISE; } } @@ -268,7 +268,7 @@ void N(CleftAI_Disguise)(Evt* script, MobileAISettings* aiSettings, EnemyDetectV npc->duration--; if (npc->duration <= 0) { npc->duration = 8; - npc->currentAnim = enemy->animList[14]; + npc->curAnim = enemy->animList[14]; script->AI_TEMP_STATE = AI_STATE_CLEFT_POST_DISGUISE; } } diff --git a/src/world/common/enemy/ai/ClubbaNappingAI.inc.c b/src/world/common/enemy/ai/ClubbaNappingAI.inc.c index 2202472c27..88ec360ddb 100644 --- a/src/world/common/enemy/ai/ClubbaNappingAI.inc.c +++ b/src/world/common/enemy/ai/ClubbaNappingAI.inc.c @@ -22,9 +22,9 @@ void N(ClubbaNappingAI_Init)(Evt* script, MobileAISettings* aiSettings, EnemyDet } if (npc->duration == 1) { - npc->currentAnim = enemy->animList[12]; + npc->curAnim = enemy->animList[12]; } else if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[10]; + npc->curAnim = enemy->animList[10]; npc->duration = 0; script->AI_TEMP_STATE = AI_STATE_NAPPING_CLUBBA_SLEEP; } @@ -52,15 +52,15 @@ void N(ClubbaNappingAI_Sleep)(Evt* script, MobileAISettings* aiSettings, EnemyDe shouldWakeUp = TRUE; } - if (playerData->currentPartner == PARTNER_KOOPER) { - if (gPartnerStatus.partnerActionState == playerData->currentPartner) { + if (playerData->curPartner == PARTNER_KOOPER) { + if (gPartnerStatus.partnerActionState == playerData->curPartner) { shouldWakeUp = TRUE; } } } - if (((playerData->currentPartner == PARTNER_GOOMBARIO) && (gPartnerStatus.partnerActionState != PARTNER_ACTION_NONE)) || - ((playerData->currentPartner == PARTNER_BOMBETTE) && (gPartnerStatus.partnerActionState == PARTNER_ACTION_BOMBETTE_2))) { + if (((playerData->curPartner == PARTNER_GOOMBARIO) && (gPartnerStatus.partnerActionState != PARTNER_ACTION_NONE)) || + ((playerData->curPartner == PARTNER_BOMBETTE) && (gPartnerStatus.partnerActionState == PARTNER_ACTION_BOMBETTE_2))) { posX = npc->pos.x; posZ = npc->pos.z; add_vec2D_polar(&posX, &posZ, 0.0f, npc->yaw); @@ -71,7 +71,7 @@ void N(ClubbaNappingAI_Sleep)(Evt* script, MobileAISettings* aiSettings, EnemyDe if (shouldWakeUp) { ai_enemy_play_sound(npc, SOUND_B000000E, 0); - npc->currentAnim = enemy->animList[11]; + npc->curAnim = enemy->animList[11]; npc->duration = 10; fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteTemp); ai_enemy_play_sound(npc, SOUND_2F4, SOUND_PARAM_MORE_QUIET); @@ -84,9 +84,9 @@ void N(ClubbaNappingAI_Sleep)(Evt* script, MobileAISettings* aiSettings, EnemyDe } else if (npc->duration == 57) { ai_enemy_play_sound(npc, SOUND_B000000D, 0); } else if (npc->duration == 59) { - npc->currentAnim = enemy->animList[12]; + npc->curAnim = enemy->animList[12]; } else if (npc->duration == 60) { - npc->currentAnim = enemy->animList[10]; + npc->curAnim = enemy->animList[10]; npc->duration = 0; } } @@ -108,7 +108,7 @@ void N(ClubbaNappingAI_LoiterInit)(Evt* script, MobileAISettings* aiSettings, En Npc* npc = get_npc_unsafe(enemy->npcID); npc->yaw = clamp_angle((npc->yaw + rand_int(180)) - 90.0f); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; script->functionTemp[1] = (rand_int(1000) % 2) + 2; // chose random number 2-3 script->AI_TEMP_STATE = AI_STATE_NAPPING_CLUBBA_LOITER; } @@ -120,7 +120,7 @@ void N(ClubbaNappingAI_Loiter)(Evt* script, MobileAISettings* aiSettings, EnemyD // try to catch sight of player if (basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 0)) { - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); script->AI_TEMP_STATE = AI_STATE_CHASE_INIT; return; } @@ -153,7 +153,7 @@ void N(ClubbaNappingAI_ReturnHomeInit)(Evt* script, MobileAISettings* aiSettings npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -169,11 +169,11 @@ void N(ClubbaNappingAI_ReturnHome)(Evt* script, MobileAISettings* aiSettings, En f32 currentYaw; if (basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 0)) { - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); script->AI_TEMP_STATE = AI_STATE_CHASE_INIT; } else if (dist2D(npc->pos.x, npc->pos.z, enemy->territory->wander.centerPos.x, enemy->territory->wander.centerPos.z) <= npc->moveSpeed) { - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->duration = 15; enemy->AI_VAR_NEXT_STATE = AI_STATE_NAPPING_CLUBBA_50; script->AI_TEMP_STATE = AI_STATE_NAPPING_CLUBBA_LOITER_INIT; @@ -219,7 +219,7 @@ API_CALLABLE(N(ClubbaNappingAI_Main)) { if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) { script->AI_TEMP_STATE = AI_STATE_NAPPING_CLUBBA_INIT; npc->duration = 30; - npc->currentAnim = enemy->animList[10]; + npc->curAnim = enemy->animList[10]; npc->flags &= ~NPC_FLAG_JUMPING; enemy->AI_VAR_ATTACK_STATE = MELEE_HITBOX_STATE_NONE; if (!enemy->territory->wander.isFlying) { @@ -230,7 +230,7 @@ API_CALLABLE(N(ClubbaNappingAI_Main)) { if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) { script->AI_TEMP_STATE = AI_STATE_SUSPEND; script->AI_TEMP_STATE_AFTER_SUSPEND = AI_RETURN_HOME_INIT; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; } enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND; } diff --git a/src/world/common/enemy/ai/ClubbaPatrolAI.inc.c b/src/world/common/enemy/ai/ClubbaPatrolAI.inc.c index 1df9f42c74..a5cdf02dae 100644 --- a/src/world/common/enemy/ai/ClubbaPatrolAI.inc.c +++ b/src/world/common/enemy/ai/ClubbaPatrolAI.inc.c @@ -25,7 +25,7 @@ API_CALLABLE(N(ClubbaPatrolAI_Main)) { if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) { script->AI_TEMP_STATE = AI_STATE_PATROL_INIT; npc->duration = 0; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; if (!enemy->territory->patrol.isFlying) { npc->flags |= NPC_FLAG_GRAVITY; diff --git a/src/world/common/enemy/ai/FireBarAI.inc.c b/src/world/common/enemy/ai/FireBarAI.inc.c index 52914e959e..e4f9fea6bd 100644 --- a/src/world/common/enemy/ai/FireBarAI.inc.c +++ b/src/world/common/enemy/ai/FireBarAI.inc.c @@ -41,7 +41,7 @@ API_CALLABLE(N(FireBarAI_Main)) { data->centerPos.x = settings->centerPos.x; data->centerPos.y = settings->centerPos.y; data->centerPos.z = settings->centerPos.z; - data->rotationRate = settings->rotationRate; + data->rotRate = settings->rotRate; data->firstNpc = settings->firstNpc; data->npcCount = settings->npcCount; data->callback = settings->callback; @@ -65,19 +65,19 @@ API_CALLABLE(N(FireBarAI_Main)) { npc->pos.x = data->centerPos.x + dX; npc->pos.y = data->centerPos.y; npc->pos.z = data->centerPos.z + dZ; - npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); } if (!(data->flags & 2) && !(playerStatus->flags & PS_FLAG_HAZARD_INVINCIBILITY)) { - dY = playerStatus->position.y - npc->pos.y; + dY = playerStatus->pos.y - npc->pos.y; if (partnerStatus->partnerActionState == PARTNER_ACTION_USE) { if (partnerStatus->actingPartner == PARTNER_LAKILESTER) { dY = partnerNpc->pos.y - npc->pos.y; } else if (partnerStatus->actingPartner == PARTNER_PARAKARRY) { - dY = (playerStatus->position.y - 10.0f) - npc->pos.y; + dY = (playerStatus->pos.y - 10.0f) - npc->pos.y; } } - dX = playerStatus->position.x - npc->pos.x; - dZ = playerStatus->position.z - npc->pos.z; + dX = playerStatus->pos.x - npc->pos.x; + dZ = playerStatus->pos.z - npc->pos.z; if ((fabsf(dY) < (npc->collisionHeight * 0.8f)) && (sqrtf(SQ(dX) + SQ(dZ)) <= ((npc->collisionDiameter * 0.5f * npc->scale.x * 0.5f) + (playerStatus->colliderDiameter * 0.5f * 0.5f)))) { hitDetected = 1; @@ -87,35 +87,35 @@ API_CALLABLE(N(FireBarAI_Main)) { if (playerStatus->flags & PS_FLAG_HAZARD_INVINCIBILITY) { hitDetected = -1; } - data->yaw += data->rotationRate; + data->yaw += data->rotRate; clampedYaw = clamp_angle(data->yaw); if (clampedYaw != data->yaw) { data->yaw = clampedYaw; sfx_play_sound_at_position(N(FireBar_Sounds)[data->soundIndex], SOUND_SPACE_MODE_0, data->centerPos.x, data->centerPos.y, data->centerPos.z); } - distToPlayer = dist2D(data->centerPos.x, data->centerPos.z, playerStatus->position.x, playerStatus->position.z); + distToPlayer = dist2D(data->centerPos.x, data->centerPos.z, playerStatus->pos.x, playerStatus->pos.z); distToNpc = dist2D(data->centerPos.x, data->centerPos.z, npc->pos.x, npc->pos.z) + (npc->collisionDiameter * 0.5f * npc->scale.x * 0.5f) + (playerStatus->colliderDiameter * 0.5f * 0.5f); tempPlayerDist = distToPlayer; // needed to match - angleToPlayer = atan2(data->centerPos.x, data->centerPos.z, playerStatus->position.x, playerStatus->position.z); + angleToPlayer = atan2(data->centerPos.x, data->centerPos.z, playerStatus->pos.x, playerStatus->pos.z); angleToNpc = atan2(data->centerPos.x, data->centerPos.z, npc->pos.x, npc->pos.z); deltaYaw = get_clamped_angle_diff(angleToPlayer, angleToNpc); if ((hitDetected > 0) && (playerStatus->actionState != ACTION_STATE_HIT_FIRE)) { playerStatus->hazardType = HAZARD_TYPE_FIRE_BAR; set_action_state(ACTION_STATE_HIT_FIRE); - sfx_play_sound_at_position(SOUND_E8, SOUND_SPACE_MODE_0, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z); + sfx_play_sound_at_position(SOUND_E8, SOUND_SPACE_MODE_0, playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z); gCurrentEncounter.battleTriggerCooldown = 45; playerStatus->blinkTimer = 45; - playerStatus->lastGoodPosition.x = playerStatus->position.x; - playerStatus->lastGoodPosition.y = playerStatus->position.y; - playerStatus->lastGoodPosition.z = playerStatus->position.z; + playerStatus->lastGoodPos.x = playerStatus->pos.x; + playerStatus->lastGoodPos.y = playerStatus->pos.y; + playerStatus->lastGoodPos.z = playerStatus->pos.z; data->soundIndex = 0; if (data->callback != NULL) { data->callback(data, FIRE_BAR_HIT); } } else if ((tempPlayerDist < distToNpc) && !(data->flags & 2) && (hitDetected == 0) && (playerStatus->actionState != ACTION_STATE_HIT_FIRE)) { - if (data->rotationRate > 0.0f) { + if (data->rotRate > 0.0f) { if (data->lastDeltaYaw < 0.0f) { if (deltaYaw > 0.0f) { data->soundIndex++; @@ -144,11 +144,11 @@ void N(FireBarAI_Callback)(FireBarData* data, s32 mode) { switch (mode) { case FIRE_BAR_SLOW_DOWN: if (data->flags & 2) { - data->rotationRate *= 0.95f; + data->rotRate *= 0.95f; } break; case FIRE_BAR_SPEED_UP: - data->rotationRate *= 1.12f; + data->rotRate *= 1.12f; if (data->soundIndex == 10) { Evt* script = start_script(&N(EVS_FireBar_Defeated), EVT_PRIORITY_1, 0); script->varTable[0] = data->firstNpc; @@ -157,7 +157,7 @@ void N(FireBarAI_Callback)(FireBarData* data, s32 mode) { } break; case FIRE_BAR_HIT: - data->rotationRate = abs(data->settings->rotationRate) * signF(-data->rotationRate); + data->rotRate = abs(data->settings->rotRate) * signF(-data->rotRate); break; } return; diff --git a/src/world/common/enemy/ai/FlyingAI.inc.c b/src/world/common/enemy/ai/FlyingAI.inc.c index 17ef9c66a8..cb1c00b79d 100644 --- a/src/world/common/enemy/ai/FlyingAI.inc.c +++ b/src/world/common/enemy/ai/FlyingAI.inc.c @@ -28,7 +28,7 @@ void N(FlyingAI_WanderInit)(Evt* script, MobileAISettings* aiSettings, EnemyDete } else { npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f); } - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; script->functionTemp[1] = 0; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; @@ -129,7 +129,7 @@ void N(FlyingAI_Wander)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVo if (aiSettings->playerSearchInterval >= 0) { if (script->functionTemp[1] <= 0) { script->functionTemp[1] = aiSettings->playerSearchInterval; - if (gPlayerStatusPtr->position.y < (npc->pos.y + npc->collisionHeight) + 10.0 && + if (gPlayerStatusPtr->pos.y < (npc->pos.y + npc->collisionHeight) + 10.0 && basic_ai_check_player_dist(territory, enemy, aiSettings->alertRadius, aiSettings->alertOffsetDist, 0) != 0) { EffectInstance* emoteTemp; @@ -188,7 +188,7 @@ void N(FlyingAI_LoiterInit)(Evt* script, MobileAISettings* aiSettings, EnemyDete npc->duration = (aiSettings->waitTime / 2) + rand_int((aiSettings->waitTime / 2) + 1); npc->yaw = clamp_angle(npc->yaw + rand_int(180) - 90.0f); - npc->currentAnim = *enemy->animList; + npc->curAnim = *enemy->animList; script->functionTemp[0] = 3; } @@ -229,7 +229,7 @@ void N(FlyingAI_Loiter)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVo } if (enemy->varTable[9] <= 0) { - if ((gPlayerStatusPtr->position.y < npc->pos.y + npc->collisionHeight + 10.0) + if ((gPlayerStatusPtr->pos.y < npc->pos.y + npc->collisionHeight + 10.0) && basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 1)) { fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &var); npc->moveToPos.y = npc->pos.y; @@ -264,8 +264,8 @@ void N(FlyingAI_JumpInit)(Evt* script, MobileAISettings* aiSettings, EnemyDetect PlayerStatus* playerStatus = gPlayerStatusPtr; npc->duration = 0; - npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; + npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; script->functionTemp[0] = AI_STATE_ALERT; } @@ -282,14 +282,14 @@ void N(FlyingAI_Jump)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolu void N(FlyingAI_ChaseInit)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolume* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); - f32 jumpVelocity = (f32)enemy->varTable[5] / 100.0; + f32 jumpVel = (f32)enemy->varTable[5] / 100.0; f32 jumpScale = (f32)enemy->varTable[6] / 100.0; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; - npc->jumpVelocity = jumpVelocity; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; + npc->jumpVel = jumpVel; npc->jumpScale = jumpScale; npc->moveSpeed = aiSettings->chaseSpeed; - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); enemy->varTable[2] = 0; @@ -330,14 +330,14 @@ void N(FlyingAI_LosePlayer)(Evt* script, MobileAISettings* aiSettings, EnemyDete f32 a = enemy->varTable[3]; f32 b = enemy->varTable[7]; - npc->jumpVelocity += npc->jumpScale; + npc->jumpVel += npc->jumpScale; temp_f20 = a / 100.0; temp_f22 = b / 100.0; npc_move_heading(npc, npc->moveSpeed, npc->yaw); - if (npc->jumpVelocity >= 0.0) { - npc->pos.y += npc->jumpVelocity; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_HIT]; + if (npc->jumpVel >= 0.0) { + npc->pos.y += npc->jumpVel; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_HIT]; enemy->hitboxIsActive = FALSE; if (!(npc->flags & NPC_FLAG_8)) { posX = npc->pos.x; @@ -357,11 +357,11 @@ void N(FlyingAI_LosePlayer)(Evt* script, MobileAISettings* aiSettings, EnemyDete } else if (npc->pos.y >= npc->moveToPos.y) { script->functionTemp[0] = 0; } - } else if (npc->jumpVelocity < 0.0) { + } else if (npc->jumpVel < 0.0) { npc->duration++; if (npc->duration >= aiSettings->chaseUpdateInterval) { npc->duration = 0; - angle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + angle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); deltaAngle = get_clamped_angle_diff(npc->yaw, angle); if (aiSettings->chaseTurnRate < fabsf(deltaAngle)) { angle = npc->yaw; @@ -375,11 +375,11 @@ void N(FlyingAI_LosePlayer)(Evt* script, MobileAISettings* aiSettings, EnemyDete } if (npc->flags & NPC_FLAG_8) { - if (npc->pos.y + npc->jumpVelocity < temp_f22) { + if (npc->pos.y + npc->jumpVel < temp_f22) { npc->pos.y = temp_f22; - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; } else { - npc->pos.y += npc->jumpVelocity; + npc->pos.y += npc->jumpVel; } return; } @@ -387,20 +387,20 @@ void N(FlyingAI_LosePlayer)(Evt* script, MobileAISettings* aiSettings, EnemyDete posX = npc->pos.x; posY = npc->pos.y + npc->collisionHeight; posZ = npc->pos.z; - posW = (fabsf(npc->jumpVelocity) + npc->collisionHeight) + 10.0; + posW = (fabsf(npc->jumpVel) + npc->collisionHeight) + 10.0; if (npc_raycast_down_sides(npc->collisionChannel, &posX, &posY, &posZ, &posW)) { - if (posW <= (npc->collisionHeight + fabsf(npc->jumpVelocity))) { - npc->jumpVelocity = 0.0f; + if (posW <= (npc->collisionHeight + fabsf(npc->jumpVel))) { + npc->jumpVel = 0.0f; npc->pos.y = posY; } else { - npc->pos.y += npc->jumpVelocity; + npc->pos.y += npc->jumpVel; } return; - } else if (fabsf(npc->jumpVelocity) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { - npc->pos.y = npc->pos.y + npc->jumpVelocity; + } else if (fabsf(npc->jumpVel) < ((npc->pos.y - temp_f22) + npc->collisionHeight)) { + npc->pos.y = npc->pos.y + npc->jumpVel; return; } - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; } } diff --git a/src/world/common/enemy/ai/FlyingMagikoopaAI.inc.c b/src/world/common/enemy/ai/FlyingMagikoopaAI.inc.c index 86d6905163..19140073e2 100644 --- a/src/world/common/enemy/ai/FlyingMagikoopaAI.inc.c +++ b/src/world/common/enemy/ai/FlyingMagikoopaAI.inc.c @@ -67,7 +67,7 @@ void N(FlyingMagikoopaAI_15)(Evt* arg0, MobileAISettings* arg1, EnemyDetectVolum randomDist = moveDist; } } else { - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); if (npc->yaw < 180.0) { baseYaw = (rand_int(10) + 90.0) - 5.0; } else { @@ -125,7 +125,7 @@ void N(FlyingMagikoopaAI_15)(Evt* arg0, MobileAISettings* arg1, EnemyDetectVolum enemy->varTable[3] = rand_int(10) + 35; npc->duration = 0; npc->moveSpeed = 3.0f; - npc->jumpVelocity = 1.4f; + npc->jumpVel = 1.4f; npc->jumpScale = 0.2f; arg0->functionTemp[0] = 0x10; } @@ -161,7 +161,7 @@ void N(FlyingMagikoopaAI_17)(Evt* script, MobileAISettings* aiSettings, EnemyDet npc->duration++; if (npc->duration == (enemy->varTable[3] - 8)) { - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); } if (limitY <= npc->pos.y) { npc->pos.y = limitY; @@ -193,14 +193,14 @@ void N(FlyingMagikoopaAI_21)(Evt* script, MobileAISettings* aiSettings, EnemyDet npc->duration--; if (npc->duration == 0) { - npc->currentAnim = enemy->animList[0]; + npc->curAnim = enemy->animList[0]; fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &emoteTemp); - npc->currentAnim = enemy->animList[0]; + npc->curAnim = enemy->animList[0]; npc->duration = 15; script->functionTemp[0] = 50; } else if ((N(MagikoopaAI_CanShootSpell)(script, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, territory) == 1) && (npc->turnAroundYawAdjustment == 0)) { ai_enemy_play_sound(npc, 0x20D4, 0); - npc->currentAnim = enemy->animList[8]; + npc->curAnim = enemy->animList[8]; posX = npc->pos.x; posY = npc->pos.y + 29.0f; posZ = npc->pos.z + 1.0f; @@ -217,7 +217,7 @@ void N(FlyingMagikoopaAI_22)(Evt* script, MobileAISettings* aiSettings, EnemyDet npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[9]; + npc->curAnim = enemy->animList[9]; npc->duration = 7; script->functionTemp[0] = 0x17; } @@ -234,7 +234,7 @@ void N(FlyingMagikoopaAI_23)(Evt* script, MobileAISettings* aiSettings, EnemyDet temp_s1 = N(MagikoopaAI_CanShootSpell)(script, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, territory); if (temp_s1 != 1) { fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &emoteTemp); - npc->currentAnim = enemy->animList[0]; + npc->curAnim = enemy->animList[0]; npc->duration = 15; script->functionTemp[0] = 50; } else { @@ -256,7 +256,7 @@ void N(FlyingMagikoopaAI_24)(Evt* script, MobileAISettings* aiSettings, EnemyDet npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[0]; + npc->curAnim = enemy->animList[0]; npc->duration = 3; script->AI_TEMP_STATE = 50; } @@ -361,7 +361,7 @@ API_CALLABLE(N(FlyingMagikoopaAI_Main)) { API_CALLABLE(N(FlyingMagikoopaAI_OnHitInit)) { Enemy* enemy = script->owner1.enemy; - evt_set_variable(script, LVar0, gCurrentEncounter.currentEnemy == enemy); + evt_set_variable(script, LVar0, gCurrentEncounter.curEnemy == enemy); return ApiStatus_DONE2; } @@ -370,7 +370,7 @@ API_CALLABLE(N(FlyingMagikoopaAI_OnHit)) { Npc* npc = get_npc_unsafe(enemy->npcID); if (enemy->varTable[0] == 2) { - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; npc->moveSpeed = 0.0f; } return ApiStatus_DONE2; diff --git a/src/world/common/enemy/ai/FlyingNoAttackAI.inc.c b/src/world/common/enemy/ai/FlyingNoAttackAI.inc.c index 00426b97a2..c290842683 100644 --- a/src/world/common/enemy/ai/FlyingNoAttackAI.inc.c +++ b/src/world/common/enemy/ai/FlyingNoAttackAI.inc.c @@ -14,10 +14,10 @@ void N(FlyingNoAttackAI_12)(Evt* script, MobileAISettings* aiSettings, EnemyDete f32 angleDiff; npc->duration = (aiSettings->chaseUpdateInterval / 2) + rand_int(aiSettings->chaseUpdateInterval / 2 + 1); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_CHASE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_CHASE]; npc->moveSpeed = aiSettings->chaseSpeed; - tempAngle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + tempAngle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); angleDiff = get_clamped_angle_diff(npc->yaw, tempAngle); if (aiSettings->chaseTurnRate < fabsf(angleDiff)) { @@ -44,7 +44,7 @@ void N(FlyingNoAttackAI_13)(Evt* script, MobileAISettings* aiSettings, EnemyDete if (basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 1) == 0) { fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &var); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->duration = 30; script->functionTemp[0] = 20; enemy->varTable[9] = 30; @@ -66,7 +66,7 @@ void N(FlyingNoAttackAI_13)(Evt* script, MobileAISettings* aiSettings, EnemyDete if (flag) { npc->pos.y = y + 1.0; } else { - temp_f6 = npc->pos.y - (gPlayerStatusPtr->position.y + 6.0); + temp_f6 = npc->pos.y - (gPlayerStatusPtr->pos.y + 6.0); if ((temp_f6 < 0.0) || (temp_f6 > 4.0)) { temp_f6 = -temp_f6; npc->pos.y += temp_f6 * 0.06; diff --git a/src/world/common/enemy/ai/GrooveGuyAI.inc.c b/src/world/common/enemy/ai/GrooveGuyAI.inc.c index fd79b9409c..90ee319775 100644 --- a/src/world/common/enemy/ai/GrooveGuyAI.inc.c +++ b/src/world/common/enemy/ai/GrooveGuyAI.inc.c @@ -21,20 +21,20 @@ void N(GrooveGuyAI_03)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVol case 0: enemy->varTable[0] = 1; enemy->varTable[1] = 0; - npc->currentAnim = ANIM_GrooveGuy_Anim0C; + npc->curAnim = ANIM_GrooveGuy_Anim0C; set_npc_yaw(npc, 270.0f); - npc->rotation.y = 0.0f; + npc->rot.y = 0.0f; // fallthrough case 1: phase = enemy->varTable[1] % 16; if (phase < 4) { - npc->currentAnim = ANIM_GrooveGuy_Anim0C; + npc->curAnim = ANIM_GrooveGuy_Anim0C; } else if (phase < 8) { - npc->currentAnim = ANIM_GrooveGuy_Anim0B; + npc->curAnim = ANIM_GrooveGuy_Anim0B; } else if (phase < 12) { - npc->currentAnim = ANIM_GrooveGuy_Anim0C; + npc->curAnim = ANIM_GrooveGuy_Anim0C; } else if (phase < 16) { - npc->currentAnim = ANIM_GrooveGuy_Anim0D; + npc->curAnim = ANIM_GrooveGuy_Anim0D; } enemy->varTable[1]++; if (enemy->varTable[1] >= 0x41) { @@ -44,13 +44,13 @@ void N(GrooveGuyAI_03)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVol case 2: enemy->varTable[0] = 3; enemy->varTable[1] = 0; - npc->rotation.y = 0.0f; - npc->currentAnim = ANIM_GrooveGuy_Anim0C; + npc->rot.y = 0.0f; + npc->curAnim = ANIM_GrooveGuy_Anim0C; // fallthrough case 3: - npc->rotation.y += 35.0; - if (npc->rotation.y > 360.0) { - npc->rotation.y -= 360.0; + npc->rot.y += 35.0; + if (npc->rot.y > 360.0) { + npc->rot.y -= 360.0; } enemy->varTable[1]++; if (enemy->varTable[1] >= 0x2E) { @@ -59,7 +59,7 @@ void N(GrooveGuyAI_03)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVol break; } if (enemy->varTable[0] == 4) { - npc->rotation.y = 0.0f; + npc->rot.y = 0.0f; set_npc_yaw(npc, 270.0f); script->functionTemp[0] = 0; } @@ -89,7 +89,7 @@ API_CALLABLE(N(GrooveGuyAI_Main)) { if (isInitialCall || enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) { script->functionTemp[0] = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; if (!enemy->territory->wander.isFlying) { diff --git a/src/world/common/enemy/ai/GuardAI.inc.c b/src/world/common/enemy/ai/GuardAI.inc.c index e5b6943cb4..a7ebddd6ff 100644 --- a/src/world/common/enemy/ai/GuardAI.inc.c +++ b/src/world/common/enemy/ai/GuardAI.inc.c @@ -26,7 +26,7 @@ void N(GuardAI_IdleInit)(Evt* script, GuardAISettings* aiSettings, EnemyDetectVo Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; script->AI_TEMP_STATE = AI_STATE_GUARD_IDLE; if (enemy->flags & ENEMY_FLAG_100000) { @@ -48,7 +48,7 @@ void N(GuardAI_Idle)(Evt* script, GuardAISettings* aiSettings, EnemyDetectVolume if (aiSettings->playerSearchInterval >= 0 && basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 0)) { fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteTemp); ai_enemy_play_sound(npc, SOUND_2F4, SOUND_PARAM_MORE_QUIET); - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); if (!(enemy->npcSettings->actionFlags & AI_ACTION_JUMP_WHEN_SEE_PLAYER)) { script->AI_TEMP_STATE = AI_STATE_CHASE_INIT; @@ -61,7 +61,7 @@ void N(GuardAI_Idle)(Evt* script, GuardAISettings* aiSettings, EnemyDetectVolume void N(GuardAI_AlertInit)(Evt* script, GuardAISettings* aiSettings, EnemyDetectVolume* territory) { Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID); - npc->jumpVelocity = 10.0f; + npc->jumpVel = 10.0f; npc->jumpScale = 2.0f; npc->moveToPos.y = npc->pos.y; npc->flags |= NPC_FLAG_JUMPING; @@ -71,12 +71,12 @@ void N(GuardAI_AlertInit)(Evt* script, GuardAISettings* aiSettings, EnemyDetectV void N(GuardAI_Alert)(Evt* script, GuardAISettings* aiSettings, EnemyDetectVolume* territory) { Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID); - npc->pos.y += npc->jumpVelocity; - npc->jumpVelocity -= npc->jumpScale; + npc->pos.y += npc->jumpVel; + npc->jumpVel -= npc->jumpScale; if (!(npc->pos.y > npc->moveToPos.y)) { npc->pos.y = npc->moveToPos.y; - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; npc->flags &= ~NPC_FLAG_JUMPING; script->AI_TEMP_STATE = AI_STATE_CHASE_INIT; } @@ -89,10 +89,10 @@ void N(GuardAI_ChaseInit)(Evt* script, GuardAISettings* aiSettings, EnemyDetectV f32 angleDiff; npc->duration = (aiSettings->chaseUpdateInterval / 2) + rand_int(aiSettings->chaseUpdateInterval / 2 + 1); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_CHASE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_CHASE]; npc->moveSpeed = aiSettings->chaseSpeed; - tempAngle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + tempAngle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); angleDiff = get_clamped_angle_diff(npc->yaw, tempAngle); if (aiSettings->chaseTurnRate < fabsf(angleDiff)) { @@ -116,7 +116,7 @@ void N(GuardAI_Chase)(Evt* script, GuardAISettings* aiSettings, EnemyDetectVolum if (!basic_ai_check_player_dist(arg2, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 1)) { fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteTemp); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->duration = 25; script->AI_TEMP_STATE = AI_STATE_LOSE_PLAYER; } else { @@ -142,7 +142,7 @@ void N(GuardAI_ReturnHomeInit)(Evt* script, GuardAISettings* aiSettings, EnemyDe Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; if (enemy->territory->wander.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->chaseSpeed * 0.3; } else { @@ -163,7 +163,7 @@ void N(GuardAI_ReturnHome)(Evt* script, GuardAISettings* aiSettings, EnemyDetect if (basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 0)) { fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, (f32) npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteTemp); ai_enemy_play_sound(npc, SOUND_2F4, SOUND_PARAM_MORE_QUIET); - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); if (enemy->npcSettings->actionFlags & AI_ACTION_JUMP_WHEN_SEE_PLAYER) { script->AI_TEMP_STATE = AI_STATE_ALERT_INIT; } else { @@ -209,7 +209,7 @@ API_CALLABLE(N(GuardAI_Main)) { script->AI_TEMP_STATE = AI_STATE_GUARD_IDLE_INIT; npc->duration = 0; enemy->varTable[0] = npc->yaw; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; if (!(enemy->territory->wander.isFlying)) { diff --git a/src/world/common/enemy/ai/HoppingAI.inc.c b/src/world/common/enemy/ai/HoppingAI.inc.c index 4347e07bb5..a8fa208810 100644 --- a/src/world/common/enemy/ai/HoppingAI.inc.c +++ b/src/world/common/enemy/ai/HoppingAI.inc.c @@ -10,7 +10,7 @@ void N(HoppingAI_HopInit)(Evt* script, MobileAISettings* aiSettings, EnemyDetect basic_ai_wander_init(script, aiSettings, territory); npc->flags |= NPC_FLAG_JUMPING; - npc->jumpVelocity = (rand_int(45) / 10.0) + 8.0; + npc->jumpVel = (rand_int(45) / 10.0) + 8.0; npc->jumpScale = 1.5f; ai_enemy_play_sound(npc, SOUND_B0000017, 0); @@ -52,7 +52,7 @@ void N(HoppingAI_Hop)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolu EffectInstance* emoteTemp; fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteTemp); ai_enemy_play_sound(npc, SOUND_2F4, SOUND_PARAM_MORE_QUIET); - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); script->AI_TEMP_STATE = 12; return; } @@ -83,16 +83,16 @@ void N(HoppingAI_Hop)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolu } } - if (npc->jumpVelocity < 0.0) { + if (npc->jumpVel < 0.0) { posX = npc->pos.x; posY = npc->pos.y + 13.0; posZ = npc->pos.z; - hitDepth = fabsf(npc->jumpVelocity) + 16.0; + hitDepth = fabsf(npc->jumpVel) + 16.0; if (npc_raycast_down_sides(npc->collisionChannel, &posX, &posY, &posZ, &hitDepth) && - hitDepth <= fabsf(npc->jumpVelocity) + 13.0) + hitDepth <= fabsf(npc->jumpVel) + 13.0) { - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; npc->pos.y = posY; npc->flags &= ~NPC_FLAG_JUMPING; script->AI_TEMP_STATE = 2; @@ -108,8 +108,8 @@ void N(HoppingAI_Hop)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolu return; } } - npc->pos.y += npc->jumpVelocity; - npc->jumpVelocity -= npc->jumpScale; + npc->pos.y += npc->jumpVel; + npc->jumpVel -= npc->jumpScale; } void N(HoppingAI_LoiterInit)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolume* territory) { @@ -118,7 +118,7 @@ void N(HoppingAI_LoiterInit)(Evt* script, MobileAISettings* aiSettings, EnemyDet npc->duration = (aiSettings->waitTime / 2) + rand_int((aiSettings->waitTime / 2) + 1); npc->yaw = clamp_angle(npc->yaw + rand_int(180) - 90.0f); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; script->AI_TEMP_STATE = 3; } @@ -130,7 +130,7 @@ void N(HoppingAI_Loiter)(Evt* script, MobileAISettings* aiSettings, EnemyDetectV EffectInstance* emoteTemp; fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteTemp); ai_enemy_play_sound(npc, SOUND_2F4, SOUND_PARAM_MORE_QUIET); - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); script->AI_TEMP_STATE = 12; } else if (npc->turnAroundYawAdjustment == 0) { npc->duration--; @@ -151,9 +151,9 @@ void N(HoppingAI_ChaseInit)(Evt* script, MobileAISettings* aiSettings, EnemyDete basic_ai_chase_init(script, aiSettings, territory); enemy->flags |= ENEMY_FLAG_800; - enemy->jumpVelocity = rand_int(5) + 10.0; + enemy->jumpVel = rand_int(5) + 10.0; enemy->jumpScale = 1.5f; - enemy->yaw = atan2(enemy->pos.x, enemy->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + enemy->yaw = atan2(enemy->pos.x, enemy->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); enemy->moveSpeed = aiSettings->chaseSpeed; script->AI_TEMP_STATE = 13; ai_enemy_play_sound(enemy, SOUND_B0000017, 0); @@ -179,7 +179,7 @@ void N(HoppingAI_Chase)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVo } } - if (npc->jumpVelocity < 0.0) { + if (npc->jumpVel < 0.0) { posX = npc->pos.x; groundY = 100.0f; posZ = npc->pos.z; @@ -189,9 +189,9 @@ void N(HoppingAI_Chase)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVo posX = npc->pos.x; posY = npc->pos.y + 13.0; posZ = npc->pos.z; - hitDepth = fabsf(npc->jumpVelocity) + 16.0; - if (npc_raycast_down_sides(npc->collisionChannel, &posX, &posY, &posZ, &hitDepth) && hitDepth <= fabsf(npc->jumpVelocity) + 13.0) { - npc->jumpVelocity = 0.0f; + hitDepth = fabsf(npc->jumpVel) + 16.0; + if (npc_raycast_down_sides(npc->collisionChannel, &posX, &posY, &posZ, &hitDepth) && hitDepth <= fabsf(npc->jumpVel) + 13.0) { + npc->jumpVel = 0.0f; npc->pos.y = posY; npc->flags &= ~NPC_FLAG_JUMPING; fx_walking_dust(2, npc->pos.x, npc->pos.y, npc->pos.z, 0.0f, 0.0f); @@ -205,8 +205,8 @@ void N(HoppingAI_Chase)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVo return; } } - npc->pos.y += npc->jumpVelocity; - npc->jumpVelocity -= npc->jumpScale; + npc->pos.y += npc->jumpVel; + npc->jumpVel -= npc->jumpScale; } void N(HoppingAI_LosePlayer)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolume* territory) { diff --git a/src/world/common/enemy/ai/KoopaPatrolAI.inc.c b/src/world/common/enemy/ai/KoopaPatrolAI.inc.c index d91285c1ee..7e47002bfb 100644 --- a/src/world/common/enemy/ai/KoopaPatrolAI.inc.c +++ b/src/world/common/enemy/ai/KoopaPatrolAI.inc.c @@ -32,7 +32,7 @@ API_CALLABLE(N(KoopaPatrolAI_Main)) { npc->duration = 0; script->functionTemp[0] = 0; enemy->hitboxIsActive = FALSE; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; npc->collisionHeight = enemy->varTable[6]; enemy->instigatorValue = 0; diff --git a/src/world/common/enemy/ai/LakituAI.inc.c b/src/world/common/enemy/ai/LakituAI.inc.c index 96190a066d..85d6ffa811 100644 --- a/src/world/common/enemy/ai/LakituAI.inc.c +++ b/src/world/common/enemy/ai/LakituAI.inc.c @@ -215,14 +215,14 @@ s32 N(LakituAI_Main)(Evt* script, s32 isInitialCall) { } if (script->AI_TEMP_STATE == AI_STATE_CHASE_INIT) { - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); enemy->varTable[4] = N(LakituAI_GetAvailableSpiny)(); if (enemy->varTable[4] >= 0) { spinyEnemy = get_enemy(enemy->varTable[4]); spinyEnemy->varTable[10] = 1; spinyEnemy->varTable[11] = enemy->npcID; npc->duration = 15; - npc->currentAnim = ANIM_Lakitu_Anim14; + npc->curAnim = ANIM_Lakitu_Anim14; script->AI_TEMP_STATE = 30; } } @@ -255,7 +255,7 @@ s32 N(LakituAI_Main)(Evt* script, s32 isInitialCall) { if (npc->duration > 0) { break; } - npc->currentAnim = ANIM_Lakitu_Anim15; + npc->curAnim = ANIM_Lakitu_Anim15; spinyEnemy = get_enemy(enemy->varTable[4]); spinyEnemy->varTable[10] = 3; npc->duration = 10; @@ -281,8 +281,8 @@ s32 N(LakituAI_Main)(Evt* script, s32 isInitialCall) { f32 playerDist; f32 lerpDist; - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - playerDist = dist2D(gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z, npc->pos.x, npc->pos.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); + playerDist = dist2D(gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z, npc->pos.x, npc->pos.z); if (!is_point_within_region(territoryPtr->shape, territoryPtr->pointX, territoryPtr->pointZ, npc->pos.x, npc->pos.z, diff --git a/src/world/common/enemy/ai/MagikoopaAI.inc.c b/src/world/common/enemy/ai/MagikoopaAI.inc.c index 821e4b2f30..a92b842635 100644 --- a/src/world/common/enemy/ai/MagikoopaAI.inc.c +++ b/src/world/common/enemy/ai/MagikoopaAI.inc.c @@ -21,7 +21,7 @@ void N(MagikoopaAI_00)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVol npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_INVISIBLE; npc->duration = 0; script->AI_TEMP_STATE = 1; @@ -75,12 +75,12 @@ void N(MagikoopaAI_06)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVol void N(MagikoopaAI_10)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolume* territory) { Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); - f32 dist = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + f32 dist = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); f32 posX, posY, posZ; enemy->varTable[0] = 1; - npc->currentAnim = enemy->animList[8]; - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->curAnim = enemy->animList[8]; + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); npc->flags &= ~NPC_FLAG_INVISIBLE; npc->scale.x = 0.1f; npc->scale.y = 0.1f; @@ -160,16 +160,16 @@ void N(MagikoopaAI_21)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVol npc->duration--; if (npc->duration == 0) { - npc->currentAnim = enemy->animList[0]; + npc->curAnim = enemy->animList[0]; fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 12, &emoteTemp); - npc->currentAnim = enemy->animList[0]; + npc->curAnim = enemy->animList[0]; npc->duration = 0xF; script->AI_TEMP_STATE = 0; return; } if (N(MagikoopaAI_CanShootSpell)(script, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, territory) == 1) { ai_enemy_play_sound(npc, SOUND_SPELL_CAST1, 0); - npc->currentAnim = enemy->animList[8]; + npc->curAnim = enemy->animList[8]; posX = npc->pos.x; posY = npc->pos.y + 32.0f; posZ = npc->pos.z + 1.0f; @@ -186,7 +186,7 @@ void N(MagikoopaAI_22)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVol temp_v0->duration--; if (temp_v0->duration <= 0) { - temp_v0->currentAnim = temp_s0->animList[9]; + temp_v0->curAnim = temp_s0->animList[9]; temp_v0->duration = 9; script->AI_TEMP_STATE = 0x17; } @@ -203,7 +203,7 @@ void N(MagikoopaAI_23)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVol projectileEnemy = N(MagikoopaAI_CanShootSpell)(script, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, territory); if (projectileEnemy != 1) { fx_emote(2, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xC, &emoteTemp); - npc->currentAnim = enemy->animList[0]; + npc->curAnim = enemy->animList[0]; npc->duration = 15; script->AI_TEMP_STATE = 0; } else { @@ -221,7 +221,7 @@ void N(MagikoopaAI_24)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVol npc->duration--; if (npc->duration <= 0) { - npc->currentAnim = enemy->animList[0]; + npc->curAnim = enemy->animList[0]; npc->duration = 3; script->AI_TEMP_STATE = 0; } @@ -249,7 +249,7 @@ API_CALLABLE(N(MagikoopaAI_Main)) { territory.detectFlags = 0; if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) { - npc->currentAnim = enemy->animList[0]; + npc->curAnim = enemy->animList[0]; npc->flags &= ~NPC_FLAG_JUMPING; npc->flags |= NPC_FLAG_200000; enemy->flags |= ENEMY_FLAG_ACTIVE_WHILE_OFFSCREEN; @@ -320,7 +320,7 @@ API_CALLABLE(N(MagikoopaAI_OnPlayerFled)) { Npc* npc = get_npc_unsafe(enemy->npcID); npc->alpha = 255; - npc->currentAnim = enemy->animList[2]; + npc->curAnim = enemy->animList[2]; npc->duration = 0; script->functionTemp[0] = 0; return ApiStatus_DONE2; @@ -329,7 +329,7 @@ API_CALLABLE(N(MagikoopaAI_OnPlayerFled)) { API_CALLABLE(N(MagikoopaAI_OnHitInit)) { Enemy* enemy = script->owner1.enemy; - evt_set_variable(script, LVar0, gCurrentEncounter.currentEnemy == enemy); + evt_set_variable(script, LVar0, gCurrentEncounter.curEnemy == enemy); return ApiStatus_DONE2; } @@ -338,7 +338,7 @@ API_CALLABLE(N(MagikoopaAI_OnHit)) { Npc* npc = get_npc_unsafe(enemy->npcID); if (enemy->varTable[0] == 2) { - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; npc->moveSpeed = 0.0f; } return ApiStatus_DONE2; diff --git a/src/world/common/enemy/ai/MagikoopaSpellAI.inc.c b/src/world/common/enemy/ai/MagikoopaSpellAI.inc.c index 9eb3f2bfe4..18626fd89a 100644 --- a/src/world/common/enemy/ai/MagikoopaSpellAI.inc.c +++ b/src/world/common/enemy/ai/MagikoopaSpellAI.inc.c @@ -10,18 +10,18 @@ s32 N(MagikoopaAI_CanShootSpell)(Evt* script, f32 arg1, f32 arg2, EnemyDetectVol f32 angle; f32 t1; - if (clamp_angle(get_clamped_angle_diff(camera->currentYaw, npc->yaw)) < 180.0) { + if (clamp_angle(get_clamped_angle_diff(camera->curYaw, npc->yaw)) < 180.0) { angle = 90.0f; } else { angle = 270.0f; } - t1 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + t1 = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); if (fabsf(get_clamped_angle_diff(angle, t1)) > 75.0) { return -1; } - t1 = atan2(0.0f, npc->pos.y, fabsf(npc->pos.x - gPlayerStatusPtr->position.x), gPlayerStatusPtr->position.y); + t1 = atan2(0.0f, npc->pos.y, fabsf(npc->pos.x - gPlayerStatusPtr->pos.x), gPlayerStatusPtr->pos.y); if (fabsf(t1 - 90.0) > 70.0) { return -1; } @@ -90,20 +90,20 @@ API_CALLABLE(N(MagikoopaAI_SpellMain)) { enemy->unk_10.z = npc1->pos.z; npc1->moveSpeed = 3.6f; - t1 = fabsf(npc1->pos.x - gPlayerStatusPtr->position.x); - t2 = atan2(0.0f, npc1->pos.y, t1, (gPlayerStatusPtr->position.y + 10.0)) - 90.0; - npc1->jumpVelocity = cosine(t2) * npc1->moveSpeed; - npc1->yaw = atan2(npc1->pos.x, npc1->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + t1 = fabsf(npc1->pos.x - gPlayerStatusPtr->pos.x); + t2 = atan2(0.0f, npc1->pos.y, t1, (gPlayerStatusPtr->pos.y + 10.0)) - 90.0; + npc1->jumpVel = cosine(t2) * npc1->moveSpeed; + npc1->yaw = atan2(npc1->pos.x, npc1->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); duration = dist3D(npc1->pos.x, npc1->pos.y, npc1->pos.z, - gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.y + 10.0, - gPlayerStatusPtr->position.z) / npc1->moveSpeed; + gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.y + 10.0, + gPlayerStatusPtr->pos.z) / npc1->moveSpeed; if (duration <= 0) { duration = 1; } enemy->varTable[3] = (s32)fx_shape_spell(0, npc1->pos.x, npc1->pos.y + 14.0f, npc1->pos.z, - gPlayerStatusPtr->position.x, - gPlayerStatusPtr->position.y + 10.0f + 14.0f, - gPlayerStatusPtr->position.z, duration); + gPlayerStatusPtr->pos.x, + gPlayerStatusPtr->pos.y + 10.0f + 14.0f, + gPlayerStatusPtr->pos.z, duration); npc1->duration = duration; script->functionTemp[0] = 2; } @@ -115,12 +115,12 @@ API_CALLABLE(N(MagikoopaAI_SpellMain)) { } if (timer == 0) { npc_move_heading(npc1, npc1->moveSpeed, npc1->yaw); - npc1->pos.y += npc1->jumpVelocity; + npc1->pos.y += npc1->jumpVel; break; } // fallthrough case 3: - npc1->jumpVelocity = 0.0f; + npc1->jumpVel = 0.0f; npc1->moveSpeed = 0.0f; npc1->pos.y -= npc1->collisionHeight * 0.5; enemy->varTable[0] = 3; diff --git a/src/world/common/enemy/ai/MeleeHitbox.inc.c b/src/world/common/enemy/ai/MeleeHitbox.inc.c index b742edfdc0..24baea7dbe 100644 --- a/src/world/common/enemy/ai/MeleeHitbox.inc.c +++ b/src/world/common/enemy/ai/MeleeHitbox.inc.c @@ -13,7 +13,7 @@ void N(MeleeHitbox_30)(Evt* script) { if (npc->turnAroundYawAdjustment == 0) { enemy->AI_VAR_ATTACK_STATE = MELEE_HITBOX_STATE_PRE; npc->duration = enemy->AI_VAR_MELEE_PRE_TIME; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; script->AI_TEMP_STATE = AI_STATE_MELEE_HITBOX_PRE; } } @@ -26,7 +26,7 @@ void N(MeleeHitbox_31)(Evt* script) { if (npc->duration <= 0) { enemy->AI_VAR_ATTACK_STATE = MELEE_HITBOX_STATE_ACTIVE; npc->duration = enemy->AI_VAR_MELEE_HIT_TIME; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_HIT]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_HIT]; script->AI_TEMP_STATE = AI_STATE_MELEE_HITBOX_ACTIVE; } } @@ -39,7 +39,7 @@ void N(MeleeHitbox_32)(Evt* script) { npc->duration--; if (npc->duration <= 0) { enemy->AI_VAR_ATTACK_STATE = MELEE_HITBOX_STATE_POST; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->duration = enemy->AI_VAR_MELEE_MISS_TIME; if (enemy->AI_VAR_MELEE_MISS_TIME >= 8) { fx_emote(EMOTE_FRUSTRATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, enemy->AI_VAR_MELEE_MISS_TIME - 1, &emoteTemp); @@ -67,22 +67,22 @@ s32 N(MeleeHitbox_CanSeePlayer)(Evt* script) { f32 angle; s32 ret = TRUE; - if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) > hitboxEnemy->AI_VAR_HITNPC_2) { + if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z) > hitboxEnemy->AI_VAR_HITNPC_2) { ret = FALSE; } - if (clamp_angle(get_clamped_angle_diff(camera->currentYaw, npc->yaw)) < 180.0) { + if (clamp_angle(get_clamped_angle_diff(camera->curYaw, npc->yaw)) < 180.0) { angle = 90.0f; } else { angle = 270.0f; } - if (fabsf(get_clamped_angle_diff(angle, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, - gPlayerStatusPtr->position.z))) > hitboxEnemy->AI_VAR_HITNPC_3) { + if (fabsf(get_clamped_angle_diff(angle, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, + gPlayerStatusPtr->pos.z))) > hitboxEnemy->AI_VAR_HITNPC_3) { ret = FALSE; } - if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - gPlayerStatusPtr->position.y)) { + if ((2.0 * npc->collisionHeight) <= fabsf(npc->pos.y - gPlayerStatusPtr->pos.y)) { ret = FALSE; } @@ -147,7 +147,7 @@ API_CALLABLE(N(MeleeHitbox_Main)) { hitboxNpc->pos.z = posZ; hitboxEnemy->unk_10.z = hitboxNpc->pos.z; - hitboxNpc->yaw = atan2(hitboxNpc->pos.x, hitboxNpc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + hitboxNpc->yaw = atan2(hitboxNpc->pos.x, hitboxNpc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); hitboxEnemy->flags &= ~(ENEMY_FLAG_100000 | ENEMY_FLAG_IGNORE_TOUCH | ENEMY_FLAG_IGNORE_JUMP | ENEMY_FLAG_IGNORE_HAMMER | ENEMY_FLAG_CANT_INTERACT | ENEMY_FLAG_IGNORE_PARTNER); hitboxNpc->duration = 0; script->functionTemp[0] = 1; diff --git a/src/world/common/enemy/ai/MontyMoleAI.inc.c b/src/world/common/enemy/ai/MontyMoleAI.inc.c index c1edde0b4e..b765fa68b9 100644 --- a/src/world/common/enemy/ai/MontyMoleAI.inc.c +++ b/src/world/common/enemy/ai/MontyMoleAI.inc.c @@ -42,10 +42,10 @@ static s32 N(MontyMoleAI_CanAttack)(Evt* script, EnemyDetectVolume* territory, f retVal = basic_ai_check_player_dist(territory, enemy, radius * 1.1, arg3, 0) != 0; // check npc facing angle for sight of player angle = 270.0f; - if (clamp_angle(get_clamped_angle_diff(cam->currentYaw, npc->yaw)) < 180.0) { + if (clamp_angle(get_clamped_angle_diff(cam->curYaw, npc->yaw)) < 180.0) { angle = 90.0f; } - if (fabsf(get_clamped_angle_diff(angle, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z))) > 60.0) { + if (fabsf(get_clamped_angle_diff(angle, atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z))) > 60.0) { retVal = FALSE; } // check for overlap with player @@ -53,7 +53,7 @@ static s32 N(MontyMoleAI_CanAttack)(Evt* script, EnemyDetectVolume* territory, f retVal = FALSE; } // check player elevation difference - if (fabsf(npc->pos.y - gPlayerStatusPtr->position.y) >= 40.0f) { + if (fabsf(npc->pos.y - gPlayerStatusPtr->pos.y) >= 40.0f) { retVal = FALSE; } // check for bow hiding @@ -130,8 +130,8 @@ static void N(MontyMoleAI_PreSurface)(Evt* script, MobileAISettings* aiSettings, npc->flags &= ~NPC_FLAG_INVISIBLE; ai_enemy_play_sound(npc, SOUND_BURROW_SURFACE, 0); - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - npc->currentAnim = ANIM_MontyMole_Anim10; // emerge from ground + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); + npc->curAnim = ANIM_MontyMole_Anim10; // emerge from ground npc->duration = 10; script->AI_TEMP_STATE = AI_STATE_MOLE_SURFACE; } @@ -145,7 +145,7 @@ static void N(MontyMoleAI_Surface)(Evt* script, MobileAISettings* aiSettings, En enemy->flags &= ~MONTY_MOLE_UNK_NPC_FLAGS; } if (npc->duration <= 0) { - npc->currentAnim = ANIM_MontyMole_Anim18; // get and throw rock + npc->curAnim = ANIM_MontyMole_Anim18; // get and throw rock npc->duration = 10; script->AI_TEMP_STATE = AI_STATE_MOLE_DRAW_ROCK; } @@ -160,11 +160,11 @@ static void N(MontyMoleAI_DrawRock)(Evt* script, MobileAISettings* aiSettings, E if ((npc->duration) <= 0) { if (!N(MontyMoleAI_CanAttack)(script, territory, aiSettings->alertRadius * 1.1, aiSettings->alertOffsetDist)) { fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteOut); - npc->currentAnim = ANIM_MontyMole_Anim01; // cancel attack + npc->curAnim = ANIM_MontyMole_Anim01; // cancel attack npc->duration = 30; script->AI_TEMP_STATE = AI_STATE_MOLE_PRE_BURROW; } else { - npc->currentAnim = ANIM_MontyMole_Anim1B; // throw rock + npc->curAnim = ANIM_MontyMole_Anim1B; // throw rock npc->duration = 15; script->AI_TEMP_STATE = AI_STATE_MOLE_THROW_ROCK; } @@ -185,13 +185,13 @@ static void N(MontyMoleAI_ThrowRock)(Evt* script, MobileAISettings* aiSettings, rockEnemy->varTable[0] = 1; } if (moleNpc->duration < 8) { - if (dist2D(moleNpc->pos.x, moleNpc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) > 100.0) { - moleNpc->currentAnim = ANIM_MontyMole_Anim15; // clap + if (dist2D(moleNpc->pos.x, moleNpc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z) > 100.0) { + moleNpc->curAnim = ANIM_MontyMole_Anim15; // clap } } if (moleNpc->duration <= 0) { - if (moleNpc->currentAnim != ANIM_MontyMole_Anim15) { - moleNpc->currentAnim = ANIM_MontyMole_Anim01; + if (moleNpc->curAnim != ANIM_MontyMole_Anim15) { + moleNpc->curAnim = ANIM_MontyMole_Anim01; } moleNpc->duration = 15; script->AI_TEMP_STATE = AI_STATE_MOLE_PRE_BURROW; @@ -206,7 +206,7 @@ static void N(MontyMoleAI_PreBurrow)(Evt* script, MobileAISettings* aiSettings, if (npc->duration <= 0) { ai_enemy_play_sound(npc, SOUND_BURROW_DIG, 0); npc->duration = 11; - npc->currentAnim = ANIM_MontyMole_Anim11; // retreat into ground + npc->curAnim = ANIM_MontyMole_Anim11; // retreat into ground script->AI_TEMP_STATE = AI_STATE_MOLE_BURROW; } } diff --git a/src/world/common/enemy/ai/ParatroopaAI.inc.c b/src/world/common/enemy/ai/ParatroopaAI.inc.c index d4accf0d92..5528aa06cc 100644 --- a/src/world/common/enemy/ai/ParatroopaAI.inc.c +++ b/src/world/common/enemy/ai/ParatroopaAI.inc.c @@ -17,12 +17,12 @@ void N(ParatroopaAI_Windup)(Evt* script, MobileAISettings* aiSettings, EnemyDete Npc* npc = get_npc_unsafe(enemy->npcID); f32 yawTemp; - npc->currentAnim = enemy->animList[9]; - npc->jumpVelocity = -5.0f; + npc->curAnim = enemy->animList[9]; + npc->jumpVel = -5.0f; npc->jumpScale = 0.15f; npc->collisionHeight = enemy->varTable[8] / 2; - dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); npc->moveSpeed = 7.0f; enemy->unk_10.x = npc->pos.x; enemy->unk_10.y = npc->pos.y; @@ -30,7 +30,7 @@ void N(ParatroopaAI_Windup)(Evt* script, MobileAISettings* aiSettings, EnemyDete enemy->hitboxIsActive = TRUE; ai_enemy_play_sound(npc, SOUND_UNUSED_2C1, 0); - yawTemp = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + yawTemp = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); npc->duration = 12; npc->yaw = yawTemp; script->AI_TEMP_STATE = AI_STATE_PARATROOPA_DIVE; @@ -40,17 +40,17 @@ void N(ParatroopaAI_Dive)(Evt* script, MobileAISettings* aiSettings, EnemyDetect Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID); - npc->jumpVelocity += npc->jumpScale; - npc->pos.y += npc->jumpVelocity; + npc->jumpVel += npc->jumpScale; + npc->pos.y += npc->jumpVel; npc_move_heading(npc, npc->moveSpeed, npc->yaw); npc->duration--; if (npc->duration <= 0) { enemy->hitboxIsActive = FALSE; npc->jumpScale = 0.3f; - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; npc->moveSpeed = 3.0f; - npc->currentAnim = enemy->animList[10]; + npc->curAnim = enemy->animList[10]; script->AI_TEMP_STATE = AI_STATE_PARATROOPA_OVERSHOOT; } } @@ -64,8 +64,8 @@ void N(ParatroopaAI_Overshoot)(Evt* script, MobileAISettings *arg1, EnemyDetectV f32 endOvershootHeight; f32 overshootAmt; - npc->jumpVelocity += npc->jumpScale; - npc->pos.y += npc->jumpVelocity; + npc->jumpVel += npc->jumpScale; + npc->pos.y += npc->jumpVel; overshootAmt = overshootAmtRaw / 100.0; npc_move_heading(npc, npc->moveSpeed, npc->yaw); @@ -81,7 +81,7 @@ void N(ParatroopaAI_Overshoot)(Evt* script, MobileAISettings *arg1, EnemyDetectV if (!(npc->pos.y < endOvershootHeight)) { npc->duration = 10; - npc->currentAnim = enemy->animList[11]; + npc->curAnim = enemy->animList[11]; npc->collisionHeight = enemy->varTable[8]; script->AI_TEMP_STATE = AI_STATE_PARATROOPA_RESET; } diff --git a/src/world/common/enemy/ai/PatrolNoAttackAI.inc.c b/src/world/common/enemy/ai/PatrolNoAttackAI.inc.c index 9da6ecc893..248f9a95c6 100644 --- a/src/world/common/enemy/ai/PatrolNoAttackAI.inc.c +++ b/src/world/common/enemy/ai/PatrolNoAttackAI.inc.c @@ -36,7 +36,7 @@ API_CALLABLE(N(PatrolNoAttackAI_Main)) { if (isInitialCall || enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) { script->AI_TEMP_STATE = AI_STATE_PATROL_INIT; npc->duration = 0; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; if (!enemy->territory->patrol.isFlying) { diff --git a/src/world/common/enemy/ai/PiranhaPlantAI.inc.c b/src/world/common/enemy/ai/PiranhaPlantAI.inc.c index 6868541c95..a611403079 100644 --- a/src/world/common/enemy/ai/PiranhaPlantAI.inc.c +++ b/src/world/common/enemy/ai/PiranhaPlantAI.inc.c @@ -14,7 +14,7 @@ void N(PiranhaPlantAI_00)(Evt* script, MobileAISettings* aiSettings, EnemyDetect npc->duration--; } else { enemy->varTable[0] = 0; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; script->functionTemp[1] = 0; script->functionTemp[0] = 1; } @@ -29,7 +29,7 @@ void N(PiranhaPlantAI_01)(Evt* script, MobileAISettings* aiSettings, EnemyDetect ai_enemy_play_sound(npc, SOUND_BURROW_DIG, 0); fx_emote(EMOTE_EXCLAMATION, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 10, &temp); ai_enemy_play_sound(npc, SOUND_2F4, SOUND_PARAM_MORE_QUIET); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; npc->duration = enemy->varTable[8]; script->functionTemp[0] = 10; } @@ -63,9 +63,9 @@ void N(PiranhaPlantAI_10)(Evt* script, MobileAISettings* aiSettings, EnemyDetect if (npc->duration == 0) { if (clamp_angle(gPlayerStatusPtr->spriteFacingAngle) < 180.0f) { - yaw2 = clamp_angle(gCameras[gCurrentCameraID].currentYaw - 90.0f); + yaw2 = clamp_angle(gCameras[gCurrentCameraID].curYaw - 90.0f); } else { - yaw2 = clamp_angle(gCameras[gCurrentCameraID].currentYaw + 90.0f); + yaw2 = clamp_angle(gCameras[gCurrentCameraID].curYaw + 90.0f); } yaw = clamp_angle(yaw2 + 180.0f); @@ -89,8 +89,8 @@ void N(PiranhaPlantAI_10)(Evt* script, MobileAISettings* aiSettings, EnemyDetect } } - npc->pos.x = gPlayerStatusPtr->position.x; - npc->pos.z = gPlayerStatusPtr->position.z; + npc->pos.x = gPlayerStatusPtr->pos.x; + npc->pos.z = gPlayerStatusPtr->pos.z; add_vec2D_polar(&npc->pos.x, &npc->pos.z, npc->collisionDiameter, yaw); npc_move_heading(npc, moveSpeed + npc->collisionDiameter, yaw2); @@ -122,13 +122,13 @@ void N(PiranhaPlantAI_10)(Evt* script, MobileAISettings* aiSettings, EnemyDetect } } else { if (!(npc->flags & NPC_FLAG_IGNORE_WORLD_COLLISION)) { - sp20 = gPlayerStatusPtr->position.x; - sp24 = gPlayerStatusPtr->position.y + 18.0; - sp28 = gPlayerStatusPtr->position.z; + sp20 = gPlayerStatusPtr->pos.x; + sp24 = gPlayerStatusPtr->pos.y + 18.0; + sp28 = gPlayerStatusPtr->pos.z; if (npc_test_move_simple_with_slipping(npc->collisionChannel, &sp20, &sp24, &sp28, moveSpeed, yaw2, npc->collisionHeight, npc->collisionDiameter)) { - sp20 = gPlayerStatusPtr->position.x; - sp24 = gPlayerStatusPtr->position.y + 45.0; - sp28 = gPlayerStatusPtr->position.z; + sp20 = gPlayerStatusPtr->pos.x; + sp24 = gPlayerStatusPtr->pos.y + 45.0; + sp28 = gPlayerStatusPtr->pos.z; cond1 = npc_test_move_simple_with_slipping(npc->collisionChannel, &sp20, &sp24, &sp28, moveSpeed, yaw2, npc->collisionHeight, npc->collisionDiameter); sp2C = npc->pos.x; sp30 = npc->pos.y + 100.0; @@ -138,26 +138,26 @@ void N(PiranhaPlantAI_10)(Evt* script, MobileAISettings* aiSettings, EnemyDetect if (!cond1 && cond2 && sp38 > 80.0 && sp38 < 120.0 && npc->pos.y != sp30) { phi_fp = TRUE; } else { - sp20 = gPlayerStatusPtr->position.x; - sp24 = gPlayerStatusPtr->position.y + 10.0; - sp28 = gPlayerStatusPtr->position.z; + sp20 = gPlayerStatusPtr->pos.x; + sp24 = gPlayerStatusPtr->pos.y + 10.0; + sp28 = gPlayerStatusPtr->pos.z; npc_test_move_simple_with_slipping(npc->collisionChannel, &sp20, &sp24, &sp28, moveSpeed, yaw2, npc->collisionHeight, npc->collisionDiameter); - posRadius = dist2D(gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z, sp20, sp28); - npc->pos.x = gPlayerStatusPtr->position.x; - npc->pos.z = gPlayerStatusPtr->position.z; + posRadius = dist2D(gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z, sp20, sp28); + npc->pos.x = gPlayerStatusPtr->pos.x; + npc->pos.z = gPlayerStatusPtr->pos.z; add_vec2D_polar(&npc->pos.x, &npc->pos.z, npc->collisionDiameter, yaw); npc_move_heading(npc, posRadius + npc->collisionDiameter, yaw2); phi_s7 = TRUE; } } } else { - sp20 = gPlayerStatusPtr->position.x; - sp24 = gPlayerStatusPtr->position.y + 18.0; - sp28 = gPlayerStatusPtr->position.z; + sp20 = gPlayerStatusPtr->pos.x; + sp24 = gPlayerStatusPtr->pos.y + 18.0; + sp28 = gPlayerStatusPtr->pos.z; if (npc_test_move_simple_with_slipping(npc->collisionChannel, &sp20, &sp24, &sp28, moveSpeed, yaw2, npc->collisionHeight, npc->collisionDiameter)) { - posRadius = dist2D(gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z, sp20, sp28); - npc->pos.x = gPlayerStatusPtr->position.x; - npc->pos.z = gPlayerStatusPtr->position.z; + posRadius = dist2D(gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z, sp20, sp28); + npc->pos.x = gPlayerStatusPtr->pos.x; + npc->pos.z = gPlayerStatusPtr->pos.z; add_vec2D_polar(&npc->pos.x, &npc->pos.z, npc->collisionDiameter, yaw); npc_move_heading(npc, posRadius + npc->collisionDiameter, yaw2); } @@ -211,9 +211,9 @@ void N(PiranhaPlantAI_10)(Evt* script, MobileAISettings* aiSettings, EnemyDetect } } - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); ai_enemy_play_sound(npc, SOUND_BURROW_SURFACE, 0); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_HIT]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_HIT]; npc->duration = enemy->varTable[10]; script->functionTemp[0] = 11; } @@ -228,7 +228,7 @@ void N(PiranhaPlantAI_11)(Evt* script, MobileAISettings* aiSettings, EnemyDetect enemy->flags &= ~(ENEMY_FLAG_100000 | ENEMY_FLAG_IGNORE_TOUCH | ENEMY_FLAG_IGNORE_JUMP | ENEMY_FLAG_IGNORE_HAMMER | ENEMY_FLAG_CANT_INTERACT | ENEMY_FLAG_IGNORE_PARTNER); } if (npc->duration == 0) { - npc->currentAnim = enemy->animList[10]; + npc->curAnim = enemy->animList[10]; npc->duration = 0; script->functionTemp[0] = 12; } @@ -241,7 +241,7 @@ void N(PiranhaPlantAI_12)(Evt* script, MobileAISettings* aiSettings, EnemyDetect npc->duration++; if (npc->duration == enemy->varTable[13]) { - npc->currentAnim = enemy->animList[11]; + npc->curAnim = enemy->animList[11]; } if (npc->duration == enemy->varTable[14]) { enemy->varTable[0] = 3; @@ -249,7 +249,7 @@ void N(PiranhaPlantAI_12)(Evt* script, MobileAISettings* aiSettings, EnemyDetect if (npc->duration >= enemy->varTable[12]) { enemy->varTable[0] = 4; npc->duration = 8; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; fx_emote(EMOTE_FRUSTRATION, npc, 0, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 10, &temp); script->functionTemp[0] = 13; } @@ -322,7 +322,7 @@ s32 N(PiranhaPlantAI_Main)(Evt* script, s32 isInitialCall) { if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) { script->AI_TEMP_STATE = AI_STATE_PIRANHA_PLANT_00; npc->duration = 0; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; enemy->AI_VAR_ATTACK_STATE = MELEE_HITBOX_STATE_NONE; if (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) { diff --git a/src/world/common/enemy/ai/ProjectileHitbox.inc.c b/src/world/common/enemy/ai/ProjectileHitbox.inc.c index 5f48dfc550..ececea58cb 100644 --- a/src/world/common/enemy/ai/ProjectileHitbox.inc.c +++ b/src/world/common/enemy/ai/ProjectileHitbox.inc.c @@ -17,15 +17,15 @@ s32 N(ProjectileHitbox_GetUsableProjectileID)(Evt* script) { s32 i; if (ai_check_player_dist(enemy, 0, aiSettings->chaseRadius, aiSettings->chaseOffsetDist)) { - if (clamp_angle(get_clamped_angle_diff(camera->currentYaw, npc->yaw)) < 180.0) { + if (clamp_angle(get_clamped_angle_diff(camera->curYaw, npc->yaw)) < 180.0) { facingAngle = 90.0f; } else { facingAngle = 270.0f; } - angleToPlayer = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + angleToPlayer = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); deltaAngle = get_clamped_angle_diff(facingAngle, angleToPlayer); - if (fabsf(deltaAngle) > 75.0 || (2.0 * npc->collisionHeight <= fabsf(npc->pos.y - gPlayerStatusPtr->position.y))) { + if (fabsf(deltaAngle) > 75.0 || (2.0 * npc->collisionHeight <= fabsf(npc->pos.y - gPlayerStatusPtr->pos.y))) { return -1; } if (gPartnerStatus.actingPartner == PARTNER_BOW) { @@ -58,14 +58,14 @@ void N(UnkNpcAIFunc48)(Evt* script, f32 arg1, f32 arg2, EnemyDetectVolume* terri EffectInstance* sp28; fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &sp28); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->duration = 20; script->functionTemp[0] = 33; } else { s32 npcID = N(ProjectileHitbox_GetUsableProjectileID)(script); if (npcID != NPC_SELF && get_enemy(npcID)->varTable[0] == 0 && npc->turnAroundYawAdjustment == 0) { - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; npc->duration = enemy->varTable[1]; script->functionTemp[0] = 30; } @@ -84,11 +84,11 @@ void N(ProjectileHitbox_30)(Evt* script) { EffectInstance* emoteTemp; fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteTemp); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; } else { Enemy* hitboxEnemy; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_HIT]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_HIT]; hitboxEnemy = get_enemy(npcID); hitboxEnemy->varTable[4] = enemy->npcID; hitboxEnemy->varTable[0] = 1; @@ -113,7 +113,7 @@ void N(ProjectileHitbox_32)(Evt* script) { npc->yaw = atan2(npc->pos.x, npc->pos.z, npc2->pos.x, npc2->pos.z); if (enemy2->varTable[0] == 0) { - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->duration = enemy->varTable[2]; script->functionTemp[0] = AI_STATE_PROJECTILE_HITBOX_33; } @@ -187,12 +187,12 @@ API_CALLABLE(N(ProjectileAI_Main)) { enemy->unk_10.x = npc->pos.x; enemy->unk_10.y = npc->pos.y; enemy->unk_10.z = npc->pos.z; - npc->rotation.x = 0.0f; - npc->rotation.y = 0.0f; - npc->rotation.z = 0.0f; + npc->rot.x = 0.0f; + npc->rot.y = 0.0f; + npc->rot.z = 0.0f; npc->moveSpeed = aiSettings->moveSpeed; - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - npc->jumpVelocity = aiSettings->alertRadius; + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); + npc->jumpVel = aiSettings->alertRadius; npc->jumpScale = aiSettings->alertOffsetDist; npc->moveToPos.y = npc2->pos.y; npc->flags &= ~NPC_FLAG_INVISIBLE; @@ -223,7 +223,7 @@ API_CALLABLE(N(ProjectileAI_Main)) { z = npc->pos.z; hitDepth = 1000.0f; if ((npc_raycast_down_sides(npc->collisionChannel, &x, &y, &z, &hitDepth) != 0) && - (hitDepth < fabsf(npc->jumpVelocity)) && + (hitDepth < fabsf(npc->jumpVel)) && (fabsf(y - npc->moveToPos.y) < 20.0)) { npc->pos.y = y; @@ -241,18 +241,18 @@ API_CALLABLE(N(ProjectileAI_Main)) { if (phi_s6 == 0) { if (enemy->varTable[1] & 1) { - npc->rotation.z += 40.0; + npc->rot.z += 40.0; } npc_move_heading(npc, npc->moveSpeed, npc->yaw); - npc->pos.y += npc->jumpVelocity; - npc->jumpVelocity -= npc->jumpScale; + npc->pos.y += npc->jumpVel; + npc->jumpVel -= npc->jumpScale; } else { fx_walking_dust(2, npc->pos.x, npc->pos.y, npc->pos.z, 0, 0); enemy->varTable[0] = 0; npc->pos.x = NPC_DISPOSE_POS_X; npc->pos.y = NPC_DISPOSE_POS_Y; npc->pos.z = NPC_DISPOSE_POS_Z; - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; npc->flags |= NPC_FLAG_INVISIBLE; disable_npc_shadow(npc); npc->flags &= ~NPC_FLAG_JUMPING; @@ -299,17 +299,17 @@ API_CALLABLE(N(ProjectileAI_Reflect)) { switch (script->functionTemp[0]) { case 0: fx_walking_dust(2, npc->pos.x, npc->pos.y, npc->pos.z, 0.0f, 0.0f); - yaw = clamp_angle(camera->currentYaw); + yaw = clamp_angle(camera->curYaw); temp_f20_2 = clamp_angle(yaw + 180.0); temp_f22 = clamp_angle(yaw + 90.0); temp_f20_3 = clamp_angle(temp_f20_2 + 90.0); - if (clamp_angle(get_clamped_angle_diff(camera->currentYaw, gPlayerStatusPtr->currentYaw)) < 180.0) { + if (clamp_angle(get_clamped_angle_diff(camera->curYaw, gPlayerStatusPtr->curYaw)) < 180.0) { npc->yaw = temp_f22; } else { npc->yaw = temp_f20_3; } npc->duration = 30; - npc->jumpVelocity = 10.0f; + npc->jumpVel = 10.0f; npc->jumpScale = 0.9f; npc->moveSpeed *= 1.2; script->functionTemp[0] = 1; @@ -327,21 +327,21 @@ API_CALLABLE(N(ProjectileAI_Reflect)) { } cond = FALSE; - if (npc->jumpVelocity < 0.0) { + if (npc->jumpVel < 0.0) { x = npc->pos.x; y = npc->pos.y + 13.0; z = npc->pos.z; - hitDepth = fabsf(npc->jumpVelocity) + 16.0; + hitDepth = fabsf(npc->jumpVel) + 16.0; if ((npc_raycast_down_sides(npc->collisionChannel, &x, &y, &z, &hitDepth) != 0) && - (hitDepth <= (fabsf(npc->jumpVelocity) + 13.0))) + (hitDepth <= (fabsf(npc->jumpVel) + 13.0))) { cond = TRUE; } } if (!cond) { - npc->pos.y += npc->jumpVelocity; - npc->jumpVelocity -= npc->jumpScale; + npc->pos.y += npc->jumpVel; + npc->jumpVel -= npc->jumpScale; } else { phi_s4 = 10; } @@ -367,7 +367,7 @@ API_CALLABLE(N(ProjectileAI_Reflect)) { return ApiStatus_DONE2; } if (enemy->varTable[1] & 1) { - npc->rotation.z += 60.0; + npc->rot.z += 60.0; } break; } diff --git a/src/world/common/enemy/ai/RangedAttackAI.inc.c b/src/world/common/enemy/ai/RangedAttackAI.inc.c index 05f0565fda..49b1a5b3e3 100644 --- a/src/world/common/enemy/ai/RangedAttackAI.inc.c +++ b/src/world/common/enemy/ai/RangedAttackAI.inc.c @@ -32,7 +32,7 @@ API_CALLABLE(N(RangedAttackAI_Main)) { if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) { script->AI_TEMP_STATE = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; if (!enemy->territory->wander.isFlying) { @@ -74,7 +74,7 @@ API_CALLABLE(N(RangedAttackAI_Main)) { basic_ai_found_player_jump(script, settings, territoryPtr); break; case AI_STATE_CHASE_INIT: - dist = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + dist = dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); if (enemy->varTable[0] == 0 || enemy->varTable[0] < dist) { N(UnkNpcAIFunc48)(script, settings->chaseRadius, settings->chaseOffsetDist, territoryPtr); if (script->AI_TEMP_STATE != AI_STATE_CHASE_INIT) { diff --git a/src/world/common/enemy/ai/SentinelAI.inc.c b/src/world/common/enemy/ai/SentinelAI.inc.c index 78aeea8acf..c37251ac82 100644 --- a/src/world/common/enemy/ai/SentinelAI.inc.c +++ b/src/world/common/enemy/ai/SentinelAI.inc.c @@ -49,9 +49,9 @@ void N(SentinelAI_ChaseInit)(Evt* script, MobileAISettings* aiSettings, EnemyDet if (npc->duration <= 0) { npc->flags &= ~NPC_FLAG_200000; npc->duration = aiSettings->chaseUpdateInterval / 2 + rand_int(aiSettings->chaseUpdateInterval / 2 + 1); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; npc->moveSpeed = aiSettings->chaseSpeed; - angle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + angle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); deltaAngle = get_clamped_angle_diff(npc->yaw, angle); if (aiSettings->chaseTurnRate < fabsf(deltaAngle)) { angle = npc->yaw; @@ -72,8 +72,8 @@ void N(SentinelAI_Chase)(Evt* script, MobileAISettings* aiSettings, EnemyDetectV if (basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 1)) { npc_move_heading(npc, npc->moveSpeed, npc->yaw); - if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, - gPlayerStatusPtr->position.z) <= (npc->moveSpeed * 2.5)) { + if (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, + gPlayerStatusPtr->pos.z) <= (npc->moveSpeed * 2.5)) { npc->duration = 0; script->AI_TEMP_STATE = AI_STATE_SENTINEL_DESCEND_INIT; } else { @@ -100,8 +100,8 @@ void N(SentinelAI_DescendInit)(Evt* script, MobileAISettings* aiSettings, EnemyD } enemy->varTable[0] |= SENTINEL_AI_FLAG_CHASING; - npc->pos.x = gPlayerStatusPtr->position.x; - npc->pos.z = gPlayerStatusPtr->position.z; + npc->pos.x = gPlayerStatusPtr->pos.x; + npc->pos.z = gPlayerStatusPtr->pos.z; if (!(enemy->varTable[0] & SENTINEL_AI_FLAG_PLAYING_SOUND)) { enemy->varTable[0] |= SENTINEL_AI_FLAG_PLAYING_SOUND; } @@ -120,28 +120,28 @@ void N(SentinelAI_Descend)(Evt* script, MobileAISettings* aiSettings, EnemyDetec sfx_adjust_env_sound_pos(SOUND_80000011, SOUND_SPACE_FULL, npc->pos.x, npc->pos.y, npc->pos.z); if (!basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 1)) { enemy->varTable[0] &= ~SENTINEL_AI_FLAG_CHASING; - npc->rotation.y = 0.0f; + npc->rot.y = 0.0f; npc->flags &= ~NPC_FLAG_200000; script->AI_TEMP_STATE = AI_STATE_SENTINEL_LOSE_PLAYER_INIT; } else { - npc->pos.x = gPlayerStatusPtr->position.x; - npc->pos.z = gPlayerStatusPtr->position.z + 2.0f; - npc->rotation.y += 25.0f; - if (npc->rotation.y > 360.0) { - npc->rotation.y -= 360.0; + npc->pos.x = gPlayerStatusPtr->pos.x; + npc->pos.z = gPlayerStatusPtr->pos.z + 2.0f; + npc->rot.y += 25.0f; + if (npc->rot.y > 360.0) { + npc->rot.y -= 360.0; } - color = 255.0f - (cosine((s32)npc->rotation.y % 180) * 56.0f); + color = 255.0f - (cosine((s32)npc->rot.y % 180) * 56.0f); set_npc_imgfx_all(npc->spriteInstanceID, IMGFX_SET_COLOR, color, color, color, 255, 0); - posX = gPlayerStatusPtr->position.x; - posY = gPlayerStatusPtr->position.y; - posZ = gPlayerStatusPtr->position.z; + posX = gPlayerStatusPtr->pos.x; + posY = gPlayerStatusPtr->pos.y; + posZ = gPlayerStatusPtr->pos.z; hitDepth = 1000.0f; npc_raycast_down_sides(npc->collisionChannel, &posX, &posY, &posZ, &hitDepth); if (fabsf(npc->pos.y - posY) > 24.0) { npc->pos.y -= SENTINEL_AI_DESCEND_RATE; } else { - npc->rotation.y = 0.0f; + npc->rot.y = 0.0f; npc->flags &= ~NPC_FLAG_200000; if (gPartnerStatus.actingPartner != PARTNER_BOW) { disable_player_input(); @@ -165,7 +165,7 @@ void N(SentinelAI_LosePlayerInit)(Evt* script, MobileAISettings* aiSettings, Ene sfx_stop_sound(SOUND_80000011); enemy->varTable[0] &= ~SENTINEL_AI_FLAG_PLAYING_SOUND; } - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_HIT]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_HIT]; npc->duration = 20; script->AI_TEMP_STATE = AI_STATE_SENTINEL_LOSE_PLAYER; } diff --git a/src/world/common/enemy/ai/ShyGuyPatrolAI.inc.c b/src/world/common/enemy/ai/ShyGuyPatrolAI.inc.c index b09960abba..a5b2f2c6bc 100644 --- a/src/world/common/enemy/ai/ShyGuyPatrolAI.inc.c +++ b/src/world/common/enemy/ai/ShyGuyPatrolAI.inc.c @@ -8,7 +8,7 @@ void N(ShyGuyPatrolAI_14)(Evt* script, MobileAISettings* aiSettings, EnemyDetect Npc* npc = get_npc_unsafe(enemy->npcID); npc->moveSpeed *= 0.6; - npc->currentAnim = enemy->animList[12]; + npc->curAnim = enemy->animList[12]; npc->duration = 5; script->functionTemp[0] = 0xF; } @@ -26,7 +26,7 @@ void N(ShyGuyPatrolAI_15)(Evt* script, MobileAISettings* aiSettings, EnemyDetect if (npc->duration == 0) { npc->moveSpeed *= 0.6; - npc->currentAnim = enemy->animList[11]; + npc->curAnim = enemy->animList[11]; npc->duration = 10; script->functionTemp[0] = 16; } @@ -54,7 +54,7 @@ void N(ShyGuyPatrolAI_17)(Evt* script, MobileAISettings* aiSettings, EnemyDetect npc->duration--; if (npc->duration == 0) { - npc->currentAnim = *enemy->animList; + npc->curAnim = *enemy->animList; script->functionTemp[0] = 0; } } @@ -83,7 +83,7 @@ API_CALLABLE(N(ShyGuyPatrolAI_Main)) { if (isInitialCall || enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) { script->functionTemp[0] = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; if (!enemy->territory->patrol.isFlying) { diff --git a/src/world/common/enemy/ai/ShyGuyWanderAI.inc.c b/src/world/common/enemy/ai/ShyGuyWanderAI.inc.c index 0c918bc524..05ce7fa76b 100644 --- a/src/world/common/enemy/ai/ShyGuyWanderAI.inc.c +++ b/src/world/common/enemy/ai/ShyGuyWanderAI.inc.c @@ -6,7 +6,7 @@ void N(ShyGuyWanderAI_14)(Evt* script, MobileAISettings* aiSettings, EnemyDetect Npc* npc = get_npc_unsafe(enemy->npcID); npc->moveSpeed *= 0.6; - npc->currentAnim = enemy->animList[12]; + npc->curAnim = enemy->animList[12]; npc->duration = 5; script->functionTemp[0] = 0xF; } @@ -24,7 +24,7 @@ void N(ShyGuyWanderAI_15)(Evt* script, MobileAISettings* aiSettings, EnemyDetect if (npc->duration == 0) { npc->moveSpeed *= 0.6; - npc->currentAnim = enemy->animList[11]; + npc->curAnim = enemy->animList[11]; npc->duration = 10; script->functionTemp[0] = 16; } @@ -52,7 +52,7 @@ void N(ShyGuyWanderAI_17)(Evt* script, MobileAISettings* aiSettings, EnemyDetect npc->duration--; if (npc->duration == 0) { - npc->currentAnim = *enemy->animList; + npc->curAnim = *enemy->animList; script->functionTemp[0] = 0; } } @@ -81,7 +81,7 @@ API_CALLABLE(N(ShyGuyWanderAI_Main)) { if (isInitialCall || enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND) { script->functionTemp[0] = 0; npc->duration = 0; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; if (!enemy->territory->wander.isFlying) { diff --git a/src/world/common/enemy/ai/SpearGuyAI.inc.c b/src/world/common/enemy/ai/SpearGuyAI.inc.c index 5bad33da03..46e9be18ad 100644 --- a/src/world/common/enemy/ai/SpearGuyAI.inc.c +++ b/src/world/common/enemy/ai/SpearGuyAI.inc.c @@ -31,7 +31,7 @@ void N(SpearGuyAI_Loiter)(Evt* script, MobileAISettings* aiSettings, EnemyDetect case 1: enemy->varTable[0] = 2; enemy->varTable[1] = 0; - npc->currentAnim = ANIM_SpearGuy_Anim0F; + npc->curAnim = ANIM_SpearGuy_Anim0F; case 2: enemy->varTable[1]++; if (enemy->varTable[1] > 50) { @@ -41,7 +41,7 @@ void N(SpearGuyAI_Loiter)(Evt* script, MobileAISettings* aiSettings, EnemyDetect case 3: enemy->varTable[0] = 4; enemy->varTable[1] = 0; - npc->currentAnim = ANIM_SpearGuy_Anim10; + npc->curAnim = ANIM_SpearGuy_Anim10; case 4: enemy->varTable[1]++; if (enemy->varTable[1] == 25) { @@ -54,7 +54,7 @@ void N(SpearGuyAI_Loiter)(Evt* script, MobileAISettings* aiSettings, EnemyDetect case 5: enemy->varTable[0] = 6; enemy->varTable[1] = 0; - npc->currentAnim = ANIM_SpearGuy_Anim03; + npc->curAnim = ANIM_SpearGuy_Anim03; fx_sweat(0, npc->pos.x, npc->pos.y, npc->pos.z, npc->collisionHeight, 0, 10); case 6: enemy->varTable[1]++; @@ -100,7 +100,7 @@ ApiStatus N(SpearGuyAI_Main)(Evt* script, s32 isInitialCall) { if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) { script->AI_TEMP_STATE = AI_STATE_WANDER_INIT; npc->duration = 0; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; if (!enemy->territory->wander.isFlying) { diff --git a/src/world/common/enemy/ai/SpinyAI.inc.c b/src/world/common/enemy/ai/SpinyAI.inc.c index 831c37bdc4..9b735f86e3 100644 --- a/src/world/common/enemy/ai/SpinyAI.inc.c +++ b/src/world/common/enemy/ai/SpinyAI.inc.c @@ -44,7 +44,7 @@ API_CALLABLE(N(SpinyAI_Main)) { if (isInitialCall || (enemy->varTable[10] == 100)) { script->AI_TEMP_STATE = 100; npc->duration = 0; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; enemy->flags |= ENEMY_FLAG_ACTIVE_WHILE_OFFSCREEN; npc->flags &= ~NPC_FLAG_GRAVITY; @@ -61,15 +61,15 @@ API_CALLABLE(N(SpinyAI_Main)) { npc->collisionHeight = enemy->varTable[6]; enemy->aiFlags &= ~ENEMY_AI_FLAG_SUSPEND; if (npc->flags & NPC_FLAG_JUMPING) { - npc->currentAnim = ANIM_Spiny_Anim18; + npc->curAnim = ANIM_Spiny_Anim18; npc->moveSpeed = 0.0f; - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; npc->jumpScale = 1.0f; script->AI_TEMP_STATE = 102; } else { EffectInstance* emoteTemp; fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0x28, &emoteTemp); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; script->functionTemp[1] = 0; script->AI_TEMP_STATE = 200; } @@ -126,21 +126,21 @@ API_CALLABLE(N(SpinyAI_Main)) { } npc->pos.y = npc2->pos.y + 25.0; npc->pos.z = npc2->pos.z + 1.0; - npc->rotation.y = 0.0f; + npc->rot.y = 0.0f; npc->flags |= NPC_FLAG_8; npc->flags &= ~NPC_FLAG_INVISIBLE; npc->flags &= ~NPC_FLAG_GRAVITY; npc->renderYaw = 0.0f; - npc->currentAnim = ANIM_Spiny_Anim18; + npc->curAnim = ANIM_Spiny_Anim18; script->AI_TEMP_STATE = 101; case 101: if (enemy->varTable[10] != 3) { break; } enemy->varTable[10] = 4; - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); npc->moveSpeed = 2.5f; - npc->jumpVelocity = 8.0f; + npc->jumpVel = 8.0f; npc->jumpScale = 0.8f; npc->flags |= NPC_FLAG_JUMPING; script->AI_TEMP_STATE = 102; @@ -156,12 +156,12 @@ API_CALLABLE(N(SpinyAI_Main)) { npc->moveSpeed = 0.0f; } } - if (npc->jumpVelocity < 0.0) { + if (npc->jumpVel < 0.0) { x2 = npc->pos.x; y2 = npc->pos.y + 13.0; z2 = npc->pos.z; - w2 = fabsf(npc->jumpVelocity) + 16.0; - if ((npc_raycast_down_sides(npc->collisionChannel, &x2, &y2, &z2, &w2) != 0) && (w2 <= (fabsf(npc->jumpVelocity) + 13.0))) { + w2 = fabsf(npc->jumpVel) + 16.0; + if ((npc_raycast_down_sides(npc->collisionChannel, &x2, &y2, &z2, &w2) != 0) && (w2 <= (fabsf(npc->jumpVel) + 13.0))) { npc->pos.y = y2; enemy->territory->wander.centerPos.x = npc->pos.x; enemy->territory->wander.centerPos.y = npc->pos.y; @@ -187,22 +187,22 @@ API_CALLABLE(N(SpinyAI_Main)) { } npc->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW; npc->flags &= ~NPC_FLAG_JUMPING; - npc->jumpVelocity = 0.0f; - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); - npc->currentAnim = ANIM_Spiny_Anim1A; + npc->jumpVel = 0.0f; + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); + npc->curAnim = ANIM_Spiny_Anim1A; npc->duration = 3; script->AI_TEMP_STATE = 103; break; } } - npc->pos.y += npc->jumpVelocity; - npc->jumpVelocity -= npc->jumpScale; + npc->pos.y += npc->jumpVel; + npc->jumpVel -= npc->jumpScale; break; case 103: npc->duration--; if (npc->duration <= 0) { npc->flags &= ~NPC_FLAG_IGNORE_CAMERA_FOR_YAW; - npc->currentAnim = ANIM_Spiny_Anim01; + npc->curAnim = ANIM_Spiny_Anim01; script->AI_TEMP_STATE = 0; } break; diff --git a/src/world/common/enemy/ai/States_PatrolAI.inc.c b/src/world/common/enemy/ai/States_PatrolAI.inc.c index a18f001a5d..74dda9d43e 100644 --- a/src/world/common/enemy/ai/States_PatrolAI.inc.c +++ b/src/world/common/enemy/ai/States_PatrolAI.inc.c @@ -34,7 +34,7 @@ void N(PatrolAI_MoveInit)(Evt* script, MobileAISettings* aiSettings, EnemyDetect } } - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -99,7 +99,7 @@ void N(PatrolAI_LoiterInit)(Evt* script, MobileAISettings* aiSettings, EnemyDete npc->duration = (aiSettings->waitTime / 2) + rand_int((aiSettings->waitTime / 2) + 1); npc->yaw = clamp_angle(npc->yaw + rand_int(180) - 90.0f); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; script->AI_TEMP_STATE = AI_STATE_LOITER; } @@ -111,7 +111,7 @@ void N(PatrolAI_Loiter)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVo if ((aiSettings->playerSearchInterval >= 0) && basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 0)) { fx_emote(EMOTE_EXCLAMATION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 0xF, &emoteTemp); - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); ai_enemy_play_sound(npc, SOUND_2F4, SOUND_PARAM_MORE_QUIET); if (!(enemy->npcSettings->actionFlags & AI_ACTION_JUMP_WHEN_SEE_PLAYER)) { script->AI_TEMP_STATE = AI_STATE_CHASE_INIT; @@ -146,7 +146,7 @@ void N(PatrolAI_PostLoiter)(Evt* script, MobileAISettings* aiSettings, EnemyDete if (script->functionTemp[2] >= enemy->territory->patrol.numPoints) { script->functionTemp[2] = 0; } - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; if (enemy->territory->patrol.moveSpeedOverride < 0) { npc->moveSpeed = aiSettings->moveSpeed; } else { @@ -159,8 +159,8 @@ void N(PatrolAI_JumpInit)(Evt* script, MobileAISettings* aiSettings, EnemyDetect Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_JUMP]; - npc->jumpVelocity = 10.0f; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_JUMP]; + npc->jumpVel = 10.0f; npc->jumpScale = 2.0f; npc->moveToPos.y = npc->pos.y; npc->flags |= NPC_FLAG_JUMPING; @@ -170,12 +170,12 @@ void N(PatrolAI_JumpInit)(Evt* script, MobileAISettings* aiSettings, EnemyDetect void N(PatrolAI_Jump)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolume* territory) { Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID); - npc->pos.y += npc->jumpVelocity; - npc->jumpVelocity -= npc->jumpScale; + npc->pos.y += npc->jumpVel; + npc->jumpVel -= npc->jumpScale; if (!(npc->pos.y > npc->moveToPos.y)) { npc->pos.y = npc->moveToPos.y; - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; npc->flags &= ~NPC_FLAG_JUMPING; script->AI_TEMP_STATE = AI_STATE_CHASE_INIT; } @@ -188,10 +188,10 @@ void N(PatrolAI_ChaseInit)(Evt* script, MobileAISettings* aiSettings, EnemyDetec f32 angleDiff; npc->duration = (aiSettings->chaseUpdateInterval / 2) + rand_int(aiSettings->chaseUpdateInterval / 2 + 1); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_CHASE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_CHASE]; npc->moveSpeed = aiSettings->chaseSpeed; - angle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + angle = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); angleDiff = get_clamped_angle_diff(npc->yaw, angle); if (aiSettings->chaseTurnRate < fabsf(angleDiff)) { @@ -215,7 +215,7 @@ ApiStatus N(PatrolAI_Chase)(Evt* script, MobileAISettings* aiSettings, EnemyDete if (!basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 1)) { fx_emote(EMOTE_QUESTION, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteTemp); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->duration = 25; script->AI_TEMP_STATE = AI_STATE_LOSE_PLAYER; } else { @@ -257,7 +257,7 @@ void N(PatrolNoAttackAI_15)(Evt* script, MobileAISettings* aiSettings, EnemyDete } npc->moveSpeed = aiSettings->moveSpeed; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; script->functionTemp[1] = 0; script->AI_TEMP_STATE = AI_STATE_PATROL; } diff --git a/src/world/common/enemy/ai/States_TackleAI.inc.c b/src/world/common/enemy/ai/States_TackleAI.inc.c index 9645ee2d13..fcb2ab84be 100644 --- a/src/world/common/enemy/ai/States_TackleAI.inc.c +++ b/src/world/common/enemy/ai/States_TackleAI.inc.c @@ -11,9 +11,9 @@ void N(set_script_owner_npc_anim)(Evt* script, MobileAISettings* aiSettings, Ene Enemy* enemy = script->owner1.enemy; Npc* npc = get_npc_unsafe(enemy->npcID); - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_PRE]; npc->duration = enemy->varTable[2]; - npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, gPlayerStatusPtr->pos.z); script->AI_TEMP_STATE = 13; } @@ -24,13 +24,13 @@ ApiStatus N(UnkDistFunc)(Evt* script, MobileAISettings* aiSettings, EnemyDetectV if ((npc->duration <= 0) || (--npc->duration <= 0)) { if (npc->turnAroundYawAdjustment == 0) { - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_HIT]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_MELEE_HIT]; npc->moveSpeed = aiSettings->chaseSpeed; if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) { npc->collisionHeight = enemy->varTable[6] / 2; } - npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, - gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8; + npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->pos.x, + gPlayerStatusPtr->pos.z) / npc->moveSpeed) + 0.8; if (npc->duration < enemy->varTable[3]) { npc->duration = enemy->varTable[3]; } @@ -66,7 +66,7 @@ void N(UnkNpcAIFunc12)(Evt* script, MobileAISettings* aiSettings, EnemyDetectVol if ((npc->duration <= 0) || (--npc->duration <= 0) || (temp != 0)) { enemy->hitboxIsActive = FALSE; - npc->currentAnim = enemy->animList[10]; + npc->curAnim = enemy->animList[10]; npc->duration = 0; script->functionTemp[0] = 15; } diff --git a/src/world/common/enemy/ai/StoneChompAI.inc.c b/src/world/common/enemy/ai/StoneChompAI.inc.c index 7a39c818fd..8e15dffd27 100644 --- a/src/world/common/enemy/ai/StoneChompAI.inc.c +++ b/src/world/common/enemy/ai/StoneChompAI.inc.c @@ -5,7 +5,7 @@ void N(StoneChompAI_HopInit)(Evt* script, MobileAISettings* aiSettings, EnemyDet Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID); basic_ai_wander_init(script, aiSettings, territory); - npc->jumpVelocity = rand_int(5) + 8.0; + npc->jumpVel = rand_int(5) + 8.0; npc->jumpScale = 1.5f; } @@ -13,7 +13,7 @@ void N(StoneChompAI_ChaseInit)(Evt* script, MobileAISettings* aiSettings, EnemyD Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID); basic_ai_chase_init(script, aiSettings, territory); - npc->jumpVelocity = rand_int(5) + 5.0; + npc->jumpVel = rand_int(5) + 5.0; npc->jumpScale = 1.5f; } diff --git a/src/world/common/enemy/ai/SwooperAI.inc.c b/src/world/common/enemy/ai/SwooperAI.inc.c index 48cb74f305..b89ff5b2a1 100644 --- a/src/world/common/enemy/ai/SwooperAI.inc.c +++ b/src/world/common/enemy/ai/SwooperAI.inc.c @@ -43,7 +43,7 @@ API_CALLABLE(N(SwooperAI_Main)) { switch (script->functionTemp[0]) { case 0: - npc->currentAnim = enemy->animList[0]; + npc->curAnim = enemy->animList[0]; npc->verticalRenderOffset = npc->collisionHeight; npc->flags |= NPC_FLAG_UPSIDE_DOWN; script->functionTemp[1] = 0; @@ -63,10 +63,10 @@ API_CALLABLE(N(SwooperAI_Main)) { break; } case 10: - npc->currentAnim = enemy->animList[3]; - npc->planarFlyDist = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + npc->curAnim = enemy->animList[3]; + npc->planarFlyDist = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); npc->jumpScale = 1.3f; - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; npc->moveSpeed = aiSettings->moveSpeed; x = npc->pos.x; y = npc->pos.y; @@ -76,7 +76,7 @@ API_CALLABLE(N(SwooperAI_Main)) { y = enemy->varTable[1]; npc->moveToPos.y = y + ((npc->pos.y - y) * 0.7); } else { - npc->moveToPos.y = playerStatus->position.y + ((npc->pos.y - playerStatus->position.y) * 0.7); + npc->moveToPos.y = playerStatus->pos.y + ((npc->pos.y - playerStatus->pos.y) * 0.7); } npc->moveToPos.z = npc->pos.y; script->functionTemp[0] = 11; @@ -88,12 +88,12 @@ API_CALLABLE(N(SwooperAI_Main)) { if (npc_test_move_simple_with_slipping(npc->collisionChannel, &x, &y, &z, npc->moveSpeed, npc->yaw, npc->collisionHeight, npc->collisionDiameter)) { npc->moveSpeed = 0.0f; } - npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); npc_move_heading(npc, npc->moveSpeed, npc->yaw); } - npc->jumpVelocity -= npc->jumpScale; - npc->pos.y += npc->jumpVelocity; + npc->jumpVel -= npc->jumpScale; + npc->pos.y += npc->jumpVel; if (npc->pos.y < npc->moveToPos.y) { npc->pos.y = npc->moveToPos.y; script->functionTemp[0] = 12; @@ -101,7 +101,7 @@ API_CALLABLE(N(SwooperAI_Main)) { break; } case 12: - npc->planarFlyDist = dist2D(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + npc->planarFlyDist = dist2D(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); if (npc->planarFlyDist < 60.0f) { npc->planarFlyDist = 60.0f; } @@ -114,25 +114,25 @@ API_CALLABLE(N(SwooperAI_Main)) { if (npc->duration == 0) { npc->duration = 1; } - npc->jumpScale = -fabsf(-(2.0f * ((-npc->jumpVelocity * npc->duration) + y2)) / SQ(npc->duration)); + npc->jumpScale = -fabsf(-(2.0f * ((-npc->jumpVel * npc->duration) + y2)) / SQ(npc->duration)); npc->verticalRenderOffset = 0; npc->flags &= ~NPC_FLAG_UPSIDE_DOWN; enemy->varTable[0] = 5; npc->duration = 0; script->functionTemp[0] = 13; case 13: - npc->jumpVelocity -= npc->jumpScale; - if (npc->jumpVelocity < 0.0f) { + npc->jumpVel -= npc->jumpScale; + if (npc->jumpVel < 0.0f) { x = npc->pos.x; y = npc->pos.y; z = npc->pos.z; - hitDepth = -npc->jumpVelocity; + hitDepth = -npc->jumpVel; if (npc_raycast_down_sides(npc->collisionChannel, &x, &y, &z, &hitDepth) != 0) { - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; } } - npc->pos.y += npc->jumpVelocity; + npc->pos.y += npc->jumpVel; if (npc->moveSpeed > 0.0) { x = npc->pos.x; y = npc->pos.y; @@ -141,10 +141,10 @@ API_CALLABLE(N(SwooperAI_Main)) { npc->collisionHeight, npc->collisionDiameter) != 0) { npc->moveSpeed = 0.0f; - } else if (npc->jumpVelocity < -2.5) { + } else if (npc->jumpVel < -2.5) { npc->duration++; if (npc->duration >= aiSettings->chaseUpdateInterval) { - f32 yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + f32 yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); f32 angleDiff = get_clamped_angle_diff(npc->yaw, yaw); if (aiSettings->chaseTurnRate < fabsf(angleDiff)) { @@ -173,7 +173,7 @@ API_CALLABLE(N(SwooperAI_Main)) { break; } case 14: - npc->currentAnim = enemy->animList[8]; + npc->curAnim = enemy->animList[8]; npc->verticalRenderOffset = npc->collisionHeight; npc->flags |= NPC_FLAG_UPSIDE_DOWN; npc->duration = 15; diff --git a/src/world/common/enemy/ai/TackleAI.inc.c b/src/world/common/enemy/ai/TackleAI.inc.c index 7e5829ff39..b6bd2a61bc 100644 --- a/src/world/common/enemy/ai/TackleAI.inc.c +++ b/src/world/common/enemy/ai/TackleAI.inc.c @@ -47,7 +47,7 @@ API_CALLABLE(N(TackleAI_Main)) { script->AI_TEMP_STATE = 0; npc->duration = 0; enemy->hitboxIsActive = FALSE; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; npc->collisionHeight = enemy->varTable[6]; enemy->varTable[9] = 0; @@ -76,10 +76,10 @@ API_CALLABLE(N(TackleAI_Main)) { if (enemy->varTable[9] > 0) { enemy->varTable[9]--; if (enemy->varTable[9] == 0) { - if (npc->currentAnim == ANIM_BonyBeetle_Anim2E || - npc->currentAnim == ANIM_BonyBeetle_Anim2F) + if (npc->curAnim == ANIM_BonyBeetle_Anim2E || + npc->curAnim == ANIM_BonyBeetle_Anim2F) { - npc->currentAnim = ANIM_BonyBeetle_Anim0C; + npc->curAnim = ANIM_BonyBeetle_Anim0C; } } else { return ApiStatus_BLOCK; @@ -100,11 +100,11 @@ API_CALLABLE(N(TackleAI_Main)) { if (enemy->varTable[8] != 0) { enemy->varTable[8] = 0; enemy->instigatorValue = 0; - npc->currentAnim = ANIM_BonyBeetle_Anim2F; + npc->curAnim = ANIM_BonyBeetle_Anim2F; } else { enemy->varTable[8] = 1; enemy->instigatorValue = 1; - npc->currentAnim = ANIM_BonyBeetle_Anim2E; + npc->curAnim = ANIM_BonyBeetle_Anim2E; } enemy->varTable[9] = 7; return ApiStatus_BLOCK; @@ -136,7 +136,7 @@ API_CALLABLE(N(TackleAI_Main)) { enemy->instigatorValue = 0; } if (enemy->varTable[8] != 0) { - switch (npc->currentAnim) { + switch (npc->curAnim) { case ANIM_BonyBeetle_Anim04: case ANIM_BonyBeetle_Anim0C: case ANIM_BonyBeetle_Anim0E: @@ -144,7 +144,7 @@ API_CALLABLE(N(TackleAI_Main)) { case ANIM_BonyBeetle_Anim12: case ANIM_BonyBeetle_Anim16: case ANIM_BonyBeetle_Anim18: - npc->currentAnim++; + npc->curAnim++; break; } } diff --git a/src/world/common/enemy/ai/WanderMeleeAI.inc.c b/src/world/common/enemy/ai/WanderMeleeAI.inc.c index 18d2356c34..b5e8bc0e82 100644 --- a/src/world/common/enemy/ai/WanderMeleeAI.inc.c +++ b/src/world/common/enemy/ai/WanderMeleeAI.inc.c @@ -41,7 +41,7 @@ ApiStatus N(WanderMeleeAI_Main)(Evt* script, s32 isInitialCall) { if (isInitialCall || (enemy->aiFlags & ENEMY_AI_FLAG_SUSPEND)) { script->AI_TEMP_STATE = AI_STATE_WANDER_INIT; npc->duration = 0; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; npc->flags &= ~NPC_FLAG_JUMPING; if (!enemy->territory->wander.isFlying) { diff --git a/src/world/common/entity/Pipe.inc.c b/src/world/common/entity/Pipe.inc.c index 22ab447225..015014daf6 100644 --- a/src/world/common/entity/Pipe.inc.c +++ b/src/world/common/entity/Pipe.inc.c @@ -45,7 +45,7 @@ API_CALLABLE(N(Pipe_SetAnimFlag)) { } API_CALLABLE(N(Pipe_GetCurrentFloor)) { - script->varTable[0] = gCollisionStatus.currentFloor; + script->varTable[0] = gCollisionStatus.curFloor; return ApiStatus_DONE2; } @@ -53,7 +53,7 @@ API_CALLABLE(N(Pipe_AwaitDownInput)) { CollisionStatus* collisionStatus = &gCollisionStatus; s32 stickX, stickY; - if (collisionStatus->currentFloor != script->varTable[11]) { + if (collisionStatus->curFloor != script->varTable[11]) { script->varTable[0] = FALSE; return ApiStatus_DONE2; } @@ -88,16 +88,16 @@ API_CALLABLE(N(Pipe_GetEntryPos)) { } API_CALLABLE(N(Pipe_GetCameraYaw)) { - script->varTable[0] = clamp_angle(gCameras[gCurrentCameraID].currentYaw + 180.0f); + script->varTable[0] = clamp_angle(gCameras[gCurrentCameraID].curYaw + 180.0f); return ApiStatus_DONE2; } API_CALLABLE(N(Pipe_GetPointAheadOfPlayer)) { PlayerStatus* playerStatus = &gPlayerStatus; f32 r = evt_get_float_variable(script, *script->ptrReadPos); - f32 x = playerStatus->position.x; - f32 y = playerStatus->position.y; - f32 z = playerStatus->position.z; + f32 x = playerStatus->pos.x; + f32 y = playerStatus->pos.y; + f32 z = playerStatus->pos.z; add_vec2D_polar(&x, &z, r, playerStatus->targetYaw); evt_set_float_variable(script, LVar0, x); diff --git a/src/world/common/entity/SuperBlock.inc.c b/src/world/common/entity/SuperBlock.inc.c index 790a2a94a6..9a981bd487 100644 --- a/src/world/common/entity/SuperBlock.inc.c +++ b/src/world/common/entity/SuperBlock.inc.c @@ -196,7 +196,7 @@ API_CALLABLE(N(SuperBlock_SwitchToPartner)) { } API_CALLABLE(N(SuperBlock_LoadCurrentPartnerName)) { - set_message_msg(gPartnerPopupProperties[gPlayerData.currentPartner].nameMsg, 0); + set_message_msg(gPartnerPopupProperties[gPlayerData.curPartner].nameMsg, 0); return ApiStatus_DONE2; } @@ -205,7 +205,7 @@ API_CALLABLE(N(SuperBlock_StartGlowEffect)) { s32 entityIdx = evt_get_variable(script, *args++); Entity* entity = get_entity_by_index(entityIdx); s32 effectPtrOutVar = *args++; - EffectInstance* effectInst = fx_energy_orb_wave(0, entity->position.x, entity->position.y + 12.5f, entity->position.z, 0.7f, 0); + EffectInstance* effectInst = fx_energy_orb_wave(0, entity->pos.x, entity->pos.y + 12.5f, entity->pos.z, 0.7f, 0); evt_set_variable(script, effectPtrOutVar, (s32) effectInst); return ApiStatus_DONE2; @@ -221,7 +221,7 @@ API_CALLABLE(N(SuperBlock_EndGlowEffect)) { API_CALLABLE(N(SuperBlock_GatherEnergyFX)) { Entity* entity = get_entity_by_index(evt_get_variable(script, *script->ptrReadPos)); - fx_radial_shimmer(4, entity->position.x, entity->position.y + 12.5f, entity->position.z, 1.0f, 75); + fx_radial_shimmer(4, entity->pos.x, entity->pos.y + 12.5f, entity->pos.z, 1.0f, 75); return ApiStatus_DONE2; } @@ -256,7 +256,7 @@ API_CALLABLE(N(SuperBlock_AnimateEnergyOrbs)) { f32 t1; s32 i; - sin_cos_deg(gCameras[gCurrentCameraID].currentYaw, &sinTheta, &cosTheta); + sin_cos_deg(gCameras[gCurrentCameraID].curYaw, &sinTheta, &cosTheta); if (isInitialCall) { script->userData = (EnergyOrbSet*)general_heap_malloc(sizeof(EnergyOrbSet)); @@ -265,8 +265,8 @@ API_CALLABLE(N(SuperBlock_AnimateEnergyOrbs)) { userData->superBlock = get_entity_by_index(evt_get_variable(script, *args++)); for (i = 0; i < SUPER_BLOCK_NUM_ORBS; i++) { - userData->orbEffects[i] = (EffectInstance*)fx_motion_blur_flame(0, userData->superBlock->position.x, - userData->superBlock->position.y + 12.5f, userData->superBlock->position.z, 1.0f, -1); + userData->orbEffects[i] = (EffectInstance*)fx_motion_blur_flame(0, userData->superBlock->pos.x, + userData->superBlock->pos.y + 12.5f, userData->superBlock->pos.z, 1.0f, -1); t1 = 0.0f; userData->posZ[i] = t1; userData->posY[i] = t1; @@ -287,9 +287,9 @@ API_CALLABLE(N(SuperBlock_AnimateEnergyOrbs)) { add_vec2D_polar(&x, &userData->partnerPosY[i], t1, N(SuperBlock_UpgradeOrbAngles)[i]); userData->partnerPosX[i] = cosTheta * x; userData->partnerPosZ[i] = sinTheta * x; - userData->partnerPosX[i] = partner->pos.x - (userData->superBlock->position.x + userData->partnerPosX[i]); - userData->partnerPosY[i] = partner->pos.y - (userData->superBlock->position.y + userData->partnerPosY[i]); - userData->partnerPosZ[i] = partner->pos.z - (userData->superBlock->position.z + userData->partnerPosZ[i]); + userData->partnerPosX[i] = partner->pos.x - (userData->superBlock->pos.x + userData->partnerPosX[i]); + userData->partnerPosY[i] = partner->pos.y - (userData->superBlock->pos.y + userData->partnerPosY[i]); + userData->partnerPosZ[i] = partner->pos.z - (userData->superBlock->pos.z + userData->partnerPosZ[i]); } } diff --git a/src/world/common/lava_piranha/part2.inc.c b/src/world/common/lava_piranha/part2.inc.c index e79d272c07..b841c503e5 100644 --- a/src/world/common/lava_piranha/part2.inc.c +++ b/src/world/common/lava_piranha/part2.inc.c @@ -276,7 +276,7 @@ void N(worker_render_piranha_vines)(void) { renderTask.appendGfx = &N(appendGfx_piranha_vines); renderTask.appendGfxArg = 0; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_SURFACE_OPA; queue_render_task(&renderTask); diff --git a/src/world/common/npc/Boo_Patrol.inc.c b/src/world/common/npc/Boo_Patrol.inc.c index 2d49f322ba..7ee385600c 100644 --- a/src/world/common/npc/Boo_Patrol.inc.c +++ b/src/world/common/npc/Boo_Patrol.inc.c @@ -50,7 +50,7 @@ void N(BooPatrolAI_Loiter)(Evt* script, MobileAISettings* aiSettings, EnemyDetec npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1); } else { script->functionTemp[0] = 4; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; } } } diff --git a/src/world/common/todo/AddPlayerHandsOffset.inc.c b/src/world/common/todo/AddPlayerHandsOffset.inc.c index ec3c882eeb..5219aabd14 100644 --- a/src/world/common/todo/AddPlayerHandsOffset.inc.c +++ b/src/world/common/todo/AddPlayerHandsOffset.inc.c @@ -12,7 +12,7 @@ API_CALLABLE(N(AddPlayerHandsOffset)) { f32 z = (f32)evt_get_variable(script, zVar); f32 cameraYaw; - cameraYaw = gCameras[gCurrentCameraID].currentYaw; + cameraYaw = gCameras[gCurrentCameraID].curYaw; if (playerStatus->spriteFacingAngle == 0.0f) { cameraYaw -= 100.0f; diff --git a/src/world/common/todo/AwaitPlayerNearNpc.inc.c b/src/world/common/todo/AwaitPlayerNearNpc.inc.c index e4cd78c586..e4b167484a 100644 --- a/src/world/common/todo/AwaitPlayerNearNpc.inc.c +++ b/src/world/common/todo/AwaitPlayerNearNpc.inc.c @@ -14,7 +14,7 @@ API_CALLABLE(N(AwaitPlayerNearNpc)) { PlayerStatus* playerStatus = &gPlayerStatus; Npc* npc = get_npc_safe(script->owner2.npcID); - if (dist2D(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z) < 50.0f) { + if (dist2D(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z) < 50.0f) { return ApiStatus_DONE2; } diff --git a/src/world/common/todo/GetEncounterEnemyIsOwner.inc.c b/src/world/common/todo/GetEncounterEnemyIsOwner.inc.c index a7bf2de6da..0bf64258c8 100644 --- a/src/world/common/todo/GetEncounterEnemyIsOwner.inc.c +++ b/src/world/common/todo/GetEncounterEnemyIsOwner.inc.c @@ -4,6 +4,6 @@ API_CALLABLE(N(GetEncounterEnemyIsOwner)) { Enemy* enemy = script->owner1.enemy; - evt_set_variable(script, LVar0, gCurrentEncounter.currentEnemy == enemy); + evt_set_variable(script, LVar0, gCurrentEncounter.curEnemy == enemy); return ApiStatus_DONE2; } diff --git a/src/world/common/todo/GetEntityPosition.inc.c b/src/world/common/todo/GetEntityPosition.inc.c index 662ee13508..e220a38059 100644 --- a/src/world/common/todo/GetEntityPosition.inc.c +++ b/src/world/common/todo/GetEntityPosition.inc.c @@ -5,8 +5,8 @@ API_CALLABLE(N(GetEntityPosition)) { Bytecode* args = script->ptrReadPos; Entity* entity = get_entity_by_index(evt_get_variable(script, *args++)); - evt_set_variable(script, *args++, entity->position.x); - evt_set_variable(script, *args++, entity->position.y); - evt_set_variable(script, *args++, entity->position.z); + evt_set_variable(script, *args++, entity->pos.x); + evt_set_variable(script, *args++, entity->pos.y); + evt_set_variable(script, *args++, entity->pos.z); return ApiStatus_DONE2; } diff --git a/src/world/common/todo/GetFloorCollider.inc.c b/src/world/common/todo/GetFloorCollider.inc.c index 9de2226649..238ff3333f 100644 --- a/src/world/common/todo/GetFloorCollider.inc.c +++ b/src/world/common/todo/GetFloorCollider.inc.c @@ -5,6 +5,6 @@ API_CALLABLE(N(GetFloorCollider)) { Bytecode* args = script->ptrReadPos; s32 outVar = *args++; - evt_set_variable(script, outVar, gCollisionStatus.currentFloor); + evt_set_variable(script, outVar, gCollisionStatus.curFloor); return ApiStatus_DONE2; } diff --git a/src/world/common/todo/GetLeftRightPoints.inc.c b/src/world/common/todo/GetLeftRightPoints.inc.c index 137dcd2762..b8cc35ea97 100644 --- a/src/world/common/todo/GetLeftRightPoints.inc.c +++ b/src/world/common/todo/GetLeftRightPoints.inc.c @@ -7,9 +7,9 @@ API_CALLABLE(N(GetLeftRightPoints)) { s32 posZ = evt_get_variable(script, *args++); f32 dist = evt_get_variable(script, *args++); - script->varTable[0] = posX + (sin_deg(gCameras[CAM_DEFAULT].currentYaw + 270.0f + dist) * 100.0f); - script->varTable[1] = posZ - (cos_deg(gCameras[CAM_DEFAULT].currentYaw + 270.0f + dist) * 100.0f); - script->varTable[2] = posX + (sin_deg(gCameras[CAM_DEFAULT].currentYaw + 90.0f + dist) * 100.0f); - script->varTable[3] = posZ - (cos_deg(gCameras[CAM_DEFAULT].currentYaw + 90.0f + dist) * 100.0f); + script->varTable[0] = posX + (sin_deg(gCameras[CAM_DEFAULT].curYaw + 270.0f + dist) * 100.0f); + script->varTable[1] = posZ - (cos_deg(gCameras[CAM_DEFAULT].curYaw + 270.0f + dist) * 100.0f); + script->varTable[2] = posX + (sin_deg(gCameras[CAM_DEFAULT].curYaw + 90.0f + dist) * 100.0f); + script->varTable[3] = posZ - (cos_deg(gCameras[CAM_DEFAULT].curYaw + 90.0f + dist) * 100.0f); return ApiStatus_DONE2; } diff --git a/src/world/common/todo/SetEntityPosition.inc.c b/src/world/common/todo/SetEntityPosition.inc.c index b7d14d1939..2c3582d850 100644 --- a/src/world/common/todo/SetEntityPosition.inc.c +++ b/src/world/common/todo/SetEntityPosition.inc.c @@ -8,8 +8,8 @@ API_CALLABLE(N(SetEntityPosition)) { s32 z = evt_get_variable(script, *args++); Entity* entity = get_entity_by_index(entityIndex); - entity->position.x = x; - entity->position.y = y; - entity->position.z = z; + entity->pos.x = x; + entity->pos.y = y; + entity->pos.z = z; return ApiStatus_DONE2; } diff --git a/src/world/common/todo/SetEntityPositionF.inc.c b/src/world/common/todo/SetEntityPositionF.inc.c index 0560d3d531..312ed18021 100644 --- a/src/world/common/todo/SetEntityPositionF.inc.c +++ b/src/world/common/todo/SetEntityPositionF.inc.c @@ -9,8 +9,8 @@ API_CALLABLE(N(SetEntityPositionF)) { f32 z = evt_get_variable(script, *args++); Entity* entity = get_entity_by_index(entityIndex); - entity->position.x = x; - entity->position.y = y; - entity->position.z = z; + entity->pos.x = x; + entity->pos.y = y; + entity->pos.z = z; return ApiStatus_DONE2; } diff --git a/src/world/common/todo/SomeItemEntityFunc.inc.c b/src/world/common/todo/SomeItemEntityFunc.inc.c index c3eaf38b86..48380d1bba 100644 --- a/src/world/common/todo/SomeItemEntityFunc.inc.c +++ b/src/world/common/todo/SomeItemEntityFunc.inc.c @@ -5,14 +5,14 @@ API_CALLABLE(N(SomeItemEntityFunc)) { ItemEntity* itemEntity = get_item_entity(script->varTable[0]); if (isInitialCall) { - script->functionTempF[2] = itemEntity->position.y; + script->functionTempF[2] = itemEntity->pos.y; script->functionTemp[1] = 0; script->functionTemp[3] = 0; } switch (script->functionTemp[1]) { case 0: - itemEntity->position.y = script->functionTempF[2] + ((1.0f - cos_rad((script->functionTemp[3] * + itemEntity->pos.y = script->functionTempF[2] + ((1.0f - cos_rad((script->functionTemp[3] * (PI / 2)) / 30.0f)) * 20.0f); if (script->functionTemp[3] == 30) { script->functionTemp[1] = 1; @@ -22,7 +22,7 @@ API_CALLABLE(N(SomeItemEntityFunc)) { } break; case 1: - itemEntity->position.y = script->functionTempF[2] + 17.0f + (cos_deg(script->functionTemp[3]) * 3.0f); + itemEntity->pos.y = script->functionTempF[2] + 17.0f + (cos_deg(script->functionTemp[3]) * 3.0f); script->functionTemp[3] = clamp_angle(script->functionTemp[3] + 9); break; } diff --git a/src/world/common/todo/SpinyTromp_CheckDist.inc.c b/src/world/common/todo/SpinyTromp_CheckDist.inc.c index bb2304570b..fb78b85fe6 100644 --- a/src/world/common/todo/SpinyTromp_CheckDist.inc.c +++ b/src/world/common/todo/SpinyTromp_CheckDist.inc.c @@ -2,9 +2,9 @@ #include "npc.h" API_CALLABLE(N(SpinyTromp_CheckDist)) { - f32 x = script->varTable[0] - gPlayerStatus.position.x; - f32 y = script->varTable[2] - gPlayerStatus.position.y; - f32 z = 0.0f - gPlayerStatus.position.z; + f32 x = script->varTable[0] - gPlayerStatus.pos.x; + f32 y = script->varTable[2] - gPlayerStatus.pos.y; + f32 z = 0.0f - gPlayerStatus.pos.z; script->varTable[4] = sqrtf(SQ(x) + SQ(y) + SQ(z)); diff --git a/src/world/common/todo/StarSpiritEffectFunc.inc.c b/src/world/common/todo/StarSpiritEffectFunc.inc.c index 635440664b..706870afd9 100644 --- a/src/world/common/todo/StarSpiritEffectFunc.inc.c +++ b/src/world/common/todo/StarSpiritEffectFunc.inc.c @@ -129,7 +129,7 @@ API_CALLABLE(N(StarSpiritEffectFunc3)) { case 2: ptr->unk_04 = ptr->unk_24 + (2.0f * (sin_deg(ptr->unk_4C) + 1.0f)); ptr->unk_4C = clamp_angle(ptr->unk_4C + 8); - if (!(dist3D(playerStatus->position.x, playerStatus->position.y + 20.0f, playerStatus->position.z, + if (!(dist3D(playerStatus->pos.x, playerStatus->pos.y + 20.0f, playerStatus->pos.z, ptr->unk_00, ptr->unk_04, ptr->unk_08) > 30.0f)) { ptr->unk_4E = 3; } @@ -184,7 +184,7 @@ API_CALLABLE(N(StarSpiritEffectFunc6)) { ptr->unk_04 = ptr->unk_24 + (2.0f * (sin_deg(ptr->unk_4C) + 1.0f)); ptr->unk_4C = clamp_angle(ptr->unk_4C + 8); - if (dist2D(playerStatus->position.x, playerStatus->position.z, + if (dist2D(playerStatus->pos.x, playerStatus->pos.z, ptr->unk_18, ptr->unk_20) <= 30.0f) { ptr->unk_4E = 3; } diff --git a/src/world/common/todo/UnkFunc12.inc.c b/src/world/common/todo/UnkFunc12.inc.c index b02ff48ab6..6846ccbeeb 100644 --- a/src/world/common/todo/UnkFunc12.inc.c +++ b/src/world/common/todo/UnkFunc12.inc.c @@ -6,21 +6,21 @@ API_CALLABLE(N(UnkFunc12)) { f32 posX, posY, posZ, hitDepth; if (script->varTable[5] == 0) { - playerStatus->position.x = script->varTable[0]; + playerStatus->pos.x = script->varTable[0]; } else { - playerStatus->position.z = script->varTable[0]; + playerStatus->pos.z = script->varTable[0]; } - posX = playerStatus->position.x; - posY = playerStatus->position.y + 10.0f; - posZ = playerStatus->position.z; + posX = playerStatus->pos.x; + posY = playerStatus->pos.y + 10.0f; + posZ = playerStatus->pos.z; hitDepth = 40.0f; npc_raycast_down_sides(0, &posX, &posY, &posZ, &hitDepth); - playerStatus->position.x = posX; - playerStatus->position.y = posY; - playerStatus->position.z = posZ; + playerStatus->pos.x = posX; + playerStatus->pos.y = posY; + playerStatus->pos.z = posZ; return ApiStatus_DONE2; } diff --git a/src/world/common/todo/UnkFunc62.inc.c b/src/world/common/todo/UnkFunc62.inc.c index 246941e770..ef324d0bc6 100644 --- a/src/world/common/todo/UnkFunc62.inc.c +++ b/src/world/common/todo/UnkFunc62.inc.c @@ -38,38 +38,38 @@ API_CALLABLE(N(UnkFunc62)) { } if (script->functionTemp[0] == 0) { - state->currentPos.x = actor->currentPos.x; - state->currentPos.y = actor->currentPos.y; + state->curPos.x = actor->curPos.x; + state->curPos.y = actor->curPos.y; stateGoalX = state->goalPos.x; stateGoalZ = state->goalPos.z; - stateCurrentX = state->currentPos.x; - stateCurrentZ = actor->currentPos.z; - state->currentPos.z = stateCurrentZ; + stateCurrentX = state->curPos.x; + stateCurrentZ = actor->curPos.z; + state->curPos.z = stateCurrentZ; state->angle = atan2(stateCurrentX, stateCurrentZ, stateGoalX, stateGoalZ); - state->distance = dist2D(stateCurrentX, stateCurrentZ, stateGoalX, stateGoalZ); + state->dist = dist2D(stateCurrentX, stateCurrentZ, stateGoalX, stateGoalZ); if (state->moveTime == 0) { - state->moveTime = state->distance / state->speed; - phi_f8 = state->distance - (state->moveTime * state->speed); + state->moveTime = state->dist / state->speed; + phi_f8 = state->dist - (state->moveTime * state->speed); } else { - state->speed = state->distance / state->moveTime; - phi_f8 = state->distance - (state->moveTime * state->speed); + state->speed = state->dist / state->moveTime; + phi_f8 = state->dist - (state->moveTime * state->speed); } if (state->moveTime == 0) { return ApiStatus_DONE2; } - state->unk_30.x = (state->goalPos.x - state->currentPos.x) / state->moveTime; - state->unk_30.y = (state->goalPos.y - state->currentPos.y) / state->moveTime; - state->unk_30.z = (state->goalPos.z - state->currentPos.z) / state->moveTime; + state->unk_30.x = (state->goalPos.x - state->curPos.x) / state->moveTime; + state->unk_30.y = (state->goalPos.y - state->curPos.y) / state->moveTime; + state->unk_30.z = (state->goalPos.z - state->curPos.z) / state->moveTime; state->acceleration = PI_S / state->moveTime; - state->velocity = 0.0f; + state->vel = 0.0f; state->speed += phi_f8 / state->moveTime; if (state->moveArcAmplitude < 3) { state->unk_24 = 90.0f; state->unk_28 = 360 / state->moveTime; - phi_f8 = state->distance; + phi_f8 = state->dist; phi_f8 -= 20.0; phi_f8 /= 6.0; phi_f8 += 47.0; @@ -79,15 +79,15 @@ API_CALLABLE(N(UnkFunc62)) { } state->unk_18.x = 0.0f; state->unk_18.y = 0.0f; - phi_f20 = state->velocity; + phi_f20 = state->vel; temp_f22_2 = state->acceleration; phi_f0 = sin_rad(DEG_TO_RAD(state->unk_24)); phi_f2 = 0.53; - state->velocity = phi_f20 + ((phi_f0 * phi_f2 * temp_f22_2) + temp_f22_2); + state->vel = phi_f20 + ((phi_f0 * phi_f2 * temp_f22_2) + temp_f22_2); } else { state->unk_24 = 90.0f; state->unk_28 = 360 / state->moveTime; - phi_f8 = state->distance; + phi_f8 = state->dist; phi_f8 -= 20.0; phi_f8 /= 6.0; phi_f8 += 47.0; @@ -97,11 +97,11 @@ API_CALLABLE(N(UnkFunc62)) { } state->unk_18.x = 0.0f; state->unk_18.y = 0.0f; - velocity = state->velocity; + velocity = state->vel; temp_f22_3 = state->acceleration; phi_f0 = sin_rad(DEG_TO_RAD(state->unk_24)); phi_f2 = 0.8; - state->velocity = velocity + ((phi_f0 * phi_f2 * temp_f22_3) + temp_f22_3); + state->vel = velocity + ((phi_f0 * phi_f2 * temp_f22_3) + temp_f22_3); } set_animation(ACTOR_SELF, 1, state->animJumpRise); sfx_play_sound(SOUND_JUMP_2081); @@ -110,45 +110,45 @@ API_CALLABLE(N(UnkFunc62)) { switch (script->functionTemp[0]) { case 1: - if (state->velocity > PI_S / 2) { + if (state->vel > PI_S / 2) { set_animation(ACTOR_SELF, 1, state->animJumpFall); } - oldActorX = actor->currentPos.x; - oldActorY = actor->currentPos.y; - state->currentPos.x += state->unk_30.x; - state->currentPos.y = state->currentPos.y + state->unk_30.y; - state->currentPos.z = state->currentPos.z + state->unk_30.z; - state->unk_18.x = actor->currentPos.y; - actor->currentPos.x = state->currentPos.x; - actor->currentPos.y = state->currentPos.y + (state->bounceDivisor * sin_rad(state->velocity)); - actor->currentPos.z = state->currentPos.z; - if (state->goalPos.y > actor->currentPos.y && state->moveTime < 3) { - actor->currentPos.y = state->goalPos.y; + oldActorX = actor->curPos.x; + oldActorY = actor->curPos.y; + state->curPos.x += state->unk_30.x; + state->curPos.y = state->curPos.y + state->unk_30.y; + state->curPos.z = state->curPos.z + state->unk_30.z; + state->unk_18.x = actor->curPos.y; + actor->curPos.x = state->curPos.x; + actor->curPos.y = state->curPos.y + (state->bounceDivisor * sin_rad(state->vel)); + actor->curPos.z = state->curPos.z; + if (state->goalPos.y > actor->curPos.y && state->moveTime < 3) { + actor->curPos.y = state->goalPos.y; } - actor->rotation.z = -atan2(oldActorX, -oldActorY, actor->currentPos.x, -actor->currentPos.y); - state->unk_18.y = actor->currentPos.y; + actor->rot.z = -atan2(oldActorX, -oldActorY, actor->curPos.x, -actor->curPos.y); + state->unk_18.y = actor->curPos.y; if (state->moveArcAmplitude < 3) { - phi_f20_2 = state->velocity; + phi_f20_2 = state->vel; temp_f22_5 = state->acceleration; phi_f0_2 = sin_rad(DEG_TO_RAD(state->unk_24)); phi_f2_2 = 0.53; - state->velocity = phi_f20_2 + ((phi_f0_2 * phi_f2_2 * temp_f22_5) + temp_f22_5); + state->vel = phi_f20_2 + ((phi_f0_2 * phi_f2_2 * temp_f22_5) + temp_f22_5); } else { - temp_f20_6 = state->velocity; + temp_f20_6 = state->vel; temp_f22_6 = state->acceleration; phi_f0_2 = sin_rad(DEG_TO_RAD(state->unk_24)); phi_f2_2 = 0.8; - state->velocity = temp_f20_6 + ((phi_f0_2 * phi_f2_2 * temp_f22_6) + temp_f22_6); + state->vel = temp_f20_6 + ((phi_f0_2 * phi_f2_2 * temp_f22_6) + temp_f22_6); } state->unk_24 += state->unk_28; state->unk_24 = clamp_angle(state->unk_24); state->moveTime--; if (state->moveTime == 0) { - actor->currentPos.y = state->goalPos.y; + actor->curPos.y = state->goalPos.y; state->acceleration = 1.8f; - state->velocity = -(state->unk_18.x - state->unk_18.y); + state->vel = -(state->unk_18.x - state->unk_18.y); set_animation(ACTOR_SELF, 1, state->animJumpLand); return ApiStatus_DONE1; } @@ -157,23 +157,23 @@ API_CALLABLE(N(UnkFunc62)) { state->moveTime = 1; state->acceleration = 1.8f; state->unk_24 = 90.0f; - state->velocity = -(state->unk_18.x - state->unk_18.y); + state->vel = -(state->unk_18.x - state->unk_18.y); state->bounceDivisor = fabsf(state->unk_18.x - state->unk_18.y) / 16.5; state->unk_28 = 360 / state->moveTime; - state->currentPos.x = actor->currentPos.x; - state->currentPos.y = actor->currentPos.y; - state->currentPos.z = actor->currentPos.z; + state->curPos.x = actor->curPos.x; + state->curPos.y = actor->curPos.y; + state->curPos.z = actor->curPos.z; script->functionTemp[0] = 3; // fallthrough case 3: - currentPosX64 = state->currentPos.x; // required to match - state->currentPos.x = currentPosX64 + state->bounceDivisor * sin_rad(DEG_TO_RAD(state->unk_24)) / 33.0; - state->currentPos.y -= state->bounceDivisor * sin_rad(DEG_TO_RAD(state->unk_24)); + currentPosX64 = state->curPos.x; // required to match + state->curPos.x = currentPosX64 + state->bounceDivisor * sin_rad(DEG_TO_RAD(state->unk_24)) / 33.0; + state->curPos.y -= state->bounceDivisor * sin_rad(DEG_TO_RAD(state->unk_24)); state->unk_24 += state->unk_28; state->unk_24 = clamp_angle(state->unk_24); - actor->currentPos.x = state->currentPos.x; - actor->currentPos.y = state->currentPos.y; - actor->currentPos.z = state->currentPos.z; + actor->curPos.x = state->curPos.x; + actor->curPos.y = state->curPos.y; + actor->curPos.z = state->curPos.z; state->moveTime--; if (state->moveTime == 0) { diff --git a/src/world/common/todo/UnkMoveFunc1.inc.c b/src/world/common/todo/UnkMoveFunc1.inc.c index 0d91d762ba..1449d8094b 100644 --- a/src/world/common/todo/UnkMoveFunc1.inc.c +++ b/src/world/common/todo/UnkMoveFunc1.inc.c @@ -5,9 +5,9 @@ API_CALLABLE(N(UnkMoveFunc1)) { BattleStatus* battleStatus = &gBattleStatus; Actor* playerActor = battleStatus->playerActor; - f32 posX = playerActor->currentPos.x; - f32 posY = playerActor->currentPos.y; - f32 posZ = playerActor->currentPos.z; + f32 posX = playerActor->curPos.x; + f32 posY = playerActor->curPos.y; + f32 posZ = playerActor->curPos.z; f32 goalX = playerActor->state.goalPos.x; f32 goalY = playerActor->state.goalPos.y; f32 goalZ = playerActor->state.goalPos.z; diff --git a/src/world/common/todo/UpdateLogShadow.inc.c b/src/world/common/todo/UpdateLogShadow.inc.c index 69a04474c7..4d59eb9eaa 100644 --- a/src/world/common/todo/UpdateLogShadow.inc.c +++ b/src/world/common/todo/UpdateLogShadow.inc.c @@ -29,12 +29,12 @@ API_CALLABLE(N(UpdateLogShadow)) { z = model->center.z; entity_raycast_down(&x, &y, &z, &hitYaw, &hitPitch, &hitLength); set_standard_shadow_scale(shadow, hitLength); - shadow->rotation.y = 0.0f; - shadow->position.x = x; - shadow->position.y = y; - shadow->position.z = z; - shadow->rotation.x = hitYaw; - shadow->rotation.z = hitPitch; + shadow->rot.y = 0.0f; + shadow->pos.x = x; + shadow->pos.y = y; + shadow->pos.z = z; + shadow->rot.x = hitYaw; + shadow->rot.z = hitPitch; shadow->scale.x *= 2.0f; shadow->scale.z *= 2.0f; return ApiStatus_BLOCK; diff --git a/src/world/common/util/ChangeNpcToPartner.inc.c b/src/world/common/util/ChangeNpcToPartner.inc.c index 792bdbf577..f982539bc4 100644 --- a/src/world/common/util/ChangeNpcToPartner.inc.c +++ b/src/world/common/util/ChangeNpcToPartner.inc.c @@ -12,7 +12,7 @@ API_CALLABLE(N(ChangeNpcToPartner)) { Npc* npc = get_npc_safe(npcID); if (isInitialCall) { - if (gPlayerData.currentPartner == PARTNER_NONE) { + if (gPlayerData.curPartner == PARTNER_NONE) { script->functionTemp[0] = 2; } else { script->functionTemp[0] = 0; @@ -32,10 +32,10 @@ API_CALLABLE(N(ChangeNpcToPartner)) { } break; case 2: - playerData->currentPartner = partnerID; + playerData->curPartner = partnerID; playerData->partners[partnerID].enabled = TRUE; partner_clear_player_tracking(npc); - func_800EB2A4(playerData->currentPartner); + func_800EB2A4(playerData->curPartner); script->functionTemp[0] = 3; break; case 3: diff --git a/src/world/common/util/CheckPositionRelativeToPlane.inc.c b/src/world/common/util/CheckPositionRelativeToPlane.inc.c index 5493583cf0..14cf1edec8 100644 --- a/src/world/common/util/CheckPositionRelativeToPlane.inc.c +++ b/src/world/common/util/CheckPositionRelativeToPlane.inc.c @@ -47,7 +47,7 @@ API_CALLABLE(N(CheckPositionRelativeToPlane)) { dzdx = (Bz - Az) / (Bx - Ax); // this is equivalent to testing the determinant: ((Bx - Ax)*(Pz - Az) - (Bz - Az)*(Px - Ax)) < 0 - if (playerStatus->position.z < ((dzdx * playerStatus->position.x) + (Az - (dzdx * Ax)))) { + if (playerStatus->pos.z < ((dzdx * playerStatus->pos.x) + (Az - (dzdx * Ax)))) { script->varTable[0] = PLANE_SIDE_NEGATIVE; } else { script->varTable[0] = PLANE_SIDE_POSITIVE; diff --git a/src/world/common/util/GetKammyBroomEmitterPos.inc.c b/src/world/common/util/GetKammyBroomEmitterPos.inc.c index 357b7d4651..a06a2e795e 100644 --- a/src/world/common/util/GetKammyBroomEmitterPos.inc.c +++ b/src/world/common/util/GetKammyBroomEmitterPos.inc.c @@ -9,8 +9,8 @@ API_CALLABLE(N(GetKammyBroomEmitterPos)) { Npc* npc = get_npc_unsafe(KAMMY_NPC); - script->varTable[0] = npc->pos.x + (sin_deg(npc->yaw + gCameras[CAM_DEFAULT].currentYaw + 180.0f) * 40.0f); + script->varTable[0] = npc->pos.x + (sin_deg(npc->yaw + gCameras[CAM_DEFAULT].curYaw + 180.0f) * 40.0f); script->varTable[1] = npc->pos.y + 8.0f; - script->varTable[2] = npc->pos.z - (cos_deg(npc->yaw + gCameras[CAM_DEFAULT].currentYaw + 180.0f) * 40.0f); + script->varTable[2] = npc->pos.z - (cos_deg(npc->yaw + gCameras[CAM_DEFAULT].curYaw + 180.0f) * 40.0f); return ApiStatus_DONE2; } diff --git a/src/world/common/util/MonitorPlayerOrbiting.inc.c b/src/world/common/util/MonitorPlayerOrbiting.inc.c index 2933c22f23..ff09ed8118 100644 --- a/src/world/common/util/MonitorPlayerOrbiting.inc.c +++ b/src/world/common/util/MonitorPlayerOrbiting.inc.c @@ -33,8 +33,8 @@ API_CALLABLE(N(MonitorPlayerOrbiting)) { // wait for player to come within range dist = get_xz_dist_to_player(orbit->pos.x, orbit->pos.z); if (dist < orbit->startRadius) { - orbit->firstPlayerX = playerStatus->position.x; - orbit->firstPlayerZ = playerStatus->position.z; + orbit->firstPlayerX = playerStatus->pos.x; + orbit->firstPlayerZ = playerStatus->pos.z; orbit->state++; } break; @@ -44,7 +44,7 @@ API_CALLABLE(N(MonitorPlayerOrbiting)) { dist = get_xz_dist_to_player(orbit->pos.x, orbit->pos.z); if (dist < orbit->startRadius) { prevAngle = atan2(orbit->pos.x, orbit->pos.z, orbit->firstPlayerX, orbit->firstPlayerZ); - curAngle = atan2(orbit->pos.x, orbit->pos.z, playerStatus->position.x, playerStatus->position.z); + curAngle = atan2(orbit->pos.x, orbit->pos.z, playerStatus->pos.x, playerStatus->pos.z); deltaAngle = get_clamped_angle_diff(prevAngle, curAngle); orbit->direction = signF(deltaAngle); orbit->state++; @@ -57,11 +57,11 @@ API_CALLABLE(N(MonitorPlayerOrbiting)) { dist = get_xz_dist_to_player(orbit->pos.x, orbit->pos.z); if (dist < orbit->startRadius) { prevAngle = atan2(orbit->pos.x, orbit->pos.z, orbit->lastPlayerX, orbit->lastPlayerZ); - curAngle = atan2(orbit->pos.x, orbit->pos.z, playerStatus->position.x, playerStatus->position.z); + curAngle = atan2(orbit->pos.x, orbit->pos.z, playerStatus->pos.x, playerStatus->pos.z); deltaAngle = get_clamped_angle_diff(prevAngle, curAngle); if (orbit->direction == signF(deltaAngle)) { prevAngle = atan2(orbit->pos.x, orbit->pos.z, orbit->firstPlayerX, orbit->firstPlayerZ); - curAngle = atan2(orbit->pos.x, orbit->pos.z, playerStatus->position.x, playerStatus->position.z); + curAngle = atan2(orbit->pos.x, orbit->pos.z, playerStatus->pos.x, playerStatus->pos.z); deltaAngle = get_clamped_angle_diff(prevAngle, curAngle); if (fabsf(deltaAngle) > 90.0f) { if (orbit->eventListener != NULL) { @@ -80,7 +80,7 @@ API_CALLABLE(N(MonitorPlayerOrbiting)) { dist = get_xz_dist_to_player(orbit->pos.x, orbit->pos.z); if (dist < orbit->orbitRadius) { prevAngle = atan2(orbit->pos.x, orbit->pos.z, orbit->lastPlayerX, orbit->lastPlayerZ); - curAngle = atan2(orbit->pos.x, orbit->pos.z, playerStatus->position.x, playerStatus->position.z); + curAngle = atan2(orbit->pos.x, orbit->pos.z, playerStatus->pos.x, playerStatus->pos.z); deltaAngle = get_clamped_angle_diff(prevAngle, curAngle); if (orbit->direction != signF(deltaAngle)) { if (orbit->eventListener != NULL) { @@ -116,8 +116,8 @@ API_CALLABLE(N(MonitorPlayerOrbiting)) { break; } - orbit->lastPlayerX = playerStatus->position.x; - orbit->lastPlayerZ = playerStatus->position.z; + orbit->lastPlayerX = playerStatus->pos.x; + orbit->lastPlayerZ = playerStatus->pos.z; return ApiStatus_BLOCK; } diff --git a/src/world/dead/area_flo/flo_00/flo_00_5_beanstalk.c b/src/world/dead/area_flo/flo_00/flo_00_5_beanstalk.c index 806d89e43b..ddb04fa53f 100644 --- a/src/world/dead/area_flo/flo_00/flo_00_5_beanstalk.c +++ b/src/world/dead/area_flo/flo_00/flo_00_5_beanstalk.c @@ -22,10 +22,10 @@ API_CALLABLE(N(PlayerRideBeanstalk)) { f32 clamped = clamp_angle(angle - temp); temp = sin_deg(clamped); - gPlayerStatus.position.x = BEANSTALK_BASE_X + (dist * temp); - gPlayerStatus.position.y = evt_get_variable(NULL, script->varTable[10]) + evt_get_variable(NULL, script->varTable[3]); + gPlayerStatus.pos.x = BEANSTALK_BASE_X + (dist * temp); + gPlayerStatus.pos.y = evt_get_variable(NULL, script->varTable[10]) + evt_get_variable(NULL, script->varTable[3]); temp = cos_deg(clamped); - gPlayerStatus.position.z = BEANSTALK_BASE_Z - (dist * temp); + gPlayerStatus.pos.z = BEANSTALK_BASE_Z - (dist * temp); return ApiStatus_DONE2; } diff --git a/src/world/dead/area_flo/flo_03/flo_03_3_npc.c b/src/world/dead/area_flo/flo_03/flo_03_3_npc.c index 071ac60b28..4ca8311cec 100644 --- a/src/world/dead/area_flo/flo_03/flo_03_3_npc.c +++ b/src/world/dead/area_flo/flo_03/flo_03_3_npc.c @@ -70,7 +70,7 @@ API_CALLABLE(N(HideBehindTree)) { f64 dist; // get a point 46 units away from the tree on the side opposite the player - yaw = clamp_angle(atan2(-210.0f, -183.0f, gPlayerStatus.position.x, gPlayerStatus.position.z) + 180.0f); + yaw = clamp_angle(atan2(-210.0f, -183.0f, gPlayerStatus.pos.x, gPlayerStatus.pos.z) + 180.0f); posX = -210.0f; posZ = -183.0f; add_vec2D_polar(&posX, &posZ, 46.0f, yaw); @@ -102,18 +102,18 @@ API_CALLABLE(N(HideBehindTree)) { osSyncPrintf("cccc\n"); } } - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_RUN]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_RUN]; npc->yaw = atan2(npc->pos.x, npc->pos.z, posX, posZ); npc_move_heading(npc, 2.0f, npc->yaw); } else if (dist > 0.2) { npc->yaw = atan2(npc->pos.x, npc->pos.z, posX, posZ); npc->pos.x = posX; npc->pos.z = posZ; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_WALK]; } else { npc->pos.x = posX; npc->pos.z = posZ; - npc->currentAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; + npc->curAnim = enemy->animList[ENEMY_ANIM_INDEX_IDLE]; } return ApiStatus_BLOCK; } diff --git a/src/world/dead/area_flo/flo_14/flo_14_3_bubbles.c b/src/world/dead/area_flo/flo_14/flo_14_3_bubbles.c index 3e693ecef6..9627b4c91b 100644 --- a/src/world/dead/area_flo/flo_14/flo_14_3_bubbles.c +++ b/src/world/dead/area_flo/flo_14/flo_14_3_bubbles.c @@ -42,7 +42,7 @@ EvtScript N(EVS_TetherParterToPlayer) = { }; API_CALLABLE(N(SavePartnerFlags)) { - if (gPlayerData.currentPartner == PARTNER_NONE) { + if (gPlayerData.curPartner == PARTNER_NONE) { script->varTable[14] = FALSE; return ApiStatus_DONE2; } diff --git a/src/world/dead/area_flo/flo_19/flo_19_5_beanstalk.c b/src/world/dead/area_flo/flo_19/flo_19_5_beanstalk.c index 96db10c0a0..90743d0c63 100644 --- a/src/world/dead/area_flo/flo_19/flo_19_5_beanstalk.c +++ b/src/world/dead/area_flo/flo_19/flo_19_5_beanstalk.c @@ -20,10 +20,10 @@ API_CALLABLE(N(PlayerRideBeanstalk)) { f32 clamped = clamp_angle(angle - temp); temp = sin_deg(clamped); - gPlayerStatus.position.x = (dist * temp) + 0.0f; - gPlayerStatus.position.y = evt_get_variable(NULL, script->varTable[10]) + evt_get_variable(NULL, script->varTable[3]); + gPlayerStatus.pos.x = (dist * temp) + 0.0f; + gPlayerStatus.pos.y = evt_get_variable(NULL, script->varTable[10]) + evt_get_variable(NULL, script->varTable[3]); temp = cos_deg(clamped); - gPlayerStatus.position.z = 0.0f - (dist * temp); + gPlayerStatus.pos.z = 0.0f - (dist * temp); return ApiStatus_DONE2; } diff --git a/src/world/dead/area_kzn/kzn_11/kzn_11_2_platforms.c b/src/world/dead/area_kzn/kzn_11/kzn_11_2_platforms.c index 59d9dd93fe..3f0a7ca650 100644 --- a/src/world/dead/area_kzn/kzn_11/kzn_11_2_platforms.c +++ b/src/world/dead/area_kzn/kzn_11/kzn_11_2_platforms.c @@ -9,13 +9,13 @@ API_CALLABLE(N(AddPushVelocity)) { CollisionStatus* collisionStatus= &gCollisionStatus; Npc* partner; - if ((collisionStatus->currentFloor == floorA) || (collisionStatus->lastTouchedFloor == floorA) - || (collisionStatus->currentFloor == floorB) || (collisionStatus->lastTouchedFloor == floorB)) { - playerStatus->pushVelocity.x = velX; + if ((collisionStatus->curFloor == floorA) || (collisionStatus->lastTouchedFloor == floorA) + || (collisionStatus->curFloor == floorB) || (collisionStatus->lastTouchedFloor == floorB)) { + playerStatus->pushVel.x = velX; } - if (gPlayerData.currentPartner != PARTNER_NONE){ + if (gPlayerData.curPartner != PARTNER_NONE){ partner = get_npc_unsafe(NPC_PARTNER); - if ((partner->currentFloor == floorA) || (partner->currentFloor == floorB)) { + if ((partner->curFloor == floorA) || (partner->curFloor == floorB)) { partner->pos.x += velX; } } @@ -26,7 +26,7 @@ API_CALLABLE(N(GetCurrentFloor)) { Bytecode* args = script->ptrReadPos; s32 outVar = *args++; - evt_set_variable(script, outVar, gCollisionStatus.currentFloor); + evt_set_variable(script, outVar, gCollisionStatus.curFloor); return ApiStatus_DONE2; } diff --git a/src/world/dead/area_kzn/kzn_11/kzn_11_3_npc.c b/src/world/dead/area_kzn/kzn_11/kzn_11_3_npc.c index e080aa99e7..d884c077ba 100644 --- a/src/world/dead/area_kzn/kzn_11/kzn_11_3_npc.c +++ b/src/world/dead/area_kzn/kzn_11/kzn_11_3_npc.c @@ -72,7 +72,7 @@ EvtScript N(EVS_FireBar_Defeated) = { FireBarAISettings N(AISettings_FireBar_01) = { .centerPos = { -300, 20, 15 }, - .rotationRate = 8, + .rotRate = 8, .firstNpc = NPC_FireBar_1A, .npcCount = 4, .callback = N(FireBarAI_Callback), @@ -80,7 +80,7 @@ FireBarAISettings N(AISettings_FireBar_01) = { FireBarAISettings N(AISettings_FireBar_02) = { .centerPos = { 0, 20, 15 }, - .rotationRate = -8, + .rotRate = -8, .firstNpc = NPC_FireBar_2A, .npcCount = 4, .callback = N(FireBarAI_Callback), @@ -88,7 +88,7 @@ FireBarAISettings N(AISettings_FireBar_02) = { FireBarAISettings N(AISettings_FireBar_03) = { .centerPos = { 325, 20, 15 }, - .rotationRate = -8, + .rotRate = -8, .firstNpc = NPC_FireBar_3A, .npcCount = 4, .callback = N(FireBarAI_Callback), diff --git a/src/world/dead/area_kzn/kzn_19/kzn_19_4_npc.c b/src/world/dead/area_kzn/kzn_19/kzn_19_4_npc.c index 3085c6658c..682e9ca099 100644 --- a/src/world/dead/area_kzn/kzn_19/kzn_19_4_npc.c +++ b/src/world/dead/area_kzn/kzn_19/kzn_19_4_npc.c @@ -337,7 +337,7 @@ void N(worker_render_piranha_vines)(void) { renderTask.appendGfx = &N(appendGfx_piranha_vines); renderTask.appendGfxArg = 0; - renderTask.distance = 10; + renderTask.dist = 10; renderTask.renderMode = RENDER_MODE_SURFACE_OPA; queue_render_task(&renderTask); diff --git a/src/world/dead/area_kzn/kzn_20/kzn_20_3_npc.c b/src/world/dead/area_kzn/kzn_20/kzn_20_3_npc.c index 73ad42efd1..1d56585b05 100644 --- a/src/world/dead/area_kzn/kzn_20/kzn_20_3_npc.c +++ b/src/world/dead/area_kzn/kzn_20/kzn_20_3_npc.c @@ -364,7 +364,7 @@ API_CALLABLE(N(GetFloorCollider)) { Bytecode* args = script->ptrReadPos; s32 outVar = *args++; - evt_set_variable(script, outVar, gCollisionStatus.currentFloor); + evt_set_variable(script, outVar, gCollisionStatus.curFloor); return ApiStatus_DONE2; } diff --git a/src/world/dead/area_kzn/kzn_22/kzn_22_2_main.c b/src/world/dead/area_kzn/kzn_22/kzn_22_2_main.c index fd15252b4f..f7ff94243a 100644 --- a/src/world/dead/area_kzn/kzn_22/kzn_22_2_main.c +++ b/src/world/dead/area_kzn/kzn_22/kzn_22_2_main.c @@ -68,7 +68,7 @@ API_CALLABLE(N(GetFloorCollider1)) { Bytecode* args = script->ptrReadPos; s32 outVar = *args++; - evt_set_variable(script, outVar, gCollisionStatus.currentFloor); + evt_set_variable(script, outVar, gCollisionStatus.curFloor); return ApiStatus_DONE2; } diff --git a/src/world/dead/area_kzn/kzn_22/kzn_22_4_npc.c b/src/world/dead/area_kzn/kzn_22/kzn_22_4_npc.c index fbeaeaf96a..bc84fa73bc 100644 --- a/src/world/dead/area_kzn/kzn_22/kzn_22_4_npc.c +++ b/src/world/dead/area_kzn/kzn_22/kzn_22_4_npc.c @@ -5,7 +5,7 @@ API_CALLABLE(N(GetFloorCollider2)) { Bytecode* args = script->ptrReadPos; s32 outVar = *args++; - evt_set_variable(script, outVar, gCollisionStatus.currentFloor); + evt_set_variable(script, outVar, gCollisionStatus.curFloor); return ApiStatus_DONE2; } diff --git a/src/world/dead/area_kzn/kzn_23/kzn_23_3_npc.c b/src/world/dead/area_kzn/kzn_23/kzn_23_3_npc.c index 202869500d..837a4178cb 100644 --- a/src/world/dead/area_kzn/kzn_23/kzn_23_3_npc.c +++ b/src/world/dead/area_kzn/kzn_23/kzn_23_3_npc.c @@ -11,9 +11,9 @@ API_CALLABLE(N(SetChestPosition)) { f32 z = evt_get_variable(script, *args++); Entity* entity = get_entity_by_index(entityIndex); - entity->position.x = x; - entity->position.y = y; - entity->position.z = z; + entity->pos.x = x; + entity->pos.y = y; + entity->pos.z = z; return ApiStatus_DONE2; } @@ -21,9 +21,9 @@ API_CALLABLE(N(GetChestPosition)) { Bytecode* args = script->ptrReadPos; Entity* entity = get_entity_by_index(evt_get_variable(script, *args++)); - evt_set_variable(script, *args++, entity->position.x); - evt_set_variable(script, *args++, entity->position.y); - evt_set_variable(script, *args++, entity->position.z); + evt_set_variable(script, *args++, entity->pos.x); + evt_set_variable(script, *args++, entity->pos.y); + evt_set_variable(script, *args++, entity->pos.z); return ApiStatus_DONE2; } @@ -59,7 +59,7 @@ API_CALLABLE(N(AnimateChestSize)) { entity->scale.y = script->functionTemp[1] / 60.0f; entity->scale.z = script->functionTemp[1] / 60.0f; - entity->rotation.y = (1.0f - cos_rad(entity->scale.y * PI)) * 990.0 / 2.0; + entity->rot.y = (1.0f - cos_rad(entity->scale.y * PI)) * 990.0 / 2.0; script->functionTemp[1]--; if (~script->functionTemp[1] == 0) { //TODO remove ~ optimization diff --git a/src/world/partner/bombette.c b/src/world/partner/bombette.c index 379696c2ea..4ba18709c2 100644 --- a/src/world/partner/bombette.c +++ b/src/world/partner/bombette.c @@ -120,19 +120,19 @@ API_CALLABLE(N(Update)) { N(TweesterPhysicsPtr)->state++; N(TweesterPhysicsPtr)->prevFlags = bombette->flags; N(TweesterPhysicsPtr)->radius = fabsf(dist2D(bombette->pos.x, bombette->pos.z, - entity->position.x, entity->position.z)); - N(TweesterPhysicsPtr)->angle = atan2(entity->position.x, entity->position.z, + entity->pos.x, entity->pos.z)); + N(TweesterPhysicsPtr)->angle = atan2(entity->pos.x, entity->pos.z, bombette->pos.x, bombette->pos.z); - N(TweesterPhysicsPtr)->angularVelocity = 6.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 50.0f; + N(TweesterPhysicsPtr)->angularVel = 6.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase = 50.0f; N(TweesterPhysicsPtr)->countdown = 120; bombette->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8; bombette->flags &= ~NPC_FLAG_GRAVITY; case TWEESTER_PARTNER_ATTRACT: sin_cos_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->angle), &sinAngle, &cosAngle); - bombette->pos.x = entity->position.x + (sinAngle * N(TweesterPhysicsPtr)->radius); - bombette->pos.z = entity->position.z - (cosAngle * N(TweesterPhysicsPtr)->radius); - N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVelocity); + bombette->pos.x = entity->pos.x + (sinAngle * N(TweesterPhysicsPtr)->radius); + bombette->pos.z = entity->pos.z - (cosAngle * N(TweesterPhysicsPtr)->radius); + N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVel); if (N(TweesterPhysicsPtr)->radius > 20.0f) { N(TweesterPhysicsPtr)->radius--; @@ -140,19 +140,19 @@ API_CALLABLE(N(Update)) { N(TweesterPhysicsPtr)->radius++; } - liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelocityPhase)) * 3.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase += 3.0f; + liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelPhase)) * 3.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase += 3.0f; - if (N(TweesterPhysicsPtr)->liftoffVelocityPhase > 150.0f) { - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 150.0f; + if (N(TweesterPhysicsPtr)->liftoffVelPhase > 150.0f) { + N(TweesterPhysicsPtr)->liftoffVelPhase = 150.0f; } bombette->pos.y += liftoffVelocity; bombette->renderYaw = clamp_angle(360.0f - N(TweesterPhysicsPtr)->angle); - N(TweesterPhysicsPtr)->angularVelocity += 0.8; + N(TweesterPhysicsPtr)->angularVel += 0.8; - if (N(TweesterPhysicsPtr)->angularVelocity > 40.0f) { - N(TweesterPhysicsPtr)->angularVelocity = 40.0f; + if (N(TweesterPhysicsPtr)->angularVel > 40.0f) { + N(TweesterPhysicsPtr)->angularVel = 40.0f; } if (--N(TweesterPhysicsPtr)->countdown == 0) { @@ -256,7 +256,7 @@ API_CALLABLE(N(UseAbility)) { N(PlayerWasFacingLeft) = partner_force_player_flip_done(); enable_npc_blur(npc); npc->duration = 4; - npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); suggest_player_anim_allow_backward(ANIM_Mario1_Idle); script->USE_STATE = BLAST_STATE_GATHER; case BLAST_STATE_GATHER: @@ -269,10 +269,10 @@ API_CALLABLE(N(UseAbility)) { script->USE_STATE = BLAST_STATE_CANCEL; break; } - npc->moveToPos.x = playerStatus->position.x; - npc->moveToPos.y = playerStatus->position.y; - npc->moveToPos.z = playerStatus->position.z; - npc->currentAnim = ANIM_WorldBombette_Run; + npc->moveToPos.x = playerStatus->pos.x; + npc->moveToPos.y = playerStatus->pos.y; + npc->moveToPos.z = playerStatus->pos.z; + npc->curAnim = ANIM_WorldBombette_Run; add_vec2D_polar(&npc->moveToPos.x, &npc->moveToPos.z, 0.0f, playerStatus->targetYaw); temp_f0 = clamp_angle(playerStatus->targetYaw + (N(PlayerWasFacingLeft) ? -90.0f : 90.0f)); add_vec2D_polar(&npc->moveToPos.x, &npc->moveToPos.z, playerStatus->colliderDiameter / 4, temp_f0); @@ -296,7 +296,7 @@ API_CALLABLE(N(UseAbility)) { disable_npc_blur(npc); suggest_player_anim_allow_backward(ANIM_MarioW1_Lift); npc->yaw = playerStatus->targetYaw; - npc->currentAnim = ANIM_WorldBombette_Walk; + npc->curAnim = ANIM_WorldBombette_Walk; script->USE_STATE = BLAST_STATE_LIFT; script->functionTemp[1] = 10; // fallthrough @@ -305,7 +305,7 @@ API_CALLABLE(N(UseAbility)) { script->USE_STATE = BLAST_STATE_CANCEL; break; } - npc->pos.y = playerStatus->position.y + playerStatus->colliderHeight; + npc->pos.y = playerStatus->pos.y + playerStatus->colliderHeight; npc->yaw = playerStatus->targetYaw; if (script->functionTemp[1] == 1) { suggest_player_anim_allow_backward(ANIM_MarioW1_PlaceItem); @@ -317,8 +317,8 @@ API_CALLABLE(N(UseAbility)) { sfx_play_sound_at_npc(SOUND_80000000, SOUND_SPACE_MODE_0, NPC_PARTNER); N(PlayingFuseSound) = TRUE; add_vec2D_polar(&npc->pos.x, &npc->pos.z, 0.0f, npc->yaw); - npc->currentAnim = ANIM_WorldBombette_WalkLit; - npc->jumpVelocity = 0.0f; + npc->curAnim = ANIM_WorldBombette_WalkLit; + npc->jumpVel = 0.0f; N(MovementBlocked) = FALSE; npc->flags |= NPC_FLAG_GRAVITY; npc->flags &= ~NPC_FLAG_IGNORE_PLAYER_COLLISION; @@ -351,7 +351,7 @@ API_CALLABLE(N(UseAbility)) { if (playerStatus->actionState == ACTION_STATE_IDLE) { suggest_player_anim_allow_backward(ANIM_Mario1_Idle); } - npc->currentAnim = ANIM_WorldBombette_AboutToExplode; + npc->curAnim = ANIM_WorldBombette_AboutToExplode; npc->flags &= ~NPC_FLAG_GRAVITY; script->functionTemp[1] = 2; script->USE_STATE = BLAST_STATE_EXPLODE; @@ -393,7 +393,7 @@ API_CALLABLE(N(UseAbility)) { break; } } - npc->currentAnim = ANIM_WorldBombette_AboutToExplode; + npc->curAnim = ANIM_WorldBombette_AboutToExplode; script->functionTemp[1] = 20; script->USE_STATE = BLAST_STATE_EXPLODE; if (playerStatus->actionState == ACTION_STATE_IDLE) { @@ -411,8 +411,8 @@ API_CALLABLE(N(UseAbility)) { N(PlayingFuseSound) = FALSE; sfx_stop_sound(SOUND_80000000); } - fx_explosion(gPlayerData.partners[gPlayerData.currentPartner].level, npc->pos.x, npc->pos.y + (npc->collisionHeight * 0.5f), npc->pos.z); - switch (gPlayerData.partners[gPlayerData.currentPartner].level) { + fx_explosion(gPlayerData.partners[gPlayerData.curPartner].level, npc->pos.x, npc->pos.y + (npc->collisionHeight * 0.5f), npc->pos.z); + switch (gPlayerData.partners[gPlayerData.curPartner].level) { case 0: sfx_play_sound_at_npc(SOUND_CANNON1, SOUND_SPACE_MODE_0, NPC_PARTNER); break; @@ -442,7 +442,7 @@ API_CALLABLE(N(UseAbility)) { } partnerStatus->partnerActionState = PARTNER_ACTION_BOMBETTE_3; N(IsBlasting) = FALSE; - npc->jumpVelocity = ((playerStatus->position.y - npc->pos.y) / 20.0f) + 30.0; + npc->jumpVel = ((playerStatus->pos.y - npc->pos.y) / 20.0f) + 30.0; npc->moveSpeed = 0.8f; npc->yaw = rand_int(360); npc->jumpScale = 0.8f; @@ -452,9 +452,9 @@ API_CALLABLE(N(UseAbility)) { collisionStatus->bombetteExplosionPos.x = npc->pos.x; collisionStatus->bombetteExplosionPos.y = npc->pos.y; collisionStatus->bombetteExplosionPos.z = npc->pos.z; - npc->currentAnim = ANIM_WorldBombette_Aftermath; - angleToPlayer = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); - if (!(get_clamped_angle_diff(camera->currentYaw, angleToPlayer) < 0.0f)) { + npc->curAnim = ANIM_WorldBombette_Aftermath; + angleToPlayer = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); + if (!(get_clamped_angle_diff(camera->curYaw, angleToPlayer) < 0.0f)) { script->functionTemp[2] = 1; } else { script->functionTemp[2] = -1; @@ -463,43 +463,43 @@ API_CALLABLE(N(UseAbility)) { script->USE_STATE = BLAST_STATE_FLY; break; case BLAST_STATE_FLY: - npc->pos.y += npc->jumpVelocity; - npc->jumpVelocity -= npc->jumpScale; - npc->rotation.z -= (script->functionTemp[2] * 79) / 2; - npc->rotation.x -= (script->functionTemp[2] * 67) / 2; + npc->pos.y += npc->jumpVel; + npc->jumpVel -= npc->jumpScale; + npc->rot.z -= (script->functionTemp[2] * 79) / 2; + npc->rot.x -= (script->functionTemp[2] * 67) / 2; if (script->functionTemp[1] != 0) { script->functionTemp[1]--; break; } if (!N(MaintainPosAfterBlast)) { - npc->pos.x = playerStatus->position.x; - npc->pos.z = playerStatus->position.z; + npc->pos.x = playerStatus->pos.x; + npc->pos.z = playerStatus->pos.z; } - npc->yaw = clamp_angle(gCameras[CAM_DEFAULT].currentYaw + playerStatus->spriteFacingAngle); + npc->yaw = clamp_angle(gCameras[CAM_DEFAULT].curYaw + playerStatus->spriteFacingAngle); add_vec2D_polar(&npc->pos.x, &npc->pos.z, 10.0f, npc->yaw); - npc->jumpVelocity = 0.0f; - npc->currentAnim = ANIM_WorldBombette_Aftermath; + npc->jumpVel = 0.0f; + npc->curAnim = ANIM_WorldBombette_Aftermath; npc->flags |= NPC_FLAG_JUMPING; script->USE_STATE = BLAST_STATE_FALL; break; case BLAST_STATE_FALL: - if (npc->pos.y + 10.0f < playerStatus->position.y + playerStatus->colliderHeight) { + if (npc->pos.y + 10.0f < playerStatus->pos.y + playerStatus->colliderHeight) { npc->flags &= ~NPC_FLAG_JUMPING; - if (fabsf(playerStatus->position.y - npc->pos.y) < 500.0) { + if (fabsf(playerStatus->pos.y - npc->pos.y) < 500.0) { script->USE_STATE = BLAST_STATE_FINISH; break; - } else if (npc_try_snap_to_ground(npc, npc->jumpVelocity)) { + } else if (npc_try_snap_to_ground(npc, npc->jumpVel)) { script->USE_STATE = BLAST_STATE_CANCEL; break; } } - npc->pos.y += npc->jumpVelocity; - npc->jumpVelocity -= npc->jumpScale; - if (npc->jumpVelocity < -8.0) { - npc->jumpVelocity = -8.0f; + npc->pos.y += npc->jumpVel; + npc->jumpVel -= npc->jumpScale; + if (npc->jumpVel < -8.0) { + npc->jumpVel = -8.0f; } - npc->rotation.z -= (script->functionTemp[2] * 79) / 2; - npc->rotation.x -= (script->functionTemp[2] * 67) / 2; + npc->rot.z -= (script->functionTemp[2] * 79) / 2; + npc->rot.x -= (script->functionTemp[2] * 67) / 2; break; } @@ -516,13 +516,13 @@ API_CALLABLE(N(UseAbility)) { } partnerStatus->partnerActionState = ACTION_STATE_IDLE; partnerStatus->actingPartner = PARTNER_NONE; - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; N(IsBlasting) = FALSE; N(TriggeredEarlyDetonation) = FALSE; - npc->pos.y = playerStatus->position.y; - npc->rotation.x = 0.0f; - npc->rotation.z = 0.0f; - npc->currentAnim = ANIM_WorldBombette_Idle; + npc->pos.y = playerStatus->pos.y; + npc->rot.x = 0.0f; + npc->rot.z = 0.0f; + npc->curAnim = ANIM_WorldBombette_Idle; partner_clear_player_tracking(npc); if (N(PlayingFuseSound)) { N(PlayingFuseSound) = FALSE; @@ -537,14 +537,14 @@ API_CALLABLE(N(UseAbility)) { } partnerStatus->partnerActionState = PARTNER_ACTION_NONE; partnerStatus->actingPartner = PARTNER_NONE; - npc->jumpVelocity = 0.0f; - npc->pos.y = playerStatus->position.y; - npc->rotation.x = 0.0f; - npc->rotation.z = 0.0f; - npc->currentAnim = ANIM_WorldBombette_Idle; - npc->pos.x = playerStatus->position.x; - npc->pos.y = playerStatus->position.y; - npc->pos.z = playerStatus->position.z; + npc->jumpVel = 0.0f; + npc->pos.y = playerStatus->pos.y; + npc->rot.x = 0.0f; + npc->rot.z = 0.0f; + npc->curAnim = ANIM_WorldBombette_Idle; + npc->pos.x = playerStatus->pos.x; + npc->pos.y = playerStatus->pos.y; + npc->pos.z = playerStatus->pos.z; N(IsBlasting) = FALSE; N(TriggeredEarlyDetonation) = FALSE; if (!N(PlayerWasFacingLeft)) { @@ -552,7 +552,7 @@ API_CALLABLE(N(UseAbility)) { } else { add_vec2D_polar(&npc->pos.x, &npc->pos.z, playerStatus->colliderDiameter / 4, clamp_angle(playerStatus->targetYaw - 90.0f)); } - npc->jumpVelocity = 0.0f; + npc->jumpVel = 0.0f; partner_clear_player_tracking(npc); temp_ret = ApiStatus_DONE2; if (N(PlayingFuseSound)) { @@ -653,7 +653,7 @@ void N(pre_battle)(Npc* bombette) { N(IsBlasting) = FALSE; playerStatus->flags &= ~PS_FLAG_JUMPING; - bombette->jumpVelocity = 0.0f; + bombette->jumpVel = 0.0f; bombette->flags &= ~NPC_FLAG_JUMPING; set_action_state(ACTION_STATE_IDLE); @@ -662,9 +662,9 @@ void N(pre_battle)(Npc* bombette) { partnerStatus->partnerActionState = PARTNER_ACTION_NONE; partnerStatus->actingPartner = 0; - bombette->pos.x = playerStatus->position.x; - bombette->pos.y = playerStatus->position.y; - bombette->pos.z = playerStatus->position.z; + bombette->pos.x = playerStatus->pos.x; + bombette->pos.y = playerStatus->pos.y; + bombette->pos.z = playerStatus->pos.z; if (!N(PlayerWasFacingLeft)) { add_vec2D_polar(&bombette->pos.x, &bombette->pos.z, @@ -674,11 +674,11 @@ void N(pre_battle)(Npc* bombette) { playerStatus->colliderDiameter / 4, clamp_angle(playerStatus->targetYaw - 90.0f)); } - bombette->jumpVelocity = 0.0f; - bombette->pos.y = playerStatus->position.y; - bombette->rotation.x = 0.0f; - bombette->rotation.z = 0.0f; - bombette->currentAnim = ANIM_WorldBombette_Idle; + bombette->jumpVel = 0.0f; + bombette->pos.y = playerStatus->pos.y; + bombette->rot.x = 0.0f; + bombette->rot.z = 0.0f; + bombette->curAnim = ANIM_WorldBombette_Idle; partner_clear_player_tracking(bombette); disable_npc_blur(bombette); diff --git a/src/world/partner/bow.c b/src/world/partner/bow.c index ed22bb4ead..d1dc7207dc 100644 --- a/src/world/partner/bow.c +++ b/src/world/partner/bow.c @@ -71,37 +71,37 @@ API_CALLABLE(N(Update)) { case TWEESTER_PARTNER_INIT: N(TweesterPhysicsPtr)->state++; N(TweesterPhysicsPtr)->prevFlags = bow->flags; - N(TweesterPhysicsPtr)->radius = fabsf(dist2D(bow->pos.x, bow->pos.z, entity->position.x, entity->position.z)); - N(TweesterPhysicsPtr)->angle = atan2(entity->position.x, entity->position.z, bow->pos.x, bow->pos.z); - N(TweesterPhysicsPtr)->angularVelocity = 6.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 50.0f; + N(TweesterPhysicsPtr)->radius = fabsf(dist2D(bow->pos.x, bow->pos.z, entity->pos.x, entity->pos.z)); + N(TweesterPhysicsPtr)->angle = atan2(entity->pos.x, entity->pos.z, bow->pos.x, bow->pos.z); + N(TweesterPhysicsPtr)->angularVel = 6.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase = 50.0f; N(TweesterPhysicsPtr)->countdown = 120; bow->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8; bow->flags &= ~NPC_FLAG_GRAVITY; case TWEESTER_PARTNER_ATTRACT: sin_cos_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->angle), &sinAngle, &cosAngle); - bow->pos.x = entity->position.x + (sinAngle * N(TweesterPhysicsPtr)->radius); - bow->pos.z = entity->position.z - (cosAngle * N(TweesterPhysicsPtr)->radius); - N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVelocity); + bow->pos.x = entity->pos.x + (sinAngle * N(TweesterPhysicsPtr)->radius); + bow->pos.z = entity->pos.z - (cosAngle * N(TweesterPhysicsPtr)->radius); + N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVel); if (N(TweesterPhysicsPtr)->radius > 20.0f) { N(TweesterPhysicsPtr)->radius -= 1.0f; } else if (N(TweesterPhysicsPtr)->radius < 19.0f) { N(TweesterPhysicsPtr)->radius++; } - liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelocityPhase)) * 3.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase += 3.0f; + liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelPhase)) * 3.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase += 3.0f; - if (N(TweesterPhysicsPtr)->liftoffVelocityPhase > 150.0f) { - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 150.0f; + if (N(TweesterPhysicsPtr)->liftoffVelPhase > 150.0f) { + N(TweesterPhysicsPtr)->liftoffVelPhase = 150.0f; } bow->pos.y += liftoffVelocity; bow->renderYaw = clamp_angle(360.0f - N(TweesterPhysicsPtr)->angle); - N(TweesterPhysicsPtr)->angularVelocity += 0.8; + N(TweesterPhysicsPtr)->angularVel += 0.8; - if (N(TweesterPhysicsPtr)->angularVelocity > 40.0f) { - N(TweesterPhysicsPtr)->angularVelocity = 40.0f; + if (N(TweesterPhysicsPtr)->angularVel > 40.0f) { + N(TweesterPhysicsPtr)->angularVel = 40.0f; } if (--N(TweesterPhysicsPtr)->countdown == 0) { N(TweesterPhysicsPtr)->state++; @@ -150,14 +150,14 @@ s32 N(check_for_treadmill_overlaps)(void) { return NO_COLLIDER; } - if (playerStatus->pushVelocity.x == 0.0f && playerStatus->pushVelocity.z == 0.0f) { + if (playerStatus->pushVel.x == 0.0f && playerStatus->pushVel.z == 0.0f) { return NO_COLLIDER; } - yaw = atan2(0.0f, 0.0f, playerStatus->pushVelocity.x, playerStatus->pushVelocity.z); - x = playerStatus->position.x; - y = playerStatus->position.y + (playerStatus->colliderHeight * 0.5f); - z = playerStatus->position.z; + yaw = atan2(0.0f, 0.0f, playerStatus->pushVel.x, playerStatus->pushVel.z); + x = playerStatus->pos.x; + y = playerStatus->pos.y + (playerStatus->colliderHeight * 0.5f); + z = playerStatus->pos.z; add_vec2D_polar(&x, &z, playerStatus->colliderDiameter * 0.5f, clamp_angle(yaw + 180.0f)); return player_test_lateral_overlap(0, playerStatus, &x, &y, &z, playerStatus->colliderDiameter, yaw); @@ -254,31 +254,31 @@ API_CALLABLE(N(UseAbility)) { partnerStatus->actingPartner = 9; playerStatus->flags |= PS_FLAG_HAZARD_INVINCIBILITY; partner_force_player_flip_done(); - bow->moveToPos.x = playerStatus->position.x; - bow->moveToPos.y = playerStatus->position.y + (playerStatus->colliderHeight * 0.5f); - bow->moveToPos.z = playerStatus->position.z; - bow->currentAnim = ANIM_WorldBow_Walk; + bow->moveToPos.x = playerStatus->pos.x; + bow->moveToPos.y = playerStatus->pos.y + (playerStatus->colliderHeight * 0.5f); + bow->moveToPos.z = playerStatus->pos.z; + bow->curAnim = ANIM_WorldBow_Walk; bow->yaw = playerStatus->targetYaw; - add_vec2D_polar(&bow->moveToPos.x, &bow->moveToPos.z, -2.0f, gCameras[gCurrentCameraID].currentYaw); + add_vec2D_polar(&bow->moveToPos.x, &bow->moveToPos.z, -2.0f, gCameras[gCurrentCameraID].curYaw); add_vec2D_polar(&bow->moveToPos.x, &bow->moveToPos.z, playerStatus->colliderDiameter * 0.5f, bow->yaw); bow->duration = 5; - bow->yaw = atan2(bow->pos.x, bow->pos.z, playerStatus->position.x, playerStatus->position.z); + bow->yaw = atan2(bow->pos.x, bow->pos.z, playerStatus->pos.x, playerStatus->pos.z); set_action_state(ACTION_STATE_RIDE); suggest_player_anim_allow_backward(ANIM_Mario1_Idle); script->USE_STATE++; // OUTTA_SIGHT_GATHER break; case OUTTA_SIGHT_GATHER: - if (collisionStatus->currentFloor >= 0 && !(playerStatus->animFlags & PA_FLAG_CHANGING_MAP)) { - bow->moveToPos.x = playerStatus->position.x; - bow->moveToPos.y = playerStatus->position.y + (playerStatus->colliderHeight * 0.5f); - bow->moveToPos.z = playerStatus->position.z; + if (collisionStatus->curFloor >= 0 && !(playerStatus->animFlags & PA_FLAG_CHANGING_MAP)) { + bow->moveToPos.x = playerStatus->pos.x; + bow->moveToPos.y = playerStatus->pos.y + (playerStatus->colliderHeight * 0.5f); + bow->moveToPos.z = playerStatus->pos.z; bow->pos.x += ((bow->moveToPos.x - bow->pos.x) / bow->duration); bow->pos.y += ((bow->moveToPos.y - bow->pos.y) / bow->duration); bow->pos.z += ((bow->moveToPos.z - bow->pos.z) / bow->duration); - N(OuttaSightPosX) = playerStatus->position.x - bow->pos.x; - N(OuttaSightPosY) = playerStatus->position.y - bow->pos.y; - N(OuttaSightPosZ) = playerStatus->position.z - bow->pos.z; + N(OuttaSightPosX) = playerStatus->pos.x - bow->pos.x; + N(OuttaSightPosY) = playerStatus->pos.y - bow->pos.y; + N(OuttaSightPosZ) = playerStatus->pos.z - bow->pos.z; bow->duration--; if (bow->duration == 0) { bow->yaw = playerStatus->targetYaw; @@ -293,7 +293,7 @@ API_CALLABLE(N(UseAbility)) { return ApiStatus_DONE2; case OUTTA_SIGHT_VANISH: - if (collisionStatus->currentFloor >= 0) { + if (collisionStatus->curFloor >= 0) { playerStatus->alpha1 -= 8; if (playerStatus->alpha1 <= 128) { playerStatus->alpha1 = 128; @@ -305,26 +305,26 @@ API_CALLABLE(N(UseAbility)) { get_shadow_by_index(bow->shadowIndex)->alpha = playerStatus->alpha1 >> 1; npc_set_imgfx_params(bow, IMGFX_SET_ALPHA, playerStatus->alpha1, 0, 0, 0, 0); - bow->pos.x = playerStatus->position.x - N(OuttaSightPosX); - bow->pos.y = playerStatus->position.y - N(OuttaSightPosY); - bow->pos.z = playerStatus->position.z - N(OuttaSightPosZ); + bow->pos.x = playerStatus->pos.x - N(OuttaSightPosX); + bow->pos.y = playerStatus->pos.y - N(OuttaSightPosY); + bow->pos.z = playerStatus->pos.z - N(OuttaSightPosZ); break; } N(end_outta_sight_cleanup)(bow); return ApiStatus_DONE2; case OUTTA_SIGHT_IDLE: - if (collisionStatus->currentFloor <= NO_COLLIDER) { + if (collisionStatus->curFloor <= NO_COLLIDER) { N(end_outta_sight_cleanup)(bow); return ApiStatus_DONE2; } - bow->pos.x = playerStatus->position.x - N(OuttaSightPosX); - bow->pos.y = playerStatus->position.y - N(OuttaSightPosY); - bow->pos.z = playerStatus->position.z - N(OuttaSightPosZ); + bow->pos.x = playerStatus->pos.x - N(OuttaSightPosX); + bow->pos.y = playerStatus->pos.y - N(OuttaSightPosY); + bow->pos.z = playerStatus->pos.z - N(OuttaSightPosZ); stickInputMag = dist2D(0.0f, 0.0f, partnerStatus->stickX, partnerStatus->stickY); - if ((collisionStatus->currentFloor <= NO_COLLIDER) + if ((collisionStatus->curFloor <= NO_COLLIDER) || stickInputMag > 10.0f || partnerStatus->pressedButtons & (BUTTON_B | BUTTON_C_DOWN) || playerStatus->flags & PS_FLAG_HIT_FIRE diff --git a/src/world/partner/goombario.c b/src/world/partner/goombario.c index b84a2a8ba0..06f3fbdac1 100644 --- a/src/world/partner/goombario.c +++ b/src/world/partner/goombario.c @@ -128,19 +128,19 @@ API_CALLABLE(N(Update)) { case 0: N(TweesterPhysicsPtr)->state = 1; N(TweesterPhysicsPtr)->prevFlags = npc->flags; - N(TweesterPhysicsPtr)->radius = fabsf(dist2D(npc->pos.x, npc->pos.z, entity->position.x, entity->position.z)); - N(TweesterPhysicsPtr)->angle = atan2(entity->position.x, entity->position.z, npc->pos.x, npc->pos.z); - N(TweesterPhysicsPtr)->angularVelocity = 6.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 50.0f; + N(TweesterPhysicsPtr)->radius = fabsf(dist2D(npc->pos.x, npc->pos.z, entity->pos.x, entity->pos.z)); + N(TweesterPhysicsPtr)->angle = atan2(entity->pos.x, entity->pos.z, npc->pos.x, npc->pos.z); + N(TweesterPhysicsPtr)->angularVel = 6.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase = 50.0f; N(TweesterPhysicsPtr)->countdown = 120; npc->flags |= NPC_FLAG_8 | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_CAMERA_FOR_YAW; npc->flags &= ~NPC_FLAG_GRAVITY; case 1: sin_cos_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->angle), &sinAngle, &cosAngle); - npc->pos.x = entity->position.x + (sinAngle * N(TweesterPhysicsPtr)->radius); - npc->pos.z = entity->position.z - (cosAngle * N(TweesterPhysicsPtr)->radius); - N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVelocity); + npc->pos.x = entity->pos.x + (sinAngle * N(TweesterPhysicsPtr)->radius); + npc->pos.z = entity->pos.z - (cosAngle * N(TweesterPhysicsPtr)->radius); + N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVel); if (N(TweesterPhysicsPtr)->radius > 20.0f) { N(TweesterPhysicsPtr)->radius--; @@ -148,20 +148,20 @@ API_CALLABLE(N(Update)) { N(TweesterPhysicsPtr)->radius++; } - liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelocityPhase)) * 3.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase += 3.0f; + liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelPhase)) * 3.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase += 3.0f; - if (N(TweesterPhysicsPtr)->liftoffVelocityPhase > 150.0f) { - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 150.0f; + if (N(TweesterPhysicsPtr)->liftoffVelPhase > 150.0f) { + N(TweesterPhysicsPtr)->liftoffVelPhase = 150.0f; } npc->pos.y += liftoffVelocity; npc->renderYaw = clamp_angle(360.0f - N(TweesterPhysicsPtr)->angle); - N(TweesterPhysicsPtr)->angularVelocity += 0.8; + N(TweesterPhysicsPtr)->angularVel += 0.8; - if (N(TweesterPhysicsPtr)->angularVelocity > 40.0f) { - N(TweesterPhysicsPtr)->angularVelocity = 40.0f; + if (N(TweesterPhysicsPtr)->angularVel > 40.0f) { + N(TweesterPhysicsPtr)->angularVel = 40.0f; } if (--N(TweesterPhysicsPtr)->countdown == 0) { @@ -281,8 +281,8 @@ API_CALLABLE(N(SelectTattleMsg)) { case USE_TATTLE_FACE_PLAYER: set_time_freeze_mode(1); playerStatus->flags &= ~PS_FLAG_HAS_CONVERSATION_NPC; - goombario->currentAnim = ANIM_WorldGoombario_Idle; - goombario->yaw = clamp_angle(gCameras[CAM_DEFAULT].currentYaw + playerStatus->spriteFacingAngle - 90.0f); + goombario->curAnim = ANIM_WorldGoombario_Idle; + goombario->yaw = clamp_angle(gCameras[CAM_DEFAULT].curYaw + playerStatus->spriteFacingAngle - 90.0f); gPartnerStatus.partnerActionState = PARTNER_ACTION_USE; close_status_bar(); if (N(HadSpeechPrompt)) { diff --git a/src/world/partner/goompa.c b/src/world/partner/goompa.c index 8201882f51..4de99905f9 100644 --- a/src/world/partner/goompa.c +++ b/src/world/partner/goompa.c @@ -58,18 +58,18 @@ API_CALLABLE(N(Update)) { N(TweesterPhysicsPtr)->state++; N(TweesterPhysicsPtr)->prevFlags = goompa->flags; N(TweesterPhysicsPtr)->radius = fabsf(dist2D(goompa->pos.x, goompa->pos.z, - entity->position.x, entity->position.z)); - N(TweesterPhysicsPtr)->angle = atan2(entity->position.x, entity->position.z, goompa->pos.x, goompa->pos.z); - N(TweesterPhysicsPtr)->angularVelocity = 6.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 50.0f; + entity->pos.x, entity->pos.z)); + N(TweesterPhysicsPtr)->angle = atan2(entity->pos.x, entity->pos.z, goompa->pos.x, goompa->pos.z); + N(TweesterPhysicsPtr)->angularVel = 6.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase = 50.0f; N(TweesterPhysicsPtr)->countdown = 120; goompa->flags |= NPC_FLAG_8 | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_CAMERA_FOR_YAW; goompa->flags &= ~NPC_FLAG_GRAVITY; case TWEESTER_PARTNER_ATTRACT: sin_cos_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->angle), &sinAngle, &cosAngle); - goompa->pos.x = entity->position.x + (sinAngle * N(TweesterPhysicsPtr)->radius); - goompa->pos.z = entity->position.z - (cosAngle * N(TweesterPhysicsPtr)->radius); - N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVelocity); + goompa->pos.x = entity->pos.x + (sinAngle * N(TweesterPhysicsPtr)->radius); + goompa->pos.z = entity->pos.z - (cosAngle * N(TweesterPhysicsPtr)->radius); + N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVel); if (N(TweesterPhysicsPtr)->radius > 20.0f) { N(TweesterPhysicsPtr)->radius--; @@ -77,19 +77,19 @@ API_CALLABLE(N(Update)) { N(TweesterPhysicsPtr)->radius++; } - liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelocityPhase)) * 3.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase += 3.0f; + liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelPhase)) * 3.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase += 3.0f; - if (N(TweesterPhysicsPtr)->liftoffVelocityPhase > 150.0f) { - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 150.0f; + if (N(TweesterPhysicsPtr)->liftoffVelPhase > 150.0f) { + N(TweesterPhysicsPtr)->liftoffVelPhase = 150.0f; } goompa->pos.y += liftoffVelocity; goompa->renderYaw = clamp_angle(360.0f - N(TweesterPhysicsPtr)->angle); - N(TweesterPhysicsPtr)->angularVelocity += 0.8; + N(TweesterPhysicsPtr)->angularVel += 0.8; - if (N(TweesterPhysicsPtr)->angularVelocity > 40.0f) { - N(TweesterPhysicsPtr)->angularVelocity = 40.0f; + if (N(TweesterPhysicsPtr)->angularVel > 40.0f) { + N(TweesterPhysicsPtr)->angularVel = 40.0f; } if (--N(TweesterPhysicsPtr)->countdown == 0) { diff --git a/src/world/partner/kooper.c b/src/world/partner/kooper.c index c798059fb8..06c7681b5d 100644 --- a/src/world/partner/kooper.c +++ b/src/world/partner/kooper.c @@ -125,39 +125,39 @@ API_CALLABLE(N(Update)) { N(TweesterPhysicsPtr)->state++; N(TweesterPhysicsPtr)->prevFlags = kooper->flags; N(TweesterPhysicsPtr)->radius = fabsf(dist2D(kooper->pos.x, kooper->pos.z, - entity->position.x, entity->position.z)); - N(TweesterPhysicsPtr)->angle = atan2(entity->position.x, entity->position.z, kooper->pos.x, kooper->pos.z); - N(TweesterPhysicsPtr)->angularVelocity = 6.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 50.0f; + entity->pos.x, entity->pos.z)); + N(TweesterPhysicsPtr)->angle = atan2(entity->pos.x, entity->pos.z, kooper->pos.x, kooper->pos.z); + N(TweesterPhysicsPtr)->angularVel = 6.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase = 50.0f; N(TweesterPhysicsPtr)->countdown = 120; kooper->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8; kooper->flags &= ~NPC_FLAG_GRAVITY; case TWEESTER_PARTNER_ATTRACT: sin_cos_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->angle), &sinAngle, &cosAngle); - kooper->pos.x = entity->position.x + (sinAngle * N(TweesterPhysicsPtr)->radius); - kooper->pos.z = entity->position.z - (cosAngle * N(TweesterPhysicsPtr)->radius); + kooper->pos.x = entity->pos.x + (sinAngle * N(TweesterPhysicsPtr)->radius); + kooper->pos.z = entity->pos.z - (cosAngle * N(TweesterPhysicsPtr)->radius); - N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVelocity); + N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVel); if (N(TweesterPhysicsPtr)->radius > 20.0f) { N(TweesterPhysicsPtr)->radius--; } else if (N(TweesterPhysicsPtr)->radius < 19.0f) { N(TweesterPhysicsPtr)->radius++; } - liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelocityPhase)) * 3.0f; + liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelPhase)) * 3.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase += 3.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase += 3.0f; - if (N(TweesterPhysicsPtr)->liftoffVelocityPhase > 150.0f) { - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 150.0f; + if (N(TweesterPhysicsPtr)->liftoffVelPhase > 150.0f) { + N(TweesterPhysicsPtr)->liftoffVelPhase = 150.0f; } kooper->pos.y += liftoffVelocity; kooper->renderYaw = clamp_angle(360.0f - N(TweesterPhysicsPtr)->angle); - N(TweesterPhysicsPtr)->angularVelocity += 0.8; - if (N(TweesterPhysicsPtr)->angularVelocity > 40.0f) { - N(TweesterPhysicsPtr)->angularVelocity = 40.0f; + N(TweesterPhysicsPtr)->angularVel += 0.8; + if (N(TweesterPhysicsPtr)->angularVel > 40.0f) { + N(TweesterPhysicsPtr)->angularVel = 40.0f; } if (--N(TweesterPhysicsPtr)->countdown == 0) { @@ -248,7 +248,7 @@ API_CALLABLE(N(UseAbility)) { partnerStatus->partnerActionState = PARTNER_ACTION_KOOPER_GATHER; partnerStatus->actingPartner = PARTNER_KOOPER; script->USE_STATE = SHELL_TOSS_STATE_HOLD; - kooper->currentAnim = ANIM_WorldKooper_SpinShell; + kooper->curAnim = ANIM_WorldKooper_SpinShell; N(ShellTossHoldTime) = 30; } } @@ -275,7 +275,7 @@ API_CALLABLE(N(UseAbility)) { enable_npc_blur(kooper); kooper->duration = 4; kooper->yaw = atan2(kooper->pos.x, kooper->pos.z, - playerStatus->position.x, playerStatus->position.z); + playerStatus->pos.x, playerStatus->pos.z); script->USE_STATE++; break; @@ -291,10 +291,10 @@ API_CALLABLE(N(UseAbility)) { } suggest_player_anim_allow_backward(ANIM_Mario1_BeforeJump); - kooper->moveToPos.x = N(ShellTossPosX) = playerStatus->position.x; - kooper->moveToPos.y = N(ShellTossPosY) = playerStatus->position.y; - kooper->moveToPos.z = N(ShellTossPosZ) = playerStatus->position.z; - kooper->currentAnim = ANIM_WorldKooper_Run; + kooper->moveToPos.x = N(ShellTossPosX) = playerStatus->pos.x; + kooper->moveToPos.y = N(ShellTossPosY) = playerStatus->pos.y; + kooper->moveToPos.z = N(ShellTossPosZ) = playerStatus->pos.z; + kooper->curAnim = ANIM_WorldKooper_Run; add_vec2D_polar(&kooper->moveToPos.x, &kooper->moveToPos.z, playerStatus->colliderDiameter / 3, playerStatus->targetYaw); moveAngle = clamp_angle(playerStatus->targetYaw + (N(PlayerWasFacingLeft) ? 90.0f : -90.0f)); @@ -321,13 +321,13 @@ API_CALLABLE(N(UseAbility)) { } kooper->yaw = playerStatus->targetYaw; - kooper->jumpVelocity = 18.0f; + kooper->jumpVel = 18.0f; kooper->jumpScale = 3.0f; - kooper->currentAnim = ANIM_WorldKooper_EnterShell; + kooper->curAnim = ANIM_WorldKooper_EnterShell; kooper->collisionHeight = 12; - kooper->moveToPos.y = playerStatus->position.y; - kooper->moveToPos.z = playerStatus->position.y + playerStatus->colliderHeight / 3; + kooper->moveToPos.y = playerStatus->pos.y; + kooper->moveToPos.z = playerStatus->pos.y + playerStatus->colliderHeight / 3; playerStatus->flags |= PS_FLAG_JUMPING; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_IGNORE_PLAYER_Y; @@ -353,35 +353,35 @@ API_CALLABLE(N(UseAbility)) { break; } - kooper->jumpVelocity -= kooper->jumpScale; - playerStatus->position.y += kooper->jumpVelocity; - if (kooper->jumpVelocity < 0.0f) { + kooper->jumpVel -= kooper->jumpScale; + playerStatus->pos.y += kooper->jumpVel; + if (kooper->jumpVel < 0.0f) { if (!N(ShellTossKickFalling)) { N(ShellTossKickFalling) = TRUE; suggest_player_anim_allow_backward(ANIM_Mario1_Fall); } } - posX = playerStatus->position.x; - posY = (playerStatus->position.y + playerStatus->colliderHeight / 2) - kooper->jumpVelocity; - posZ = playerStatus->position.z; + posX = playerStatus->pos.x; + posY = (playerStatus->pos.y + playerStatus->colliderHeight / 2) - kooper->jumpVel; + posZ = playerStatus->pos.z; testLength = hitLength = playerStatus->colliderHeight / 2; if ((npc_raycast_up(COLLISION_CHANNEL_10000, &posX, &posY, &posZ, &hitLength)) && (hitLength < testLength)) { - collisionStatus->currentCeiling = NpcHitQueryColliderID; - playerStatus->position.y = posY - playerStatus->colliderHeight; + collisionStatus->curCeiling = NpcHitQueryColliderID; + playerStatus->pos.y = posY - playerStatus->colliderHeight; N(vertical_hit_interactable_entity)(kooper); } - if (!(kooper->jumpVelocity > 0.0f) && (playerStatus->position.y < kooper->moveToPos.z)) { + if (!(kooper->jumpVel > 0.0f) && (playerStatus->pos.y < kooper->moveToPos.z)) { N(D_802BEC5C) = 0; kooper->flags &= ~NPC_FLAG_IGNORE_PLAYER_COLLISION; partnerStatus->actingPartner = PARTNER_KOOPER; partnerStatus->partnerActionState = PARTNER_ACTION_KOOPER_TOSS; - kooper->rotation.z = 0.0f; + kooper->rot.z = 0.0f; kooper->planarFlyDist = 0.0f; kooper->moveSpeed = 8.0f; - kooper->currentAnim = ANIM_WorldKooper_SpinShell; + kooper->curAnim = ANIM_WorldKooper_SpinShell; ShellTossHitboxState = SHELL_TOSS_HITBOX_ENABLED; fx_damage_stars(3, kooper->pos.x, kooper->pos.y + kooper->collisionHeight, kooper->pos.z, sin_deg(playerStatus->targetYaw), -1.0f, -cos_deg(playerStatus->targetYaw), 3); @@ -467,7 +467,7 @@ API_CALLABLE(N(UseAbility)) { } if (!(npc_try_snap_to_ground(kooper, 6.0f) || playerStatus->flags & (PS_FLAG_JUMPING | PS_FLAG_FALLING))) { - kooper->pos.y += (playerStatus->position.y - kooper->pos.y) / 10.0f; + kooper->pos.y += (playerStatus->pos.y - kooper->pos.y) / 10.0f; } npc_do_other_npc_collision(kooper); @@ -568,7 +568,7 @@ API_CALLABLE(N(UseAbility)) { } if (npc_try_snap_to_ground(kooper, 6.0f) == 0) { - kooper->pos.y += (playerStatus->position.y - kooper->pos.y) / 10.0f; + kooper->pos.y += (playerStatus->pos.y - kooper->pos.y) / 10.0f; } posX = kooper->pos.x; @@ -597,9 +597,9 @@ API_CALLABLE(N(UseAbility)) { moveAngle = clamp_angle(playerStatus->targetYaw - (N(PlayerWasFacingLeft) ? 90.0f : -90.0f)); add_vec2D_polar(&posX, &posZ, 4.0f, moveAngle); - heldItem->position.x = posX; - heldItem->position.y = posY; - heldItem->position.z = posZ; + heldItem->pos.x = posX; + heldItem->pos.y = posY; + heldItem->pos.z = posZ; } if (kooper->planarFlyDist + 15.0f < kooper->moveSpeed) { @@ -625,9 +625,9 @@ API_CALLABLE(N(UseAbility)) { kooper->flags &= ~(NPC_FLAG_JUMPING | NPC_FLAG_IGNORE_WORLD_COLLISION); partnerStatus->actingPartner = PARTNER_NONE; partnerStatus->partnerActionState = PARTNER_ACTION_NONE; - kooper->jumpVelocity = 0.0f; + kooper->jumpVel = 0.0f; kooper->collisionHeight = 24; - kooper->currentAnim = ANIM_WorldKooper_Walk; + kooper->curAnim = ANIM_WorldKooper_Walk; sfx_stop_sound(SOUND_284); disable_npc_blur(kooper); @@ -745,7 +745,7 @@ void N(pre_battle)(Npc* kooper) { ShellTossHitboxState = SHELL_TOSS_HITBOX_DISABLED; playerStatus->flags &= ~PS_FLAG_JUMPING; - kooper->jumpVelocity = 0.0f; + kooper->jumpVel = 0.0f; kooper->flags &= ~NPC_FLAG_JUMPING; kooper->flags &= ~NPC_FLAG_IGNORE_WORLD_COLLISION; diff --git a/src/world/partner/lakilester.c b/src/world/partner/lakilester.c index 02789b4259..42abe6b537 100644 --- a/src/world/partner/lakilester.c +++ b/src/world/partner/lakilester.c @@ -59,7 +59,7 @@ void N(sync_player_position)(void) { f32 speed; if (playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT) { - speed = playerStatus->currentSpeed; + speed = playerStatus->curSpeed; if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) { speed *= 0.5f; } @@ -68,10 +68,10 @@ void N(sync_player_position)(void) { lakilester->yaw = playerStatus->targetYaw; } - playerStatus->position.x = lakilester->pos.x; - playerStatus->position.y = lakilester->pos.y + 10.0f + abs(N(PlayerBounceOffset)) * 0.34f; - playerStatus->position.z = lakilester->pos.z; - add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, 2.0f, gCameras[gCurrentCameraID].currentYaw); + playerStatus->pos.x = lakilester->pos.x; + playerStatus->pos.y = lakilester->pos.y + 10.0f + abs(N(PlayerBounceOffset)) * 0.34f; + playerStatus->pos.z = lakilester->pos.z; + add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, 2.0f, gCameras[gCurrentCameraID].curYaw); } void N(init)(Npc* lakilester) { @@ -141,18 +141,18 @@ API_CALLABLE(N(Update)) { case TWEESTER_PARTNER_INIT: N(TweesterPhysicsPtr)->state++; N(TweesterPhysicsPtr)->prevFlags = lakilester->flags; - N(TweesterPhysicsPtr)->radius = fabsf(dist2D(lakilester->pos.x, lakilester->pos.z, entity->position.x, entity->position.z)); - N(TweesterPhysicsPtr)->angle = atan2(entity->position.x, entity->position.z, lakilester->pos.x, lakilester->pos.z); - N(TweesterPhysicsPtr)->angularVelocity = 6.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 50.0f; + N(TweesterPhysicsPtr)->radius = fabsf(dist2D(lakilester->pos.x, lakilester->pos.z, entity->pos.x, entity->pos.z)); + N(TweesterPhysicsPtr)->angle = atan2(entity->pos.x, entity->pos.z, lakilester->pos.x, lakilester->pos.z); + N(TweesterPhysicsPtr)->angularVel = 6.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase = 50.0f; N(TweesterPhysicsPtr)->countdown = 120; lakilester->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8; lakilester->flags &= ~NPC_FLAG_GRAVITY; case TWEESTER_PARTNER_ATTRACT: sin_cos_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->angle), &sinAngle, &cosAngle); - lakilester->pos.x = entity->position.x + (sinAngle * N(TweesterPhysicsPtr)->radius); - lakilester->pos.z = entity->position.z - (cosAngle * N(TweesterPhysicsPtr)->radius); - N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVelocity); + lakilester->pos.x = entity->pos.x + (sinAngle * N(TweesterPhysicsPtr)->radius); + lakilester->pos.z = entity->pos.z - (cosAngle * N(TweesterPhysicsPtr)->radius); + N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVel); if (N(TweesterPhysicsPtr)->radius > 20.0f) { N(TweesterPhysicsPtr)->radius--; @@ -160,19 +160,19 @@ API_CALLABLE(N(Update)) { N(TweesterPhysicsPtr)->radius++; } - liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelocityPhase)) * 3.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase += 3.0f; + liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelPhase)) * 3.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase += 3.0f; - if (N(TweesterPhysicsPtr)->liftoffVelocityPhase > 150.0f) { - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 150.0f; + if (N(TweesterPhysicsPtr)->liftoffVelPhase > 150.0f) { + N(TweesterPhysicsPtr)->liftoffVelPhase = 150.0f; } lakilester->pos.y += liftoffVelocity; lakilester->renderYaw = clamp_angle(360.0f - N(TweesterPhysicsPtr)->angle); - N(TweesterPhysicsPtr)->angularVelocity += 0.8; + N(TweesterPhysicsPtr)->angularVel += 0.8; - if (N(TweesterPhysicsPtr)->angularVelocity > 40.0f) { - N(TweesterPhysicsPtr)->angularVelocity = 40.0f; + if (N(TweesterPhysicsPtr)->angularVel > 40.0f) { + N(TweesterPhysicsPtr)->angularVel = 40.0f; } if (--N(TweesterPhysicsPtr)->countdown == 0) { @@ -216,7 +216,7 @@ void N(get_movement_from_input)(f32* outAngle, f32* outSpeed) { PartnerStatus* partnerStatus = &gPartnerStatus; f32 stickX = partnerStatus->stickX; f32 stickY = partnerStatus->stickY; - f32 moveAngle = clamp_angle(atan2(0.0f, 0.0f, stickX, -stickY) + gCameras[CAM_DEFAULT].currentYaw); + f32 moveAngle = clamp_angle(atan2(0.0f, 0.0f, stickX, -stickY) + gCameras[CAM_DEFAULT].curYaw); f32 moveSpeed = 0.0f; if (dist2D(0.0f, 0.0f, stickX, -stickY) >= 1.0) { @@ -250,10 +250,10 @@ s32 N(can_dismount)(void) { canDismount = FALSE; outLength = 16.0f; outY = lakilester->moveToPos.y + 7.0f; - outX = playerStatus->position.x; - outZ = playerStatus->position.z; + outX = playerStatus->pos.x; + outZ = playerStatus->pos.z; currentCamera = &gCameras[gCurrentCameraID]; - add_vec2D_polar(&outX, &outZ, 2.0f, currentCamera->currentYaw); + add_vec2D_polar(&outX, &outZ, 2.0f, currentCamera->curYaw); hitResult = player_raycast_below_cam_relative(playerStatus, &outX, &outY, &outZ, &outLength, &hitRx, &hitRz, &hitDirX, &hitDirZ); temp = hitResult; @@ -279,9 +279,9 @@ s32 N(can_dismount)(void) { } s32 N(test_mounting_height_adjustment)(Npc* lakilester, f32 height, f32 dist) { - f32 x = gPlayerStatus.position.x; - f32 y = gPlayerStatus.position.y + height; - f32 z = gPlayerStatus.position.z; + f32 x = gPlayerStatus.pos.x; + f32 y = gPlayerStatus.pos.y + height; + f32 z = gPlayerStatus.pos.z; f32 depth = dist; f32 hitRx, hitRz; f32 hitDirX, hitDirZ; @@ -323,7 +323,7 @@ void N(apply_riding_static_collisions)(Npc* lakilester) { if (TEST_MOVE_AT_ANGLE(npc_test_move_complex_with_slipping, lakilester->yaw)) { lakilester->flags |= (NPC_FLAG_COLLDING_FORWARD_WITH_WORLD | NPC_FLAG_COLLDING_WITH_WORLD); - lakilester->currentWall = NpcHitQueryColliderID; + lakilester->curWall = NpcHitQueryColliderID; lakilester->pos.x = x; lakilester->pos.z = z; } else { @@ -381,7 +381,7 @@ void N(update_riding_physics)(Npc* lakilester) { moveSpeed = 0.0f; N(get_movement_from_input)(&moveAngle, &moveSpeed); - currentSurfaceType = get_collider_flags(lakilester->currentFloor) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; + currentSurfaceType = get_collider_flags(lakilester->curFloor) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; if (currentSurfaceType == SURFACE_TYPE_LAVA) { moveSpeed *= 0.5f; } @@ -417,7 +417,7 @@ void N(update_riding_physics)(Npc* lakilester) { if (npc_test_move_taller_with_slipping(lakilester->collisionChannel, &x, &y, &z, lakilester->collisionDiameter, lakilester->yaw, lakilester->collisionHeight, lakilester->collisionDiameter)) { - collisionStatus->currentInspect = (partnerStatus->pressedButtons & BUTTON_A) ? NpcHitQueryColliderID : NO_COLLIDER; + collisionStatus->curInspect = (partnerStatus->pressedButtons & BUTTON_A) ? NpcHitQueryColliderID : NO_COLLIDER; } if (moveSpeed != 0.0f) { @@ -492,9 +492,9 @@ void N(update_riding_physics)(Npc* lakilester) { lakilester->moveToPos.y -= lakilester->jumpScale; hitDepth = lakilester->collisionHeight + 2; y = lakilester->moveToPos.y + 12.0f; - x = playerStatus->position.x; - z = playerStatus->position.z; - add_vec2D_polar(&x, &z, 2.0f, gCameras[gCurrentCameraID].currentYaw); + x = playerStatus->pos.x; + z = playerStatus->pos.z; + add_vec2D_polar(&x, &z, 2.0f, gCameras[gCurrentCameraID].curYaw); raycastBelowResult = player_raycast_below_cam_relative(playerStatus, &x, &y, &z, &hitDepth, &sp40, &sp44, &sp48, &sp4C); N(CurrentGroundPitch) = get_player_normal_pitch(); @@ -510,12 +510,12 @@ void N(update_riding_physics)(Npc* lakilester) { } if (hitDepth <= height && raycastBelowResult > NO_COLLIDER) { - playerStatus->lastGoodPosition.x = lakilester->pos.x; - playerStatus->lastGoodPosition.y = lakilester->pos.y; - playerStatus->lastGoodPosition.z = lakilester->pos.z; - collisionStatus->currentFloor = raycastBelowResult; + playerStatus->lastGoodPos.x = lakilester->pos.x; + playerStatus->lastGoodPos.y = lakilester->pos.y; + playerStatus->lastGoodPos.z = lakilester->pos.z; + collisionStatus->curFloor = raycastBelowResult; - lakilester->currentFloor = raycastBelowResult; + lakilester->curFloor = raycastBelowResult; lakilester->moveToPos.y = y; lakilester->moveToPos.x = x; lakilester->moveToPos.z = z; @@ -524,18 +524,18 @@ void N(update_riding_physics)(Npc* lakilester) { belowSurfaceType = get_collider_flags(raycastBelowResult) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; if (belowSurfaceType == SURFACE_TYPE_LAVA) { - lakilester->currentAnim = ANIM_WorldLakilester_StrainWalk; + lakilester->curAnim = ANIM_WorldLakilester_StrainWalk; lakilester->moveSpeed = moveSpeed * 0.5f; } else { - lakilester->currentAnim = ANIM_WorldLakilester_Walk; + lakilester->curAnim = ANIM_WorldLakilester_Walk; lakilester->moveSpeed = moveSpeed; } return; } - collisionStatus->currentFloor = NO_COLLIDER; + collisionStatus->curFloor = NO_COLLIDER; playerStatus->timeInAir++; - lakilester->currentFloor = NO_COLLIDER; + lakilester->curFloor = NO_COLLIDER; lakilester->jumpScale += 1.8; if (lakilester->jumpScale > 12.0f) { @@ -549,9 +549,9 @@ s32 N(test_dismount_height)(f32* posY) { f32 hitRx, hitRz; f32 posX, posZ; - *posY = gPlayerStatus.position.y + colliderHeight; - posX = gPlayerStatus.position.x; - posZ = gPlayerStatus.position.z; + *posY = gPlayerStatus.pos.y + colliderHeight; + posX = gPlayerStatus.pos.x; + posZ = gPlayerStatus.pos.z; return player_raycast_below_cam_relative(&gPlayerStatus, &posX, posY, &posZ, &colliderHeight, &hitRx, &hitRz, &hitDirX, &hitDirZ); @@ -607,18 +607,18 @@ API_CALLABLE(N(UseAbility)) { lakilester->flags |= NPC_FLAG_IGNORE_PLAYER_COLLISION; set_action_state(ACTION_STATE_RIDE); suggest_player_anim_always_forward(ANIM_MarioW2_RideLaki); - lakilester->currentAnim = ANIM_WorldLakilester_Walk; + lakilester->curAnim = ANIM_WorldLakilester_Walk; N(MountState) = MOUNT_STATE_IN_PROGRESS; // unexpected lakilester->flags &= ~(NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8); lakilester->flags |= (NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_TOUCHES_GROUND); partnerStatus->actingPartner = PARTNER_LAKILESTER; partnerStatus->partnerActionState = PARTNER_ACTION_LAKILESTER_1; gGameStatusPtr->keepUsingPartnerOnMapChange = FALSE; - lakilester->pos.x = playerStatus->position.x; + lakilester->pos.x = playerStatus->pos.x; lakilester->pos.y = lakilester->moveToPos.y; - lakilester->pos.z = playerStatus->position.z; - lakilester->currentAnim = ANIM_WorldLakilester_Walk; - playerStatus->position.y = lakilester->pos.y + 10.0f; + lakilester->pos.z = playerStatus->pos.z; + lakilester->curAnim = ANIM_WorldLakilester_Walk; + playerStatus->pos.y = lakilester->pos.y + 10.0f; lakilester->moveSpeed = 3.0f; lakilester->jumpScale = 0.0f; lakilester->yaw = playerStatus->targetYaw; @@ -700,9 +700,9 @@ API_CALLABLE(N(UseAbility)) { set_action_state(ACTION_STATE_RIDE); N(MountState) = MOUNT_STATE_IN_PROGRESS; partner_force_player_flip_done(); - lakilester->moveToPos.x = playerStatus->position.x; - lakilester->moveToPos.y = playerStatus->position.y; - lakilester->moveToPos.z = playerStatus->position.z; + lakilester->moveToPos.x = playerStatus->pos.x; + lakilester->moveToPos.y = playerStatus->pos.y; + lakilester->moveToPos.z = playerStatus->pos.z; yaw = 0.0f; for (i = 0; i < 4; i++) { @@ -719,8 +719,8 @@ API_CALLABLE(N(UseAbility)) { lakilester->yaw = atan2(lakilester->pos.x, lakilester->pos.z, lakilester->moveToPos.x, lakilester->moveToPos.z); lakilester->duration = 12; - lakilester->currentAnim = ANIM_WorldLakilester_Walk; - lakilester->jumpVelocity = 8.0f; + lakilester->curAnim = ANIM_WorldLakilester_Walk; + lakilester->jumpVel = 8.0f; lakilester->jumpScale = 1.4f; suggest_player_anim_allow_backward(ANIM_Mario1_BeforeJump); N(AbilityState) = RIDE_STATE_MOUNT_2; @@ -737,13 +737,13 @@ API_CALLABLE(N(UseAbility)) { lakilester->pos.x += (lakilester->moveToPos.x - lakilester->pos.x) / lakilester->duration; lakilester->pos.z += (lakilester->moveToPos.z - lakilester->pos.z) / lakilester->duration; lakilester->pos.y += (lakilester->moveToPos.y - lakilester->pos.y) / lakilester->duration; - playerStatus->position.y += lakilester->jumpVelocity; + playerStatus->pos.y += lakilester->jumpVel; N(test_mounting_height_adjustment)(lakilester, playerStatus->colliderHeight, 2 * playerStatus->colliderHeight); - playerStatus->position.y += N(MountingDeltaY); + playerStatus->pos.y += N(MountingDeltaY); lakilester->pos.y += N(MountingDeltaY); - lakilester->jumpVelocity -= lakilester->jumpScale; + lakilester->jumpVel -= lakilester->jumpScale; - if (lakilester->jumpVelocity <= 0.0f) { + if (lakilester->jumpVel <= 0.0f) { suggest_player_anim_allow_backward(ANIM_Mario1_Fall); } @@ -752,10 +752,10 @@ API_CALLABLE(N(UseAbility)) { if (lakilester->duration > 0) { if (lakilester->duration == 1) { add_vec2D_polar(&lakilester->pos.x, &lakilester->pos.z, -2.0f, - gCameras[gCurrentCameraID].currentYaw); + gCameras[gCurrentCameraID].curYaw); } } else { - playerStatus->position.y = lakilester->pos.y + 10.0f; + playerStatus->pos.y = lakilester->pos.y + 10.0f; lakilester->moveSpeed = playerStatus->runSpeed; lakilester->jumpScale = 0.0f; lakilester->yaw = playerStatus->targetYaw; @@ -827,24 +827,24 @@ API_CALLABLE(N(UseAbility)) { lakilester->flags &= ~NPC_FLAG_IGNORE_WORLD_COLLISION; playerStatus->flags |= PS_FLAG_PAUSE_DISABLED; N(can_dismount)(); - camYaw = camera->currentYaw; + camYaw = camera->curYaw; if (playerStatus->spriteFacingAngle >= 90.0f && playerStatus->spriteFacingAngle < 270.0f) { yaw = (180.0f + camYaw) - 90.0f; } else { yaw = (0.0f + camYaw) - 90.0f; } lakilester->yaw = yaw; - dist = dist2D(playerStatus->position.x, playerStatus->position.z, + dist = dist2D(playerStatus->pos.x, playerStatus->pos.z, lakilester->moveToPos.x, lakilester->moveToPos.z); - lakilester->yaw = atan2(playerStatus->position.x, playerStatus->position.z, + lakilester->yaw = atan2(playerStatus->pos.x, playerStatus->pos.z, lakilester->moveToPos.x, lakilester->moveToPos.z); lakilester->duration = 14; lakilester->jumpScale = 1.2f; if (lakilester->moveToPos.y > lakilester->pos.y) { - lakilester->jumpVelocity = 6.0f + (lakilester->moveToPos.y - lakilester->pos.y) / 14.0f; + lakilester->jumpVel = 6.0f + (lakilester->moveToPos.y - lakilester->pos.y) / 14.0f; } else { - lakilester->jumpVelocity = 6.0f; + lakilester->jumpVel = 6.0f; } lakilester->moveSpeed = dist / lakilester->duration; @@ -857,34 +857,34 @@ API_CALLABLE(N(UseAbility)) { // fallthrough case RIDE_STATE_DISMOUNT_3: gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_IGNORE_PLAYER_Y; - playerStatus->position.y += lakilester->jumpVelocity; + playerStatus->pos.y += lakilester->jumpVel; dist = playerStatus->colliderHeight * 0.5f; - x = playerStatus->position.x; - y = playerStatus->position.y + (playerStatus->colliderHeight * 0.5f); - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y + (playerStatus->colliderHeight * 0.5f); + z = playerStatus->pos.z; - yaw = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw; + yaw = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw; if (player_raycast_up_corners(playerStatus, &x, &y, &z, &dist, yaw) >= 0) { N(AbilityState) = RIDE_STATE_FINISH_1; break; } - lakilester->jumpVelocity -= lakilester->jumpScale; - add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, lakilester->moveSpeed, lakilester->yaw); + lakilester->jumpVel -= lakilester->jumpScale; + add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, lakilester->moveSpeed, lakilester->yaw); func_800E4AD8(0); if (N(test_dismount_height)(&y) > NO_COLLIDER) { N(AbilityState) = RIDE_STATE_FINISH_1; - playerStatus->position.y = y; + playerStatus->pos.y = y; } break; } - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; gCameras[CAM_DEFAULT].targetPos.y = lakilester->moveToPos.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; if (N(AbilityState) == RIDE_STATE_FINISH_1) { N(MountState) = MOUNT_STATE_NONE; @@ -963,25 +963,25 @@ API_CALLABLE(N(PutAway)) { switch (N(PutAwayState)) { case PUT_AWAY_DISMOUNT_1: N(can_dismount)(); - yaw = cam->currentYaw; + yaw = cam->curYaw; if ((playerStatus->spriteFacingAngle >= 90.0f) && (playerStatus->spriteFacingAngle < 270.0f)) { lakilester->yaw = (yaw + 180.0f) - 90.0f; } else { lakilester->yaw = (yaw + 0.0f) - 90.0f; } - sp2C = dist2D(playerStatus->position.x, playerStatus->position.z, + sp2C = dist2D(playerStatus->pos.x, playerStatus->pos.z, lakilester->moveToPos.x, lakilester->moveToPos.z); lakilester->duration = 14; if (lakilester->moveToPos.y > lakilester->pos.y ) { - lakilester->jumpVelocity = (lakilester->moveToPos.y - lakilester->pos.y) / 14.0f + 6.0f; + lakilester->jumpVel = (lakilester->moveToPos.y - lakilester->pos.y) / 14.0f + 6.0f; } else { - lakilester->jumpVelocity = 6.0f; + lakilester->jumpVel = 6.0f; } lakilester->jumpScale = 1.2f; lakilester->moveSpeed = sp2C / lakilester->duration; - lakilester->yaw = atan2(playerStatus->position.x, playerStatus->position.z, + lakilester->yaw = atan2(playerStatus->pos.x, playerStatus->pos.z, lakilester->moveToPos.x, lakilester->moveToPos.z); suggest_player_anim_allow_backward(ANIM_Mario1_BeforeJump); N(PutAwayState)++; @@ -990,33 +990,33 @@ API_CALLABLE(N(PutAway)) { suggest_player_anim_allow_backward(ANIM_Mario1_Jump); N(PutAwayState)++; case PUT_AWAY_DISMOUNT_3: - playerStatus->position.y += lakilester->jumpVelocity; - lakilester->jumpVelocity -= lakilester->jumpScale; - add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, + playerStatus->pos.y += lakilester->jumpVel; + lakilester->jumpVel -= lakilester->jumpScale; + add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, lakilester->moveSpeed, lakilester->yaw); func_800E4AD8(0); - if (lakilester->jumpVelocity <= 0.0f) { + if (lakilester->jumpVel <= 0.0f) { playerStatus->flags |= PS_FLAG_FALLING; - if (lakilester->jumpVelocity < -10.0) { - lakilester->jumpVelocity = -10.0f; + if (lakilester->jumpVel < -10.0) { + lakilester->jumpVel = -10.0f; } } - sp20 = playerStatus->position.x; - sp24 = playerStatus->position.y + playerStatus->colliderHeight; - sp28 = playerStatus->position.z; + sp20 = playerStatus->pos.x; + sp24 = playerStatus->pos.y + playerStatus->colliderHeight; + sp28 = playerStatus->pos.z; sp2C = playerStatus->colliderHeight; if (npc_raycast_down_around(0, &sp20, &sp24, &sp28, &sp2C, lakilester->yaw, lakilester->collisionDiameter)) { N(PutAwayState) = PUT_AWAY_FINISH_1; - playerStatus->position.y = sp24; + playerStatus->pos.y = sp24; } break; } - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; switch (N(PutAwayState)) { case PUT_AWAY_FINISH_1: @@ -1118,7 +1118,7 @@ void N(offset_player_from_camera)(f32 speed) { Camera* currentCamera = &gCameras[gCurrentCameraID]; PlayerStatus* playerStatus = &gPlayerStatus; - add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, speed, currentCamera->currentYaw); + add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, speed, currentCamera->curYaw); } API_CALLABLE(N(EnterMap)) { @@ -1136,22 +1136,22 @@ API_CALLABLE(N(EnterMap)) { switch (script->functionTemp[0]) { case 0: if (!script->varTable[12]) { - temp_f0 = playerStatus->position.x; + temp_f0 = playerStatus->pos.x; lakilester->pos.x = temp_f0; lakilester->moveToPos.x = temp_f0; - temp_f4 = playerStatus->position.z; + temp_f4 = playerStatus->pos.z; lakilester->pos.z = temp_f4; lakilester->moveToPos.z = temp_f4; - playerStatus->position.y = lakilester->pos.y + 10.0f; + playerStatus->pos.y = lakilester->pos.y + 10.0f; partner_kill_ability_script(); } else { set_action_state(ACTION_STATE_RIDE); disable_player_static_collisions(); disable_player_input(); - lakilester->moveToPos.x = lakilester->pos.x = playerStatus->position.x; - lakilester->moveToPos.y = lakilester->pos.y = playerStatus->position.y; - lakilester->moveToPos.z = lakilester->pos.z = playerStatus->position.z; - playerStatus->position.y = lakilester->pos.y + 10.0f; + lakilester->moveToPos.x = lakilester->pos.x = playerStatus->pos.x; + lakilester->moveToPos.y = lakilester->pos.y = playerStatus->pos.y; + lakilester->moveToPos.z = lakilester->pos.z = playerStatus->pos.z; + playerStatus->pos.y = lakilester->pos.y + 10.0f; } script->functionTemp[1] = script->varTable[4]; @@ -1182,9 +1182,9 @@ API_CALLABLE(N(EnterMap)) { case 1: npc_move_heading(lakilester, lakilester->moveSpeed, lakilester->yaw); - playerStatus->position.x = lakilester->pos.x; - playerStatus->position.y = lakilester->pos.y + 10.0f; - playerStatus->position.z = lakilester->pos.z; + playerStatus->pos.x = lakilester->pos.x; + playerStatus->pos.y = lakilester->pos.y + 10.0f; + playerStatus->pos.z = lakilester->pos.z; playerStatus->targetYaw = lakilester->yaw; N(offset_player_from_camera)(2.0f); script->functionTemp[1] -= 1; diff --git a/src/world/partner/parakarry.c b/src/world/partner/parakarry.c index 46a310d174..9777a082e7 100644 --- a/src/world/partner/parakarry.c +++ b/src/world/partner/parakarry.c @@ -87,19 +87,19 @@ API_CALLABLE(N(Update)) { N(TweesterPhysicsPtr)->state++; N(TweesterPhysicsPtr)->prevFlags = parakarry->flags; N(TweesterPhysicsPtr)->radius = fabsf(dist2D(parakarry->pos.x, parakarry->pos.z, - entity->position.x, entity->position.z)); - N(TweesterPhysicsPtr)->angle = atan2(entity->position.x, entity->position.z, + entity->pos.x, entity->pos.z)); + N(TweesterPhysicsPtr)->angle = atan2(entity->pos.x, entity->pos.z, parakarry->pos.x, parakarry->pos.z); - N(TweesterPhysicsPtr)->angularVelocity = 6.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 50.0f; + N(TweesterPhysicsPtr)->angularVel = 6.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase = 50.0f; N(TweesterPhysicsPtr)->countdown = 120; parakarry->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8; parakarry->flags &= ~NPC_FLAG_GRAVITY; case TWEESTER_PARTNER_ATTRACT: sin_cos_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->angle), &sinAngle, &cosAngle); - parakarry->pos.x = entity->position.x + (sinAngle * N(TweesterPhysicsPtr)->radius); - parakarry->pos.z = entity->position.z - (cosAngle * N(TweesterPhysicsPtr)->radius); - N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVelocity); + parakarry->pos.x = entity->pos.x + (sinAngle * N(TweesterPhysicsPtr)->radius); + parakarry->pos.z = entity->pos.z - (cosAngle * N(TweesterPhysicsPtr)->radius); + N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVel); if (N(TweesterPhysicsPtr)->radius > 20.0f) { N(TweesterPhysicsPtr)->radius--; @@ -107,19 +107,19 @@ API_CALLABLE(N(Update)) { N(TweesterPhysicsPtr)->radius++; } - liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelocityPhase)) * 3.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase += 3.0f; + liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelPhase)) * 3.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase += 3.0f; - if (N(TweesterPhysicsPtr)->liftoffVelocityPhase > 150.0f) { - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 150.0f; + if (N(TweesterPhysicsPtr)->liftoffVelPhase > 150.0f) { + N(TweesterPhysicsPtr)->liftoffVelPhase = 150.0f; } parakarry->pos.y += liftoffVelocity; parakarry->renderYaw = clamp_angle(360.0f - N(TweesterPhysicsPtr)->angle); - N(TweesterPhysicsPtr)->angularVelocity += 0.8; + N(TweesterPhysicsPtr)->angularVel += 0.8; - if (N(TweesterPhysicsPtr)->angularVelocity > 40.0f) { - N(TweesterPhysicsPtr)->angularVelocity = 40.0f; + if (N(TweesterPhysicsPtr)->angularVel > 40.0f) { + N(TweesterPhysicsPtr)->angularVel = 40.0f; } if (--N(TweesterPhysicsPtr)->countdown == 0) { @@ -165,9 +165,9 @@ s32 N(update_current_floor)(void) { s32 hitResult; s32 surfaceType; - x = gPlayerStatus.position.x; - y = gPlayerStatus.position.y + (colliderBaseHeight * 0.5); - z = gPlayerStatus.position.z; + x = gPlayerStatus.pos.x; + y = gPlayerStatus.pos.y + (colliderBaseHeight * 0.5); + z = gPlayerStatus.pos.z; length = colliderBaseHeight / 2.0f; hitResult = player_raycast_below_cam_relative(&gPlayerStatus, &x, &y, &z, &length, &hitRx, @@ -218,7 +218,7 @@ API_CALLABLE(N(UseAbility)) { parakarry->flags &= ~(NPC_FLAG_JUMPING | NPC_FLAG_GRAVITY); N(UsingAbility) = TRUE; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_IGNORE_PLAYER_Y; - parakarry->currentAnim = ANIM_WorldParakarry_CarryLight; + parakarry->curAnim = ANIM_WorldParakarry_CarryLight; partnerStatus->actingPartner = PARTNER_PARAKARRY; partnerStatus->partnerActionState = PARTNER_ACTION_PARAKARRY_HOVER; parakarry->flags &= ~NPC_FLAG_COLLDING_FORWARD_WITH_WORLD; @@ -263,7 +263,7 @@ API_CALLABLE(N(UseAbility)) { partnerStatus->partnerActionState = PARTNER_ACTION_PARAKARRY_HOVER; N(PlayerWasFacingLeft) = partner_force_player_flip_done(); enable_npc_blur(parakarry); - parakarry->yaw = atan2(parakarry->pos.x, parakarry->pos.z, playerStatus->position.x, playerStatus->position.z); + parakarry->yaw = atan2(parakarry->pos.x, parakarry->pos.z, playerStatus->pos.x, playerStatus->pos.z); parakarry->duration = 4; N(AbilityState)++; // AIR_LIFT_GATHER break; @@ -278,10 +278,10 @@ API_CALLABLE(N(UseAbility)) { N(AbilityState) = AIR_LIFT_DROP; } else { suggest_player_anim_allow_backward(ANIM_Mario1_Idle); - parakarry->moveToPos.x = playerStatus->position.x; - parakarry->moveToPos.y = playerStatus->position.y + 32.0f; - parakarry->moveToPos.z = playerStatus->position.z; - parakarry->currentAnim = ANIM_WorldParakarry_Run; + parakarry->moveToPos.x = playerStatus->pos.x; + parakarry->moveToPos.y = playerStatus->pos.y + 32.0f; + parakarry->moveToPos.z = playerStatus->pos.z; + parakarry->curAnim = ANIM_WorldParakarry_Run; add_vec2D_polar(¶karry->moveToPos.x, ¶karry->moveToPos.z, 0.0f, playerStatus->targetYaw); yaw = playerStatus->targetYaw; @@ -302,13 +302,13 @@ API_CALLABLE(N(UseAbility)) { disable_npc_blur(parakarry); parakarry->yaw = playerStatus->targetYaw; parakarry->moveSpeed = 0.2f; - parakarry->currentAnim = ANIM_WorldParakarry_CarryHeavy; + parakarry->curAnim = ANIM_WorldParakarry_CarryHeavy; parakarry->planarFlyDist = 0; suggest_player_anim_always_forward(ANIM_MarioW2_HoldOnto); sfx_play_sound_at_npc(SOUND_2009, SOUND_SPACE_MODE_0, NPC_PARTNER); gCollisionStatus.lastTouchedFloor = NO_COLLIDER; - gCollisionStatus.currentFloor = NO_COLLIDER; - parakarry->currentFloor = NO_COLLIDER; + gCollisionStatus.curFloor = NO_COLLIDER; + parakarry->curFloor = NO_COLLIDER; N(AbilityStateTime) = 20; N(AbilityState) = AIR_LIFT_PICKUP; } @@ -334,7 +334,7 @@ API_CALLABLE(N(UseAbility)) { } length = fabsf(sin_rad(DEG_TO_RAD((20 - N(AbilityStateTime)) * 18))) * 1.3; - playerStatus->position.y += length; + playerStatus->pos.y += length; parakarry->pos.y += length; x = parakarry->pos.x; y = parakarry->pos.y + parakarry->collisionHeight / 2.0f; @@ -349,23 +349,23 @@ API_CALLABLE(N(UseAbility)) { } length = playerStatus->colliderHeight / 2.0f; - x = playerStatus->position.x; - y = playerStatus->position.y + playerStatus->colliderHeight / 2.0f; - z = playerStatus->position.z; - halfCollisionHeight = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].currentYaw; + x = playerStatus->pos.x; + y = playerStatus->pos.y + playerStatus->colliderHeight / 2.0f; + z = playerStatus->pos.z; + halfCollisionHeight = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw; if (player_raycast_up_corners(playerStatus, &x, &y, &z, &length, halfCollisionHeight) >= 0) { suggest_player_anim_allow_backward(ANIM_Mario1_Idle); N(AbilityState) = AIR_LIFT_DROP; break; } - x = playerStatus->position.x; - y = playerStatus->position.y; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y; + z = playerStatus->pos.z; hitCount = npc_test_move_complex_with_slipping(COLLISION_CHANNEL_10000, &x, &y, &z, parakarry->moveSpeed, parakarry->yaw, playerStatus->colliderHeight, playerStatus->colliderDiameter); if (hitCount > 1) { - playerStatus->position.x += (x - playerStatus->position.x) / 8.0f; - playerStatus->position.z += (z - playerStatus->position.z) / 8.0f; + playerStatus->pos.x += (x - playerStatus->pos.x) / 8.0f; + playerStatus->pos.z += (z - playerStatus->pos.z) / 8.0f; parakarry->pos.x += (x - parakarry->pos.x) / 8.0f; parakarry->pos.z += (z - parakarry->pos.z) / 8.0f; } @@ -375,8 +375,8 @@ API_CALLABLE(N(UseAbility)) { z = parakarry->pos.z; hitCount = npc_test_move_complex_with_slipping(COLLISION_CHANNEL_10000, &x, &y, &z, parakarry->moveSpeed, parakarry->yaw, parakarry->collisionHeight, parakarry->collisionDiameter); if (hitCount > 1) { - playerDeltaX = (x - playerStatus->position.x) / 8.0f; - playerDeltaZ = (z - playerStatus->position.z) / 8.0f; + playerDeltaX = (x - playerStatus->pos.x) / 8.0f; + playerDeltaZ = (z - playerStatus->pos.z) / 8.0f; parakarryDeltaX = (x - parakarry->pos.x) / 8.0f; parakarryDeltaZ = (z - parakarry->pos.z) / 8.0f; @@ -388,8 +388,8 @@ API_CALLABLE(N(UseAbility)) { z = parakarry->pos.z; hitCount = npc_test_move_complex_with_slipping(COLLISION_CHANNEL_10000, &x, &y, &z, parakarry->moveSpeed, parakarry->yaw, parakarry->collisionHeight, parakarry->collisionDiameter); if (hitCount == 0) { - playerStatus->position.x += playerDeltaX; - playerStatus->position.z += playerDeltaZ; + playerStatus->pos.x += playerDeltaX; + playerStatus->pos.z += playerDeltaZ; parakarry->pos.x += parakarryDeltaX; parakarry->pos.z += parakarryDeltaZ; } @@ -397,13 +397,13 @@ API_CALLABLE(N(UseAbility)) { if (hitCount == 0 && !(playerStatus->animFlags & PA_FLAG_NPC_COLLIDED)) { add_vec2D_polar(¶karry->pos.x, ¶karry->pos.z, parakarry->moveSpeed, parakarry->yaw); - add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, parakarry->moveSpeed, parakarry->yaw); + add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, parakarry->moveSpeed, parakarry->yaw); parakarry->planarFlyDist += parakarry->moveSpeed; } - x = playerStatus->position.x; - y = playerStatus->position.y + playerStatus->colliderHeight / 2.0f; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y + playerStatus->colliderHeight / 2.0f; + z = playerStatus->pos.z; length = playerStatus->colliderHeight / 2.0f; if (npc_raycast_down_around(COLLISION_CHANNEL_10000, &x, &y, &z, &length, parakarry->yaw, parakarry->collisionDiameter)) { s32 surfaceType = get_collider_flags(NpcHitQueryColliderID) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; @@ -413,8 +413,8 @@ API_CALLABLE(N(UseAbility)) { N(AbilityState) = AIR_LIFT_DROP; } - playerStatus->position.y += (y - playerStatus->position.y) / 4.0f; - parakarry->pos.y = playerStatus->position.y + 32.0f; + playerStatus->pos.y += (y - playerStatus->pos.y) / 4.0f; + parakarry->pos.y = playerStatus->pos.y + 32.0f; } if (parakarry->flags & NPC_FLAG_COLLDING_FORWARD_WITH_WORLD) { @@ -423,24 +423,24 @@ API_CALLABLE(N(UseAbility)) { break; } - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; if (N(AbilityStateTime) != 0) { N(AbilityStateTime)--; } else { - parakarry->jumpVelocity = -0.5f; + parakarry->jumpVel = -0.5f; parakarry->jumpScale = -0.01f; - parakarry->moveToPos.y = playerStatus->position.y; + parakarry->moveToPos.y = playerStatus->pos.y; parakarry->duration = 0; - parakarry->currentAnim = ANIM_WorldParakarry_CarryHeavy; + parakarry->curAnim = ANIM_WorldParakarry_CarryHeavy; parakarry->animationSpeed = 1.8f; - gCollisionStatus.currentFloor = NO_COLLIDER; + gCollisionStatus.curFloor = NO_COLLIDER; N(AbilityState)++; // AIR_LIFT_CARRY } break; case AIR_LIFT_CARRY: - gCollisionStatus.currentFloor = N(update_current_floor)(); + gCollisionStatus.curFloor = N(update_current_floor)(); if (playerStatus->actionState == ACTION_STATE_HIT_FIRE || playerStatus->actionState == ACTION_STATE_HIT_LAVA || playerStatus->actionState == ACTION_STATE_KNOCKBACK @@ -470,13 +470,13 @@ API_CALLABLE(N(UseAbility)) { sfx_play_sound_at_npc(SOUND_2009, SOUND_SPACE_MODE_0, NPC_PARTNER); } - parakarry->jumpVelocity -= parakarry->jumpScale; - if (parakarry->jumpVelocity > 0.0) { - parakarry->jumpVelocity = 0.0f; + parakarry->jumpVel -= parakarry->jumpScale; + if (parakarry->jumpVel > 0.0) { + parakarry->jumpVel = 0.0f; } - parakarry->pos.y += parakarry->jumpVelocity; - playerStatus->position.y += parakarry->jumpVelocity; + parakarry->pos.y += parakarry->jumpVel; + playerStatus->pos.y += parakarry->jumpVel; if (!(playerStatus->animFlags & PA_FLAG_NPC_COLLIDED)) { parakarry->moveSpeed += 0.1; if (parakarry->moveSpeed > 2.0) { @@ -484,7 +484,7 @@ API_CALLABLE(N(UseAbility)) { } add_vec2D_polar(¶karry->pos.x, ¶karry->pos.z, parakarry->moveSpeed, parakarry->yaw); - add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, parakarry->moveSpeed, parakarry->yaw); + add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, parakarry->moveSpeed, parakarry->yaw); parakarry->planarFlyDist += parakarry->moveSpeed; parakarry->animationSpeed -= 0.05; if (parakarry->animationSpeed < 1.5) { @@ -494,9 +494,9 @@ API_CALLABLE(N(UseAbility)) { parakarry->animationSpeed += 0.5; } if (!(playerStatus->animFlags & PA_FLAG_NPC_COLLIDED)) { - x = playerStatus->position.x; - y = playerStatus->position.y; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y; + z = playerStatus->pos.z; if (npc_test_move_complex_with_slipping(COLLISION_CHANNEL_10000, &x, &y, &z, parakarry->moveSpeed, parakarry->yaw, playerStatus->colliderHeight, playerStatus->colliderDiameter) @@ -522,19 +522,19 @@ API_CALLABLE(N(UseAbility)) { halfCollisionHeight = length; if (npc_raycast_up(COLLISION_CHANNEL_10000, &x, &y, &z, &length) && (length < halfCollisionHeight)) { parakarry->pos.y = y - parakarry->collisionHeight; - playerStatus->position.y = parakarry->pos.y - 32.0f; + playerStatus->pos.y = parakarry->pos.y - 32.0f; hitAbove = TRUE; } - x = playerStatus->position.x; - y = playerStatus->position.y + playerStatus->colliderHeight / 2.0f; - z = playerStatus->position.z; + x = playerStatus->pos.x; + y = playerStatus->pos.y + playerStatus->colliderHeight / 2.0f; + z = playerStatus->pos.z; length = playerStatus->colliderHeight / 2.0f; if (npc_raycast_down_around(COLLISION_CHANNEL_10000, &x, &y, &z, &length, parakarry->yaw, parakarry->collisionDiameter)) { - playerStatus->position.y += (y - playerStatus->position.y) / 4.0f; - parakarry->pos.y = playerStatus->position.y + 32.0f; + playerStatus->pos.y += (y - playerStatus->pos.y) / 4.0f; + parakarry->pos.y = playerStatus->pos.y + 32.0f; y = parakarry->pos.y; - parakarry->pos.y = playerStatus->position.y; + parakarry->pos.y = playerStatus->pos.y; spawn_surface_effects(parakarry, SURFACE_INTERACT_WALK); parakarry->pos.y = y; @@ -547,9 +547,9 @@ API_CALLABLE(N(UseAbility)) { if (!phys_adjust_cam_on_landing()) { gCameras[CAM_DEFAULT].moveFlags &= ~CAMERA_MOVE_FLAG_2; } - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; if (!(parakarry->flags & NPC_FLAG_COLLDING_FORWARD_WITH_WORLD)) { parakarry->duration++; if (!(parakarry->planarFlyDist < 100.0f)) { @@ -577,9 +577,9 @@ API_CALLABLE(N(UseAbility)) { || N(AbilityState) == AIR_LIFT_DROP || N(AbilityState) == AIR_LIFT_CANCEL ) { - parakarry->currentAnim = ANIM_WorldParakarry_Idle; + parakarry->curAnim = ANIM_WorldParakarry_Idle; N(UsingAbility) = FALSE; - parakarry->jumpVelocity = 0.0f; + parakarry->jumpVel = 0.0f; parakarry->flags &= ~NPC_FLAG_JUMPING; parakarry->animationSpeed = 1.0f; partner_clear_player_tracking(parakarry); diff --git a/src/world/partner/sushie.c b/src/world/partner/sushie.c index a3784f6cf7..ee3c38c7bc 100644 --- a/src/world/partner/sushie.c +++ b/src/world/partner/sushie.c @@ -42,9 +42,9 @@ void N(sync_player_position)(void) { Camera* camera = &gCameras[CAM_DEFAULT]; s32 angleOffset; - playerStatus->position.x = partnerNPC->pos.x; - playerStatus->position.y = partnerNPC->pos.y + 16.0f; - playerStatus->position.z = partnerNPC->pos.z; + playerStatus->pos.x = partnerNPC->pos.x; + playerStatus->pos.y = partnerNPC->pos.y + 16.0f; + playerStatus->pos.z = partnerNPC->pos.z; playerStatus->targetYaw = partnerNPC->yaw; if (playerStatus->spriteFacingAngle < 90.0f || playerStatus->spriteFacingAngle > 270.0f) { @@ -53,8 +53,8 @@ void N(sync_player_position)(void) { angleOffset = 8; } - playerStatus->position.z -= cos_rad(DEG_TO_RAD( - camera->currentYaw + playerStatus->spriteFacingAngle - 90.0f + angleOffset)) * -4.0f; + playerStatus->pos.z -= cos_rad(DEG_TO_RAD( + camera->curYaw + playerStatus->spriteFacingAngle - 90.0f + angleOffset)) * -4.0f; } void N(get_movement_from_input)(f32* outAngle, f32* outSpeed) { @@ -65,7 +65,7 @@ void N(get_movement_from_input)(f32* outAngle, f32* outSpeed) { N(InputStickX) = stickX; N(InputStickY) = stickY; - moveAngle = clamp_angle(atan2(0.0f, 0.0f, stickX, -stickY) + gCameras[CAM_DEFAULT].currentYaw); + moveAngle = clamp_angle(atan2(0.0f, 0.0f, stickX, -stickY) + gCameras[CAM_DEFAULT].curYaw); moveSpeed = 0.0f; if (dist2D(0.0f, 0.0f, N(InputStickX), -N(InputStickY)) >= 1.0) { @@ -92,9 +92,9 @@ void N(test_for_water_level)(s32 ignoreFlags, f32 posX, f32 posY, f32 posZ, f32 depth = 200.0f; if (!npc_raycast_down_around(ignoreFlags, &posX, &posY, &posZ, &depth, yaw, radius)) { - collisionStatus->currentFloor = NO_COLLIDER; + collisionStatus->curFloor = NO_COLLIDER; } else { - collisionStatus->currentFloor = NpcHitQueryColliderID; + collisionStatus->curFloor = NpcHitQueryColliderID; N(WaterSurfaceY) = posY; } } @@ -154,7 +154,7 @@ void N(update_riding_physics)(Npc* sushie) { } } - moveAngle = clamp_angle(atan2(0.0f, 0.0f, N(InertialStickX), -N(InertialStickY)) + gCameras[CAM_DEFAULT].currentYaw); + moveAngle = clamp_angle(atan2(0.0f, 0.0f, N(InertialStickX), -N(InertialStickY)) + gCameras[CAM_DEFAULT].curYaw); if (N(InertialMoveSpeed) <= moveSpeed) { N(InertialMoveSpeed) += (moveSpeed - N(InertialMoveSpeed)) / moveSpeedDamping; if (N(InertialMoveSpeed) > moveSpeed) { @@ -251,7 +251,7 @@ void N(update_riding_physics)(Npc* sushie) { } } if (N(DiveState) == DIVE_STATE_DELAY) { - if ((partnerStatus->currentButtons & BUTTON_C_DOWN) && N(DiveTime) == 0) { + if ((partnerStatus->curButtons & BUTTON_C_DOWN) && N(DiveTime) == 0) { N(DiveState) = DIVE_STATE_DIVING; } } @@ -277,17 +277,17 @@ void N(update_riding_physics)(Npc* sushie) { } if (N(DiveTime) == 1) { suggest_player_anim_always_forward(ANIM_MarioW2_DiveSushie); - sushie->currentAnim = ANIM_WorldSushie_Ride; + sushie->curAnim = ANIM_WorldSushie_Ride; } - if (!N(IsUnderwater) && (playerStatus->position.y + (playerStatus->colliderHeight * 0.5f) < N(WaterSurfaceY))) { + if (!N(IsUnderwater) && (playerStatus->pos.y + (playerStatus->colliderHeight * 0.5f) < N(WaterSurfaceY))) { N(IsUnderwater) = TRUE; playerStatus->renderMode = RENDER_MODE_ALPHATEST; set_player_imgfx_all(playerStatus->trueAnimation, IMGFX_SET_WAVY, 2, 0, 0, 0, 0); npc_set_imgfx_params(sushie, IMGFX_SET_WAVY, 2, 0, 0, 0, 0); } if (N(DiveTime) >= 10) { - if (!(partnerStatus->currentButtons & BUTTON_C_DOWN) || N(DiveTime) >= 30) { - sushie->currentAnim = ANIM_WorldSushie_Rise; + if (!(partnerStatus->curButtons & BUTTON_C_DOWN) || N(DiveTime) >= 30) { + sushie->curAnim = ANIM_WorldSushie_Rise; sfx_play_sound_at_npc(SOUND_294 | SOUND_ID_TRIGGER_CHANGE_SOUND, SOUND_SPACE_MODE_0, NPC_PARTNER); N(DiveState) = DIVE_STATE_SURFACING; } @@ -321,7 +321,7 @@ void N(update_riding_physics)(Npc* sushie) { npc_set_imgfx_params(sushie, IMGFX_CLEAR, 0, 0, 0, 0, 0); } N(DiveState) = DIVE_STATE_NONE; - sushie->currentAnim = ANIM_WorldSushie_Ride; + sushie->curAnim = ANIM_WorldSushie_Ride; sushie->moveToPos.y = N(WaterSurfaceY) - (sushie->collisionHeight * 0.5f); suggest_player_anim_always_forward(ANIM_MarioW2_RideSushie); } @@ -391,7 +391,7 @@ API_CALLABLE(N(UseAbility)) { case SWIM_STATE_INIT: if (!gGameStatusPtr->keepUsingPartnerOnMapChange) { // are we colliding with a solid (non-entity) wall? - collider = collisionStatus->currentWall; + collider = collisionStatus->curWall; if (collider <= NO_COLLIDER || collider & COLLISION_WITH_ENTITY_BIT) { return ApiStatus_DONE1; } @@ -404,7 +404,7 @@ API_CALLABLE(N(UseAbility)) { } else { // resume riding state from previous map sushie->moveToPos.y = sushie->pos.y; - playerStatus->position.y = sushie->moveToPos.y + 16.0f; + playerStatus->pos.y = sushie->moveToPos.y + 16.0f; N(IsRiding) = TRUE; sushie->flags |= NPC_FLAG_8; sushie->flags &= ~NPC_FLAG_GRAVITY; @@ -413,7 +413,7 @@ API_CALLABLE(N(UseAbility)) { disable_player_shadow(); disable_npc_shadow(sushie); npc_set_imgfx_params(sushie, IMGFX_SET_WAVY, 2, 0, 0, 0, 0); - sushie->currentAnim = ANIM_WorldSushie_Ride; + sushie->curAnim = ANIM_WorldSushie_Ride; sushie->moveSpeed = playerStatus->runSpeed; sushie->jumpScale = 0.0f; partnerStatus->partnerActionState = PARTNER_ACTION_USE; @@ -427,15 +427,15 @@ API_CALLABLE(N(UseAbility)) { break; case SWIM_STATE_BEGIN: - if (collisionStatus->currentWall <= NO_COLLIDER) { + if (collisionStatus->curWall <= NO_COLLIDER) { return ApiStatus_DONE1; } // check for obstructions between player and center of current wall - get_collider_center(collisionStatus->currentWall, &x, &y, &z); - angle = atan2(x, z, playerStatus->position.x, playerStatus->position.z); - x = playerStatus->position.x; - y = playerStatus->position.y; - z = playerStatus->position.z; + get_collider_center(collisionStatus->curWall, &x, &y, &z); + angle = atan2(x, z, playerStatus->pos.x, playerStatus->pos.z); + x = playerStatus->pos.x; + y = playerStatus->pos.y; + z = playerStatus->pos.z; collider = N(test_ray_to_wall_center)(0, &x, &y, &z, playerStatus->colliderDiameter * 0.5f, 2.0f * playerStatus->colliderDiameter, &angle); // check surface type for wall @@ -452,9 +452,9 @@ API_CALLABLE(N(UseAbility)) { disable_player_static_collisions(); disable_player_input(); sushie->collisionChannel = COLLISION_CHANNEL_80000; - sushie->moveToPos.x = playerStatus->position.x; - sushie->moveToPos.y = playerStatus->position.y; - sushie->moveToPos.z = playerStatus->position.z; + sushie->moveToPos.x = playerStatus->pos.x; + sushie->moveToPos.y = playerStatus->pos.y; + sushie->moveToPos.z = playerStatus->pos.z; sushie->yaw = angle; playerStatus->targetYaw = angle; sushie->renderYaw = 90.0f; @@ -465,7 +465,7 @@ API_CALLABLE(N(UseAbility)) { dist = 100.0f; collider = npc_raycast_down_around(sushie->collisionChannel, &x, &y, &z, &dist, sushie->yaw, sushie->collisionDiameter); - sushie->currentAnim = ANIM_WorldSushie_Run; + sushie->curAnim = ANIM_WorldSushie_Run; sushie->duration = 12; sushie->moveToPos.y = y - (sushie->collisionHeight * 0.5f); suggest_player_anim_allow_backward(ANIM_Mario1_Idle); @@ -489,15 +489,15 @@ API_CALLABLE(N(UseAbility)) { sushie->flags &= ~(NPC_FLAG_GRAVITY | NPC_FLAG_IGNORE_WORLD_COLLISION); disable_npc_shadow(sushie); npc_set_imgfx_params(sushie, IMGFX_SET_WAVY, 2, 0, 0, 0, 0); - sushie->currentAnim = ANIM_WorldSushie_Ride; + sushie->curAnim = ANIM_WorldSushie_Ride; playerStatus->flags |= PS_FLAG_MOVEMENT_LOCKED; - dist = dist2D(playerStatus->position.x, playerStatus->position.z, sushie->moveToPos.x, sushie->moveToPos.z); - sushie->jumpVelocity = 5.0f; + dist = dist2D(playerStatus->pos.x, playerStatus->pos.z, sushie->moveToPos.x, sushie->moveToPos.z); + sushie->jumpVel = 5.0f; sushie->jumpScale = 0.6f; - y = sushie->moveToPos.y - playerStatus->position.y; - sushie->duration = (2.0f * sushie->jumpVelocity) / 0.6f; + y = sushie->moveToPos.y - playerStatus->pos.y; + sushie->duration = (2.0f * sushie->jumpVel) / 0.6f; sushie->moveSpeed = dist / sushie->duration; - sushie->jumpVelocity += y / sushie->duration; + sushie->jumpVel += y / sushie->duration; suggest_player_anim_allow_backward(ANIM_Mario1_Jump); script->USE_STATE++; // SWIM_STATE_EMBARK_1 fx_rising_bubble(0, sushie->pos.x, sushie->moveToPos.y + (sushie->collisionHeight * 0.5f), sushie->pos.z, 0.0f); @@ -511,15 +511,15 @@ API_CALLABLE(N(UseAbility)) { script->USE_STATE++; // fallthrough case SWIM_STATE_EMBARK_4: - playerStatus->position.y += sushie->jumpVelocity; - sushie->jumpVelocity -= sushie->jumpScale; - add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, sushie->moveSpeed, sushie->yaw); - if (sushie->jumpVelocity <= 0.0f) { + playerStatus->pos.y += sushie->jumpVel; + sushie->jumpVel -= sushie->jumpScale; + add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, sushie->moveSpeed, sushie->yaw); + if (sushie->jumpVel <= 0.0f) { suggest_player_anim_allow_backward(ANIM_Mario1_Fall); } - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; if (sushie->duration != 0) { sushie->duration--; @@ -530,9 +530,9 @@ API_CALLABLE(N(UseAbility)) { playerStatus->flags &= ~PS_FLAG_MOVEMENT_LOCKED; suggest_player_anim_always_forward(ANIM_MarioW2_RideSushie); sfx_play_sound_at_npc(SOUND_2013, SOUND_SPACE_MODE_0, NPC_PARTNER); - playerStatus->position.x = sushie->pos.x; - playerStatus->position.y = sushie->pos.y; - playerStatus->position.z = sushie->pos.z; + playerStatus->pos.x = sushie->pos.x; + playerStatus->pos.y = sushie->pos.y; + playerStatus->pos.z = sushie->pos.z; playerStatus->targetYaw = sushie->yaw; sushie->moveSpeed = 3.0f; partnerStatus->partnerActionState = PARTNER_ACTION_USE; @@ -609,18 +609,18 @@ API_CALLABLE(N(UseAbility)) { if (npc_test_move_taller_with_slipping(sushie->collisionChannel, &x, &y, &z, 10.0f, sushie->yaw, sushie->collisionHeight, sushie->collisionDiameter) ) { - collisionStatus->pushingAgainstWall = sushie->currentWall = NpcHitQueryColliderID; + collisionStatus->pushingAgainstWall = sushie->curWall = NpcHitQueryColliderID; } else { collisionStatus->pushingAgainstWall = NO_COLLIDER; } - if (sushie->currentWall < 0 || sushie->currentWall & COLLISION_WITH_ENTITY_BIT) { + if (sushie->curWall < 0 || sushie->curWall & COLLISION_WITH_ENTITY_BIT) { if (N(DiveState) == DIVE_STATE_DIVING && N(DiveTime) == 1) { sfx_play_sound_at_npc(SOUND_294, SOUND_SPACE_MODE_0, NPC_PARTNER); } break; } - collider = get_collider_flags(sushie->currentWall) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; + collider = get_collider_flags(sushie->curWall) & COLLIDER_FLAGS_SURFACE_TYPE_MASK; if (collider != SURFACE_TYPE_DOCK_WALL) { if (N(DiveState) == DIVE_STATE_DIVING && N(DiveTime) == 1) { sfx_play_sound_at_npc(SOUND_294, SOUND_SPACE_MODE_0, NPC_PARTNER); @@ -636,7 +636,7 @@ API_CALLABLE(N(UseAbility)) { // this var is a condition here collider = npc_raycast_down_around(sushie->collisionChannel, &x, &y, &z, &dist, sushie->yaw, 0.0f); if (collider) { - get_collider_center(sushie->currentWall, &x, &y, &z); + get_collider_center(sushie->curWall, &x, &y, &z); dist = dist2D(sushie->pos.x, sushie->pos.z, x, z); sin_cos_rad(DEG_TO_RAD(atan2(sushie->pos.x, sushie->pos.z, x, z)), &sinAngle, &cosAngle); x = sushie->pos.x + ((sinAngle * dist) * 0.6); @@ -646,14 +646,14 @@ API_CALLABLE(N(UseAbility)) { sushie->moveToPos.y = y; sushie->moveToPos.x = x; sushie->moveToPos.z = z; - playerStatus->targetYaw = atan2(playerStatus->position.x, playerStatus->position.z, x, z); + playerStatus->targetYaw = atan2(playerStatus->pos.x, playerStatus->pos.z, x, z); sushie->yaw = playerStatus->targetYaw; - dist = dist2D(playerStatus->position.x, playerStatus->position.z, sushie->moveToPos.x, sushie->moveToPos.z); - sushie->jumpVelocity = 5.0f; + dist = dist2D(playerStatus->pos.x, playerStatus->pos.z, sushie->moveToPos.x, sushie->moveToPos.z); + sushie->jumpVel = 5.0f; sushie->jumpScale = 0.6f; - sushie->duration = (2.0f * sushie->jumpVelocity) / 0.6f; + sushie->duration = (2.0f * sushie->jumpVel) / 0.6f; sushie->moveSpeed = dist / sushie->duration; - sushie->jumpVelocity += (sushie->moveToPos.y - playerStatus->position.y) / sushie->duration; + sushie->jumpVel += (sushie->moveToPos.y - playerStatus->pos.y) / sushie->duration; sfx_play_sound_at_npc(SOUND_JUMP_2081, SOUND_SPACE_MODE_0, NPC_PARTNER); suggest_player_anim_allow_backward(ANIM_Mario1_BeforeJump); enable_player_shadow(); @@ -667,26 +667,26 @@ API_CALLABLE(N(UseAbility)) { script->USE_STATE++; // fallthrough case SWIM_STATE_DISEMBARK_2: - if (sushie->jumpVelocity <= 0.0f) { + if (sushie->jumpVel <= 0.0f) { suggest_player_anim_allow_backward(ANIM_Mario1_Fall); script->USE_STATE++; } // fallthrough case SWIM_STATE_DISEMBARK_3: - if (sushie->jumpVelocity <= 0.0f) { - playerStatus->position.y = y = player_check_collision_below(sushie->jumpVelocity, &collider); + if (sushie->jumpVel <= 0.0f) { + playerStatus->pos.y = y = player_check_collision_below(sushie->jumpVel, &collider); if (collider > 0) { suggest_player_anim_allow_backward(ANIM_Mario1_Land); } } else { - playerStatus->position.y += sushie->jumpVelocity; + playerStatus->pos.y += sushie->jumpVel; } - sushie->jumpVelocity -= sushie->jumpScale; - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + sushie->jumpVel -= sushie->jumpScale; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; if (sushie->duration != 0) { - add_vec2D_polar(&playerStatus->position.x, &playerStatus->position.z, sushie->moveSpeed, sushie->yaw); + add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, sushie->moveSpeed, sushie->yaw); sushie->duration--; break; } @@ -696,19 +696,19 @@ API_CALLABLE(N(UseAbility)) { sushie->flags |= NPC_FLAG_IGNORE_WORLD_COLLISION; dist = dist2D(sushie->pos.x, sushie->pos.z, sushie->moveToPos.x, sushie->moveToPos.z) + (playerStatus->colliderDiameter * 0.5f); - sushie->jumpVelocity = 8.0f; + sushie->jumpVel = 8.0f; sushie->jumpScale = 1.0f; sushie->moveSpeed = 4.0f; y = sushie->moveToPos.y - sushie->pos.y; - sushie->duration = (2.0f * sushie->jumpVelocity) / sushie->jumpScale; + sushie->duration = (2.0f * sushie->jumpVel) / sushie->jumpScale; sushie->moveSpeed = dist / sushie->duration; - sushie->jumpVelocity += y / sushie->duration; + sushie->jumpVel += y / sushie->duration; script->USE_STATE = SWIM_STATE_EXIT_WATER; } break; case SWIM_STATE_EXIT_WATER: - sushie->pos.y += sushie->jumpVelocity; - sushie->jumpVelocity -= sushie->jumpScale; + sushie->pos.y += sushie->jumpVel; + sushie->jumpVel -= sushie->jumpScale; add_vec2D_polar(&sushie->pos.x, &sushie->pos.z, sushie->moveSpeed, sushie->yaw); if (sushie->duration == 0) { enable_player_static_collisions(); @@ -796,18 +796,18 @@ API_CALLABLE(N(Update)) { N(TweesterPhysicsPtr)->state++; N(TweesterPhysicsPtr)->prevFlags = sushie->flags; N(TweesterPhysicsPtr)->radius = fabsf(dist2D(sushie->pos.x, sushie->pos.z, - entity->position.x, entity->position.z)); - N(TweesterPhysicsPtr)->angle = atan2(entity->position.x, entity->position.z, sushie->pos.x, sushie->pos.z); - N(TweesterPhysicsPtr)->angularVelocity = 6.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 50.0f; + entity->pos.x, entity->pos.z)); + N(TweesterPhysicsPtr)->angle = atan2(entity->pos.x, entity->pos.z, sushie->pos.x, sushie->pos.z); + N(TweesterPhysicsPtr)->angularVel = 6.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase = 50.0f; N(TweesterPhysicsPtr)->countdown = 120; sushie->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8; sushie->flags &= ~NPC_FLAG_GRAVITY; case TWEESTER_PARTNER_ATTRACT: sin_cos_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->angle), &sinAngle, &cosAngle); - sushie->pos.x = entity->position.x + (sinAngle * N(TweesterPhysicsPtr)->radius); - sushie->pos.z = entity->position.z - (cosAngle * N(TweesterPhysicsPtr)->radius); - N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVelocity); + sushie->pos.x = entity->pos.x + (sinAngle * N(TweesterPhysicsPtr)->radius); + sushie->pos.z = entity->pos.z - (cosAngle * N(TweesterPhysicsPtr)->radius); + N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVel); if (N(TweesterPhysicsPtr)->radius > 20.0f) { N(TweesterPhysicsPtr)->radius--; @@ -815,19 +815,19 @@ API_CALLABLE(N(Update)) { N(TweesterPhysicsPtr)->radius++; } - liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelocityPhase)) * 3.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase += 3.0f; + liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelPhase)) * 3.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase += 3.0f; - if (N(TweesterPhysicsPtr)->liftoffVelocityPhase > 150.0f) { - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 150.0f; + if (N(TweesterPhysicsPtr)->liftoffVelPhase > 150.0f) { + N(TweesterPhysicsPtr)->liftoffVelPhase = 150.0f; } sushie->pos.y += liftoffVelocity; sushie->renderYaw = clamp_angle(360.0f - N(TweesterPhysicsPtr)->angle); - N(TweesterPhysicsPtr)->angularVelocity += 0.8; + N(TweesterPhysicsPtr)->angularVel += 0.8; - if (N(TweesterPhysicsPtr)->angularVelocity > 40.0f) { - N(TweesterPhysicsPtr)->angularVelocity = 40.0f; + if (N(TweesterPhysicsPtr)->angularVel > 40.0f) { + N(TweesterPhysicsPtr)->angularVel = 40.0f; } if (--N(TweesterPhysicsPtr)->countdown == 0) { @@ -915,7 +915,7 @@ API_CALLABLE(N(EnterMap)) { if (isInitialCall) { script->functionTemp[0] = 0; - N(WaterSurfaceY) = playerStatus->position.y; + N(WaterSurfaceY) = playerStatus->pos.y; } switch (script->functionTemp[0]) { @@ -923,14 +923,14 @@ API_CALLABLE(N(EnterMap)) { gGameStatusPtr->keepUsingPartnerOnMapChange = TRUE; disable_player_static_collisions(); disable_player_input(); - partnerNPC->pos.x = playerStatus->position.x; - partnerNPC->pos.z = playerStatus->position.z; - partnerNPC->pos.y = playerStatus->position.y; + partnerNPC->pos.x = playerStatus->pos.x; + partnerNPC->pos.z = playerStatus->pos.z; + partnerNPC->pos.y = playerStatus->pos.y; N(test_for_water_level)(partnerNPC->collisionChannel, partnerNPC->pos.x, partnerNPC->pos.y, partnerNPC->pos.z, partnerNPC->yaw, partnerNPC->collisionDiameter * 0.5f); partnerNPC->pos.y = N(WaterSurfaceY) - (partnerNPC->collisionHeight * 0.5f); partnerNPC->yaw = atan2(partnerNPC->pos.x, partnerNPC->pos.z, script->varTable[1], script->varTable[3]); - partnerNPC->currentAnim = ANIM_WorldSushie_Ride; + partnerNPC->curAnim = ANIM_WorldSushie_Ride; partnerNPC->jumpScale = 0.0f; partnerNPC->moveSpeed = 3.0f; partnerNPC->moveToPos.x = partnerNPC->pos.x; diff --git a/src/world/partner/watt.c b/src/world/partner/watt.c index 4ed8530d81..16a6cd3c0e 100644 --- a/src/world/partner/watt.c +++ b/src/world/partner/watt.c @@ -122,13 +122,13 @@ API_CALLABLE(N(Update)) { if (!N(WattIsMoving)) { N(WattIsMoving) = TRUE; N(reset_static_effect)(1); - watt->currentAnim = ANIM_WorldWatt_Run; + watt->curAnim = ANIM_WorldWatt_Run; } } else { if (N(WattIsMoving)) { N(WattIsMoving) = FALSE; N(reset_static_effect)(0); - watt->currentAnim = ANIM_WorldWatt_Idle; + watt->curAnim = ANIM_WorldWatt_Idle; } } if (N(StaticEffect) != NULL) { @@ -143,18 +143,18 @@ API_CALLABLE(N(Update)) { case TWEESTER_PARTNER_INIT: N(TweesterPhysicsPtr)->state++; N(TweesterPhysicsPtr)->prevFlags = watt->flags; - N(TweesterPhysicsPtr)->radius = fabsf(dist2D(watt->pos.x, watt->pos.z, entity->position.x, entity->position.z)); - N(TweesterPhysicsPtr)->angle = atan2(entity->position.x, entity->position.z, watt->pos.x, watt->pos.z); - N(TweesterPhysicsPtr)->angularVelocity = 6.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 50.0f; + N(TweesterPhysicsPtr)->radius = fabsf(dist2D(watt->pos.x, watt->pos.z, entity->pos.x, entity->pos.z)); + N(TweesterPhysicsPtr)->angle = atan2(entity->pos.x, entity->pos.z, watt->pos.x, watt->pos.z); + N(TweesterPhysicsPtr)->angularVel = 6.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase = 50.0f; N(TweesterPhysicsPtr)->countdown = 120; watt->flags |= NPC_FLAG_IGNORE_CAMERA_FOR_YAW | NPC_FLAG_IGNORE_PLAYER_COLLISION | NPC_FLAG_IGNORE_WORLD_COLLISION | NPC_FLAG_8; watt->flags &= ~NPC_FLAG_GRAVITY; case TWEESTER_PARTNER_ATTRACT: sin_cos_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->angle), &sinAngle, &cosAngle); - watt->pos.x = entity->position.x + (sinAngle * N(TweesterPhysicsPtr)->radius); - watt->pos.z = entity->position.z - (cosAngle * N(TweesterPhysicsPtr)->radius); - N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVelocity); + watt->pos.x = entity->pos.x + (sinAngle * N(TweesterPhysicsPtr)->radius); + watt->pos.z = entity->pos.z - (cosAngle * N(TweesterPhysicsPtr)->radius); + N(TweesterPhysicsPtr)->angle = clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVel); if (N(TweesterPhysicsPtr)->radius > 20.0f) { N(TweesterPhysicsPtr)->radius--; @@ -162,19 +162,19 @@ API_CALLABLE(N(Update)) { N(TweesterPhysicsPtr)->radius++; } - liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelocityPhase)) * 3.0f; - N(TweesterPhysicsPtr)->liftoffVelocityPhase += 3.0f; + liftoffVelocity = sin_rad(DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelPhase)) * 3.0f; + N(TweesterPhysicsPtr)->liftoffVelPhase += 3.0f; - if (N(TweesterPhysicsPtr)->liftoffVelocityPhase > 150.0f) { - N(TweesterPhysicsPtr)->liftoffVelocityPhase = 150.0f; + if (N(TweesterPhysicsPtr)->liftoffVelPhase > 150.0f) { + N(TweesterPhysicsPtr)->liftoffVelPhase = 150.0f; } watt->pos.y += liftoffVelocity; watt->renderYaw = clamp_angle(360.0f - N(TweesterPhysicsPtr)->angle); - N(TweesterPhysicsPtr)->angularVelocity += 0.8; + N(TweesterPhysicsPtr)->angularVel += 0.8; - if (N(TweesterPhysicsPtr)->angularVelocity > 40.0f) { - N(TweesterPhysicsPtr)->angularVelocity = 40.0f; + if (N(TweesterPhysicsPtr)->angularVel > 40.0f) { + N(TweesterPhysicsPtr)->angularVel = 40.0f; } if (--N(TweesterPhysicsPtr)->countdown == 0) { @@ -253,7 +253,7 @@ API_CALLABLE(N(UseAbility)) { partnerStatus->shouldResumeAbility = FALSE; playerStatus->animFlags |= (PA_FLAG_USING_WATT | PA_FLAG_WATT_IN_HANDS); N(update_player_carry_anim)(); - npc->currentAnim = ANIM_WorldWatt_Idle; + npc->curAnim = ANIM_WorldWatt_Idle; N(AbilityState) = SHINING_STATE_HOLDING; script->functionTemp[1] = 2; } @@ -294,13 +294,13 @@ API_CALLABLE(N(UseAbility)) { gGameStatusPtr->keepUsingPartnerOnMapChange = FALSE; partnerStatus->partnerActionState = PARTNER_ACTION_USE; partnerStatus->actingPartner = PARTNER_WATT; - npc->moveToPos.x = playerStatus->position.x; - npc->moveToPos.y = playerStatus->position.y + 5.0f; - npc->moveToPos.z = playerStatus->position.z; - npc->currentAnim = ANIM_WorldWatt_Walk; + npc->moveToPos.x = playerStatus->pos.x; + npc->moveToPos.y = playerStatus->pos.y + 5.0f; + npc->moveToPos.z = playerStatus->pos.z; + npc->curAnim = ANIM_WorldWatt_Walk; add_vec2D_polar(&npc->moveToPos.x, &npc->moveToPos.z, 15.0f, playerStatus->targetYaw); npc->yaw = playerStatus->targetYaw; - npc->currentAnim = ANIM_WorldWatt_Idle; + npc->curAnim = ANIM_WorldWatt_Idle; playerStatus->animFlags |= PA_FLAG_WATT_IN_HANDS; N(update_player_carry_anim)(); npc_set_palswap_mode_A(npc, 1); @@ -314,13 +314,13 @@ API_CALLABLE(N(UseAbility)) { partnerStatus->partnerActionState = PARTNER_ACTION_USE; partnerStatus->actingPartner = PARTNER_WATT; partner_force_player_flip_done(); - npc->moveToPos.x = playerStatus->position.x; - npc->moveToPos.y = playerStatus->position.y + 5.0f; - npc->moveToPos.z = playerStatus->position.z; - npc->currentAnim = ANIM_WorldWatt_Walk; + npc->moveToPos.x = playerStatus->pos.x; + npc->moveToPos.y = playerStatus->pos.y + 5.0f; + npc->moveToPos.z = playerStatus->pos.z; + npc->curAnim = ANIM_WorldWatt_Walk; add_vec2D_polar(&npc->moveToPos.x, &npc->moveToPos.z, 15.0f, playerStatus->targetYaw); npc->duration = 8; - npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->position.x, playerStatus->position.z); + npc->yaw = atan2(npc->pos.x, npc->pos.z, playerStatus->pos.x, playerStatus->pos.z); N(AbilityState)++; // SHINING_STATE_GATHER } break; @@ -331,7 +331,7 @@ API_CALLABLE(N(UseAbility)) { npc->duration--; if (npc->duration == 0) { npc->yaw = playerStatus->targetYaw; - npc->currentAnim = ANIM_WorldWatt_Idle; + npc->curAnim = ANIM_WorldWatt_Idle; partnerStatus->actingPartner = PARTNER_WATT; playerStatus->animFlags |= PA_FLAG_WATT_IN_HANDS; N(update_player_carry_anim)(); @@ -369,7 +369,7 @@ API_CALLABLE(N(UseAbility)) { if (N(AbilityState) == SHINING_STATE_RELEASE) { playerStatus->animFlags &= ~(PA_FLAG_WATT_IN_HANDS | PA_FLAG_USING_WATT); - npc->currentAnim = ANIM_WorldWatt_Idle; + npc->curAnim = ANIM_WorldWatt_Idle; partner_clear_player_tracking(npc); N(IsPlayerHolding) = FALSE; partnerStatus->actingPartner = PARTNER_NONE; @@ -466,7 +466,7 @@ API_CALLABLE(N(EnterMap)) { } script->functionTemp[1] = script->varTable[4]; - playerStatus->targetYaw = atan2(playerStatus->position.x, playerStatus->position.z, + playerStatus->targetYaw = atan2(playerStatus->pos.x, playerStatus->pos.z, script->varTable[1], script->varTable[3]); playerStatus->heading = playerStatus->targetYaw; move_player(script->functionTemp[1], playerStatus->heading, script->varTableF[5]); @@ -497,7 +497,7 @@ API_CALLABLE(N(EnterMap)) { void N(update_player_carry_anim)(void) { PlayerStatus* playerStatus = &gPlayerStatus; - f32 currentSpeed = playerStatus->currentSpeed; + f32 currentSpeed = playerStatus->curSpeed; AnimID anim; if (playerStatus->runSpeed <= currentSpeed) { @@ -539,19 +539,19 @@ void N(sync_held_position)(void) { } } - angle = DEG_TO_RAD(camera->currentYaw + 270.0f - gPlayerStatusPtr->spriteFacingAngle + angleOffset); + angle = DEG_TO_RAD(camera->curYaw + 270.0f - gPlayerStatusPtr->spriteFacingAngle + angleOffset); playerStatus = gPlayerStatusPtr; partnerNPC = wPartnerNpc; - partnerNPC->pos.x = playerStatus->position.x + (sin_rad(angle) * gPlayerStatusPtr->colliderDiameter * offsetScale); + partnerNPC->pos.x = playerStatus->pos.x + (sin_rad(angle) * gPlayerStatusPtr->colliderDiameter * offsetScale); new_var2 = wPartnerNpc; playerStatus = gPlayerStatusPtr; partnerNPC = new_var2; - partnerNPC->pos.z = playerStatus->position.z - (cos_rad(angle) * gPlayerStatusPtr->colliderDiameter * offsetScale); + partnerNPC->pos.z = playerStatus->pos.z - (cos_rad(angle) * gPlayerStatusPtr->colliderDiameter * offsetScale); wPartnerNpc->yaw = gPlayerStatusPtr->targetYaw; - wPartnerNpc->pos.y = gPlayerStatusPtr->position.y + 5.0f; + wPartnerNpc->pos.y = gPlayerStatusPtr->pos.y + 5.0f; } } diff --git a/src/world/partners.c b/src/world/partners.c index 7464f5531a..756b76ad9d 100644 --- a/src/world/partners.c +++ b/src/world/partners.c @@ -630,13 +630,13 @@ void _use_partner_ability(void) { if (partnerStatus->inputDisabledCount == 0) { partnerStatus->stickX = gGameStatusPtr->stickX[gGameStatusPtr->multiplayerEnabled]; partnerStatus->stickY = gGameStatusPtr->stickY[gGameStatusPtr->multiplayerEnabled]; - partnerStatus->currentButtons = gGameStatusPtr->currentButtons[gGameStatusPtr->multiplayerEnabled]; + partnerStatus->curButtons = gGameStatusPtr->curButtons[gGameStatusPtr->multiplayerEnabled]; partnerStatus->pressedButtons = gGameStatusPtr->pressedButtons[gGameStatusPtr->multiplayerEnabled]; partnerStatus->heldButtons = gGameStatusPtr->heldButtons[gGameStatusPtr->multiplayerEnabled]; } else { partnerStatus->stickX = 0; partnerStatus->stickY = 0; - partnerStatus->currentButtons = 0; + partnerStatus->curButtons = 0; partnerStatus->pressedButtons = 0; partnerStatus->heldButtons = 0; } @@ -682,7 +682,7 @@ void _use_partner_ability(void) { } set_time_freeze_mode(TIME_FREEZE_NORMAL); partner_free_npc(); - playerData->currentPartner = wCurrentPartnerId = NextPartnerID; + playerData->curPartner = wCurrentPartnerId = NextPartnerID; create_partner_npc(); sfx_play_sound(SOUND_E); wPartner->init(wPartnerNpc); @@ -718,12 +718,12 @@ void _use_partner_ability(void) { PartnerCommandState += 1; case 1: partner_free_npc(); - playerData->currentPartner = wCurrentPartnerId = NextPartnerID; + playerData->curPartner = wCurrentPartnerId = NextPartnerID; create_partner_npc(); wPartnerNpc->pos.x = wSavedPartnerPosX; wPartnerNpc->pos.y = wSavedPartnerPosY; wPartnerNpc->pos.z = wSavedPartnerPosZ; - wPartnerNpc->jumpVelocity = 0.0f; + wPartnerNpc->jumpVel = 0.0f; wPartnerNpc->scale.x = 1.0f; wPartnerNpc->scale.y = 1.0f; wPartnerNpc->scale.z = 1.0f; @@ -760,7 +760,7 @@ void _use_partner_ability(void) { } partner_free_npc(); PartnerCommand = PARTNER_CMD_INIT; - playerData->currentPartner = wCurrentPartnerId = NextPartnerID; + playerData->curPartner = wCurrentPartnerId = NextPartnerID; enable_player_input(); break; } @@ -770,7 +770,7 @@ void _use_partner_ability(void) { kill_script_by_ID(wPartnerCurrentScriptID); partner_free_npc(); PartnerCommand = PARTNER_CMD_INIT; - playerData->currentPartner = wCurrentPartnerId = NextPartnerID; + playerData->curPartner = wCurrentPartnerId = NextPartnerID; break; } break; @@ -778,7 +778,7 @@ void _use_partner_ability(void) { switch (PartnerCommandState) { case 0: // create the new partner disable_player_input(); - playerData->currentPartner = wCurrentPartnerId = NextPartnerID; + playerData->curPartner = wCurrentPartnerId = NextPartnerID; create_partner_npc(); wPartner->init(wPartnerNpc); PartnerCommandState += 1; @@ -808,12 +808,12 @@ void _use_partner_ability(void) { switch (PartnerCommandState) { case 0: disable_player_input(); - playerData->currentPartner = wCurrentPartnerId = NextPartnerID; + playerData->curPartner = wCurrentPartnerId = NextPartnerID; create_partner_npc(); wPartnerNpc->pos.x = wSavedPartnerPosX; wPartnerNpc->pos.y = wSavedPartnerPosY; wPartnerNpc->pos.z = wSavedPartnerPosZ; - wPartnerNpc->jumpVelocity = 0.0f; + wPartnerNpc->jumpVel = 0.0f; wPartnerNpc->scale.x = 1.0f; wPartnerNpc->scale.y = 1.0f; wPartnerNpc->scale.z = 1.0f; @@ -826,7 +826,7 @@ void _use_partner_ability(void) { wPartnerCurrentScriptID = wPartnerCurrentScript->id; wPartnerCurrentScript->groupFlags = EVT_GROUP_08 | EVT_GROUP_02; PartnerCommand = PARTNER_CMD_INIT; - wPartnerNpc->currentAnim = gPartnerAnimations[wCurrentPartnerId].fly; + wPartnerNpc->curAnim = gPartnerAnimations[wCurrentPartnerId].fly; enable_player_input(); break; } @@ -866,9 +866,9 @@ void _use_partner_ability(void) { break; case 2: if (partnerStatus->partnerActionState != 1) { - wSavedPartnerPosX = playerStatus->position.x; - wSavedPartnerPosY = playerStatus->position.y; - wSavedPartnerPosZ = playerStatus->position.z; + wSavedPartnerPosX = playerStatus->pos.x; + wSavedPartnerPosY = playerStatus->pos.y; + wSavedPartnerPosZ = playerStatus->pos.z; wPartnerCurrentScript = start_script(wPartner->update, EVT_PRIORITY_14, EVT_FLAG_RUN_IMMEDIATELY); wPartnerCurrentScript->owner2.npc = wPartnerNpc; wPartnerCurrentScriptID = wPartnerCurrentScript->id; @@ -910,9 +910,9 @@ void switch_to_partner(s32 partnerID) { NextPartnerCommand = PARTNER_CMD_PUT_AWAY; } else { NextPartnerCommand = PARTNER_CMD_TAKE_OUT; - wSavedPartnerPosX = playerStatus->position.x; - wSavedPartnerPosY = playerStatus->position.y; - wSavedPartnerPosZ = playerStatus->position.z; + wSavedPartnerPosX = playerStatus->pos.x; + wSavedPartnerPosY = playerStatus->pos.y; + wSavedPartnerPosZ = playerStatus->pos.z; } } } @@ -933,9 +933,9 @@ void partner_init_after_battle(s32 partnerID) { NextPartnerCommand = PARTNER_CMD_PUT_AWAY; } else { NextPartnerCommand = PARTNER_CMD_TAKE_OUT; - wSavedPartnerPosX = playerStatus->position.x; - wSavedPartnerPosY = playerStatus->position.y; - wSavedPartnerPosZ = playerStatus->position.z; + wSavedPartnerPosX = playerStatus->pos.x; + wSavedPartnerPosY = playerStatus->pos.y; + wSavedPartnerPosZ = playerStatus->pos.z; } } } @@ -962,7 +962,7 @@ s32 partner_use_ability(void) { && wPartner != NULL && (wPartner->canUseAbility == NULL || wPartner->canUseAbility(wPartnerNpc))) { - if (gGameStatusPtr->multiplayerEnabled && (partnerStatus->currentButtons & BUTTON_B)) { + if (gGameStatusPtr->multiplayerEnabled && (partnerStatus->curButtons & BUTTON_B)) { sfx_play_sound(SOUND_MENU_ERROR); } else if (wCurrentPartnerId != PARTNER_NONE) { D_8010CFE0 = 1; @@ -993,7 +993,7 @@ s32 partner_can_use_ability(void) { void partner_reset_data(void) { PlayerStatus* playerStatus = &gPlayerStatus; - s32 currentPartner = gPlayerData.currentPartner; + s32 currentPartner = gPlayerData.curPartner; mem_clear(&gPartnerStatus, sizeof(gPartnerStatus)); get_worker(create_worker_frontUI(_use_partner_ability, NULL)); @@ -1008,9 +1008,9 @@ void partner_reset_data(void) { } wPartner = NULL; - wSavedPartnerPosX = playerStatus->position.x; - wSavedPartnerPosY = playerStatus->position.y; - wSavedPartnerPosZ = playerStatus->position.z; + wSavedPartnerPosX = playerStatus->pos.x; + wSavedPartnerPosY = playerStatus->pos.y; + wSavedPartnerPosZ = playerStatus->pos.z; if (wCurrentPartnerId == PARTNER_NONE) { NextPartnerCommand = PARTNER_CMD_INIT; @@ -1088,7 +1088,7 @@ void partner_handle_after_battle(void) { NextPartnerCommand = PARTNER_CMD_INIT; - if (playerData->currentPartner != PARTNER_WATT && partnerStatus->actingPartner == PARTNER_WATT) { + if (playerData->curPartner != PARTNER_WATT && partnerStatus->actingPartner == PARTNER_WATT) { gPlayerStatusPtr->animFlags &= ~PA_FLAG_USING_WATT; gPlayerStatusPtr->animFlags &= ~PA_FLAG_WATT_IN_HANDS; partnerStatus->actingPartner = PARTNER_NONE; @@ -1134,9 +1134,9 @@ void partner_walking_enable(Npc* partner, s32 val) { partner->pos.z = wSavedPartnerPosZ; for (i = 0; i < ARRAY_COUNT(gPlayerMoveHistory); i++, it++) { - it->pos.x = playerStatus->position.x; - it->pos.y = playerStatus->position.y; - it->pos.z = playerStatus->position.z; + it->pos.x = playerStatus->pos.x; + it->pos.y = playerStatus->pos.y; + it->pos.z = playerStatus->pos.z; it->isJumping = FALSE; } @@ -1158,10 +1158,10 @@ void partner_walking_enable(Npc* partner, s32 val) { D_8010CFCC = 0; wPartnerMoveTime = 16; wPartnerTetherDistance = 40.0f; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; func_800EA5B8(partner); partner->collisionChannel = COLLISION_CHANNEL_10000; - partner->jumpVelocity = 0.0f; + partner->jumpVel = 0.0f; partner->flags |= NPC_FLAG_TOUCHES_GROUND | NPC_FLAG_GRAVITY | NPC_FLAG_IGNORE_PLAYER_COLLISION; partner->jumpScale = 1.8f; } @@ -1178,16 +1178,16 @@ void partner_walking_update_player_tracking(Npc* partner) { } currentSnapshot = &gPlayerMoveHistory[gPlayerMoveHistoryIndex]; if ((!currentSnapshot->isJumping || !isPlayerJumping) && - ((currentSnapshot->pos.x != playerStatus->position.x) || (currentSnapshot->pos.y != playerStatus->position.y) - || (currentSnapshot->pos.z != playerStatus->position.z))) { + ((currentSnapshot->pos.x != playerStatus->pos.x) || (currentSnapshot->pos.y != playerStatus->pos.y) + || (currentSnapshot->pos.z != playerStatus->pos.z))) { if (D_8010CFBC != gPlayerMoveHistoryIndex + 1) { if (++gPlayerMoveHistoryIndex >= ARRAY_COUNT(gPlayerMoveHistory)) { gPlayerMoveHistoryIndex = 0; } currentSnapshot = &gPlayerMoveHistory[gPlayerMoveHistoryIndex]; - currentSnapshot->pos.x = playerStatus->position.x; - currentSnapshot->pos.y = playerStatus->position.y; - currentSnapshot->pos.z = playerStatus->position.z; + currentSnapshot->pos.x = playerStatus->pos.x; + currentSnapshot->pos.y = playerStatus->pos.y; + currentSnapshot->pos.z = playerStatus->pos.z; currentSnapshot->isJumping = isPlayerJumping; } } @@ -1207,11 +1207,11 @@ void partner_walking_update_motion(Npc* partner) { } } - if (wPartnerFollowState != 50 && fabsf(partner->pos.y - playerStatus->position.y) > 1000.0f) { - partner->pos.x = playerStatus->position.x; - partner->pos.y = playerStatus->position.y; - partner->pos.z = playerStatus->position.z; - partner->jumpVelocity = 0.0f; + if (wPartnerFollowState != 50 && fabsf(partner->pos.y - playerStatus->pos.y) > 1000.0f) { + partner->pos.x = playerStatus->pos.x; + partner->pos.y = playerStatus->pos.y; + partner->pos.z = playerStatus->pos.z; + partner->jumpVel = 0.0f; partner->jumpScale = 0.0f; partner->flags = partner->flags & ~PA_FLAG_OPENED_HIDDEN_PANEL; } @@ -1245,22 +1245,22 @@ void partner_walking_follow_player(Npc* partner) { z = partner->pos.z; partner->moveSpeed = 3.0f; - distance = dist2D(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); + distance = dist2D(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); if (distance >= 50.0) { partner->moveSpeed = !(playerStatus->animFlags & PA_FLAG_SPINNING) ? 5.0f : 7.0f; } if (wPartnerTetherDistance < 20.0) { partner->moveSpeed = 4.0f; } - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].run; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].run; if (!(partner->flags & NPC_FLAG_GROUNDED)) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fall; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].fall; } while (TRUE) { distance = dist2D(x, z, moveHistoryX, moveHistoryZ); yaw = atan2(x, z, moveHistoryX, moveHistoryZ); if (partner->moveSpeed < distance) { - distance = dist2D(x, z, playerStatus->position.x, playerStatus->position.z); + distance = dist2D(x, z, playerStatus->pos.x, playerStatus->pos.z); if (distance >= 50.0) { break; } @@ -1277,7 +1277,7 @@ void partner_walking_follow_player(Npc* partner) { break; } else { partner->moveSpeed = 0.0f; - partner->yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); + partner->yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); } } if (D_8010CFBC == gPlayerMoveHistoryIndex) { @@ -1285,7 +1285,7 @@ void partner_walking_follow_player(Npc* partner) { partner->moveSpeed = 0.0f; partner->jumpScale = 0.0f; wPartnerFollowState = 5; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; break; } else { D_8010CFBC++; @@ -1314,11 +1314,11 @@ void partner_walking_follow_player(Npc* partner) { partner->yaw = yaw; npc_move_heading(partner, partner->moveSpeed, partner->yaw); spawn_surface_effects(partner, (partner->moveSpeed < 4.0) ? SURFACE_INTERACT_WALK : SURFACE_INTERACT_RUN); - surfaceType = get_collider_flags(partner->currentFloor); + surfaceType = get_collider_flags(partner->curFloor); if (surfaceType == SURFACE_TYPE_SPIKES || surfaceType == SURFACE_TYPE_LAVA || (partner->flags & (NPC_FLAG_GROUNDED | NPC_FLAG_COLLDING_FORWARD_WITH_WORLD)) == (NPC_FLAG_GROUNDED | NPC_FLAG_COLLDING_FORWARD_WITH_WORLD)) { - if (!func_800EA4B0(partner->currentWall)) { + if (!func_800EA4B0(partner->curWall)) { D_8010CFBC++; if (D_8010CFBC >= 40) { D_8010CFBC = 0; @@ -1337,13 +1337,13 @@ void partner_walking_follow_player(Npc* partner) { } break; case 1: - surfaceType = get_collider_flags(partner->currentFloor); + surfaceType = get_collider_flags(partner->curFloor); if (D_8010CFBC == gPlayerMoveHistoryIndex) { if (surfaceType == SURFACE_TYPE_SPIKES || surfaceType == SURFACE_TYPE_LAVA) { moveHistoryX = partner->pos.x; - moveHistoryY = playerStatus->position.y; + moveHistoryY = playerStatus->pos.y; moveHistoryZ = partner->pos.z; - add_vec2D_polar(&moveHistoryX, &moveHistoryZ, 6.0f, atan2(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z)); + add_vec2D_polar(&moveHistoryX, &moveHistoryZ, 6.0f, atan2(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z)); } else { break; } @@ -1371,8 +1371,8 @@ void partner_walking_follow_player(Npc* partner) { distance = partner->planarFlyDist; y = partner->moveToPos.y - partner->pos.y; if (distance < wPartnerTetherDistance && !(surfaceType == SURFACE_TYPE_SPIKES || surfaceType == SURFACE_TYPE_LAVA)) { - partner->jumpVelocity = 0.0f; - partner->yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); + partner->jumpVel = 0.0f; + partner->yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); wPartnerFollowState = 0; return; } @@ -1381,17 +1381,17 @@ void partner_walking_follow_player(Npc* partner) { partner->duration = 10; } partner->moveSpeed = partner->planarFlyDist / partner->duration; - partner->jumpVelocity = (y + partner->jumpScale * partner->duration * partner->duration * 0.5f) / partner->duration; - if (partner->jumpVelocity > 20.0) { - partner->jumpVelocity = 20.0f; + partner->jumpVel = (y + partner->jumpScale * partner->duration * partner->duration * 0.5f) / partner->duration; + if (partner->jumpVel > 20.0) { + partner->jumpVel = 20.0f; } - if (partner->jumpVelocity < 0.0) { - partner->jumpVelocity = 0.0f; + if (partner->jumpVel < 0.0) { + partner->jumpVel = 0.0f; } if (!(surfaceType == SURFACE_TYPE_SPIKES || surfaceType == SURFACE_TYPE_LAVA)) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].jump; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].jump; } else { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].hurt; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].hurt; } partner->moveToPos.x = partner->pos.x; @@ -1401,42 +1401,42 @@ void partner_walking_follow_player(Npc* partner) { wPartnerFollowState = 2; // fallthrough case 2: - partner->jumpVelocity -= partner->jumpScale; - partner->pos.y += partner->jumpVelocity; - if (partner->jumpVelocity <= 0.0f) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fall; + partner->jumpVel -= partner->jumpScale; + partner->pos.y += partner->jumpVel; + if (partner->jumpVel <= 0.0f) { + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].fall; } if (partner->pos.y < -2000.0f) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fly; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].fly; partner->flags &= ~NPC_FLAG_JUMPING; - partner->jumpVelocity = 0.0f; - partner->yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); - partner->pos.x = playerStatus->position.x; - partner->pos.y = playerStatus->position.y; - partner->pos.z = playerStatus->position.z; + partner->jumpVel = 0.0f; + partner->yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); + partner->pos.x = playerStatus->pos.x; + partner->pos.y = playerStatus->pos.y; + partner->pos.z = playerStatus->pos.z; wPartnerFollowState = 5; return; } - if (partner->jumpVelocity <= 0.0f) { - distance = fabsf(partner->jumpVelocity) + 11.0f; + if (partner->jumpVel <= 0.0f) { + distance = fabsf(partner->jumpVel) + 11.0f; x = partner->pos.x; y = partner->pos.y + distance; z = partner->pos.z; if (npc_raycast_down_around(partner->collisionChannel, &x, &y, &z, &distance, partner->yaw, partner->collisionDiameter) != 0) { - if (distance <= fabsf(partner->jumpVelocity) + 22.0f) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fly; + if (distance <= fabsf(partner->jumpVel) + 22.0f) { + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].fly; partner->flags &= ~NPC_FLAG_JUMPING; - partner->jumpVelocity = 0.0f; + partner->jumpVel = 0.0f; partner->pos.y = y; - partner->yaw = atan2(x, z, playerStatus->position.x, playerStatus->position.z); + partner->yaw = atan2(x, z, playerStatus->pos.x, playerStatus->pos.z); spawn_surface_effects(partner, SURFACE_INTERACT_LAND); wPartnerFollowState = 0; distance = dist2D(partner->pos.x, partner->pos.z, partner->moveToPos.x, partner->moveToPos.z); if (distance < 5.0) { - partner->pos.x = playerStatus->position.x; - partner->pos.y = playerStatus->position.y; - partner->pos.z = playerStatus->position.z; - add_vec2D_polar(&partner->pos.x, &partner->pos.z, 5.0f, clamp_angle((cameras[CAM_DEFAULT].currentYaw + 90.0f) - playerStatus->spriteFacingAngle)); + partner->pos.x = playerStatus->pos.x; + partner->pos.y = playerStatus->pos.y; + partner->pos.z = playerStatus->pos.z; + add_vec2D_polar(&partner->pos.x, &partner->pos.z, 5.0f, clamp_angle((cameras[CAM_DEFAULT].curYaw + 90.0f) - playerStatus->spriteFacingAngle)); wPartnerFollowState = 5; } break; @@ -1452,32 +1452,32 @@ void partner_walking_follow_player(Npc* partner) { x = partner->pos.x; y = partner->pos.y; z = partner->pos.z; - distance = dist2D(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); + distance = dist2D(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); if (distance <= wPartnerTetherDistance) { if (D_8010CFCA == 0) { partner->moveSpeed = 0.0f; partner->jumpScale = 0.0f; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; if (playerStatus->actionState == ACTION_STATE_TALK) { D_8010CFCA = 0; } - surfaceType = get_collider_flags(partner->currentFloor); + surfaceType = get_collider_flags(partner->curFloor); if (surfaceType == SURFACE_TYPE_SPIKES || surfaceType == SURFACE_TYPE_LAVA) { wPartnerFollowState = 0; return; } } else { - temp_a3 = clamp_angle(cameras[CAM_DEFAULT].currentYaw + (playerStatus->spriteFacingAngle < 180.0f ? 90.0f : -90.0f)); - partner->moveToPos.x = playerStatus->position.x; - partner->moveToPos.y = playerStatus->position.y; - partner->moveToPos.z = playerStatus->position.z; + temp_a3 = clamp_angle(cameras[CAM_DEFAULT].curYaw + (playerStatus->spriteFacingAngle < 180.0f ? 90.0f : -90.0f)); + partner->moveToPos.x = playerStatus->pos.x; + partner->moveToPos.y = playerStatus->pos.y; + partner->moveToPos.z = playerStatus->pos.z; add_vec2D_polar(&partner->moveToPos.x, &partner->moveToPos.z, wPartnerTetherDistance - 10.0f, temp_a3); yaw = atan2(partner->pos.x, partner->pos.z, partner->moveToPos.x, partner->moveToPos.z); distance = dist2D(partner->pos.x, partner->pos.z, partner->moveToPos.x, partner->moveToPos.z); partner->moveSpeed = 2.0f; if (distance > 2.0f) { partner->yaw = yaw; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].run; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].run; if (!(partner->flags & NPC_FLAG_COLLDING_FORWARD_WITH_WORLD)) { D_800F803A = 0; } else { @@ -1487,18 +1487,18 @@ void partner_walking_follow_player(Npc* partner) { partner->moveSpeed = 0.0f; partner->jumpScale = 0.0f; partner->renderYaw = yaw; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; if (D_8010CFCA == 2 || playerStatus->actionState == ACTION_STATE_TALK) { D_8010CFCA = 0; } } } } else { - yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); + yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); partner->yaw = yaw; partner->moveSpeed = 0.0f; partner->jumpScale = 0.0f; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; if (D_8010CFCA == 2 || playerStatus->actionState == ACTION_STATE_TALK) { D_8010CFCA = 0; } @@ -1517,7 +1517,7 @@ void partner_walking_follow_player(Npc* partner) { npc_move_heading(partner, partner->moveSpeed, partner->yaw); partner->moveSpeed = 0.0f; partner->jumpScale = 0.0f; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; if (D_8010CFCA == 2) { D_8010CFCA = 0; } else if (playerStatus->actionState == ACTION_STATE_TALK) { @@ -1530,7 +1530,7 @@ void partner_walking_follow_player(Npc* partner) { break; } } - distance = dist2D(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); + distance = dist2D(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); if (distance <= wPartnerTetherDistance) { if (!func_800EA4B0(NpcHitQueryColliderID)) { D_8010CFCA = 2; @@ -1541,7 +1541,7 @@ void partner_walking_follow_player(Npc* partner) { break; } yaw = atan2(partner->pos.x, partner->pos.z, moveHistoryX, moveHistoryZ); - if (fabsf(get_clamped_angle_diff(yaw, atan2(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z))) < 90.0f) { + if (fabsf(get_clamped_angle_diff(yaw, atan2(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z))) < 90.0f) { break; } if (D_8010CFBC == gPlayerMoveHistoryIndex) { @@ -1564,7 +1564,7 @@ void partner_walking_follow_player(Npc* partner) { break; } yaw = atan2(partner->pos.x, partner->pos.z, moveHistoryX, moveHistoryZ); - if (fabsf(get_clamped_angle_diff(yaw, atan2(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z))) < 90.0f) { + if (fabsf(get_clamped_angle_diff(yaw, atan2(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z))) < 90.0f) { break; } if (D_8010CFBC == gPlayerMoveHistoryIndex) { @@ -1586,14 +1586,14 @@ void partner_walking_follow_player(Npc* partner) { switch (D_8010CFCE) { case 0: angle = clamp_angle(func_800E5348() + 180.0f); - partner->moveToPos.x = playerStatus->position.x; - partner->moveToPos.y = playerStatus->position.y; - partner->moveToPos.z = playerStatus->position.z; + partner->moveToPos.x = playerStatus->pos.x; + partner->moveToPos.y = playerStatus->pos.y; + partner->moveToPos.z = playerStatus->pos.z; add_vec2D_polar(&partner->moveToPos.x, &partner->moveToPos.z, playerStatus->colliderDiameter, angle); distance = dist2D(partner->pos.x, partner->pos.z, partner->moveToPos.x, partner->moveToPos.z); wPartnerMoveSpeed = distance / wPartnerMoveTime; partner->moveSpeed = wPartnerMoveSpeed; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].anims[wPartnerMoveSpeed >= 4.0 ? PARTNER_ANIM_INDEX_RUN : PARTNER_ANIM_INDEX_WALK]; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].anims[wPartnerMoveSpeed >= 4.0 ? PARTNER_ANIM_INDEX_RUN : PARTNER_ANIM_INDEX_WALK]; yaw = atan2(partner->pos.x, partner->pos.z, partner->moveToPos.x, partner->moveToPos.z); partner->yaw = D_800F8034 = yaw; D_8010CFCE++; @@ -1602,20 +1602,20 @@ void partner_walking_follow_player(Npc* partner) { if (wPartnerMoveTime != 0) { wPartnerMoveTime--; if (partner->jumpScale != 0.0f) { - partner->jumpVelocity -= partner->jumpScale; - partner->pos.y += partner->jumpVelocity; - if (partner->jumpVelocity <= 0.0f) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fall; + partner->jumpVel -= partner->jumpScale; + partner->pos.y += partner->jumpVel; + if (partner->jumpVel <= 0.0f) { + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].fall; } - if (partner->jumpVelocity <= 0.0f) { - distance = fabsf(partner->jumpVelocity) + 11.0f; + if (partner->jumpVel <= 0.0f) { + distance = fabsf(partner->jumpVel) + 11.0f; x = partner->pos.x; y = partner->pos.y + distance; z = partner->pos.z; - if ((npc_raycast_down_around(partner->collisionChannel, &x, &y, &z, &distance, partner->yaw, partner->collisionDiameter) != 0) && (distance <= (fabsf(partner->jumpVelocity) + 22.0f))) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].anims[partner->moveSpeed >= 4.0 ? PARTNER_ANIM_INDEX_RUN : PARTNER_ANIM_INDEX_WALK]; + if ((npc_raycast_down_around(partner->collisionChannel, &x, &y, &z, &distance, partner->yaw, partner->collisionDiameter) != 0) && (distance <= (fabsf(partner->jumpVel) + 22.0f))) { + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].anims[partner->moveSpeed >= 4.0 ? PARTNER_ANIM_INDEX_RUN : PARTNER_ANIM_INDEX_WALK]; partner->jumpScale = 0.0f; - partner->jumpVelocity = 0.0f; + partner->jumpVel = 0.0f; partner->pos.y = y; partner->flags &= ~NPC_FLAG_JUMPING; } @@ -1629,8 +1629,8 @@ void partner_walking_follow_player(Npc* partner) { partner_clear_player_tracking(partner); partner->moveSpeed = 0.0f; partner->jumpScale = 0.0f; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; - partner->yaw = clamp_angle((cameras[CAM_DEFAULT].currentYaw + 270.0f) - playerStatus->spriteFacingAngle); + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->yaw = clamp_angle((cameras[CAM_DEFAULT].curYaw + 270.0f) - playerStatus->spriteFacingAngle); wPartnerMoveTime = 30; D_8010CFCE++; } @@ -1650,41 +1650,41 @@ void partner_walking_follow_player(Npc* partner) { break; case 40: if (partner->flags & NPC_FLAG_GROUNDED) { - if (func_800EA4B0(partner->currentFloor)) { + if (func_800EA4B0(partner->curFloor)) { wPartnerFollowState = 50; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; } else { wPartnerFollowState = 1; } break; } partner->jumpScale = 3.0f; - partner->jumpVelocity -= partner->jumpScale; - partner->pos.y += partner->jumpVelocity; - if (partner->jumpVelocity <= 0.0f) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fall; + partner->jumpVel -= partner->jumpScale; + partner->pos.y += partner->jumpVel; + if (partner->jumpVel <= 0.0f) { + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].fall; } if (partner->pos.y < -2000.0f) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; partner->flags &= ~NPC_FLAG_JUMPING; - partner->jumpVelocity = 0.0f; - partner->yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); - partner->pos.x = playerStatus->position.x; - partner->pos.y = playerStatus->position.y; - partner->pos.z = playerStatus->position.z; + partner->jumpVel = 0.0f; + partner->yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); + partner->pos.x = playerStatus->pos.x; + partner->pos.y = playerStatus->pos.y; + partner->pos.z = playerStatus->pos.z; wPartnerFollowState = 50; return; } - distance = fabsf(partner->jumpVelocity) + 11.0f; + distance = fabsf(partner->jumpVel) + 11.0f; x = partner->pos.x; y = partner->pos.y + distance; z = partner->pos.z; if (npc_raycast_down_around(partner->collisionChannel, &x, &y, &z, &distance, partner->yaw, partner->collisionDiameter) != 0) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; partner->flags &= ~NPC_FLAG_JUMPING; - partner->jumpVelocity = 0.0f; + partner->jumpVel = 0.0f; partner->pos.y = y; - partner->yaw = atan2(x, z, playerStatus->position.x, playerStatus->position.z); + partner->yaw = atan2(x, z, playerStatus->pos.x, playerStatus->pos.z); spawn_surface_effects(partner, SURFACE_INTERACT_LAND); wPartnerFollowState = 50; } @@ -1734,7 +1734,7 @@ void partner_flying_enable(Npc* partner, s32 val) { D_8010CFCC = 0; wPartnerMoveTime = 16; wPartnerTetherDistance = 40.0f; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; func_800EA5B8(partner); partner->collisionChannel = COLLISION_CHANNEL_10000; partner->flags |= NPC_FLAG_IGNORE_PLAYER_COLLISION; @@ -1747,21 +1747,21 @@ void partner_flying_update_player_tracking(Npc* partner) { f32 effectiveY; s32 isPlayerJumping = FALSE; - effectiveY = playerStatus->position.y; + effectiveY = playerStatus->pos.y; if ((playerStatus->actionState == ACTION_STATE_HIT_LAVA) || (playerStatus->actionState == ACTION_STATE_HIT_FIRE)) { - effectiveY = playerStatus->lastGoodPosition.y + partner->collisionHeight + 5; + effectiveY = playerStatus->lastGoodPos.y + partner->collisionHeight + 5; } currentSnapshot = &gPlayerMoveHistory[gPlayerMoveHistoryIndex]; - if ((!currentSnapshot->isJumping || !isPlayerJumping) && (currentSnapshot->pos.x != playerStatus->position.x || currentSnapshot->pos.y != effectiveY - || currentSnapshot->pos.z != playerStatus->position.z)) { + if ((!currentSnapshot->isJumping || !isPlayerJumping) && (currentSnapshot->pos.x != playerStatus->pos.x || currentSnapshot->pos.y != effectiveY + || currentSnapshot->pos.z != playerStatus->pos.z)) { if (D_8010CFBC != gPlayerMoveHistoryIndex + 1) { if (++gPlayerMoveHistoryIndex >= ARRAY_COUNT(gPlayerMoveHistory)) { gPlayerMoveHistoryIndex = 0; } currentSnapshot = &gPlayerMoveHistory[gPlayerMoveHistoryIndex]; - currentSnapshot->pos.x = playerStatus->position.x; + currentSnapshot->pos.x = playerStatus->pos.x; currentSnapshot->pos.y = effectiveY; - currentSnapshot->pos.z = playerStatus->position.z; + currentSnapshot->pos.z = playerStatus->pos.z; currentSnapshot->isJumping = isPlayerJumping; } } @@ -1786,11 +1786,11 @@ void partner_flying_update_motion(Npc* partner) { partnerStatus->partnerAction_unk_2 = FALSE; } } - if (wPartnerFollowState != 50 && fabsf(partner->pos.y - playerStatus->position.y) > 1000.0f) { - partner->pos.x = playerStatus->position.x; - partner->pos.y = playerStatus->position.y; - partner->pos.z = playerStatus->position.z; - partner->jumpVelocity = 0.0f; + if (wPartnerFollowState != 50 && fabsf(partner->pos.y - playerStatus->pos.y) > 1000.0f) { + partner->pos.x = playerStatus->pos.x; + partner->pos.y = playerStatus->pos.y; + partner->pos.z = playerStatus->pos.z; + partner->jumpVel = 0.0f; partner->jumpScale = 0.0f; partner->flags &= ~NPC_FLAG_JUMPING; } @@ -1814,15 +1814,15 @@ void partner_flying_update_motion(Npc* partner) { z = partner->pos.z; hitDepth = 1000.0f; if (npc_raycast_down_around(COLLISION_CHANNEL_10000, &x, &y, &z, &hitDepth, partner->yaw, partner->collisionDiameter) == 0) { - y = playerStatus->position.y; + y = playerStatus->pos.y; } if (partner->pos.y <= y + partner->collisionHeight + 2.0f) { - if (playerStatus->currentSpeed != 0.0f) { + if (playerStatus->curSpeed != 0.0f) { D_800F84F8 = ((y + (partner->collisionHeight / 2) + 2.0f) - partner->pos.y) * 0.125f; } else { - if (y < playerStatus->position.y) { - var_f0 = playerStatus->position.y + 10.0f - partner->pos.y; + if (y < playerStatus->pos.y) { + var_f0 = playerStatus->pos.y + 10.0f - partner->pos.y; } else { var_f0 = y + 10.0f - partner->pos.y; } @@ -1830,13 +1830,13 @@ void partner_flying_update_motion(Npc* partner) { D_800F84F8 = var_f0 * var_f2; } } else { - if (playerStatus->position.y + playerStatus->colliderHeight < y) { + if (playerStatus->pos.y + playerStatus->colliderHeight < y) { D_800F84F8 = (y + partner->collisionHeight - partner->pos.y) * 0.125f; if (partner->pos.y + D_800F84F8 <= y + partner->collisionHeight) { D_800F84F8 = (y + partner->collisionHeight - partner->pos.y) * 0.25f; } } else { - var_f0 = (playerStatus->position.y + playerStatus->colliderHeight + 5.0f) - partner->pos.y; + var_f0 = (playerStatus->pos.y + playerStatus->colliderHeight + 5.0f) - partner->pos.y; var_f2 = 0.0625f; D_800F84F8 = var_f0 * var_f2; } @@ -1880,9 +1880,9 @@ void partner_flying_follow_player(Npc* partner) { partner->pos.y = y + (moveHistoryY + 20.0f + var_f12 - y) * 0.125f; partner->moveSpeed = 3.0f; y = partner->pos.y; - distance = dist2D(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); + distance = dist2D(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); if (distance >= 50.0) { - if (partner->pos.y >= playerStatus->position.y) { + if (partner->pos.y >= playerStatus->pos.y) { partner->moveSpeed = distance * 0.25f; } else { partner->moveSpeed = 8.0f; @@ -1896,7 +1896,7 @@ void partner_flying_follow_player(Npc* partner) { yaw = atan2(x, z, moveHistoryX, moveHistoryZ); distance = dist2D(x, z, moveHistoryX, moveHistoryZ); if (partner->moveSpeed < distance) { - if (partner->pos.y >= playerStatus->position.y) { + if (partner->pos.y >= playerStatus->pos.y) { if (partner->moveSpeed >= distance * 0.25f) { partner->moveSpeed = distance * 0.25f; } else { @@ -1915,16 +1915,16 @@ void partner_flying_follow_player(Npc* partner) { yaw = partner->yaw; partner->moveSpeed = 0.0f; partner->jumpScale = 0.0f; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; break; } - distance = dist2D(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); + distance = dist2D(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); if (distance <= wPartnerTetherDistance) { wPartnerFollowState = 5; yaw = partner->yaw; partner->moveSpeed = 0.0f; partner->jumpScale = 0.0f; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; break; } D_8010CFBC++; @@ -1973,8 +1973,8 @@ void partner_flying_follow_player(Npc* partner) { } if (wPartnerFollowState == 1) { if (distance < wPartnerTetherDistance) { - partner->jumpVelocity = 0.0f; - partner->yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); + partner->jumpVel = 0.0f; + partner->yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); wPartnerFollowState = 5; return; } @@ -1987,30 +1987,30 @@ void partner_flying_follow_player(Npc* partner) { partner->duration = 10; } - partner->jumpVelocity = (y + (partner->jumpScale * partner->duration * partner->duration * 0.5f)) / partner->duration; - if (partner->jumpVelocity > 20.0) { - partner->jumpVelocity = 20.0f; + partner->jumpVel = (y + (partner->jumpScale * partner->duration * partner->duration * 0.5f)) / partner->duration; + if (partner->jumpVel > 20.0) { + partner->jumpVel = 20.0f; } wPartnerFollowState = 2; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].jump; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].jump; partner->moveToPos.x = partner->pos.x; partner->moveToPos.y = partner->pos.y; partner->moveToPos.z = partner->pos.z; } break; case 2: - partner->jumpVelocity -= partner->jumpScale; - partner->pos.y += partner->jumpVelocity; - if (partner->jumpVelocity <= 0.0f) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fall; + partner->jumpVel -= partner->jumpScale; + partner->pos.y += partner->jumpVel; + if (partner->jumpVel <= 0.0f) { + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].fall; } npc_move_heading(partner, partner->moveSpeed, partner->yaw); - if (partner->jumpVelocity <= 0.0f) { + if (partner->jumpVel <= 0.0f) { if (partner->pos.y < partner->moveToPos.y) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fly; - partner->jumpVelocity = 0.0f; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].fly; + partner->jumpVel = 0.0f; partner->pos.y = partner->moveToPos.y; - partner->yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); + partner->yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); wPartnerFollowState = 0; distance = dist2D(partner->pos.x, partner->pos.z, partner->moveToPos.x, partner->moveToPos.z); if (distance < wPartnerTetherDistance) { @@ -2026,29 +2026,29 @@ void partner_flying_follow_player(Npc* partner) { currentSnapshot = &gPlayerMoveHistory[D_8010CFBC]; moveHistoryX = currentSnapshot->pos.x; moveHistoryZ = currentSnapshot->pos.z; - distance = dist2D(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); + distance = dist2D(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); if (distance <= wPartnerTetherDistance) { if (D_8010CFCA == 0) { - partner->pos.y = y + (((playerStatus->position.y + (playerStatus->colliderHeight - partner->collisionHeight / 2)) - partner->pos.y) * 0.03125); + partner->pos.y = y + (((playerStatus->pos.y + (playerStatus->colliderHeight - partner->collisionHeight / 2)) - partner->pos.y) * 0.03125); y = partner->pos.y; partner->moveSpeed = 0.0f; partner->jumpScale = 0.0f; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; if (playerStatus->actionState == ACTION_STATE_TALK) { D_8010CFCA = 0; } } else { - temp_a3 = clamp_angle(camera->currentYaw + (playerStatus->spriteFacingAngle < 180.0f ? 90.0f : -90.0f)); - partner->moveToPos.x = playerStatus->position.x; - partner->moveToPos.y = playerStatus->position.y; - partner->moveToPos.z = playerStatus->position.z; + temp_a3 = clamp_angle(camera->curYaw + (playerStatus->spriteFacingAngle < 180.0f ? 90.0f : -90.0f)); + partner->moveToPos.x = playerStatus->pos.x; + partner->moveToPos.y = playerStatus->pos.y; + partner->moveToPos.z = playerStatus->pos.z; add_vec2D_polar(&partner->moveToPos.x, &partner->moveToPos.z, wPartnerTetherDistance - 10.0f, temp_a3); yaw = atan2(partner->pos.x, partner->pos.z, partner->moveToPos.x, partner->moveToPos.z); distance = dist2D(partner->pos.x, partner->pos.z, partner->moveToPos.x, partner->moveToPos.z); partner->moveSpeed = 2.0f; if (distance > 2.0f) { partner->yaw = yaw; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].run; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].run; if (!(partner->flags & NPC_FLAG_COLLDING_FORWARD_WITH_WORLD)) { D_800F803A = 0; } else { @@ -2058,18 +2058,18 @@ void partner_flying_follow_player(Npc* partner) { partner->moveSpeed = 0.0f; partner->jumpScale = 0.0f; partner->renderYaw = yaw; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; if (D_8010CFCA == 2 || playerStatus->actionState == ACTION_STATE_TALK) { D_8010CFCA = 0; } } } } else { - yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); + yaw = atan2(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); partner->yaw = yaw; partner->moveSpeed = 0.0f; partner->jumpScale = 0.0f; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; if (D_8010CFCA == 2 || playerStatus->actionState == ACTION_STATE_TALK) { D_8010CFCA = 0; } @@ -2080,12 +2080,12 @@ void partner_flying_follow_player(Npc* partner) { } } - distance = dist2D(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z); + distance = dist2D(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z); if (!(distance <= wPartnerTetherDistance)) { while (TRUE) { if (!currentSnapshot->isJumping) { yaw = atan2(partner->pos.x, partner->pos.z, moveHistoryX, moveHistoryZ); - if (!(fabsf(get_clamped_angle_diff(yaw, atan2(partner->pos.x, partner->pos.z, playerStatus->position.x, playerStatus->position.z))) < 90.0f)) { + if (!(fabsf(get_clamped_angle_diff(yaw, atan2(partner->pos.x, partner->pos.z, playerStatus->pos.x, playerStatus->pos.z))) < 90.0f)) { if (D_8010CFBC != gPlayerMoveHistoryIndex) { D_8010CFBC++; if (D_8010CFBC >= 40) { @@ -2108,13 +2108,13 @@ void partner_flying_follow_player(Npc* partner) { switch (D_8010CFCE) { case 0: temp_f0_15 = clamp_angle(func_800E5348() + 180.0f); - partner->moveToPos.x = playerStatus->position.x; - partner->moveToPos.y = playerStatus->position.y; - partner->moveToPos.z = playerStatus->position.z; + partner->moveToPos.x = playerStatus->pos.x; + partner->moveToPos.y = playerStatus->pos.y; + partner->moveToPos.z = playerStatus->pos.z; add_vec2D_polar(&partner->moveToPos.x, &partner->moveToPos.z, playerStatus->colliderDiameter, temp_f0_15); distance = dist2D(partner->pos.x, partner->pos.z, partner->moveToPos.x, partner->moveToPos.z); partner->moveSpeed = wPartnerMoveSpeed = distance / wPartnerMoveTime; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].anims[(partner->moveSpeed < 4.0) ? PARTNER_ANIM_INDEX_WALK : PARTNER_ANIM_INDEX_RUN]; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].anims[(partner->moveSpeed < 4.0) ? PARTNER_ANIM_INDEX_WALK : PARTNER_ANIM_INDEX_RUN]; yaw = atan2(partner->pos.x, partner->pos.z, partner->moveToPos.x, partner->moveToPos.z); partner->yaw = D_800F8034 = yaw; D_8010CFCE++; @@ -2127,11 +2127,11 @@ void partner_flying_follow_player(Npc* partner) { distance = partner->collisionHeight + 1; wPartnerMoveTime--; if (npc_raycast_down_around(COLLISION_CHANNEL_10000, &x, &y, &z, &distance, partner->yaw, partner->collisionDiameter) == 0) { - if (partner->collisionHeight + 5 < fabs((partner->pos.y - playerStatus->position.y))) { - partner->pos.y += (playerStatus->position.y - partner->pos.y) / 10.0f; + if (partner->collisionHeight + 5 < fabs((partner->pos.y - playerStatus->pos.y))) { + partner->pos.y += (playerStatus->pos.y - partner->pos.y) / 10.0f; } } else { - partner->pos.y += (((playerStatus->position.y + playerStatus->colliderHeight) - partner->pos.y) * 0.125f); + partner->pos.y += (((playerStatus->pos.y + playerStatus->colliderHeight) - partner->pos.y) * 0.125f); } partner->moveSpeed = wPartnerMoveSpeed; partner->yaw = D_800F8034; @@ -2149,11 +2149,11 @@ void partner_flying_follow_player(Npc* partner) { partner_clear_player_tracking(partner); partner->moveSpeed = 0.0f; partner->jumpScale = 0.0f; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; wPartnerFollowState = 0; D_8010CFCA = 0; D_8010CFCE = 0; - partner->yaw = clamp_angle((camera->currentYaw + 270.0f) - playerStatus->spriteFacingAngle); + partner->yaw = clamp_angle((camera->curYaw + 270.0f) - playerStatus->spriteFacingAngle); } } break; @@ -2161,7 +2161,7 @@ void partner_flying_follow_player(Npc* partner) { partner_move_to_goal(partner, TRUE); break; case 40: - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; break; case 50: break; @@ -2193,11 +2193,11 @@ s32 partner_put_away(Npc* partner) { tempMoveToZ = partner->pos.z; partner->flags &= ~NPC_FLAG_GRAVITY; partner->flags &= ~NPC_FLAG_8; - tempPosX = playerStatus->position.x; + tempPosX = playerStatus->pos.x; partner->moveToPos.x = tempPosX; - tempPosY = playerStatus->position.y + (playerStatus->colliderHeight / 2); - partner->moveToPos.y = playerStatus->position.y + (playerStatus->colliderHeight / 2); - tempPosZ = playerStatus->position.z; + tempPosY = playerStatus->pos.y + (playerStatus->colliderHeight / 2); + partner->moveToPos.y = playerStatus->pos.y + (playerStatus->colliderHeight / 2); + tempPosZ = playerStatus->pos.z; wSavedPartnerPosX = tempMoveToX; wSavedPartnerPosY = tempMoveToY; wSavedPartnerPosZ = tempMoveToZ; @@ -2210,16 +2210,16 @@ s32 partner_put_away(Npc* partner) { divisor = 15.0f; partner->moveSpeed = partner->planarFlyDist / divisor; tempMoveToY = tempPosY - tempMoveToY; - partner->jumpVelocity = (tempMoveToY + partner->jumpScale * partner->duration * partner->duration * 0.5f) / partner->duration; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].jump; + partner->jumpVel = (tempMoveToY + partner->jumpScale * partner->duration * partner->duration * 0.5f) / partner->duration; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].jump; enable_npc_blur(partner); wPartnerFollowState = 1; break; case 1: - partner->jumpVelocity -= partner->jumpScale; - partner->pos.y += partner->jumpVelocity; - if (partner->jumpVelocity <= 0.0f) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fall; + partner->jumpVel -= partner->jumpScale; + partner->pos.y += partner->jumpVel; + if (partner->jumpVel <= 0.0f) { + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].fall; } npc_move_heading(partner, partner->moveSpeed, partner->yaw); tempDuration = partner->duration; @@ -2235,8 +2235,8 @@ s32 partner_put_away(Npc* partner) { } break; case 2: - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fly; - partner->jumpVelocity = 0.0f; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].fly; + partner->jumpVel = 0.0f; partner->pos.y = partner->moveToPos.y; disable_npc_blur(partner); return TRUE; @@ -2262,16 +2262,16 @@ s32 partner_get_out(Npc* partner) { switch (wPartnerFollowState) { case 0: if (clamp_angle(playerStatus->spriteFacingAngle) < 180.0f) { - partner->yaw = clamp_angle(camera->currentYaw + 90.0f); + partner->yaw = clamp_angle(camera->curYaw + 90.0f); } else { - partner->yaw = clamp_angle(camera->currentYaw - 90.0f); + partner->yaw = clamp_angle(camera->curYaw - 90.0f); } - partner->moveToPos.x = playerStatus->position.x; - partner->moveToPos.y = playerStatus->position.y; + partner->moveToPos.x = playerStatus->pos.x; + partner->moveToPos.y = playerStatus->pos.y; if (wPartner->isFlying) { - partner->moveToPos.y = playerStatus->position.y; + partner->moveToPos.y = playerStatus->pos.y; } - partner->moveToPos.z = playerStatus->position.z; + partner->moveToPos.z = playerStatus->pos.z; add_vec2D_polar(&partner->moveToPos.x, &partner->moveToPos.z, playerStatus->colliderDiameter, partner->yaw); moveToX = partner->moveToPos.x; moveToY = partner->moveToPos.y; @@ -2280,29 +2280,29 @@ s32 partner_get_out(Npc* partner) { x = moveToX; y = moveToY + partner->collisionHeight; z = moveToZ; - add_vec2D_polar(&x, &z, 2.0f, gCameras[gCurrentCameraID].currentYaw); + add_vec2D_polar(&x, &z, 2.0f, gCameras[gCurrentCameraID].curYaw); hitDepth = 1000.0f; if (npc_raycast_down_around(COLLISION_CHANNEL_10000, &x, &y, &z, &hitDepth, partner->yaw, partner->collisionDiameter)) { // @bug? collider flags not properly masked with COLLIDER_FLAG_SURFACE_TYPE s32 surfaceType = get_collider_flags(NpcHitQueryColliderID); if ((surfaceType == SURFACE_TYPE_SPIKES || surfaceType == SURFACE_TYPE_LAVA) || (hitDepth > 100.0f)) { - moveToX = playerStatus->position.x; - moveToY = playerStatus->position.y; - moveToZ = playerStatus->position.z; - add_vec2D_polar(&x, &z, 2.0f, gCameras[gCurrentCameraID].currentYaw); + moveToX = playerStatus->pos.x; + moveToY = playerStatus->pos.y; + moveToZ = playerStatus->pos.z; + add_vec2D_polar(&x, &z, 2.0f, gCameras[gCurrentCameraID].curYaw); } } else { - moveToX = playerStatus->position.x; - moveToY = playerStatus->position.y; - moveToZ = playerStatus->position.z; - add_vec2D_polar(&x, &z, 2.0f, gCameras[gCurrentCameraID].currentYaw); + moveToX = playerStatus->pos.x; + moveToY = playerStatus->pos.y; + moveToZ = playerStatus->pos.z; + add_vec2D_polar(&x, &z, 2.0f, gCameras[gCurrentCameraID].curYaw); } } - x = partner->pos.x = playerStatus->position.x; - y = partner->pos.y = playerStatus->position.y + (playerStatus->colliderHeight / 2); - z = partner->pos.z = playerStatus->position.z; + x = partner->pos.x = playerStatus->pos.x; + y = partner->pos.y = playerStatus->pos.y + (playerStatus->colliderHeight / 2); + z = partner->pos.z = playerStatus->pos.z; partner->moveSpeed = 4.0f; partner->jumpScale = 1.2f; @@ -2313,21 +2313,21 @@ s32 partner_get_out(Npc* partner) { partner->duration = 10; partner->moveSpeed = partner->planarFlyDist / partner->duration; } - partner->jumpVelocity = (moveToY - y + (partner->jumpScale * partner->duration * partner->duration * 0.5f)) / + partner->jumpVel = (moveToY - y + (partner->jumpScale * partner->duration * partner->duration * 0.5f)) / partner->duration; wPartnerFollowState = 1; y = moveToY - y; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].jump; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].jump; break; case 1: - if (partner->jumpVelocity < 0.0f && npc_try_snap_to_ground(partner, fabsf(partner->jumpVelocity))) { + if (partner->jumpVel < 0.0f && npc_try_snap_to_ground(partner, fabsf(partner->jumpVel))) { wPartnerFollowState = 2; break; } - partner->jumpVelocity -= partner->jumpScale; - partner->pos.y += partner->jumpVelocity; - if (partner->jumpVelocity <= 0.0f) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fall; + partner->jumpVel -= partner->jumpScale; + partner->pos.y += partner->jumpVel; + if (partner->jumpVel <= 0.0f) { + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].fall; } npc_move_heading(partner, partner->moveSpeed, partner->yaw); npc_do_world_collision(partner); @@ -2347,7 +2347,7 @@ s32 partner_get_out(Npc* partner) { break; case 2: partner->pos.y = partner->moveToPos.y; - partner->jumpVelocity = 0.0f; + partner->jumpVel = 0.0f; partner->scale.x = 1.0f; partner->scale.y = 1.0f; partner->scale.z = 1.0f; @@ -2355,9 +2355,9 @@ s32 partner_get_out(Npc* partner) { partner->moveToPos.y = partner->pos.y; partner->moveToPos.z = partner->pos.z; partner->pos.x = partner->pos.x; - partner->pos.y = playerStatus->position.y; + partner->pos.y = playerStatus->pos.y; if (wPartner->isFlying) { - partner->pos.y = playerStatus->position.y; + partner->pos.y = playerStatus->pos.y; } partner->pos.z = partner->pos.z; partner_clear_player_tracking(partner); @@ -2454,21 +2454,21 @@ s32 partner_force_player_flip_done(void) { if (playerStatus->flipYaw[CAM_DEFAULT] == 0.0f) { if (!(playerStatus->spriteFacingAngle >= 90.0f) || !(playerStatus->spriteFacingAngle < 270.0f)) { isFacingLeft = TRUE; - playerStatus->targetYaw = clamp_angle(cameras[CAM_DEFAULT].currentYaw - 90.0f); + playerStatus->targetYaw = clamp_angle(cameras[CAM_DEFAULT].curYaw - 90.0f); } else { isFacingLeft = FALSE; - playerStatus->targetYaw = clamp_angle(cameras[CAM_DEFAULT].currentYaw + 90.0f); + playerStatus->targetYaw = clamp_angle(cameras[CAM_DEFAULT].curYaw + 90.0f); } - } else if (get_clamped_angle_diff(cameras[CAM_DEFAULT].currentYaw, playerStatus->targetYaw) < 0.0f) { + } else if (get_clamped_angle_diff(cameras[CAM_DEFAULT].curYaw, playerStatus->targetYaw) < 0.0f) { isFacingLeft = TRUE; - playerStatus->targetYaw = clamp_angle(cameras[CAM_DEFAULT].currentYaw - 90.0f); + playerStatus->targetYaw = clamp_angle(cameras[CAM_DEFAULT].curYaw - 90.0f); } else { isFacingLeft = FALSE; - playerStatus->targetYaw = clamp_angle(cameras[CAM_DEFAULT].currentYaw + 90.0f); + playerStatus->targetYaw = clamp_angle(cameras[CAM_DEFAULT].curYaw + 90.0f); } - playerStatus->currentYaw = playerStatus->targetYaw; + playerStatus->curYaw = playerStatus->targetYaw; return isFacingLeft; } @@ -2498,7 +2498,7 @@ void partner_do_player_collision(Npc* partner) { f32 W; transform_point(gCameras[CAM_DEFAULT].perspectiveMatrix, - playerStatus->position.x, playerStatus->position.y, playerStatus->position.z, 1.0f, + playerStatus->pos.x, playerStatus->pos.y, playerStatus->pos.z, 1.0f, &playerScreenX, &playerScreenY, &playerScreenZ, &W); transform_point(gCameras[CAM_DEFAULT].perspectiveMatrix, partner->pos.x, partner->pos.y, partner->pos.z, 1.0f, &partnerScreenX, &partnerScreenY, &partnerScreenZ, &W); @@ -2509,8 +2509,8 @@ void partner_do_player_collision(Npc* partner) { playerScreenY <= partner->collisionHeight + playerStatus->colliderHeight && playerScreenZ <= 4.0) { npc_move_heading(partner, 1.0f, - atan2(playerStatus->position.x, playerStatus->position.z, partner->pos.x, partner->pos.z)); - add_vec2D_polar(&partner->pos.x, &partner->pos.z, 2.0f, gCameras[gCurrentCameraID].currentYaw); + atan2(playerStatus->pos.x, playerStatus->pos.z, partner->pos.x, partner->pos.z)); + add_vec2D_polar(&partner->pos.x, &partner->pos.z, 2.0f, gCameras[gCurrentCameraID].curYaw); } } @@ -2522,7 +2522,7 @@ void partner_move_to_goal(Npc* partner, s32 isFlying) { switch (D_8010CFCE) { case 0: D_8010CFCE++; - partner->moveToPos.y = playerStatus->position.y; + partner->moveToPos.y = playerStatus->pos.y; partner->moveToPos.x = wPartnerMoveGoalX; partner->moveToPos.z = wPartnerMoveGoalZ; D_800F8034 = atan2(partner->pos.x, partner->pos.z, partner->moveToPos.x, partner->moveToPos.z); @@ -2531,36 +2531,36 @@ void partner_move_to_goal(Npc* partner, s32 isFlying) { wPartnerMoveTime = 18; temp = dist2D(partner->pos.x, partner->pos.z, partner->moveToPos.x, partner->moveToPos.z); partner->moveSpeed = wPartnerMoveSpeed = temp / wPartnerMoveTime; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].anims[ + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].anims[ (partner->moveSpeed >= 4.0) ? PARTNER_ANIM_INDEX_RUN : PARTNER_ANIM_INDEX_WALK]; case 1: if (wPartnerMoveTime != 0) { wPartnerMoveTime--; if (!isFlying) { if (!(partner->flags & NPC_FLAG_GROUNDED)) { - partner->pos.y = playerStatus->position.y; + partner->pos.y = playerStatus->pos.y; } - if (partner->jumpVelocity != 0.0f) { - partner->jumpVelocity -= partner->jumpScale; - partner->pos.y += partner->jumpVelocity; - if (partner->jumpVelocity <= 0.0f) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].fall; + if (partner->jumpVel != 0.0f) { + partner->jumpVel -= partner->jumpScale; + partner->pos.y += partner->jumpVel; + if (partner->jumpVel <= 0.0f) { + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].fall; } - if (partner->jumpVelocity <= 0.0f) { - temp = fabsf(partner->jumpVelocity) + partner->collisionHeight; + if (partner->jumpVel <= 0.0f) { + temp = fabsf(partner->jumpVel) + partner->collisionHeight; y = partner->pos.y + partner->collisionHeight; x = partner->pos.x; z = partner->pos.z; if (npc_raycast_down_around(partner->collisionChannel, &x, &y, &z, &temp, partner->yaw, partner->collisionDiameter) && - (temp <= fabsf(partner->jumpVelocity) + 22.0f)) + (temp <= fabsf(partner->jumpVel) + 22.0f)) { - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].anims[ + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].anims[ (partner->moveSpeed >= 4.0) ? PARTNER_ANIM_INDEX_RUN : PARTNER_ANIM_INDEX_WALK]; partner->jumpScale = 0.0f; - partner->jumpVelocity = 0.0f; + partner->jumpVel = 0.0f; partner->pos.y = y; partner->flags &= ~NPC_FLAG_JUMPING; } @@ -2569,12 +2569,12 @@ void partner_move_to_goal(Npc* partner, s32 isFlying) { partner->moveSpeed = wPartnerMoveSpeed; partner->yaw = D_800F8034; npc_move_heading(partner, partner->moveSpeed, partner->yaw); - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].anims[ + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].anims[ (partner->moveSpeed >= 4.0) ? PARTNER_ANIM_INDEX_RUN : PARTNER_ANIM_INDEX_WALK]; npc_do_world_collision(partner); } else { - if (fabs(partner->pos.y - playerStatus->position.y) > 5.0) { - partner->pos.y += (playerStatus->position.y - partner->pos.y) * 0.5f; + if (fabs(partner->pos.y - playerStatus->pos.y) > 5.0) { + partner->pos.y += (playerStatus->pos.y - partner->pos.y) * 0.5f; } partner->moveSpeed = wPartnerMoveSpeed; partner->yaw = D_800F8034; @@ -2584,7 +2584,7 @@ void partner_move_to_goal(Npc* partner, s32 isFlying) { spawn_surface_effects(partner, (partner->moveSpeed < 4.0) ? SURFACE_INTERACT_WALK : SURFACE_INTERACT_RUN); } else { partner->flags &= ~NPC_FLAG_IGNORE_WORLD_COLLISION; - partner->currentAnim = gPartnerAnimations[wCurrentPartnerId].idle; + partner->curAnim = gPartnerAnimations[wCurrentPartnerId].idle; D_8010CFCE++; } break; diff --git a/src/world/script_api/enter_exit.c b/src/world/script_api/enter_exit.c index 1cddd6c614..31f3340ea8 100644 --- a/src/world/script_api/enter_exit.c +++ b/src/world/script_api/enter_exit.c @@ -24,16 +24,16 @@ API_CALLABLE(TeleportPartnerToPlayer) { PlayerStatus* playerStatus = &gPlayerStatus; Npc* partner; - if (gPlayerData.currentPartner == PARTNER_NONE) { + if (gPlayerData.curPartner == PARTNER_NONE) { return ApiStatus_DONE2; } partner = get_npc_unsafe(NPC_PARTNER); - partner->pos.x = playerStatus->position.x; - partner->pos.z = playerStatus->position.z; + partner->pos.x = playerStatus->pos.x; + partner->pos.z = playerStatus->pos.z; if (partner_is_flying()) { - partner->pos.y = playerStatus->position.y; + partner->pos.y = playerStatus->pos.y; } set_npc_yaw(partner, playerStatus->targetYaw); @@ -44,19 +44,19 @@ API_CALLABLE(TeleportPartnerToPlayer) { API_CALLABLE(SetPlayerPositionFromSaveData) { PlayerStatus* playerStatus = &gPlayerStatus; Camera* camera = &gCameras[gCurrentCameraID]; - s32 currentPartner = gPlayerData.currentPartner; + s32 currentPartner = gPlayerData.curPartner; - playerStatus->position.x = gGameStatusPtr->savedPos.x; - playerStatus->position.y = gGameStatusPtr->savedPos.y; - playerStatus->position.z = gGameStatusPtr->savedPos.z; + playerStatus->pos.x = gGameStatusPtr->savedPos.x; + playerStatus->pos.y = gGameStatusPtr->savedPos.y; + playerStatus->pos.z = gGameStatusPtr->savedPos.z; if (currentPartner != PARTNER_NONE) { Npc* partner = get_npc_unsafe(NPC_PARTNER); f32 angle = clamp_angle((playerStatus->spriteFacingAngle < 180.0f) ? (90.0f) : (-90.0f)); - partner->pos.x = playerStatus->position.x; - partner->pos.y = playerStatus->position.y; - partner->pos.z = playerStatus->position.z; + partner->pos.x = playerStatus->pos.x; + partner->pos.y = playerStatus->pos.y; + partner->pos.z = playerStatus->pos.z; add_vec2D_polar(&partner->pos.x, &partner->pos.z, playerStatus->colliderDiameter + 5, angle); enable_partner_ai(); } @@ -71,24 +71,24 @@ API_CALLABLE(EnterPlayerPostPipe) { ApiStatus ret = ApiStatus_BLOCK; if (isInitialCall) { - playerStatus->position.x = (*mapSettings->entryList)[gGameStatusPtr->entryID].x; - playerStatus->position.z = (*mapSettings->entryList)[gGameStatusPtr->entryID].z; + playerStatus->pos.x = (*mapSettings->entryList)[gGameStatusPtr->entryID].x; + playerStatus->pos.z = (*mapSettings->entryList)[gGameStatusPtr->entryID].z; script->varTable[2] = (*mapSettings->entryList)[gGameStatusPtr->entryID].y; - playerStatus->position.y = script->varTable[2] - 40; + playerStatus->pos.y = script->varTable[2] - 40; playerStatus->flags |= PS_FLAG_CAMERA_DOESNT_FOLLOW; } else { do { - playerStatus->position.y += 1.0f; - if (!(playerStatus->position.y < script->varTable[2])) { - playerStatus->position.y = script->varTable[2]; + playerStatus->pos.y += 1.0f; + if (!(playerStatus->pos.y < script->varTable[2])) { + playerStatus->pos.y = script->varTable[2]; playerStatus->flags &= ~PS_FLAG_CAMERA_DOESNT_FOLLOW; ret = ApiStatus_DONE2; } } while (0); // todo required to match } - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; return ret; } diff --git a/src/world/script_api/push_blocks.c b/src/world/script_api/push_blocks.c index 42eb3fe045..8e53c59412 100644 --- a/src/world/script_api/push_blocks.c +++ b/src/world/script_api/push_blocks.c @@ -32,8 +32,8 @@ f32 PushBlockMovePositions[] = { API_CALLABLE(MovePlayerTowardBlock) { PlayerStatus* playerStatus = &gPlayerStatus; - playerStatus->position.x += (script->varTable[0] - playerStatus->position.x) / 2; - playerStatus->position.z += (script->varTable[2] - playerStatus->position.z) / 2; + playerStatus->pos.x += (script->varTable[0] - playerStatus->pos.x) / 2; + playerStatus->pos.z += (script->varTable[2] - playerStatus->pos.z) / 2; return ApiStatus_DONE2; } @@ -45,37 +45,37 @@ API_CALLABLE(UpdatePushBlockMotion) { if (isInitialCall) { script->functionTemp[0] = 0; - script->varTable[0] = playerStatus->position.x; - script->varTable[1] = playerStatus->position.y; - script->varTable[2] = playerStatus->position.z; - script->varTable[3] = entity->position.x; - script->varTable[4] = entity->position.y; - script->varTable[5] = entity->position.z; - script->varTable[9] = entity->rotation.x; - script->varTable[12] = entity->rotation.z; + script->varTable[0] = playerStatus->pos.x; + script->varTable[1] = playerStatus->pos.y; + script->varTable[2] = playerStatus->pos.z; + script->varTable[3] = entity->pos.x; + script->varTable[4] = entity->pos.y; + script->varTable[5] = entity->pos.z; + script->varTable[9] = entity->rot.x; + script->varTable[12] = entity->rot.z; } moveRatio = PushBlockMovePositions[script->functionTemp[0]]; - playerStatus->position.x = script->varTable[0] + (script->varTable[6] * moveRatio * BLOCK_GRID_SIZE); - playerStatus->position.y = script->varTable[1] + (script->varTable[7] * moveRatio * BLOCK_GRID_SIZE); - playerStatus->position.z = script->varTable[2] + (script->varTable[8] * moveRatio * BLOCK_GRID_SIZE); - entity->position.x = script->varTable[3] + (script->varTable[6] * moveRatio * BLOCK_GRID_SIZE); - entity->position.y = script->varTable[4] + (script->varTable[7] * moveRatio * BLOCK_GRID_SIZE); - entity->position.z = script->varTable[5] + (script->varTable[8] * moveRatio * BLOCK_GRID_SIZE); + playerStatus->pos.x = script->varTable[0] + (script->varTable[6] * moveRatio * BLOCK_GRID_SIZE); + playerStatus->pos.y = script->varTable[1] + (script->varTable[7] * moveRatio * BLOCK_GRID_SIZE); + playerStatus->pos.z = script->varTable[2] + (script->varTable[8] * moveRatio * BLOCK_GRID_SIZE); + entity->pos.x = script->varTable[3] + (script->varTable[6] * moveRatio * BLOCK_GRID_SIZE); + entity->pos.y = script->varTable[4] + (script->varTable[7] * moveRatio * BLOCK_GRID_SIZE); + entity->pos.z = script->varTable[5] + (script->varTable[8] * moveRatio * BLOCK_GRID_SIZE); if (script->functionTemp[0] < 12) { - entity->rotation.z = script->varTable[12] + (script->varTable[6] * moveRatio * -90.0f); - entity->rotation.x = script->varTable[9] + (script->varTable[8] * moveRatio * 90.0f); - entity->position.y = entity->position.y + (sin_deg(moveRatio * 90.0f) * BLOCK_GRID_SIZE * 0.5); - entity->position.x = entity->position.x - (script->varTable[6] * sin_deg(moveRatio * 90.0f) * BLOCK_GRID_SIZE * 0.5); - entity->position.z = entity->position.z - (script->varTable[8] * sin_deg(moveRatio * 90.0f) * BLOCK_GRID_SIZE * 0.5); + entity->rot.z = script->varTable[12] + (script->varTable[6] * moveRatio * -90.0f); + entity->rot.x = script->varTable[9] + (script->varTable[8] * moveRatio * 90.0f); + entity->pos.y = entity->pos.y + (sin_deg(moveRatio * 90.0f) * BLOCK_GRID_SIZE * 0.5); + entity->pos.x = entity->pos.x - (script->varTable[6] * sin_deg(moveRatio * 90.0f) * BLOCK_GRID_SIZE * 0.5); + entity->pos.z = entity->pos.z - (script->varTable[8] * sin_deg(moveRatio * 90.0f) * BLOCK_GRID_SIZE * 0.5); } else { - entity->rotation.z = entity->rotation.x = 0.0f; + entity->rot.z = entity->rot.x = 0.0f; } - gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x; - gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y; - gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z; + gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x; + gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y; + gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z; script->functionTemp[0]++; if (script->functionTemp[0] == ARRAY_COUNT(PushBlockMovePositions)) { @@ -93,11 +93,11 @@ API_CALLABLE(FinishPushBlockMotion) { if (isInitialCall) { script->functionTemp[0] = 0; - script->varTable[0] = block->position.y; + script->varTable[0] = block->pos.y; - hitX = block->position.x; - hitZ = block->position.z; - hitY = block->position.y + 5.0f; + hitX = block->pos.x; + hitZ = block->pos.z; + hitY = block->pos.y + 5.0f; hitDepth = 35.0f; hitResult = npc_raycast_down_sides(0, &hitX, &hitY, &hitZ, &hitDepth); @@ -110,21 +110,21 @@ API_CALLABLE(FinishPushBlockMotion) { if (grid->dropCallback != NULL) { if (grid->dropCallback(block, script)) { - i = (block->position.x - grid->centerPos.x) / BLOCK_GRID_SIZE; - j = (block->position.z - grid->centerPos.z) / BLOCK_GRID_SIZE; + i = (block->pos.x - grid->centerPos.x) / BLOCK_GRID_SIZE; + j = (block->pos.z - grid->centerPos.z) / BLOCK_GRID_SIZE; grid->cells[i + (j * grid->numCellsX)] = 0; return ApiStatus_DONE1; } else { return ApiStatus_BLOCK; } } else { - block->position.y = script->varTable[0] - (PushBlockMovePositions[script->functionTemp[0]] * BLOCK_GRID_SIZE); + block->pos.y = script->varTable[0] - (PushBlockMovePositions[script->functionTemp[0]] * BLOCK_GRID_SIZE); script->functionTemp[0]++; if (script->functionTemp[0] != ARRAY_COUNT(PushBlockMovePositions)) { return ApiStatus_BLOCK; } - i = (block->position.x - grid->centerPos.x) / BLOCK_GRID_SIZE; - j = (block->position.z - grid->centerPos.z) / BLOCK_GRID_SIZE; + i = (block->pos.x - grid->centerPos.x) / BLOCK_GRID_SIZE; + j = (block->pos.z - grid->centerPos.z) / BLOCK_GRID_SIZE; grid->cells[i + (j * grid->numCellsX)] = PUSH_GRID_EMPTY; } return ApiStatus_DONE1; @@ -145,9 +145,9 @@ API_CALLABLE(FetchPushedBlockProperties) { gridCenterY = grid->centerPos.y; gridCenterZ = grid->centerPos.z; - xThing = gPlayerStatus.position.x; - yThing = gPlayerStatus.position.y; - zThing = gPlayerStatus.position.z; + xThing = gPlayerStatus.pos.x; + yThing = gPlayerStatus.pos.y; + zThing = gPlayerStatus.pos.z; xThing -= gridCenterX; yThing -= gridCenterY; @@ -179,9 +179,9 @@ API_CALLABLE(FetchPushedBlockProperties) { script->varTable[1] = yThing; script->varTable[2] = zThing; - script->varTable[3] = entityX = entity->position.x; - script->varTable[4] = entityY = entity->position.y; - script->varTable[5] = entityZ = entity->position.z; + script->varTable[3] = entityX = entity->pos.x; + script->varTable[4] = entityY = entity->pos.y; + script->varTable[5] = entityZ = entity->pos.z; xThing = entityX - grid->centerPos.x; zThing = entityZ - grid->centerPos.z; @@ -227,8 +227,8 @@ API_CALLABLE(ClearPushedBlockFromGrid) { s32 ip, jp; // prev grid pos (i,j) s32 in, jn; // next grid pos (i,j) - ip = ((s32)block->position.x - grid->centerPos.x) / BLOCK_GRID_SIZE; - jp = ((s32)block->position.z - grid->centerPos.z) / BLOCK_GRID_SIZE; + ip = ((s32)block->pos.x - grid->centerPos.x) / BLOCK_GRID_SIZE; + jp = ((s32)block->pos.z - grid->centerPos.z) / BLOCK_GRID_SIZE; in = ip + script->varTable[6]; jn = jp + script->varTable[8]; diff --git a/src/world/script_api/shops.c b/src/world/script_api/shops.c index a4a1e83782..8fd73b5e27 100644 --- a/src/world/script_api/shops.c +++ b/src/world/script_api/shops.c @@ -204,7 +204,7 @@ API_CALLABLE(func_80280410) { s32 currentItemSlot = evt_get_variable(script, *script->ptrReadPos); if (!(shop->flags & SHOP_FLAG_8)) { - shop->currentItemSlot = currentItemSlot; + shop->curItemSlot = currentItemSlot; shop->flags |= SHOP_FLAG_1; func_800E98EC(); shop->unk_358 = 5; @@ -289,7 +289,7 @@ API_CALLABLE(ShowShopPurchaseDialog) { break; case PURCHASE_DIALOG_STATE_WAIT_FOR_SPEECH: if (script->functionTemp[2] == TRUE) { - if (D_80286528->currentOption == 0) { + if (D_80286528->curOption == 0) { if (playerData->coins < shopInventory->price) { script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_NOT_ENOUGH_COINS); script->functionTemp[0] = PURCHASE_DIALOG_STATE_NOT_ENOUGH_COINS; @@ -528,7 +528,7 @@ API_CALLABLE(ShowShopOwnerDialog) { break; case DIALOG_STATE_AWAIT_MAIN_MENU: if (script->functionTemp[2] == 1) { - switch (D_80286538->currentOption) { + switch (D_80286538->curOption) { case 0: script->functionTemp[1] = shop_owner_continue_speech(SHOP_MSG_INSTRUCTIONS); script->functionTemp[0] = DIALOG_STATE_DONE_INSTRUCTIONS; @@ -614,7 +614,7 @@ API_CALLABLE(ShowShopOwnerDialog) { break; case DIALOG_STATE_HANDLE_SELL_CHOICE: if (script->functionTemp[2] == 1) { - if (D_80286538->currentOption == 0) { + if (D_80286538->curOption == 0) { add_coins(shop_get_sell_price(playerData->invItems[shop->selectedStoreItemSlot])); playerData->invItems[shop->selectedStoreItemSlot] = 0; if (get_item_count() == 0) { @@ -641,7 +641,7 @@ API_CALLABLE(ShowShopOwnerDialog) { break; case DIALOG_STATE_AWAIT_SELL_MORE_CHOICE: if (script->functionTemp[2] == 1) { - if (D_80286538->currentOption == 0) { + if (D_80286538->curOption == 0) { script->functionTemp[1] = shop_owner_end_speech(); script->functionTemp[0] = DIALOG_STATE_INIT_SELL_CHOICE; hide_coin_counter_immediately(); @@ -696,7 +696,7 @@ API_CALLABLE(ShowShopOwnerDialog) { break; case DIALOG_STATE_AWAIT_CHECK_MORE_CHOICE: if (script->functionTemp[2] == 1) { - if (D_80286538->currentOption == 0) { + if (D_80286538->curOption == 0) { script->functionTemp[1] = shop_owner_end_speech(); script->functionTemp[0] = DIALOG_STATE_INIT_CHECK_CHOICE; } else { @@ -749,7 +749,7 @@ API_CALLABLE(ShowShopOwnerDialog) { break; case DIALOG_STATE_AWAIT_CLAIM_MORE_CHOICE: if (script->functionTemp[2] == 1) { - if (D_80286538->currentOption == 0) { + if (D_80286538->curOption == 0) { script->functionTemp[1] = shop_owner_end_speech(); script->functionTemp[0] = DIALOG_STATE_INIT_CLAIM_CHOICE; } else { @@ -779,7 +779,7 @@ API_CALLABLE(ShowShopOwnerDialog) { void shop_draw_item_name(s32 arg0, s32 posX, s32 posY) { Shop* shop = gGameStatusPtr->mapShop; - ShopItemData* siItem = &shop->staticInventory[shop->currentItemSlot]; + ShopItemData* siItem = &shop->staticInventory[shop->curItemSlot]; ItemData* shopItem = &gItemTable[siItem->itemID]; draw_msg(shopItem->nameMsg, posX + 60 - (get_msg_width(shopItem->nameMsg, 0) >> 1), posY + 6, 255, MSG_PAL_WHITE, 0); @@ -787,7 +787,7 @@ void shop_draw_item_name(s32 arg0, s32 posX, s32 posY) { void shop_draw_item_desc(s32 arg0, s32 posX, s32 posY) { Shop* shop = gGameStatusPtr->mapShop; - ShopItemData* shopItem = &shop->staticInventory[shop->currentItemSlot]; + ShopItemData* shopItem = &shop->staticInventory[shop->curItemSlot]; draw_msg(shopItem->descMsg, posX + 8, posY, 255, MSG_PAL_STANDARD, 0); } @@ -844,7 +844,7 @@ void draw_shop_items(void) { draw_number(itemData->price, xTemp + xOffset, yTemp, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_WHITE, 255, 0); } - if (i == shop->currentItemSlot) { + if (i == shop->curItemSlot) { hud_element_set_render_pos(shop->costIconID, (xTemp + xOffset) - 6, yTemp + 5); hud_element_set_scale(shop->costIconID, 0.7f); hud_element_draw_clipped(shop->costIconID); @@ -948,7 +948,7 @@ API_CALLABLE(MakeShop) { set_window_properties(WINDOW_ID_ITEM_INFO_DESC, 32, 184, 256, 32, WINDOW_PRIORITY_1, shop_draw_item_desc, NULL, -1); gWindowStyles[10].defaultStyleID = WINDOW_STYLE_9; gWindowStyles[11].defaultStyleID = WINDOW_STYLE_3; - shop->currentItemSlot = 0; + shop->curItemSlot = 0; shop->selectedStoreItemSlot = 0; shop->flags = 0; shop->owner = NULL; diff --git a/src/world/world.c b/src/world/world.c index 37bb0087bb..b82575a806 100644 --- a/src/world/world.c +++ b/src/world/world.c @@ -196,7 +196,7 @@ void load_map_by_IDs(s16 areaID, s16 mapID, s16 loadType) { clear_printers(); clear_item_entity_data(); - gPlayerStatus.targetYaw = gPlayerStatus.currentYaw; + gPlayerStatus.targetYaw = gPlayerStatus.curYaw; sfx_set_reverb_mode(WorldReverbModeMapping[*(s32*)mapConfig->unk_1C & 0x3]); sfx_reset_door_sounds();